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 5B59041C3D for ; Wed, 8 Feb 2023 10:16:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5372840DFD; Wed, 8 Feb 2023 10:16:10 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2105.outbound.protection.outlook.com [40.107.212.105]) by mails.dpdk.org (Postfix) with ESMTP id 23A5740141; Wed, 8 Feb 2023 10:16:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HoiMDMeWNWKxWPaOWlsw2cNyezC0EtiJuiuOuVT8yCGJvZacSncpAktXS3x/YnrlP14JzSsAB5VD0CiJbiOBFFEjIxeT1CU2V0Tg565O7q89+oOsKnbCzOGPBt9y7pcu4IK+YaMCb0WYATGqeUumO9Hev+NB8ytNgK8/QnJ215tkgA4/V0xNuiHCDoNG3BW2vJymzugKrAEVUS5LCcbUWMRJ2GQL1Bw2J/NahtQIoVCfBgQNc4cXJ+R2sVzADWq5FSYLblrVV9csTx+f6I10k/YqxRBRYa7+2efuQBtoTx9oL9Al5yv5y5x2YkshwQhlp5+BWa9fiD0rId8uMnn/jg== 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=JVwfc51Ko3fWQAlkIxaOQvgP9i+8RbyFMfAIM45lsiI=; b=R5drFMwqOdItStw03o4WrWT/PuK12Hf/HgnGsM/zbXyWH6q//scRXiXIScISBOCcWM55DEommF7IAVAQ2kwBtFU8wYnjElAKvgJuzgX2S34aveCa9Dwr5awDFDvCb3zisW399vXZzmYI1JGpfDxkKfD81+ndSluGhlkPETTCOmXpwZvrubiGGJILw6q6kNM3b9p50+WaJwCMagaLNsivO0B9DVsiupyXwbsEVtC/wpuSiirOy58sxc5S5A0F1r9BXp+a6cQytoKIngDrVRKIJUNgAndUHSCQwrrWL52ksfkJexhcLN6NTW+NHp0ELcFcHSigOC+cNXRVavxO0h4K8w== 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=JVwfc51Ko3fWQAlkIxaOQvgP9i+8RbyFMfAIM45lsiI=; b=VMP9P1lrmAmWVc4DMtXxGKJAtywblMaD1O7/5Md7zOaQdGq+hvJxml3KaYPgqwoxhBVQiAxvdsq8zmYkDJqSPE2VhUs1sm782BmkmrfuU5hCr46AyuWaGG7TcGj4Rst1LQZPyr125b14C6AMuF0GkZl7e0/RWonh3M3/M76Chp4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by DM4PR13MB5857.namprd13.prod.outlook.com (2603:10b6:8:44::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Wed, 8 Feb 2023 09:16:05 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d%5]) with mapi id 15.20.6064.036; Wed, 8 Feb 2023 09:16:05 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Peng Zhang , jin.liu@corigine.com, stable@dpdk.org, Chaoyong He Subject: [PATCH] net/nfp: support 48-bit DMA address for firmware with NFDk Date: Wed, 8 Feb 2023 17:15:44 +0800 Message-Id: <20230208091544.22122-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.29.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR02CA0022.apcprd02.prod.outlook.com (2603:1096:3:17::34) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|DM4PR13MB5857:EE_ X-MS-Office365-Filtering-Correlation-Id: b800c7ca-da1a-4c96-5370-08db09b51ad2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dRU+7O9kUSNSTU0kQCODC5/O8bxCw2YrMJBrKn4+zch5ObJtDr5NPzunX1aNj6p9L5XAu9emXEnOJJRrM7+3V7WJ8vrB900PbrWq1m89KHeta/7duySuqdwZZp1rpY8Xc+yB8Ycf1HLIeiJhAgwr50I2VXDakRuYU6wWEEifgUV+O+ItSk8yDDPoWqn5Qt86ta+ivhbMOxg7R3/tL4d1cTEl+BZwZYq57ogO3YQP24ADoh+LtG3ePWJpbV8PlicPPvYAxZoNXO/47Zb+uCsWprDkgyOJxNf/IV9suffyTXw3JwRsbDu6y45GNXpMyuUKoP5c6oBlz3opflw6dxxBNzE3lwRpbeI08eGfXTq7BP4PWW3pSVCFJOOa8AleINlU5kWDRkT8Q2aomDV2bxsqAcDQQ5VMHEBR3F8LesAFs0GWdKk+jzINWSa/4uDkV06f30Zcj7+E8+/aRUsIt7nPqK7g8e7eIScPMbuuZEd8yFj/SYsmGqezIrU+vHK0hY8/zxp8fpFHIpLkwLxXYkhYonjz/EUEnsz9g9AndAQSeQVJigudWtzIxXFJ3EEnUw5cH+RZVQnpBlj8MuROn5qs2dUsXcwN5PS/cAlKknktpuqUfPAfLb4bWSbcjRS8j/r+05/Q1RxQsdPzcCFjdjRLLbHJX5IGhhX8ZLg9VoBqzfy2guircY9ygHJyVPa0GTGOeRSjZQBYsbY5j9QP/sh2bg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(366004)(346002)(39840400004)(136003)(396003)(451199018)(41300700001)(36756003)(2906002)(38350700002)(52116002)(38100700002)(6486002)(478600001)(2616005)(26005)(66574015)(1076003)(6506007)(8676002)(4326008)(6916009)(186003)(66946007)(66556008)(66476007)(6512007)(6666004)(316002)(450100002)(86362001)(54906003)(83380400001)(107886003)(44832011)(5660300002)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bG8rZmpiQjlETnlKVjBodEdpT1FwdlVmbmZSVTBCQ1J4cE9VZExsZ2kyS1ZY?= =?utf-8?B?MmhWbk03MTNUeFprMkt2THdGZkFQbVE1MnRTZm1EWVJwZ1lMNndnbWhJY0l0?= =?utf-8?B?amcvTVdVVW1IRVFwb1ZDeHJaOHBoUXR1elNKUCtvdDdpZldzb3dadVY3U0gr?= =?utf-8?B?Y0ZBbnRodjlRSXlCL0RTTFpBOUdZSTh3S1hZRlJOUjFKdDJMQm1TanZkbjN1?= =?utf-8?B?aXV3amxCOUxCdzBoUmtxbHVVaUswSmNlRENUWHROQ25mQ3NmdUoyd1E0UXdh?= =?utf-8?B?ZS8yMUsxZzNRallhN0V5QXlSZzNXUDg5RTNUT3FTbytmbTRPVmVOM1RKbEZw?= =?utf-8?B?Z3c1MCs4aXVjOHMvQlVhWTFubEdoODJIMkpvaXcwdjVEUn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com X-MS-Exchange-CrossTenant-Network-Message-Id: b800c7ca-da1a-4c96-5370-08db09b51ad2 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 09:16:04.9434 (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: KIsyvsVXaKmBF7ItIvY0LRpQXKN4+44VepxUHyfWDx7j9FRNIo7DYOBv9eUZFmLHbqpUv3FrYX6l3qVfTdWAv9gHtNE2rsaiBzFDUKR/RwI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR13MB5857 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Peng Zhang 48-bit DMA address is supported in the firmware with NFDk, so enable this feature in PMD now. But the firmware with NFD3 still just support 40-bit DMA address. RX free list descriptor, used by both NFD3 and NFDk, is also modified to support 48-bit DMA address. That's OK because the top bits is always set to 0 when assigned with 40-bit DMA address. Fixes: c73dced48c8c ("net/nfp: add NFDk Tx") Cc: jin.liu@corigine.com Cc: stable@dpdk.org Signed-off-by: Peng Zhang Reviewed-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/flower/nfp_flower.c | 12 ++++-------- drivers/net/nfp/flower/nfp_flower_ctrl.c | 2 +- drivers/net/nfp/nfp_common.c | 18 ++++++++++++++++++ drivers/net/nfp/nfp_common.h | 1 + drivers/net/nfp/nfp_ethdev.c | 11 +++-------- drivers/net/nfp/nfp_ethdev_vf.c | 11 +++-------- drivers/net/nfp/nfp_rxtx.c | 4 ++-- drivers/net/nfp/nfp_rxtx.h | 4 ++-- 8 files changed, 34 insertions(+), 29 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c index 7b46dc0f6a..7302d39af5 100644 --- a/drivers/net/nfp/flower/nfp_flower.c +++ b/drivers/net/nfp/flower/nfp_flower.c @@ -452,7 +452,7 @@ nfp_flower_pf_recv_pkts(void *rx_queue, rxds->vals[1] = 0; dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb)); rxds->fld.dd = 0; - rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xff; + rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff; rxds->fld.dma_addr_lo = dma_addr & 0xffffffff; nb_hold++; @@ -632,13 +632,6 @@ nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type) pf_dev = hw->pf_dev; pci_dev = hw->pf_dev->pci_dev; - /* NFP can not handle DMA addresses requiring more than 40 bits */ - if (rte_mem_check_dma_mask(40)) { - PMD_INIT_LOG(ERR, "Device %s can not be used: restricted dma mask to 40 bits!\n", - pci_dev->device.name); - return -ENODEV; - }; - hw->device_id = pci_dev->id.device_id; hw->vendor_id = pci_dev->id.vendor_id; hw->subsystem_device_id = pci_dev->id.subsystem_device_id; @@ -667,6 +660,9 @@ nfp_flower_init_vnic_common(struct nfp_net_hw *hw, const char *vnic_type) hw->mtu = hw->max_mtu; hw->flbufsz = DEFAULT_FLBUF_SIZE; + if (nfp_net_check_dma_mask(hw, pci_dev->name) != 0) + return -ENODEV; + /* read the Rx offset configured from firmware */ if (NFD_CFG_MAJOR_VERSION_of(hw->ver) < 2) hw->rx_offset = NFP_NET_RX_OFFSET; diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c index 03a2e2e622..b134a74bd8 100644 --- a/drivers/net/nfp/flower/nfp_flower_ctrl.c +++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c @@ -122,7 +122,7 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue, rxds->vals[1] = 0; dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb)); rxds->fld.dd = 0; - rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xff; + rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff; rxds->fld.dma_addr_lo = dma_addr & 0xffffffff; nb_hold++; diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index 4f21d9978d..4b36861b21 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -1563,6 +1563,24 @@ nfp_net_set_vxlan_port(struct nfp_net_hw *hw, return ret; } +/* + * The firmware with NFD3 can not handle DMA address requiring more + * than 40 bits + */ +int +nfp_net_check_dma_mask(struct nfp_net_hw *hw, char *name) +{ + if (NFD_CFG_CLASS_VER_of(hw->ver) == NFP_NET_CFG_VERSION_DP_NFD3 && + rte_mem_check_dma_mask(40) != 0) { + PMD_DRV_LOG(ERR, + "The device %s can't be used: restricted dma mask to 40 bits!", + name); + return -ENODEV; + } + + return 0; +} + RTE_LOG_REGISTER_SUFFIX(nfp_logtype_init, init, NOTICE); RTE_LOG_REGISTER_SUFFIX(nfp_logtype_driver, driver, NOTICE); RTE_LOG_REGISTER_SUFFIX(nfp_logtype_cpp, cpp, NOTICE); diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h index 56b7edc951..980f3cad89 100644 --- a/drivers/net/nfp/nfp_common.h +++ b/drivers/net/nfp/nfp_common.h @@ -454,6 +454,7 @@ int nfp_net_rx_desc_limits(struct nfp_net_hw *hw, int nfp_net_tx_desc_limits(struct nfp_net_hw *hw, uint16_t *min_tx_desc, uint16_t *max_tx_desc); +int nfp_net_check_dma_mask(struct nfp_net_hw *hw, char *name); #define NFP_NET_DEV_PRIVATE_TO_HW(adapter)\ (&((struct nfp_net_adapter *)adapter)->hw) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 31201c0197..8ac2a4b5cd 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -517,14 +517,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev) /* Use backpointer to the CoreNIC app struct */ app_fw_nic = NFP_PRIV_TO_APP_FW_NIC(pf_dev->app_fw_priv); - /* NFP can not handle DMA addresses requiring more than 40 bits */ - if (rte_mem_check_dma_mask(40)) { - 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) { PMD_DRV_LOG(ERR, "Port value is wrong"); @@ -572,6 +564,9 @@ nfp_net_init(struct rte_eth_dev *eth_dev) hw->ver = nn_cfg_readl(hw, NFP_NET_CFG_VERSION); + if (nfp_net_check_dma_mask(hw, pci_dev->name) != 0) + return -ENODEV; + if (nfp_net_ethdev_ops_mount(hw, eth_dev)) return -EINVAL; diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index 4eea197f85..e60e9f0f15 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -291,14 +291,6 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); - /* NFP can not handle DMA addresses requiring more than 40 bits */ - if (rte_mem_check_dma_mask(40)) { - 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); hw->ctrl_bar = (uint8_t *)pci_dev->mem_resource[0].addr; @@ -312,6 +304,9 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) hw->ver = nn_cfg_readl(hw, NFP_NET_CFG_VERSION); + if (nfp_net_check_dma_mask(hw, pci_dev->name) != 0) + return -ENODEV; + if (nfp_netvf_ethdev_ops_mount(hw, eth_dev)) return -EINVAL; diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 4a7574fd65..5ca3aef7e1 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -48,7 +48,7 @@ nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq) rxd = &rxq->rxds[i]; rxd->fld.dd = 0; - rxd->fld.dma_addr_hi = (dma_addr >> 32) & 0xff; + rxd->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff; rxd->fld.dma_addr_lo = dma_addr & 0xffffffff; rxe[i].mbuf = mbuf; PMD_RX_LOG(DEBUG, "[%d]: %" PRIx64, i, dma_addr); @@ -454,7 +454,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxds->vals[1] = 0; dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb)); rxds->fld.dd = 0; - rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xff; + rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff; rxds->fld.dma_addr_lo = dma_addr & 0xffffffff; nb_hold++; diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index 8a29adbd73..765717e8dc 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -287,8 +287,8 @@ struct nfp_net_rx_desc { union { /* Freelist descriptor */ struct { - uint8_t dma_addr_hi; - __le16 spare; + __le16 dma_addr_hi; + uint8_t spare; uint8_t dd; __le32 dma_addr_lo; -- 2.29.3