patch 'net/hns3: fix burst mode query with dummy function' has been queued to stable release 22.11.2
Xueming Li
xuemingl at nvidia.com
Mon Feb 27 08:00:17 CET 2023
Hi,
FYI, your patch has been queued to stable release 22.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/01/23. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=c6b36e818356bf81a6e4d8b38689603b6e9b21ea
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From c6b36e818356bf81a6e4d8b38689603b6e9b21ea Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong at huawei.com>
Date: Sat, 11 Feb 2023 17:18:25 +0800
Subject: [PATCH] net/hns3: fix burst mode query with dummy function
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 10f91af5a5b370df922f888826a4387abebe1cde ]
The rte_eth_rx/tx_burst_mode_get API will fail when Rx/Tx
function is dummy.
Fixes: 7ef933908f04 ("net/hns3: add simple Tx path")
Fixes: 521ab3e93361 ("net/hns3: add simple Rx path")
Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3 at huawei.com>
---
drivers/net/hns3/hns3_rxtx.c | 38 ++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index f1163ce8a9..feef9e1c7b 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -2786,6 +2786,7 @@ hns3_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
{ hns3_recv_scattered_pkts, "Scalar Scattered" },
{ hns3_recv_pkts_vec, "Vector Neon" },
{ hns3_recv_pkts_vec_sve, "Vector Sve" },
+ { rte_eth_pkt_burst_dummy, "Dummy" },
};
eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
@@ -4272,24 +4273,31 @@ int
hns3_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
struct rte_eth_burst_mode *mode)
{
+ static const struct {
+ eth_tx_burst_t pkt_burst;
+ const char *info;
+ } burst_infos[] = {
+ { hns3_xmit_pkts_simple, "Scalar Simple" },
+ { hns3_xmit_pkts, "Scalar" },
+ { hns3_xmit_pkts_vec, "Vector Neon" },
+ { hns3_xmit_pkts_vec_sve, "Vector Sve" },
+ { rte_eth_pkt_burst_dummy, "Dummy" },
+ };
+
eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
- const char *info = NULL;
-
- if (pkt_burst == hns3_xmit_pkts_simple)
- info = "Scalar Simple";
- else if (pkt_burst == hns3_xmit_pkts)
- info = "Scalar";
- else if (pkt_burst == hns3_xmit_pkts_vec)
- info = "Vector Neon";
- else if (pkt_burst == hns3_xmit_pkts_vec_sve)
- info = "Vector Sve";
-
- if (info == NULL)
- return -EINVAL;
+ int ret = -EINVAL;
+ unsigned int i;
- snprintf(mode->info, sizeof(mode->info), "%s", info);
+ for (i = 0; i < RTE_DIM(burst_infos); i++) {
+ if (pkt_burst == burst_infos[i].pkt_burst) {
+ snprintf(mode->info, sizeof(mode->info), "%s",
+ burst_infos[i].info);
+ ret = 0;
+ break;
+ }
+ }
- return 0;
+ return ret;
}
static bool
--
2.25.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2023-02-27 14:08:44.391761900 +0800
+++ 0110-net-hns3-fix-burst-mode-query-with-dummy-function.patch 2023-02-27 14:08:40.859237000 +0800
@@ -1 +1 @@
-From 10f91af5a5b370df922f888826a4387abebe1cde Mon Sep 17 00:00:00 2001
+From c6b36e818356bf81a6e4d8b38689603b6e9b21ea Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 10f91af5a5b370df922f888826a4387abebe1cde ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list