diff options
author | Andrew Rybchenko <arybchik@FreeBSD.org> | 2018-11-28 06:54:25 +0000 |
---|---|---|
committer | Andrew Rybchenko <arybchik@FreeBSD.org> | 2018-11-28 06:54:25 +0000 |
commit | 17f272e7a7fbf7b122f48f0ee19260a71ef61447 (patch) | |
tree | 9b35ecdfaa2943e074399d13d62864ed464c3166 /sys/dev/sfxge/common/ef10_nic.c | |
parent | 09eac95749f0b3882fa7cf137c9cbe3fbeed24ef (diff) | |
download | src-17f272e7a7fbf7b122f48f0ee19260a71ef61447.tar.gz src-17f272e7a7fbf7b122f48f0ee19260a71ef61447.zip |
sfxge(4): move PF/VF config to ef10 NIC board config
Submitted by: Andy Moreton <amoreton at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
Differential Revision: https://reviews.freebsd.org/D18185
Notes
Notes:
svn path=/head/; revision=341109
Diffstat (limited to 'sys/dev/sfxge/common/ef10_nic.c')
-rw-r--r-- | sys/dev/sfxge/common/ef10_nic.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/sfxge/common/ef10_nic.c b/sys/dev/sfxge/common/ef10_nic.c index ebbe1857039a..e8a8b266ac16 100644 --- a/sys/dev/sfxge/common/ef10_nic.c +++ b/sys/dev/sfxge/common/ef10_nic.c @@ -1576,6 +1576,8 @@ ef10_nic_board_cfg( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint32_t port; + uint32_t pf; + uint32_t vf; efx_rc_t rc; /* Get the (zero-based) MCDI port number */ @@ -1589,13 +1591,27 @@ ef10_nic_board_cfg( &encp->enc_external_port)) != 0) goto fail2; + /* + * Get PCIe function number from firmware (used for + * per-function privilege and dynamic config info). + * - PCIe PF: pf = PF number, vf = 0xffff. + * - PCIe VF: pf = parent PF, vf = VF number. + */ + if ((rc = efx_mcdi_get_function_info(enp, &pf, &vf)) != 0) + goto fail3; + + encp->enc_pf = pf; + encp->enc_vf = vf; + /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) - goto fail3; + goto fail4; return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: |