From: Gautam Dawar Date: Mon, 10 Jun 2019 07:38:32 +0000 (+0100) Subject: net/sfc/base: export the zero-based MCDI port number X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5895208db67ce52ea7e1be157ec9454a2dbf8445;p=dpdk.git net/sfc/base: export the zero-based MCDI port number Proxy authorization module for SR-IOV requires one instance of proxy data structures per card. In order to achieve this, proxy data structures will be allocated only for primary port (port id 0) and other secondary ports in the card will access those data structures through reference to primary port. Accordingly, the port number obtained from efx_mcdi_get_port_assignment is stored in NIC configuration as enc_mcdi_port. Signed-off-by: Gautam Dawar Signed-off-by: Andrew Rybchenko --- diff --git a/drivers/net/sfc/base/ef10_nic.c b/drivers/net/sfc/base/ef10_nic.c index 4c90e10a8b..8ee80479aa 100644 --- a/drivers/net/sfc/base/ef10_nic.c +++ b/drivers/net/sfc/base/ef10_nic.c @@ -1840,6 +1840,8 @@ ef10_nic_board_cfg( /* EFX MCDI interface uses one-based port numbers */ emip->emi_port = port + 1; + encp->enc_assigned_port = port; + if ((rc = ef10_external_port_mapping(enp, port, &encp->enc_external_port)) != 0) goto fail2; diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h index 6b6538cae6..40308ff58d 100644 --- a/drivers/net/sfc/base/efx.h +++ b/drivers/net/sfc/base/efx.h @@ -1407,6 +1407,8 @@ typedef struct efx_nic_cfg_s { boolean_t enc_filter_action_flag_supported; boolean_t enc_filter_action_mark_supported; uint32_t enc_filter_action_mark_max; + /* Port assigned to this PCI function */ + uint32_t enc_assigned_port; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff)