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 00E8FA0548; Thu, 2 Jun 2022 03:55:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E1FD8427F9; Thu, 2 Jun 2022 03:54:56 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2126.outbound.protection.outlook.com [40.107.223.126]) by mails.dpdk.org (Postfix) with ESMTP id 41F7A4280D for ; Thu, 2 Jun 2022 03:54:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dbowF0lhpsVVPthxzKAvJ/GzDpFT4JACRzwtuYu6fjnDwnzt92fTexLOrVCNieazLCpqBYHfdbgq6kX8B9jQyZcBzF3zzKsqbvUHJc6+B0VLXta1V4pRMAEpKAHRP+rvSBpcPsiEP4k4k9zxwsGLinvHIuEuLiRfp9ZE9rTp+66BjhRTnFeSdglaTVff/U0IcrSk1PxNJSqKotDRb/rdb0gT5TfDPvtGyWayogrKCsoVsQBL6fBGm79b5f3TetIXVb9CRMDd12lY7eG7yyu0RWZG5OX4S6cLllsxsdvF142fLr9nRt/tAqv5vMaM3iNQAhQo9RSuKou4+xKqWdgE3A== 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=Uj3Z6gSNBLW1L8VHXHARwI0Ds9CWuVSewfjUXOuOKc0=; b=Z8MgGIQ6FSc/GHMUBDTfp+QWY+GrkjdSYtmpdTkBD4J2QX6EiFJr7tL8BlUgNFcm0ypJUiifh4197ZcO1wSALJDsCdJJ/flLdtOPaviqucUAZFqQsDT1LidUyViBsePTcrYlk870NWgqgz6tyA5EdStPcjbseQaBbzsh0ul/OrrY1EY6u+U90y0cSc94AYxJqcWAEUr4YBZhCnL8eZ1C0msM5vJBTl0K1PIIAPjgJ31o2g+p5uKbylhr5XGg3KEkVcre4iRjoQ9gQaYWL0RWj8RPDjKcXVs6LRrJAFTHHNdXK4kBU/Te8dOy1sKmrk08fuMXCi2P9LLx71HJTK3rqA== 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=Uj3Z6gSNBLW1L8VHXHARwI0Ds9CWuVSewfjUXOuOKc0=; b=fNmXhM0fK9b2KHIjGL1tdnxdkGwabs0/2CO/erX4+qMY+hNEeu7d8X3Y2Rjx23A8WPcicCFO88N+bLvKKw2FdKgz8VJ65pM3Ec5IJNhPy4Xmf8HN1ahF2vbgjjjylp+mThhg/2ZZs+aboY+CaEP13ZF8kXRjEbPNF9u+nA7Deto= 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 DM4PR13MB5858.namprd13.prod.outlook.com (2603:10b6:8:46::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.11; Thu, 2 Jun 2022 01:54:51 +0000 Received: from DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::d902:ed7d:82bb:c753]) by DM6PR13MB3004.namprd13.prod.outlook.com ([fe80::d902:ed7d:82bb:c753%4]) with mapi id 15.20.5314.013; Thu, 2 Jun 2022 01:54:51 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH 07/14] net/nfp: support NFDK firmware Date: Thu, 2 Jun 2022 03:52:57 +0200 Message-Id: <20220602015304.710197-8-jin.liu@corigine.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220602015304.710197-1-jin.liu@corigine.com> References: <20220602015304.710197-1-jin.liu@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0457.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::12) 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: 9d659ad1-76a1-411a-42c4-08da443ae1b6 X-MS-TrafficTypeDiagnostic: DM4PR13MB5858: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: tTpJbGIYlqE65cA1UI2F0XdvNzNo/Qe6y2IH2oQAMdVJWvk7KZlVsD+qNfjCLNwvKlzkMEjdLxZpWovzH74sHTin2m9IT0dJ0IlAxaRifb0bSXTSJ/B1QZvSuPgpvYRZLaUUoFBlKP/TkJqXvmj96i69t85Sd9/X7LMuIwufDrCUmz04b5HCSDd0yUTiNXKJibKWpG8CtToAfuRjtfkH2oIh8El6WRyY4JGXeL0kYvKf+rjyVGWqpxrOU30v4wagD7KC5st898ITmpMLg7QGTrDXfkfUG/1MksdQMzReHvCVescIfntu2BYjQPZGSlaZA+9BFz91TgtgMGsJZN0cMxNZc/lRyFUyEeOZyTZCYmVYh/K42qCTS0xX8V/gdAW2hzqZlyaUmDT6gn60c3UJyWh0CdvHbDzzzj7aJlhTz0/27PEpqGsh1rLMxsOJJRuGoY1RMElxfcaru/dGnEkKOe+Nve6ncIA3R6q7LnI1ba4iWEqD8sJ76qRDSo3QjBSdRiQHLcZYSGkxsPB7StsGA9Aw9cZNWedvZdM7ItpQRCC6A4o+u0lwF1k/qUribB9JUBy+wDgWCZ4a9jebDyK43Bk8MJxQNa8CgCbs+tRXMHwmrKifNze35Gatciu94x3AKnMrL6xrkk9sdPWcwQYNEblbjevYVLaGK1ZxOFChq2G4oA5JeFdlQO6Fk6tWCIn0Qecv5abSn3kVIQzIpy8ofA== 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:(13230001)(4636009)(346002)(366004)(396003)(136003)(376002)(39840400004)(36756003)(186003)(66574015)(83380400001)(5660300002)(4326008)(44832011)(8936002)(2906002)(6916009)(54906003)(1076003)(107886003)(6506007)(316002)(2616005)(41300700001)(8676002)(66946007)(66476007)(66556008)(26005)(6512007)(52116002)(38100700002)(38350700002)(86362001)(6486002)(508600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OXNqVUN6U2ZUa1oxbU9wWU1wM1VCV0JYUFNrMWNJY28reVc1V2x5N3BiekRx?= =?utf-8?B?MVAxT1FpU2d6RmtSTVIraDdxUUdzcTNIb1Q4cm1sKzR2RDZoOFFCZ3RIMGhU?= =?utf-8?B?cVBmVG5CMnZWN29KZ1BqMGFZckdZc3A0RDJqWTRtaTZuSjdPZERzcUJMSnhu?= =?utf-8?B?UFROMmMzNHRkSXJ4K2hTSXBxK1Qrc1F6Qkg2Q0tzUFpCeHN3c0xlS3FGdUhl?= =?utf-8?B?SjVxcFN1a00yRVFUQXFNaFJiRlFpRzlxZGhqbEpmUSsvZVprT1ZsOHlCUTZE?= =?utf-8?B?Y1JmUkdYVVRtUUxJTkdOMGR5M0t6ZnJhckUzdlhPRktkU3htYnFPcHZVMDh4?= =?ut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BxbDc4QVdQM0ROT1JSY0VNTERvM3pWUGNZ?= =?utf-8?B?N2tNT1U0dWhpK2F0MGtVNXpYdGtKMVd1bnVKMUovK2Q5ZE0zUEZuaTBzdVBV?= =?utf-8?B?aHB6UVRsWWNVL1ZaWWIxUkdRRUJtNElEOGtDR2l0cDN5S25pd2Q4aThNTlZ2?= =?utf-8?B?TkZkSnByWkJiM2ZiU1JVSnpyME5kTVRBb1UrL2FkTmNTcHp6YlA4QT09?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d659ad1-76a1-411a-42c4-08da443ae1b6 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB3004.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 01:54:51.4456 (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: g7EJux8EUpteY8iOZ5BWQd3R3JpuK+facDL5c2MeBd9fMgjQFak9OviKTuqDXQtqoTsbwfSrjQH83YRlVxe8Og== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR13MB5858 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 Modify nfp driver logic, add firmware version (NFD3 or NFDK) judgment, will according to the firmware version, mount different driver 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 --- drivers/net/nfp/nfp_ctrl.h | 2 ++ drivers/net/nfp/nfp_ethdev.c | 51 ++++++++++++++++++++++++++------- drivers/net/nfp/nfp_ethdev_vf.c | 37 +++++++++++++++++------- 3 files changed, 69 insertions(+), 21 deletions(-) diff --git a/drivers/net/nfp/nfp_ctrl.h b/drivers/net/nfp/nfp_ctrl.h index 4dd62ef194..e73715e2aa 100644 --- a/drivers/net/nfp/nfp_ctrl.h +++ b/drivers/net/nfp/nfp_ctrl.h @@ -135,6 +135,8 @@ * - define more STS bits */ #define NFP_NET_CFG_VERSION 0x0030 +#define NFP_NET_CFG_VERSION_DP_NFD3 0 +#define NFP_NET_CFG_VERSION_DP_NFDK 1 #define NFP_NET_CFG_VERSION_RESERVED_MASK (0xff << 24) #define NFP_NET_CFG_VERSION_CLASS_MASK (0xff << 16) #define NFP_NET_CFG_VERSION_CLASS(x) (((x) & 0xff) << 16) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 4d2cd9b0b3..c09a035323 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -358,6 +358,32 @@ static const struct eth_dev_ops nfp_net_nfd3_eth_dev_ops = { .rx_queue_intr_disable = nfp_rx_queue_intr_disable, }; +static inline int +nfp_net_ethdev_ops_mount(struct nfp_net_hw *hw, struct rte_eth_dev *eth_dev) +{ + switch (NFD_CFG_CLASS_VER_of(hw->ver)) { + case NFP_NET_CFG_VERSION_DP_NFD3: + break; + case NFP_NET_CFG_VERSION_DP_NFDK: + if (NFD_CFG_MAJOR_VERSION_of(hw->ver) < 5) { + PMD_DRV_LOG(ERR, "NFDK must use ABI 5 or newer, found: %d", + NFD_CFG_MAJOR_VERSION_of(hw->ver)); + return -EINVAL; + } + break; + default: + PMD_DRV_LOG(ERR, "The version of firmware is not correct."); + return -EINVAL; + } + + eth_dev->dev_ops = &nfp_net_nfd3_eth_dev_ops; + eth_dev->rx_queue_count = nfp_net_rx_queue_count; + eth_dev->rx_pkt_burst = &nfp_net_recv_pkts; + eth_dev->tx_pkt_burst = &nfp_net_nfd3_xmit_pkts; + + return 0; +} + static int nfp_net_init(struct rte_eth_dev *eth_dev) { @@ -384,7 +410,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) RTE_LOG(ERR, PMD, "device %s can not be used: restricted dma " "mask to 40 bits!\n", pci_dev->device.name); return -ENODEV; - }; + } port = ((struct nfp_net_hw *)eth_dev->data->dev_private)->idx; if (port < 0 || port > 7) { @@ -401,11 +427,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev) PMD_INIT_LOG(DEBUG, "Working with physical port number: %d, " "NFP internal port number: %d", port, hw->nfp_idx); - eth_dev->dev_ops = &nfp_net_nfd3_eth_dev_ops; - eth_dev->rx_queue_count = nfp_net_rx_queue_count; - eth_dev->rx_pkt_burst = &nfp_net_recv_pkts; - eth_dev->tx_pkt_burst = &nfp_net_nfd3_xmit_pkts; - /* For secondary processes, the primary has done all the work */ if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; @@ -440,6 +461,11 @@ nfp_net_init(struct rte_eth_dev *eth_dev) PMD_INIT_LOG(DEBUG, "ctrl bar: %p", hw->ctrl_bar); + hw->ver = nn_cfg_readl(hw, NFP_NET_CFG_VERSION); + + if (nfp_net_ethdev_ops_mount(hw, eth_dev)) + return -EINVAL; + hw->max_rx_queues = nn_cfg_readl(hw, NFP_NET_CFG_MAX_RXRINGS); hw->max_tx_queues = nn_cfg_readl(hw, NFP_NET_CFG_MAX_TXRINGS); @@ -472,7 +498,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev) nfp_net_cfg_queue_setup(hw); /* Get some of the read-only fields from the config BAR */ - hw->ver = nn_cfg_readl(hw, NFP_NET_CFG_VERSION); hw->cap = nn_cfg_readl(hw, NFP_NET_CFG_CAP); hw->max_mtu = nn_cfg_readl(hw, NFP_NET_CFG_MAX_MTU); hw->mtu = RTE_ETHER_MTU; @@ -938,6 +963,7 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) int err; int total_ports; struct nfp_cpp *cpp; + struct nfp_net_hw *hw; struct nfp_rtsym_table *sym_tbl; if (pci_dev == NULL) @@ -987,11 +1013,14 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) "ethdev doesn't exist"); return -ENODEV; } + + hw = NFP_NET_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); + + if (nfp_net_ethdev_ops_mount(hw, eth_dev)) + return -EINVAL; + eth_dev->process_private = cpp; - eth_dev->dev_ops = &nfp_net_nfd3_eth_dev_ops; - eth_dev->rx_queue_count = nfp_net_rx_queue_count; - eth_dev->rx_pkt_burst = &nfp_net_recv_pkts; - eth_dev->tx_pkt_burst = &nfp_net_nfd3_xmit_pkts; + rte_eth_dev_probing_finish(eth_dev); } diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index f5a0406e7d..e83c9dbcaf 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -287,7 +287,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) RTE_LOG(ERR, PMD, "device %s can not be used: restricted dma " "mask to 40 bits!\n", pci_dev->device.name); return -ENODEV; - }; + } hw = NFP_NET_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); @@ -296,6 +296,32 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = &nfp_net_recv_pkts; eth_dev->tx_pkt_burst = &nfp_net_nfd3_xmit_pkts; + hw->ctrl_bar = (uint8_t *)pci_dev->mem_resource[0].addr; + if (hw->ctrl_bar == NULL) { + PMD_DRV_LOG(ERR, + "hw->ctrl_bar is NULL. BAR0 not configured"); + return -ENODEV; + } + + PMD_INIT_LOG(DEBUG, "ctrl bar: %p", hw->ctrl_bar); + + hw->ver = nn_cfg_readl(hw, NFP_NET_CFG_VERSION); + + switch (NFD_CFG_CLASS_VER_of(hw->ver)) { + case NFP_NET_CFG_VERSION_DP_NFD3: + break; + case NFP_NET_CFG_VERSION_DP_NFDK: + if (NFD_CFG_MAJOR_VERSION_of(hw->ver) < 5) { + PMD_DRV_LOG(ERR, "NFDK must use ABI 5 or newer,found: %d", + NFD_CFG_MAJOR_VERSION_of(hw->ver)); + return -EINVAL; + } + break; + default: + PMD_DRV_LOG(ERR, "The version of firmware is not correct."); + return -EINVAL; + } + /* For secondary processes, the primary has done all the work */ if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; @@ -312,15 +338,6 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) pci_dev->addr.domain, pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); - hw->ctrl_bar = (uint8_t *)pci_dev->mem_resource[0].addr; - if (hw->ctrl_bar == NULL) { - PMD_DRV_LOG(ERR, - "hw->ctrl_bar is NULL. BAR0 not configured"); - return -ENODEV; - } - - PMD_INIT_LOG(DEBUG, "ctrl bar: %p", hw->ctrl_bar); - hw->max_rx_queues = nn_cfg_readl(hw, NFP_NET_CFG_MAX_RXRINGS); hw->max_tx_queues = nn_cfg_readl(hw, NFP_NET_CFG_MAX_TXRINGS); -- 2.27.0