From patchwork Thu Jun 2 01:52:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jin Liu X-Patchwork-Id: 112244 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 44E9BA0548; Thu, 2 Jun 2022 03:54:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7761742B71; Thu, 2 Jun 2022 03:54:48 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2107.outbound.protection.outlook.com [40.107.223.107]) by mails.dpdk.org (Postfix) with ESMTP id 9268D42B70 for ; Thu, 2 Jun 2022 03:54:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NKZAL2zrZLIsikKGVilmI9JIyFGVuP8uN7BE02IOCeBzz7r68Y0PhW4FzzfKun2eifhE4clwQ8SvxT8Ur2Oq8F+Nrna0gUcRnf8uJ9yKtiD3CL7osfqy+jBskKqKJxWTDMVwtnlks/RzcWgyltemQRF0rKpfzJLlfFHfv1nDGu6F14EBt6QIQkMWn4Gu0+WJUeZOUTH+2M2PJEvnaDbBkr9VH35N3axizxK0y13BN6tyv7zOlBVaLI6mpNTCNcdZTYdRAtXdXP8Dn38WyrdaQQfIPdMXLDla8yeQ3vjn/JT8ym4oY+dLn3+qVFuPZL12GCd9B1cb12WhX8Yf24DKKQ== 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=jNQQseR4lHSv6qkTTkZDpdzMgaWasqRxgBnyOqsxc/I=; b=eyoPqVy9eX4UNna1+s9VuIlnSqJs6ljMqHx62rnf0vcrtr8EEceZ99DGP74QOKr1KmsYFQIRBrdpE3U9CvaVBNKsT/YUm9k3xjkzEoqbIVIwnDsYt7dYi9CyHxfDDs/EDHlAG47INjZlewXo837fTW/jdCQrOqVGH6vRDa3XmzbWNUJWOd6UaMX5/ACS8ddKP/sv11DHqMfKgRKqkqYelc2UaANuUjjGsXVPgq9guBYAMZ9LlZ56ufhm+8Yoi9A1jOqnXsndWuu83TSz8U7WPZTl2SLtpvmwLuWwK5mSmj4SzxbHNzJv3r5xOhxvlkmmPeizYbxLX1BnscbbzMvWvQ== 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=jNQQseR4lHSv6qkTTkZDpdzMgaWasqRxgBnyOqsxc/I=; b=regGp9ZVjg1V3QBY/Gkf7+2J7SD3ly8cLpKqXsM/FlsoHjnz3x3b/giP0HFN+ZTa03QqR+YAJ9K35vPnRD3DWZR63ij7TjJyASW0Jqh1gV7b8I6XKSwuxobgUR3ImI+5fDSvwf33i1E09Xt/Mp5SmFZPziSM9PGkM1zOmQwCTqw= 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:46 +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:46 +0000 From: Jin Liu To: dev@dpdk.org Cc: niklas.soderlund@corigine.com, Jin Liu , Diana Wang , Peng Zhang , Chaoyong He Subject: [PATCH 05/14] net/nfp: rename function and struct Date: Thu, 2 Jun 2022 03:52:55 +0200 Message-Id: <20220602015304.710197-6-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> 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: ccf77b29-ee9a-4c0d-8f32-08da443ade65 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: bJTpfpN/sJfWvRJKiMcr8ZS0bpfTcjdC3cupMsFMSFh+oyglJPM3wVCncQnSpksREUH7EIitKKXd6OT9Qxrw88GzYrGOVh/yrfkj+WBx6BVEsOCuN+i8fieEQjKSMWlDJWydFg5UQje1/xhzHEj63/n72E3U9Y75juOhD74K1inSfvdxaGsVBA1ABc5512hCr45ClCMqBkQyXUqvY9uKEFLMJORm/R2knwn8R556/jCWrEoXxWN+++A93IjBiORjPRczSM3fSvRHIyLC4oAc1Nu2xGkwECnWjVXFOcT2yJIBfzpoL2y3jONx0s4gxTV3Imy1VKjpH6m8FdoGLDPks1laKlGccp7nK2gVleo3klCodlk3+mh2iZfa/wqdBSxrGQVyEZoqTlzuW+lp7gSdPnWwV/Nf6kVOE5yTFL2tbOk0t5+u87pRQCU2DdleOPO12IV2+0lJECfepzxJZ7dFulHh9e5DxCd2gMYlLcgwJ6zWNimlnpVU+I51izEyXUEJNhOsgJYCiE8cTmaZn7bD+FdpzJ5f95Op9LozVi/xeV2h61SWlDXojeC6DJZLO7moqVwrCgZejPCltgqrDlHEevD13ng711BflThQKPXT82Mci/dX6XXLMfmaI7DmNkUsK0PqL0ggmvkCi1dRKrIrkTl6ZLZf138Lu4BNbjXeO2HJpUkIRL6A1d312dl5oYKbLTj/n+526AfA+5J8Aqcndw== 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)(30864003)(5660300002)(4326008)(44832011)(8936002)(2906002)(6916009)(54906003)(1076003)(107886003)(6506007)(316002)(2616005)(41300700001)(8676002)(66946007)(66476007)(6666004)(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?q?J2/j0C/04TNSias1QUqhWYbke4Hl?= =?utf-8?q?wml4zhpTBNwYtYa1RjcRoagHcwH2Rtky+JLV3v1mGYD/Ow8kxpfiEez5MF/WurnsO?= =?utf-8?q?DxZu8BbkLmVmseISxtk/gbQV6+mjETtVVg7tAN4lRPrUM9iyNuxB64voagSxxVp26?= =?utf-8?q?M+qQypYeLfm0wyw+VkoOkLIzBIQSiY2DEoOxe5jmKsQqCBq88Wrx5yQ7Hkz9gicEz?= =?utf-8?q?FlySVfa/x4L8Ai9QKqahFLKNmya6oSA98Og4rRnN81FpRGMD9HzIcRB5XdRTIvLzH?= =?utf-8?q?DljcbStby5ZaaoGQryxxtnUsNOlRmAFl5pmSL0TWqsDwfS7k8xw4ATeRbUv/KVpSy?= =?utf-8?q?nmI8Va4J8Lx2YUyT6zWOo5HlDrJVemRbMYNC16c0CZbKBbQ5GPzF5zn7U6Bj6+kWl?= =?utf-8?q?WVgJiQYH3ZcFPoneDg+vM0BQz0fmpnNsxugkrbnRrg8+QbQdc8k/WgBJRAzQ8jHch?= =?utf-8?q?c/94smO+SshG9fzki2pxrl3in4Uo63Iw0NAUhn8RKRuRLDUpHcpF29/bG5lrVn0bc?= =?utf-8?q?Smq7S17nAy5pLTYO9Nuk10azoYueFyUpkaTCrHcwzk90rBspcV1jSnt5KWnLt1tMy?= =?utf-8?q?YcfGyp1Kz7cAq2s9F4pPD/CuTMBw1TRqXgt8gwWhb6J078cEGJ1hXew3gF4aBrbUm?= =?utf-8?q?QAmUrxhmKX7gZX1rVsArbjQpiUNCZoj2sRThalaG6jPpl3fMzTS6ogsDMVv3nU1v9?= =?utf-8?q?scJGO1pkLzJQwPTc8omV7Bn2aMSFVnftrYjXuxaOefOfT7cKDaaAYpjR5bbL3qYZ1?= =?utf-8?q?z/p4pY3gm5hAanigIBysuNjAH0Qn6MMUCYN9GLmda5e1p1icjNd10yDREqVkf6CLf?= =?utf-8?q?rYAD4XNE/qRyDSPr+Ts/KVa/YmNLLmu+cF6nmJIC+0Z57ZQs0teqTCd3c+Msk2T2w?= =?utf-8?q?CHdiFoR2LcLmuJl2us+CexGcasAgJUA6tEETM+0WO7MM1C0ZxFMwgct/HFCLqRyR6?= =?utf-8?q?xvp1l29KyDfYQML0qw3b186NR379LQLeiHOlo41tUOlHiFIGDn0Jh3mj7K/mP+EdD?= =?utf-8?q?SLS3cU3Fg/0x0HUBQkwa9BnU0nXN3fliXtxSmKc6gWtAGqazh/2GpIy/h0EZn4xof?= =?utf-8?q?iJ5tW9EBbB5j+ERqVUgpITfcfxo7kMGistkitmyrysqmRxBaSoNi3cpPyEGiCC4Ah?= =?utf-8?q?81i81yg+2QaClDQQ9WJS99Io1r+QGZ8YTWM6YGe0z9UA3LvqRBJtxxIa0eAdeM7tj?= =?utf-8?q?A4lBct6CexM8uFsIzmYxaQjz5h5DlwXshDEbXkLJwTBacqdSsPMbSSg2pxD6F3rb8?= =?utf-8?q?vrbfYFcesSZBnMYR+8u5pbhCOMulsKeijAgCF8liT8tonUOx1Dl1yPpirbeTCAN97?= =?utf-8?q?nTBvFCuyFXwAh8d7czw6MYXnrMlLev8m5VIXwA2Huqqw3iDy0j1V7oY3/qy+kU0/p?= =?utf-8?q?vKaE24VW1gXQfIbWXRj1K4bzEOY+cElyV3kJ5V0gU5dAlQrYRmH2LVJE2EQDhE3bW?= =?utf-8?q?rQdpmMWS/uN6/HJe0kPNAMGM3uf3/L4DMtRtl62iHtr4ut5Cn4HRO5n+jtBf7VLfp?= =?utf-8?q?YfVme23uAxEgklgQXWP8TRn/O5/2sWDZQtryzW8LEL6GCQzHye9D810+fTYJlgLPr?= =?utf-8?q?CdVOtOWSE+Cjgt9gl0U8iOAbG1eF54IMzVjxifUPz2AWMq/iF+2So9c++2edXf19B?= =?utf-8?q?sZIT24GQs/8enRSVrVKlggt1Y9W1c6eg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccf77b29-ee9a-4c0d-8f32-08da443ade65 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:45.9929 (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: ME4ePJF4yTkO3o7Pje5AaRvZrxvg6lGBBFFB4+blpl2MZP6anpxGpn70rGmlMCA5Yqs0yUN4+urYM/0vh8gBsw== 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 Add 'nfd3' into the nfd3 firmware eth driver function name, preparation for the next work, as we will support another nfdk firmware version. 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_ethdev.c | 28 +++++++++---------- drivers/net/nfp/nfp_ethdev_vf.c | 26 +++++++++--------- drivers/net/nfp/nfp_rxtx.c | 48 ++++++++++++++++----------------- drivers/net/nfp/nfp_rxtx.h | 12 ++++----- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index e491eee99a..0d5caf94ea 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -179,7 +179,7 @@ nfp_net_start(struct rte_eth_dev *dev) /* Stop device: disable rx and tx functions to allow for reconfiguring. */ static int -nfp_net_stop(struct rte_eth_dev *dev) +nfp_net_nfd3_stop(struct rte_eth_dev *dev) { int i; struct nfp_net_hw *hw; @@ -195,7 +195,7 @@ nfp_net_stop(struct rte_eth_dev *dev) /* Clear queues */ for (i = 0; i < dev->data->nb_tx_queues; i++) { this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; - nfp_net_reset_tx_queue(this_tx_q); + nfp_net_nfd3_reset_tx_queue(this_tx_q); } for (i = 0; i < dev->data->nb_rx_queues; i++) { @@ -251,7 +251,7 @@ nfp_net_set_link_down(struct rte_eth_dev *dev) /* Reset and stop device. The device can not be restarted. */ static int -nfp_net_close(struct rte_eth_dev *dev) +nfp_net_nfd3_close(struct rte_eth_dev *dev) { struct nfp_net_hw *hw; struct rte_pci_device *pci_dev; @@ -279,8 +279,8 @@ nfp_net_close(struct rte_eth_dev *dev) /* Clear queues */ for (i = 0; i < dev->data->nb_tx_queues; i++) { this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; - nfp_net_reset_tx_queue(this_tx_q); - nfp_net_tx_queue_release(dev, i); + nfp_net_nfd3_reset_tx_queue(this_tx_q); + nfp_net_nfd3_tx_queue_release(dev, i); } for (i = 0; i < dev->data->nb_rx_queues; i++) { @@ -329,13 +329,13 @@ nfp_net_close(struct rte_eth_dev *dev) } /* Initialise and register driver with DPDK Application */ -static const struct eth_dev_ops nfp_net_eth_dev_ops = { +static const struct eth_dev_ops nfp_net_nfd3_eth_dev_ops = { .dev_configure = nfp_net_configure, .dev_start = nfp_net_start, - .dev_stop = nfp_net_stop, + .dev_stop = nfp_net_nfd3_stop, .dev_set_link_up = nfp_net_set_link_up, .dev_set_link_down = nfp_net_set_link_down, - .dev_close = nfp_net_close, + .dev_close = nfp_net_nfd3_close, .promiscuous_enable = nfp_net_promisc_enable, .promiscuous_disable = nfp_net_promisc_disable, .link_update = nfp_net_link_update, @@ -352,8 +352,8 @@ static const struct eth_dev_ops nfp_net_eth_dev_ops = { .rss_hash_conf_get = nfp_net_rss_hash_conf_get, .rx_queue_setup = nfp_net_rx_queue_setup, .rx_queue_release = nfp_net_rx_queue_release, - .tx_queue_setup = nfp_net_tx_queue_setup, - .tx_queue_release = nfp_net_tx_queue_release, + .tx_queue_setup = nfp_net_nfd3_tx_queue_setup, + .tx_queue_release = nfp_net_nfd3_tx_queue_release, .rx_queue_intr_enable = nfp_rx_queue_intr_enable, .rx_queue_intr_disable = nfp_rx_queue_intr_disable, }; @@ -401,10 +401,10 @@ 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_eth_dev_ops; + 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_xmit_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) @@ -970,10 +970,10 @@ nfp_pf_secondary_init(struct rte_pci_device *pci_dev) return -ENODEV; } eth_dev->process_private = cpp; - eth_dev->dev_ops = &nfp_net_eth_dev_ops; + 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_xmit_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 aa156ad162..7d79a08041 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -143,7 +143,7 @@ nfp_netvf_start(struct rte_eth_dev *dev) } static int -nfp_netvf_stop(struct rte_eth_dev *dev) +nfp_netvf_nfd3_stop(struct rte_eth_dev *dev) { struct nfp_net_txq *this_tx_q; struct nfp_net_rxq *this_rx_q; @@ -156,7 +156,7 @@ nfp_netvf_stop(struct rte_eth_dev *dev) /* Clear queues */ for (i = 0; i < dev->data->nb_tx_queues; i++) { this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; - nfp_net_reset_tx_queue(this_tx_q); + nfp_net_nfd3_reset_tx_queue(this_tx_q); } for (i = 0; i < dev->data->nb_rx_queues; i++) { @@ -182,7 +182,7 @@ nfp_netvf_set_link_down(struct rte_eth_dev *dev __rte_unused) /* Reset and stop device. The device can not be restarted. */ static int -nfp_netvf_close(struct rte_eth_dev *dev) +nfp_netvf_nfd3_close(struct rte_eth_dev *dev) { struct rte_pci_device *pci_dev; struct nfp_net_txq *this_tx_q; @@ -206,8 +206,8 @@ nfp_netvf_close(struct rte_eth_dev *dev) /* Clear queues */ for (i = 0; i < dev->data->nb_tx_queues; i++) { this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; - nfp_net_reset_tx_queue(this_tx_q); - nfp_net_tx_queue_release(dev, i); + nfp_net_nfd3_reset_tx_queue(this_tx_q); + nfp_net_nfd3_tx_queue_release(dev, i); } for (i = 0; i < dev->data->nb_rx_queues; i++) { @@ -236,13 +236,13 @@ nfp_netvf_close(struct rte_eth_dev *dev) } /* Initialise and register VF driver with DPDK Application */ -static const struct eth_dev_ops nfp_netvf_eth_dev_ops = { +static const struct eth_dev_ops nfp_netvf_nfd3_eth_dev_ops = { .dev_configure = nfp_net_configure, .dev_start = nfp_netvf_start, - .dev_stop = nfp_netvf_stop, + .dev_stop = nfp_netvf_nfd3_stop, .dev_set_link_up = nfp_netvf_set_link_up, .dev_set_link_down = nfp_netvf_set_link_down, - .dev_close = nfp_netvf_close, + .dev_close = nfp_netvf_nfd3_close, .promiscuous_enable = nfp_net_promisc_enable, .promiscuous_disable = nfp_net_promisc_disable, .link_update = nfp_net_link_update, @@ -259,8 +259,8 @@ static const struct eth_dev_ops nfp_netvf_eth_dev_ops = { .rss_hash_conf_get = nfp_net_rss_hash_conf_get, .rx_queue_setup = nfp_net_rx_queue_setup, .rx_queue_release = nfp_net_rx_queue_release, - .tx_queue_setup = nfp_net_tx_queue_setup, - .tx_queue_release = nfp_net_tx_queue_release, + .tx_queue_setup = nfp_net_nfd3_tx_queue_setup, + .tx_queue_release = nfp_net_nfd3_tx_queue_release, .rx_queue_intr_enable = nfp_rx_queue_intr_enable, .rx_queue_intr_disable = nfp_rx_queue_intr_disable, }; @@ -291,10 +291,10 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) hw = NFP_NET_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); - eth_dev->dev_ops = &nfp_netvf_eth_dev_ops; + eth_dev->dev_ops = &nfp_netvf_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_xmit_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) @@ -467,7 +467,7 @@ static const struct rte_pci_id pci_id_nfp_vf_net_map[] = { static int nfp_vf_pci_uninit(struct rte_eth_dev *eth_dev) { /* VF cleanup, just free private port data */ - return nfp_netvf_close(eth_dev); + return nfp_netvf_nfd3_close(eth_dev); } static int eth_nfp_vf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index cd7faa2c58..2c9875e829 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -618,7 +618,7 @@ nfp_net_tx_free_bufs(struct nfp_net_txq *txq) } static void -nfp_net_tx_queue_release_mbufs(struct nfp_net_txq *txq) +nfp_net_nfd3_tx_queue_release_mbufs(struct nfp_net_txq *txq) { unsigned int i; @@ -634,12 +634,12 @@ nfp_net_tx_queue_release_mbufs(struct nfp_net_txq *txq) } void -nfp_net_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx) +nfp_net_nfd3_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx) { struct nfp_net_txq *txq = dev->data->tx_queues[queue_idx]; if (txq) { - nfp_net_tx_queue_release_mbufs(txq); + nfp_net_nfd3_tx_queue_release_mbufs(txq); rte_eth_dma_zone_free(dev, "tx_ring", queue_idx); rte_free(txq->txbufs); rte_free(txq); @@ -647,15 +647,15 @@ nfp_net_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx) } void -nfp_net_reset_tx_queue(struct nfp_net_txq *txq) +nfp_net_nfd3_reset_tx_queue(struct nfp_net_txq *txq) { - nfp_net_tx_queue_release_mbufs(txq); + nfp_net_nfd3_tx_queue_release_mbufs(txq); txq->wr_p = 0; txq->rd_p = 0; } int -nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, +nfp_net_nfd3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf) { @@ -670,7 +670,7 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, PMD_INIT_FUNC_TRACE(); /* Validating number of descriptors */ - tx_desc_sz = nb_desc * sizeof(struct nfp_net_tx_desc); + tx_desc_sz = nb_desc * sizeof(struct nfp_net_nfd3_tx_desc); if (tx_desc_sz % NFP_ALIGN_RING_DESC != 0 || nb_desc > NFP_NET_MAX_TX_DESC || nb_desc < NFP_NET_MIN_TX_DESC) { @@ -698,7 +698,7 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, if (dev->data->tx_queues[queue_idx]) { PMD_TX_LOG(DEBUG, "Freeing memory prior to re-allocation %d", queue_idx); - nfp_net_tx_queue_release(dev, queue_idx); + nfp_net_nfd3_tx_queue_release(dev, queue_idx); dev->data->tx_queues[queue_idx] = NULL; } @@ -718,12 +718,12 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, * resizing in later calls to the queue setup function. */ tz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_idx, - sizeof(struct nfp_net_tx_desc) * + sizeof(struct nfp_net_nfd3_tx_desc) * NFP_NET_MAX_TX_DESC, NFP_MEMZONE_ALIGN, socket_id); if (tz == NULL) { PMD_DRV_LOG(ERR, "Error allocating tx dma"); - nfp_net_tx_queue_release(dev, queue_idx); + nfp_net_nfd3_tx_queue_release(dev, queue_idx); dev->data->tx_queues[queue_idx] = NULL; return -ENOMEM; } @@ -743,21 +743,21 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, /* Saving physical and virtual addresses for the TX ring */ txq->dma = (uint64_t)tz->iova; - txq->txds = (struct nfp_net_tx_desc *)tz->addr; + txq->txds = (struct nfp_net_nfd3_tx_desc *)tz->addr; /* mbuf pointers array for referencing mbufs linked to TX descriptors */ txq->txbufs = rte_zmalloc_socket("txq->txbufs", sizeof(*txq->txbufs) * nb_desc, RTE_CACHE_LINE_SIZE, socket_id); if (txq->txbufs == NULL) { - nfp_net_tx_queue_release(dev, queue_idx); + nfp_net_nfd3_tx_queue_release(dev, queue_idx); dev->data->tx_queues[queue_idx] = NULL; return -ENOMEM; } PMD_TX_LOG(DEBUG, "txbufs=%p hw_ring=%p dma_addr=0x%" PRIx64, txq->txbufs, txq->txds, (unsigned long)txq->dma); - nfp_net_reset_tx_queue(txq); + nfp_net_nfd3_reset_tx_queue(txq); txq->hw = hw; @@ -773,7 +773,7 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, /* Leaving always free descriptors for avoiding wrapping confusion */ static inline -uint32_t nfp_free_tx_desc(struct nfp_net_txq *txq) +uint32_t nfp_net_nfd3_free_tx_desc(struct nfp_net_txq *txq) { if (txq->wr_p >= txq->rd_p) return txq->tx_count - (txq->wr_p - txq->rd_p) - 8; @@ -790,14 +790,14 @@ uint32_t nfp_free_tx_desc(struct nfp_net_txq *txq) * This function uses the host copy* of read/write pointers */ static inline -uint32_t nfp_net_txq_full(struct nfp_net_txq *txq) +uint32_t nfp_net_nfd3_txq_full(struct nfp_net_txq *txq) { - return (nfp_free_tx_desc(txq) < txq->tx_free_thresh); + return (nfp_net_nfd3_free_tx_desc(txq) < txq->tx_free_thresh); } /* nfp_net_tx_tso - Set TX descriptor for TSO */ static inline void -nfp_net_tx_tso(struct nfp_net_txq *txq, struct nfp_net_tx_desc *txd, +nfp_net_nfd3_tx_tso(struct nfp_net_txq *txq, struct nfp_net_nfd3_tx_desc *txd, struct rte_mbuf *mb) { uint64_t ol_flags; @@ -828,7 +828,7 @@ nfp_net_tx_tso(struct nfp_net_txq *txq, struct nfp_net_tx_desc *txd, /* nfp_net_tx_cksum - Set TX CSUM offload flags in TX descriptor */ static inline void -nfp_net_tx_cksum(struct nfp_net_txq *txq, struct nfp_net_tx_desc *txd, +nfp_net_nfd3_tx_cksum(struct nfp_net_txq *txq, struct nfp_net_nfd3_tx_desc *txd, struct rte_mbuf *mb) { uint64_t ol_flags; @@ -857,11 +857,11 @@ nfp_net_tx_cksum(struct nfp_net_txq *txq, struct nfp_net_tx_desc *txd, } uint16_t -nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) +nfp_net_nfd3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct nfp_net_txq *txq; struct nfp_net_hw *hw; - struct nfp_net_tx_desc *txds, txd; + struct nfp_net_nfd3_tx_desc *txds, txd; struct rte_mbuf *pkt; uint64_t dma_addr; int pkt_size, dma_size; @@ -876,10 +876,10 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) PMD_TX_LOG(DEBUG, "working for queue %u at pos %d and %u packets", txq->qidx, txq->wr_p, nb_pkts); - if ((nfp_free_tx_desc(txq) < nb_pkts) || (nfp_net_txq_full(txq))) + if ((nfp_net_nfd3_free_tx_desc(txq) < nb_pkts) || (nfp_net_nfd3_txq_full(txq))) nfp_net_tx_free_bufs(txq); - free_descs = (uint16_t)nfp_free_tx_desc(txq); + free_descs = (uint16_t)nfp_net_nfd3_free_tx_desc(txq); if (unlikely(free_descs == 0)) return 0; @@ -913,8 +913,8 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) * multisegment packet, but TSO info needs to be in all of them. */ txd.data_len = pkt->pkt_len; - nfp_net_tx_tso(txq, &txd, pkt); - nfp_net_tx_cksum(txq, &txd, pkt); + nfp_net_nfd3_tx_tso(txq, &txd, pkt); + nfp_net_nfd3_tx_cksum(txq, &txd, pkt); if ((pkt->ol_flags & RTE_MBUF_F_TX_VLAN) && (hw->cap & NFP_NET_CFG_CTRL_TXVLAN)) { diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index dec1857da3..87a9c59b3b 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -53,7 +53,7 @@ #define PCIE_DESC_TX_ENCAP_VXLAN (1 << 1) #define PCIE_DESC_TX_ENCAP_GRE (1 << 0) -struct nfp_net_tx_desc { +struct nfp_net_nfd3_tx_desc { union { struct { uint8_t dma_addr_hi; /* High bits of host buf address */ @@ -124,7 +124,7 @@ struct nfp_net_txq { * of the queue and @size is the size in bytes for the queue * (needed for free) */ - struct nfp_net_tx_desc *txds; + struct nfp_net_nfd3_tx_desc *txds; /* * At this point 48 bytes have been used for all the fields in the @@ -284,12 +284,12 @@ int nfp_net_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp); -void nfp_net_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx); -void nfp_net_reset_tx_queue(struct nfp_net_txq *txq); -int nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, +void nfp_net_nfd3_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx); +void nfp_net_nfd3_reset_tx_queue(struct nfp_net_txq *txq); +int nfp_net_nfd3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); -uint16_t nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, +uint16_t nfp_net_nfd3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); #endif /* _NFP_RXTX_H_ */