From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F2A2A0093; Fri, 17 Jun 2022 11:35:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F376442B71; Fri, 17 Jun 2022 11:35:28 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2095.outbound.protection.outlook.com [40.107.94.95]) by mails.dpdk.org (Postfix) with ESMTP id 920EB42B6F for ; Fri, 17 Jun 2022 11:35:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LOjWdOce35M+7b+NxtvJrFaLgPbQ/N5wQC5wByuP8oqu9z7tgdwbfriw9f7WHt/GQcvoatpBjqKbS7VrZYQC3SfDy5ba9uVj0IREzGAVuaD3mWCQFg0BS0kigFiEJm/cblQUSUUscBWj+V//OQR4EZvr3GltlvMssh+K8hP3Bdc4qQ6tBZJC0ynbxVhQMNgTI9bW7mH17IGoPLO1CrEjBI8fC5ggvi5V/Q2U1vN6BuZhKX93G0dS3BXaX2z/8Hus7zZguzb6mdFjqJuF9MV2h2B0TxfAtktEpMHQPUrk62sJINY6j//vZ1JTbnVG2nbTgih2rF2B+tTy1eeed+LGmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+IbkRzZI+k90O8t0zYy11/8e4XRdT5anWVyDXpR/Z0c=; b=nlrjkgSkaEKOPkW9xf29bX1z4/6zQf40LZ+2+s77TyXRJ0s5nbDJz7p+F9M7YI5Tm4KFzOdXV2J2yYGZGOi4hutgblf1PFycwk9nNGqr8mwRsRZYkf6JOCZnW1H8fG0z2nndS/Pzpoqic8jePxBAAzINvi/YQXAARFEBM3xiQtF92DheUo+L/w8DWcZXALM7qjoF9Xw4KKss5m9AE6yQBc5hFQu+DeL6nqXhwHfRVwjwtI5r/cKpNvbuOSAVZKHGxPEOnfA+errTSExpFJVXVuQLE+8JA1+/krCwd4LfNajukRqjFqPMe/iccGC02UDYpQepdAikghzv1Y0EjUrAuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+IbkRzZI+k90O8t0zYy11/8e4XRdT5anWVyDXpR/Z0c=; b=Bdc3vPlCWaWqkRzIrd7PzitFqkJumyOQC/H1evQi2Gdnx6Y40fm5m68cfFykDFI25DmCfjX53dubqt4OK939uMQB1ohsNGxEI1vqXfAQJRbt3J5JZfLncmJdWh6oH6que6kCkgWfZKm9K/0pni4+qCWqdHCYsO5e+uo/HSmOfy4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB3004.namprd13.prod.outlook.com (2603:10b6:5:191::21) by CO3PR13MB5671.namprd13.prod.outlook.com (2603:10b6:303:17a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.9; Fri, 17 Jun 2022 09:35:24 +0000 Received: from DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::ac31:a36a:cc15:cd35]) by DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::ac31:a36a:cc15:cd35%7]) with mapi id 15.20.5373.009; Fri, 17 Jun 2022 09:35:24 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH v3 06/13] net/nfp: support NFP3800 card Date: Fri, 17 Jun 2022 11:34:37 +0200 Message-Id: <20220617093444.2004000-7-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220617093444.2004000-1-jin.liu@corigine.com> References: <20220616023939.1798769-1-jin.liu@corigine.com> <20220617093444.2004000-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0192.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a4::17) To DM6PR13MB3004.namprd13.prod.outlook.com (2603:10b6:5:191::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c952342-0876-4d52-bd98-08da5044b44a X-MS-TrafficTypeDiagnostic: CO3PR13MB5671:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eZIBYiLp2w0GVmSz75uI55kBR3g+efkunKfDPBNchXJ8f6BvdlZ7zQPyn313QvhG41OU7bdXZGC0KBI7EBnZta331vt3WA05Iz/PvfrvjzKv5bHkPefHMNYaTK6+zteT1w/KQmD9yVN5JWoCThYqEelWwHvFPSUhRsqcb96F0WnswjH/QdwN0KcUmXdrit37FztypM2fufXM57XC7rFbbNE0WoiUckDjiTt5mx5UFM+7h2VgOR5wxjvpFg8aLVOKVmM16D5fEXbZAGnGQ1yCQp9HJi8VCQq8kabdQlkoAqp+m9azJJ2oTqpk10NeOyMiF4HVa3zyVzLIGoHLZWKS4PX7p3S2mcAGEe5pZ1as/tPRdyCFvLe3P/Bm0HZOv22lAAPFLZkrFiSnifF64ZDx86B5HMqduaY4J6O6tXqrPoGu2SMPkdLkfPZS3r1/09NjEi9VE7jLPRfPEjmIXhIEnOS04UKCTRVXJ40uf2A5QFkkZqF7qT1AAidfb7GJwGmC7WIdtm5u9WCWVAxRgmCaiY51J/9J9LOEX/NiCyDHSP47YvDly+Gnh/afDaO28hQWLFBsHO3VBBDxxZ+GSDhtXyCPTYrutZhrqY2j9agQKL7im1Or/jr4Lr68S1epEadGw/gEbX3LMJicRyV+fyE/nN5gQwl6J4GvxodSHkT1wZG1R/0aNNYd9KBg6/uiS5DOplZmQP16SSreObsVY8aYPnnyS51LGo2IebcPMSAlSwZVjBU00grBiL5CE6czPssJ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR13MB3004.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(346002)(136003)(366004)(396003)(39840400004)(66476007)(66556008)(26005)(8676002)(66574015)(6666004)(107886003)(66946007)(6506007)(6916009)(44832011)(2906002)(316002)(4326008)(38350700002)(186003)(508600001)(54906003)(5660300002)(6486002)(6512007)(1076003)(8936002)(2616005)(36756003)(52116002)(83380400001)(86362001)(38100700002)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U3VHSm01R0ZrczN1dTBIMUNlbWV5aktzblFOcnZDQmdjSHNxc1lmK0Z4N3lC?= =?utf-8?B?YWdyR3poWWloUjNsRi94QkdxTzY3cE1SUVV1Z1VBY0FVK0JEdU1yY05BUS9S?= =?utf-8?B?aFRudlFqNFpWeW1kOTNQZTJ2UU1xN0dmZit0R3gxczFNL21obUI2aWp1dWpL?= =?utf-8?B?UGNQZFYraWlUcVlBTTBHYlc2dEFacmpvQmIyOWF5RGpObjNmc04zQ2pxdmVw?= =?utf-8?B?NUR2NWc0N2V0Y3J1cGtVWk5lbHpWV0VHR05pTFh1T1BSM2g5c0pEY1Bwd1R1?= =?utf-8?B?L3RpazhTSC9CVE4zMlFMSTcxSmJhaVBKYzh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B?YlZyeDJ6a3BzZjF2eDJ0azF4MU1IeWlHRmV2MGhmdytKdFY4OUEveWp1WHBz?= =?utf-8?B?bWZleTdQWkRYdTMyZjNHVXZ0QWVOODJ1b0ErOVhvS2t2aGJTR01BbzBvTGNB?= =?utf-8?B?ZlVsWEdFeTdyQjMrc2xEKzhEWU1nRUhpWGoxd2UyMk1KK2pkRXB0ZnhTU0RE?= =?utf-8?B?SVh4SWxiZVpxZGhLczVETExGbnhyTnQwL0h3U0J3dHpGMW1rcVplMXBVaHYv?= =?utf-8?Q?qAhcp5hRTF20mbOo=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c952342-0876-4d52-bd98-08da5044b44a X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 09:35:24.1797 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Vz9D/xjSCyr/+CVzTNgs1ObbtGLsCg2iS55eevkhUjDO6Gu5sUSP3zQ63hxjBxj204raQbwhcLh1aq53lxafqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR13MB5671 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add support for a new type of NIC NFP3800 card, and update some network card data acquisition interface functions. Signed-off-by: Jin Liu Signed-off-by: Diana Wang Signed-off-by: Peng Zhang Signed-off-by: Chaoyong He Signed-off-by: Niklas Söderlund --- doc/guides/nics/nfp.rst | 3 ++- doc/guides/rel_notes/release_22_07.rst | 4 +++ drivers/net/nfp/nfp_common.h | 34 ++++++++++++++++++++++++-- drivers/net/nfp/nfp_ethdev.c | 28 ++++++++++++++++++--- drivers/net/nfp/nfp_ethdev_vf.c | 9 +++++-- drivers/net/nfp/nfpcore/nfp_cpp.h | 2 +- drivers/net/nfp/nfpcore/nfp_nsp_eth.c | 20 +++++++++++---- 7 files changed, 86 insertions(+), 14 deletions(-) diff --git a/doc/guides/nics/nfp.rst b/doc/guides/nics/nfp.rst index 30cdc69202..dcefac3ef6 100644 --- a/doc/guides/nics/nfp.rst +++ b/doc/guides/nics/nfp.rst @@ -12,7 +12,8 @@ up to 400-Gb/s. This document explains how to use DPDK with the Netronome Poll Mode Driver (PMD) supporting Netronome's Network Flow Processor 6xxx -(NFP-6xxx) and Netronome's Flow Processor 4xxx (NFP-4xxx). +(NFP-6xxx), Netronome's Network Flow Processor 4xxx (NFP-4xxx) and +Netronome's Network Flow Processor 38xx (NFP-38xx). NFP is a SRIOV capable device and the PMD supports the physical function (PF) and the virtual functions (VFs). diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst index 7d5e3fac77..d5d8c735b1 100644 --- a/doc/guides/rel_notes/release_22_07.rst +++ b/doc/guides/rel_notes/release_22_07.rst @@ -108,6 +108,10 @@ New Features * Added support for MTU on Windows. * Added matching and RSS on IPsec ESP. +* **Updated Netronome nfp driver.** + + * Added support for NFP3800 NIC. + * **Updated VMware vmxnet3 networking driver.** * Added version 5 support. diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h index 8e1b4fb6a4..19e96414e3 100644 --- a/drivers/net/nfp/nfp_common.h +++ b/drivers/net/nfp/nfp_common.h @@ -16,9 +16,11 @@ #define NFP_NET_PMD_VERSION "0.1" #define PCI_VENDOR_ID_NETRONOME 0x19ee +#define PCI_DEVICE_ID_NFP3800_PF_NIC 0x3800 +#define PCI_DEVICE_ID_NFP3800_VF_NIC 0x3803 #define PCI_DEVICE_ID_NFP4000_PF_NIC 0x4000 #define PCI_DEVICE_ID_NFP6000_PF_NIC 0x6000 -#define PCI_DEVICE_ID_NFP6000_VF_NIC 0x6003 +#define PCI_DEVICE_ID_NFP6000_VF_NIC 0x6003 /* Include NFP4000VF */ /* Forward declaration */ struct nfp_net_adapter; @@ -41,8 +43,16 @@ struct nfp_net_adapter; #define NFP_QCP_QUEUE_STS_HI 0x000c #define NFP_QCP_QUEUE_STS_HI_WRITEPTR_mask (0x3ffff) +#define NFP_PCIE_QCP_NFP3800_OFFSET 0x400000 +#define NFP_PCIE_QCP_NFP6000_OFFSET 0x80000 +#define NFP_PCIE_QUEUE_NFP3800_MASK 0x1ff +#define NFP_PCIE_QUEUE_NFP6000_MASK 0xff +#define NFP_PCIE_QCP_PF_OFFSET 0x0 +#define NFP_PCIE_QCP_VF_OFFSET 0x0 + /* The offset of the queue controller queues in the PCIe Target */ -#define NFP_PCIE_QUEUE(_q) (0x80000 + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & 0xff))) +#define NFP_PCIE_QUEUE(_offset, _q, _mask) \ + ((_offset) + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & (_mask)))) /* Interrupt definitions */ #define NFP_NET_IRQ_LSC_IDX 0 @@ -342,6 +352,26 @@ nfp_qcp_read(uint8_t *q, enum nfp_qcp_ptr ptr) return val & NFP_QCP_QUEUE_STS_HI_WRITEPTR_mask; } +static inline uint32_t +nfp_pci_queue(struct rte_pci_device *pdev, uint16_t queue) +{ + switch (pdev->id.device_id) { + case PCI_DEVICE_ID_NFP4000_PF_NIC: + case PCI_DEVICE_ID_NFP6000_PF_NIC: + return NFP_PCIE_QUEUE(NFP_PCIE_QCP_PF_OFFSET, queue, + NFP_PCIE_QUEUE_NFP6000_MASK); + case PCI_DEVICE_ID_NFP3800_VF_NIC: + return NFP_PCIE_QUEUE(NFP_PCIE_QCP_VF_OFFSET, queue, + NFP_PCIE_QUEUE_NFP3800_MASK); + case PCI_DEVICE_ID_NFP6000_VF_NIC: + return NFP_PCIE_QUEUE(NFP_PCIE_QCP_VF_OFFSET, queue, + NFP_PCIE_QUEUE_NFP6000_MASK); + default: + return NFP_PCIE_QUEUE(NFP_PCIE_QCP_PF_OFFSET, queue, + NFP_PCIE_QUEUE_NFP3800_MASK); + } +} + /* Prototypes for common NFP functions */ int nfp_net_reconfig(struct nfp_net_hw *hw, uint32_t ctrl, uint32_t update); int nfp_net_configure(struct rte_eth_dev *dev); diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index ae6cb5943f..cb84dc3188 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -446,12 +446,13 @@ nfp_net_init(struct rte_eth_dev *eth_dev) /* Work out where in the BAR the queues start. */ switch (pci_dev->id.device_id) { + case PCI_DEVICE_ID_NFP3800_PF_NIC: case PCI_DEVICE_ID_NFP4000_PF_NIC: case PCI_DEVICE_ID_NFP6000_PF_NIC: start_q = nn_cfg_readl(hw, NFP_NET_CFG_START_TXQ); - tx_bar_off = (uint64_t)start_q * NFP_QCP_QUEUE_ADDR_SZ; + tx_bar_off = nfp_pci_queue(pci_dev, start_q); start_q = nn_cfg_readl(hw, NFP_NET_CFG_START_RXQ); - rx_bar_off = (uint64_t)start_q * NFP_QCP_QUEUE_ADDR_SZ; + rx_bar_off = nfp_pci_queue(pci_dev, start_q); break; default: PMD_DRV_LOG(ERR, "nfp_net: no device ID matching"); @@ -764,6 +765,7 @@ nfp_pf_init(struct rte_pci_device *pci_dev) { int err; int ret = 0; + uint64_t addr; int total_ports; struct nfp_cpp *cpp; struct nfp_pf_dev *pf_dev; @@ -867,8 +869,24 @@ nfp_pf_init(struct rte_pci_device *pci_dev) PMD_INIT_LOG(DEBUG, "ctrl bar: %p", pf_dev->ctrl_bar); /* configure access to tx/rx vNIC BARs */ + switch (pci_dev->id.device_id) { + case PCI_DEVICE_ID_NFP3800_PF_NIC: + addr = NFP_PCIE_QUEUE(NFP_PCIE_QCP_NFP3800_OFFSET, + 0, NFP_PCIE_QUEUE_NFP3800_MASK); + break; + case PCI_DEVICE_ID_NFP4000_PF_NIC: + case PCI_DEVICE_ID_NFP6000_PF_NIC: + addr = NFP_PCIE_QUEUE(NFP_PCIE_QCP_NFP6000_OFFSET, + 0, NFP_PCIE_QUEUE_NFP6000_MASK); + break; + default: + PMD_INIT_LOG(ERR, "nfp_net: no device ID matching"); + err = -ENODEV; + goto ctrl_area_cleanup; + } + pf_dev->hw_queues = nfp_cpp_map_area(pf_dev->cpp, 0, 0, - NFP_PCIE_QUEUE(0), NFP_QCP_QUEUE_AREA_SZ, + addr, NFP_QCP_QUEUE_AREA_SZ, &pf_dev->hwqueues_area); if (pf_dev->hw_queues == NULL) { PMD_INIT_LOG(ERR, "nfp_rtsym_map fails for net.qc"); @@ -995,6 +1013,10 @@ nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, } static const struct rte_pci_id pci_id_nfp_pf_net_map[] = { + { + RTE_PCI_DEVICE(PCI_VENDOR_ID_NETRONOME, + PCI_DEVICE_ID_NFP3800_PF_NIC) + }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NFP4000_PF_NIC) diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index d0fa1df24d..c46ee0f913 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -327,11 +327,12 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) /* Work out where in the BAR the queues start. */ switch (pci_dev->id.device_id) { + case PCI_DEVICE_ID_NFP3800_VF_NIC: case PCI_DEVICE_ID_NFP6000_VF_NIC: start_q = nn_cfg_readl(hw, NFP_NET_CFG_START_TXQ); - tx_bar_off = (uint64_t)start_q * NFP_QCP_QUEUE_ADDR_SZ; + tx_bar_off = nfp_pci_queue(pci_dev, start_q); start_q = nn_cfg_readl(hw, NFP_NET_CFG_START_RXQ); - rx_bar_off = (uint64_t)start_q * NFP_QCP_QUEUE_ADDR_SZ; + rx_bar_off = nfp_pci_queue(pci_dev, start_q); break; default: PMD_DRV_LOG(ERR, "nfp_net: no device ID matching"); @@ -456,6 +457,10 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) } static const struct rte_pci_id pci_id_nfp_vf_net_map[] = { + { + RTE_PCI_DEVICE(PCI_VENDOR_ID_NETRONOME, + PCI_DEVICE_ID_NFP3800_VF_NIC) + }, { RTE_PCI_DEVICE(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NFP6000_VF_NIC) diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h index 720d3989e6..a04a68f546 100644 --- a/drivers/net/nfp/nfpcore/nfp_cpp.h +++ b/drivers/net/nfp/nfpcore/nfp_cpp.h @@ -214,7 +214,7 @@ void nfp_cpp_free(struct nfp_cpp *cpp); * @return true if model is in the NFP6000 family, false otherwise. */ #define NFP_CPP_MODEL_IS_6000(model) \ - ((NFP_CPP_MODEL_CHIP_of(model) >= 0x4000) && \ + ((NFP_CPP_MODEL_CHIP_of(model) >= 0x3800) && \ (NFP_CPP_MODEL_CHIP_of(model) < 0x7000)) /* diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c index 67946891ab..f8f3c372ac 100644 --- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c +++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c @@ -266,6 +266,7 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp) struct nfp_eth_table *table; uint32_t table_sz; int i, j, ret, cnt = 0; + const struct rte_ether_addr *mac; entries = malloc(NSP_ETH_TABLE_SIZE); if (!entries) @@ -278,9 +279,15 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp) goto err; } - for (i = 0; i < NSP_ETH_MAX_COUNT; i++) - if (entries[i].port & NSP_ETH_PORT_LANES_MASK) + /* The NFP3800 NIC support 8 ports, but only 2 ports are valid, + * the rest 6 ports mac are all 0, ensure we don't use these port + */ + for (i = 0; i < NSP_ETH_MAX_COUNT; i++) { + mac = (const struct rte_ether_addr *)entries[i].mac_addr; + if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) && + (!rte_is_zero_ether_addr(mac))) cnt++; + } /* Some versions of flash will give us 0 instead of port count. For * those that give a port count, verify it against the value calculated @@ -299,10 +306,13 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp) memset(table, 0, table_sz); table->count = cnt; - for (i = 0, j = 0; i < NSP_ETH_MAX_COUNT; i++) - if (entries[i].port & NSP_ETH_PORT_LANES_MASK) + for (i = 0, j = 0; i < NSP_ETH_MAX_COUNT; i++) { + mac = (const struct rte_ether_addr *)entries[i].mac_addr; + if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) && + (!rte_is_zero_ether_addr(mac))) nfp_eth_port_translate(nsp, &entries[i], i, - &table->ports[j++]); + &table->ports[j++]); + } nfp_eth_calc_port_geometry(table); for (i = 0; i < (int)table->count; i++) -- 2.27.0