[dpdk-dev] [PATCH 17/29] net/sfc/base: export the zero-based MCDI port number

Andrew Rybchenko arybchenko at solarflare.com
Mon Jun 10 09:38:32 CEST 2019


From: Gautam Dawar <gdawar at solarflare.com>

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 <gdawar at solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 drivers/net/sfc/base/ef10_nic.c | 2 ++
 drivers/net/sfc/base/efx.h      | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/net/sfc/base/ef10_nic.c b/drivers/net/sfc/base/ef10_nic.c
index 4c90e10..8ee8047 100644
--- a/drivers/net/sfc/base/ef10_nic.c
+++ b/drivers/net/sfc/base/ef10_nic.c
@@ -1840,6 +1840,8 @@
 	/* 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 6b6538c..40308ff 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -1407,6 +1407,8 @@ enum {
 	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)
-- 
1.8.3.1



More information about the dev mailing list