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 680D9A0545; Thu, 23 Jun 2022 04:27:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD47942B6E; Thu, 23 Jun 2022 04:27:18 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2100.outbound.protection.outlook.com [40.107.94.100]) by mails.dpdk.org (Postfix) with ESMTP id 71F7A42B74 for ; Thu, 23 Jun 2022 04:27:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AB4BMsuJHLbbIisBWA0dTPzfjmsThQcWJehZWvLc5D1KPJviq78f3oD5pfEDBba8QEIXuNoLBCS0jq7k1+KEKOz6KTN5ZvRtPi9H5mMdP7ZnK43P9txO0N1uVUsc8OmkF1dTcNESajP31zi8dfCb+b2pyjguLwrt28oDB+U/pWMVG0jt80Ngh34mgRRrlLz5KIH/kQ3Gz7ODNuSQ1JKaGDBp/K36UDMR3IJfHVGAX3csjInJGGTnf4rLuRL8SNM7PGkKT/ZHJOcc/Pj897B47conWPGaqcFWEw2rPT1zLAECYIakEMFzyoy/IbScOqJaTsRsGz0/hL661nhG1LfjNw== 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=E+tpuh67qkQ6mUlgH/OZpLp5rdgjRDpOZAsf3NCTslJe2XyBZTwuDwoAzdHdbMQcMe7IyHAqHoagL+RvOQDvI6YRWFTt1Zz3RCaqIb1CwDIuTy5YubY7BkhuYHoL9g76V9ixhLWs/Pg78269ZKkOc8l32RT4uOz7DHfAUc1pv+4fAsiY7Nt9DmyCZvGPupidWVNUW2Vg38wQ9L1+OnrPWl9SejoBkaABZlY4HlcR6oELrPjIP4vMBMhL08AyOI+R6WZSHzk2q75Nw6AgF02w+BxRnxqk8rZFoqYUjzfIMPtTNZn3BVKv82R3gc4fjiFO8fGaC9E6E9fz/iEvB6sFlA== 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=nrZGKMwmmDgnbR5qqbQBbtkoReAJe9LsbtkN3tbGdwzWzpltCokBi5wv0yK+WGeHs7btU7iQ5UD/KhdMrcw4QxpgkEzO5Ty9Ymiq1GAU+PAWglJAdwF8J6UaoL09AxYa2ET5Sl4oudYbP7cNocK46O2omZMvuAq64MDEFgUB48I= 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 MN2PR13MB3535.namprd13.prod.outlook.com (2603:10b6:208:169::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15; Thu, 23 Jun 2022 02:27:07 +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.015; Thu, 23 Jun 2022 02:27:07 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH v4 06/13] net/nfp: support NFP3800 card Date: Thu, 23 Jun 2022 04:26:08 +0200 Message-Id: <20220623022615.3628093-7-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220623022615.3628093-1-jin.liu@corigine.com> References: <20220617093444.2004000-1-jin.liu@corigine.com> <20220623022615.3628093-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0222.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:33a::10) 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: 99882342-93e2-4652-4c3a-08da54bfde61 X-MS-TrafficTypeDiagnostic: MN2PR13MB3535: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: vkmPGzhwiLccGS+R1iPbgiCbFvf69NLEhcaiAweGEd6hlhpF4wrh+bSPpoL1lBqCbn68i+nt7wZ6/qJjyp99RKvR1ec+0MOA9bxPcyyRa+556rdkXZeo6RvIuqfTFzxP8+xQIFxeo98P749hJ7KVf30AHdVfG5HaTE/uVPK2t5JUjoH+pCjJ8zvo5WTfvAvww2xpaeaBurD4BrpHuy62zrE5fxJpxlAPwBYdKui179NeB0IZiSaOy8PnrVJt3rG8cytcwzO4x2GdaPU6Y+P7rouf/4ILZLw3Y3S2ODDt8D9OSsFdDIhy9tC2vnfFtPrWV40ebR3nMy/rCGTn9PopjJw6eWXus0f/Ex//weN5kk6oqDAt4STDRGccVns20qh+YExpCuHFnMrof+tNfXqXGE0U+tiu07Dc4F5lmcRWycfAVdTAsARcM2wXv+J+uotTSd1aaEnPNZu+XRQUl2k7vVQfbGXgnd9syGjyp+yNsZ9nPO0K5OsDmpnWW93YhuScFWgAV8DlSxBjAL5bVoFXrw0YJLRrztn/o1G+rVuEUw+v7qn5h39C6U9Qv/F37w6LJZnyA3kb0uLNbyl27uAzURu+vnQHVemK/a894pQ/nvs/MV4Sz7zANAfzXyryRbGlYXyaqWOZAsQVrL72OtbODsM1ZqvS7HpyRXdl07OgT0ESfhnPp2uv1dJrPSCiWamWYkM5d4RCurXkAUJQbQZfHf1c8xGsPNfPSxqJOBPnYF0UsGQ6G7Z/lSF7Bl2/C04HhZxEha6tl/j7u2sl/7EjCbNWrextF2Ac7XsoJbix9No= 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)(376002)(366004)(346002)(136003)(396003)(39830400003)(107886003)(1076003)(38100700002)(38350700002)(6486002)(36756003)(66574015)(8936002)(54906003)(2616005)(6916009)(5660300002)(316002)(66556008)(52116002)(6506007)(186003)(66946007)(8676002)(4326008)(66476007)(41300700001)(86362001)(6512007)(26005)(83380400001)(478600001)(2906002)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q3NvWEtZY3A4WEM0R1crQ2x1aWQ4MnRDNEhuM1dRNER5UXZOQkhTNDFBSXJN?= =?utf-8?B?NHdscHRxNjlnQVo3ZTA1UFBzOXhPTVNnNmFFQUp5b2QrbkUzajdiRG9DTFY3?= =?utf-8?B?RVJPV0NhTUNBbzJoWE4xTnRYemZyeDJMNjhMK0RxZkl3ZU9CbmpsamlsbnI4?= =?utf-8?B?d2toY3hBYzE4bzJQZWVoeG1UTzVqSURQUlZpblQxVzBsUGh0b3p4STJYOUcv?= =?utf-8?B?Mnd6MVQvcGYxR0FFajhCMUlJQmlSMUNYK1YxQVpI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utf-8?B?NEV3eFJvRVIzOXN0MS9Fc1kyM0hGR1dkMTBGOFF1NEFnU0FiL1lxLzNjbjlL?= =?utf-8?Q?6GK2tFy+IY9jYymKzZYs9Djf8?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99882342-93e2-4652-4c3a-08da54bfde61 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2022 02:27:07.5251 (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: f2H2ULR3qD9Hq77GbGlTTOBI63PAEs2Ui88qG3jMWXk0zYylO2AmEGhZwANb9veHzgIvzwzlcJiwZ9jKulJCSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3535 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