From patchwork Thu Apr 15 01:51:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91512 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 50811A0562; Thu, 15 Apr 2021 03:54:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 278AB161E18; Thu, 15 Apr 2021 03:51:19 +0200 (CEST) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id E1D37161EB0 for ; Thu, 15 Apr 2021 03:51:17 +0200 (CEST) Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FLMhC2fc8z18JSj for ; Thu, 15 Apr 2021 09:48:59 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Thu, 15 Apr 2021 09:51:13 +0800 From: "Min Hu (Connor)" To: CC: Date: Thu, 15 Apr 2021 09:51:29 +0800 Message-ID: <1618451489-56226-1-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1618314611-47978-11-git-send-email-humin29@huawei.com> References: <1618314611-47978-11-git-send-email-humin29@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2] net/hns3: rename Rx burst API 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 Sender: "dev" From: Chengwen Feng Currently, user could use runtime config "rx_func_hint=simple" to select the hns3_recv_pkts API, but the API's name get from rte_eth_rx_burst_mode_get is "Scalar" which has not reflected "simple". So this patch renames hns3_recv_pkts to hns3_recv_pkts_simple, and also change it's name which gets from rte_eth_rx_burst_mode_get to "Scalar Simple" to maintain conceptual consistency. Also changes the hns3_recv_scattered_pkts API's name which gets from rte_eth_rx_burst_mode_get to "Scalar". Fixes: 521ab3e93361 ("net/hns3: add simple Rx path") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) --- v2: * revert "Scalar Scattered". --- drivers/net/hns3/hns3_rxtx.c | 18 ++++++++++-------- drivers/net/hns3/hns3_rxtx.h | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index 19adf00..bc087fc 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1992,7 +1992,7 @@ hns3_dev_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_UNKNOWN }; - if (dev->rx_pkt_burst == hns3_recv_pkts || + if (dev->rx_pkt_burst == hns3_recv_pkts_simple || dev->rx_pkt_burst == hns3_recv_scattered_pkts || dev->rx_pkt_burst == hns3_recv_pkts_vec || dev->rx_pkt_burst == hns3_recv_pkts_vec_sve) @@ -2360,7 +2360,9 @@ hns3_rx_ptp_timestamp_handle(struct hns3_rx_queue *rxq, struct rte_mbuf *mbuf, } uint16_t -hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +hns3_recv_pkts_simple(void *rx_queue, + struct rte_mbuf **rx_pkts, + uint16_t nb_pkts) { volatile struct hns3_desc *rx_ring; /* RX ring (desc) */ volatile struct hns3_desc *rxdp; /* pointer of the current desc */ @@ -2743,10 +2745,10 @@ hns3_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, eth_rx_burst_t pkt_burst; const char *info; } burst_infos[] = { - { hns3_recv_pkts, "Scalar" }, + { hns3_recv_pkts_simple, "Scalar Simple" }, { hns3_recv_scattered_pkts, "Scalar Scattered" }, - { hns3_recv_pkts_vec, "Vector Neon" }, - { hns3_recv_pkts_vec_sve, "Vector Sve" }, + { hns3_recv_pkts_vec, "Vector Neon" }, + { hns3_recv_pkts_vec_sve, "Vector Sve" }, }; eth_rx_burst_t pkt_burst = dev->rx_pkt_burst; @@ -2792,14 +2794,14 @@ hns3_get_rx_function(struct rte_eth_dev *dev) if (hns->rx_func_hint == HNS3_IO_FUNC_HINT_SVE && sve_allowed) return hns3_recv_pkts_vec_sve; if (hns->rx_func_hint == HNS3_IO_FUNC_HINT_SIMPLE && simple_allowed) - return hns3_recv_pkts; + return hns3_recv_pkts_simple; if (hns->rx_func_hint == HNS3_IO_FUNC_HINT_COMMON) return hns3_recv_scattered_pkts; if (vec_allowed) return hns3_recv_pkts_vec; if (simple_allowed) - return hns3_recv_pkts; + return hns3_recv_pkts_simple; return hns3_recv_scattered_pkts; } @@ -4474,7 +4476,7 @@ hns3_dev_rx_descriptor_status(void *rx_queue, uint16_t offset) rxdp = &rxq->rx_ring[desc_id]; bd_base_info = rte_le_to_cpu_32(rxdp->rx.bd_base_info); dev = &rte_eth_devices[rxq->port_id]; - if (dev->rx_pkt_burst == hns3_recv_pkts || + if (dev->rx_pkt_burst == hns3_recv_pkts_simple || dev->rx_pkt_burst == hns3_recv_scattered_pkts) { if (offset >= rxq->nb_rx_desc - rxq->rx_free_hold) return RTE_ETH_RX_DESC_UNAVAIL; diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h index 10a6c64..ad85d0d 100644 --- a/drivers/net/hns3/hns3_rxtx.h +++ b/drivers/net/hns3/hns3_rxtx.h @@ -683,8 +683,8 @@ int hns3_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id); int hns3_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id); int hns3_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id); int hns3_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); -uint16_t hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, - uint16_t nb_pkts); +uint16_t hns3_recv_pkts_simple(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts); uint16_t hns3_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); uint16_t hns3_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,