Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140615699
D4935.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D4935.diff
View Options
Index: head/sys/dev/sfxge/common/efx.h
===================================================================
--- head/sys/dev/sfxge/common/efx.h
+++ head/sys/dev/sfxge/common/efx.h
@@ -1162,6 +1162,8 @@
/* External port identifier */
uint8_t enc_external_port;
uint32_t enc_mcdi_max_payload_length;
+ /* VPD may be per-PF or global */
+ boolean_t enc_vpd_is_global;
} efx_nic_cfg_t;
#define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff)
Index: head/sys/dev/sfxge/common/hunt_vpd.c
===================================================================
--- head/sys/dev/sfxge/common/hunt_vpd.c
+++ head/sys/dev/sfxge/common/hunt_vpd.c
@@ -48,13 +48,20 @@
caddr_t svpd;
size_t svpd_size;
uint32_t pci_pf;
+ uint32_t tag;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
- pci_pf = enp->en_nic_cfg.enc_pf;
+ if (enp->en_nic_cfg.enc_vpd_is_global) {
+ tag = TLV_TAG_GLOBAL_STATIC_VPD;
+ } else {
+ pci_pf = enp->en_nic_cfg.enc_pf;
+ tag = TLV_TAG_PF_STATIC_VPD(pci_pf);
+ }
+
/*
* The VPD interface exposes VPD resources from the combined static and
* dynamic VPD storage. As the static VPD configuration should *never*
@@ -64,8 +71,7 @@
svpd_size = 0;
rc = ef10_nvram_partn_read_tlv(enp,
NVRAM_PARTITION_TYPE_STATIC_CONFIG,
- TLV_TAG_PF_STATIC_VPD(pci_pf),
- &svpd, &svpd_size);
+ tag, &svpd, &svpd_size);
if (rc != 0) {
if (rc == EACCES) {
/* Unpriviledged functions cannot access VPD */
@@ -132,17 +138,22 @@
caddr_t dvpd;
size_t dvpd_size;
uint32_t pci_pf;
+ uint32_t tag;
efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
- pci_pf = enp->en_nic_cfg.enc_pf;
+ if (enp->en_nic_cfg.enc_vpd_is_global) {
+ tag = TLV_TAG_GLOBAL_DYNAMIC_VPD;
+ } else {
+ pci_pf = enp->en_nic_cfg.enc_pf;
+ tag = TLV_TAG_PF_DYNAMIC_VPD(pci_pf);
+ }
if ((rc = ef10_nvram_partn_read_tlv(enp,
NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
- TLV_TAG_PF_DYNAMIC_VPD(pci_pf),
- &dvpd, &dvpd_size)) != 0)
+ tag, &dvpd, &dvpd_size)) != 0)
goto fail1;
if (dvpd_size > size) {
@@ -396,12 +407,18 @@
{
size_t vpd_length;
uint32_t pci_pf;
+ uint32_t tag;
efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
- pci_pf = enp->en_nic_cfg.enc_pf;
+ if (enp->en_nic_cfg.enc_vpd_is_global) {
+ tag = TLV_TAG_GLOBAL_DYNAMIC_VPD;
+ } else {
+ pci_pf = enp->en_nic_cfg.enc_pf;
+ tag = TLV_TAG_PF_DYNAMIC_VPD(pci_pf);
+ }
/* Determine total length of new dynamic VPD */
if ((rc = efx_vpd_hunk_length(data, size, &vpd_length)) != 0)
@@ -410,8 +427,7 @@
/* Store new dynamic VPD in all segments in DYNAMIC_CONFIG partition */
if ((rc = ef10_nvram_partn_write_segment_tlv(enp,
NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
- TLV_TAG_PF_DYNAMIC_VPD(pci_pf),
- data, vpd_length, B_TRUE)) != 0) {
+ tag, data, vpd_length, B_TRUE)) != 0) {
goto fail2;
}
Index: head/sys/dev/sfxge/common/medford_nic.c
===================================================================
--- head/sys/dev/sfxge/common/medford_nic.c
+++ head/sys/dev/sfxge/common/medford_nic.c
@@ -212,6 +212,12 @@
*/
encp->enc_tx_tso_tcp_header_offset_limit = EF10_TCP_HEADER_OFFSET_LIMIT;
+ /*
+ * Medford stores a single global copy of VPD, not per-PF as on
+ * Huntington.
+ */
+ encp->enc_vpd_is_global = B_TRUE;
+
return (0);
fail11:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 27, 12:13 AM (4 m, 3 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27292827
Default Alt Text
D4935.diff (3 KB)
Attached To
Mode
D4935: sfxge: medford stores a single global copy of VPD
Attached
Detach File
Event Timeline
Log In to Comment