From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 9C24BA0495 for ; Mon, 10 Jun 2019 09:40:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C5FA11BECE; Mon, 10 Jun 2019 09:39:13 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id C1B6C1BE8E for ; Mon, 10 Jun 2019 09:38:55 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us5.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id BE2464C0058 for ; Mon, 10 Jun 2019 07:38:54 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Jun 2019 00:38:51 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Mon, 10 Jun 2019 00:38:51 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x5A7cn6E008823; Mon, 10 Jun 2019 08:38:49 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id CC5211627D7; Mon, 10 Jun 2019 08:38:49 +0100 (BST) From: Andrew Rybchenko To: CC: Gautam Dawar Date: Mon, 10 Jun 2019 08:38:32 +0100 Message-ID: <1560152324-20538-18-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560152324-20538-1-git-send-email-arybchenko@solarflare.com> References: <1560152324-20538-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24664.003 X-TM-AS-Result: No-5.321100-4.000000-10 X-TMASE-MatchedRID: ad8nTaO1fAcs8CiT+sAz66GGAym3r7HtRwDU669267zHMkjqltnst5vL 0XpC+dc2VWDscq6Sk6Lzl+bU6RgcYBjzy5O+AQqCxi///JpaHQN6i696PjRPiB3RY4pGTCyHsoG mWO8qx858bO6hWfRWzo9CL1e45ag4F4ERzbABDwAwjFu8zcBWiLfHCp+e+coeqPGqHIPGZiPqs9 E0tCHijOLzNWBegCW2wgn7iDBesS15zdAzex5xZvmgFqgVtWDQEdxZgN6uXy4HTZxLkMjXuduwa j4fm1CnTybAdMX6EF2UTGVAhB5EbQ== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--5.321100-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24664.003 X-MDID: 1560152335-hA6gL0JWfoJK Subject: [dpdk-dev] [PATCH 17/29] net/sfc/base: export the zero-based MCDI port number X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Gautam Dawar 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 --- 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