patch 'net/hns3: fix some return values' has been queued to stable release 20.11.10
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Wed Nov 8 20:25:19 CET 2023
Hi,
FYI, your patch has been queued to stable release 20.11.10
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/10/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://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/a6dd3475c50042cc1aecaef153dbbaa71e556b4d
Thanks.
Luca Boccassi
---
>From a6dd3475c50042cc1aecaef153dbbaa71e556b4d Mon Sep 17 00:00:00 2001
From: Jie Hai <haijie1 at huawei.com>
Date: Tue, 31 Oct 2023 20:23:56 +0800
Subject: [PATCH] net/hns3: fix some return values
[ upstream commit 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 ]
1. Fix the return value of hns3_get_imissed_stats_num as 'uint16_t'.
2. Add some error check for return value.
Fixes: fcba820d9b9e ("net/hns3: support flow director")
Signed-off-by: Jie Hai <haijie1 at huawei.com>
---
drivers/net/hns3/hns3_ethdev_vf.c | 5 ++++-
drivers/net/hns3/hns3_fdir.c | 2 +-
drivers/net/hns3/hns3_stats.c | 10 ++++++++--
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index cc04659369..0b15b3bd2f 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -2659,8 +2659,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)
*/
if (pci_dev->kdrv == RTE_PCI_KDRV_IGB_UIO ||
pci_dev->kdrv == RTE_PCI_KDRV_UIO_GENERIC) {
- if (hns3vf_enable_msix(pci_dev, true))
+ ret = hns3vf_enable_msix(pci_dev, true);
+ if (ret != 0) {
hns3_err(hw, "Failed to enable msix");
+ return ret;
+ }
}
rte_intr_enable(&pci_dev->intr_handle);
diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index f210c8b1e4..cbb78bfcd6 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -962,7 +962,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
rule->key_conf.spec.src_port,
rule->key_conf.spec.dst_port, ret);
else
- hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf);
+ ret = hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf);
return ret;
}
diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c
index 7e645361cf..5cbdbecb6f 100644
--- a/drivers/net/hns3/hns3_stats.c
+++ b/drivers/net/hns3/hns3_stats.c
@@ -1144,9 +1144,15 @@ int
hns3_stats_init(struct hns3_hw *hw)
{
struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
+ int ret;
- if (!hns->is_vf)
- hns3_mac_stats_reset(hw);
+ if (!hns->is_vf) {
+ ret = hns3_mac_stats_reset(hw);
+ if (ret) {
+ hns3_err(hw, "reset mac stats failed, ret = %d", ret);
+ return ret;
+ }
+ }
return hns3_tqp_stats_init(hw);
}
--
2.39.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2023-11-08 19:23:53.037677581 +0000
+++ 0021-net-hns3-fix-some-return-values.patch 2023-11-08 19:23:51.797396789 +0000
@@ -1 +1 @@
-From 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 Mon Sep 17 00:00:00 2001
+From a6dd3475c50042cc1aecaef153dbbaa71e556b4d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -16,2 +17,2 @@
- drivers/net/hns3/hns3_stats.c | 15 ++++++++++-----
- 3 files changed, 15 insertions(+), 7 deletions(-)
+ drivers/net/hns3/hns3_stats.c | 10 ++++++++--
+ 3 files changed, 13 insertions(+), 4 deletions(-)
@@ -20 +21 @@
-index 0a227e6e45..156fb905f9 100644
+index cc04659369..0b15b3bd2f 100644
@@ -23 +24 @@
-@@ -2081,8 +2081,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)
+@@ -2659,8 +2659,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)
@@ -35 +36 @@
- rte_intr_enable(pci_dev->intr_handle);
+ rte_intr_enable(&pci_dev->intr_handle);
@@ -37 +38 @@
-index c80fa59e63..d100e58d10 100644
+index f210c8b1e4..cbb78bfcd6 100644
@@ -40 +41 @@
-@@ -978,7 +978,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
+@@ -962,7 +962,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
@@ -50 +51 @@
-index c2e692a2c5..9a1e8935e5 100644
+index 7e645361cf..5cbdbecb6f 100644
@@ -53,19 +54,2 @@
-@@ -771,7 +771,7 @@ hns3_mac_stats_reset(struct hns3_hw *hw)
- return 0;
- }
-
--static int
-+static uint16_t
- hns3_get_imissed_stats_num(struct hns3_adapter *hns)
- {
- #define NO_IMISSED_STATS_NUM 0
-@@ -993,7 +993,7 @@ hns3_imissed_stats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
- struct hns3_adapter *hns = dev->data->dev_private;
- struct hns3_hw *hw = &hns->hw;
- struct hns3_rx_missed_stats *imissed_stats = &hw->imissed_stats;
-- int imissed_stats_num;
-+ uint16_t imissed_stats_num;
- int cnt = *count;
- char *addr;
- uint16_t i;
-@@ -1170,7 +1170,7 @@ hns3_imissed_stats_name_get(struct rte_eth_dev *dev,
+@@ -1144,9 +1144,15 @@ int
+ hns3_stats_init(struct hns3_hw *hw)
@@ -73,10 +57,2 @@
- struct hns3_adapter *hns = dev->data->dev_private;
- uint32_t cnt = *count;
-- int imissed_stats_num;
-+ uint16_t imissed_stats_num;
- uint16_t i;
-
- imissed_stats_num = hns3_get_imissed_stats_num(hns);
-@@ -1539,8 +1539,13 @@ hns3_stats_init(struct hns3_hw *hw)
- return ret;
- }
+ struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
++ int ret;
More information about the stable
mailing list