[dpdk-stable] patch 'net/hns3: fix FEC state query' has been queued to stable release 20.11.1
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Fri Feb 5 12:15:20 CET 2021
Hi,
FYI, your patch has been queued to stable release 20.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/07/21. 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/f5c23c81806c9ff09e5f4246bf5f2bf3cbe26a36
Thanks.
Luca Boccassi
---
>From f5c23c81806c9ff09e5f4246bf5f2bf3cbe26a36 Mon Sep 17 00:00:00 2001
From: "Min Hu (Connor)" <humin29 at huawei.com>
Date: Thu, 10 Dec 2020 20:48:43 +0800
Subject: [PATCH] net/hns3: fix FEC state query
[ upstream commit 2390bf217f4df0228f238d4ba4b57097feef1d0e ]
As FEC is not supported below 10 Gbps,
CMD(HNS3_OPC_CONFIG_FEC_MODE) offered from
Firmware read will return fail in 10 Gbps device.
This patch will prevent read this CMD when below 10 Gbps,
as this is non-sense.
Fixes: 9bf2ea8dbc65 ("net/hns3: support FEC")
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
Signed-off-by: Lijun Ou <oulijun at huawei.com>
---
drivers/net/hns3/hns3_ethdev.c | 40 ++++++++++++++++++++++------------
drivers/net/hns3/hns3_ethdev.h | 2 ++
2 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 2011378879..c94a325d25 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -100,7 +100,7 @@ static int hns3_add_mc_addr(struct hns3_hw *hw,
static int hns3_remove_mc_addr(struct hns3_hw *hw,
struct rte_ether_addr *mac_addr);
static int hns3_restore_fec(struct hns3_hw *hw);
-static int hns3_query_dev_fec_info(struct rte_eth_dev *dev);
+static int hns3_query_dev_fec_info(struct hns3_hw *hw);
static void
hns3_pf_disable_irq0(struct hns3_hw *hw)
@@ -3001,13 +3001,6 @@ hns3_get_capability(struct hns3_hw *hw)
device_id == HNS3_DEV_ID_200G_RDMA)
hns3_set_bit(hw->capability, HNS3_DEV_SUPPORT_DCB_B, 1);
- ret = hns3_query_dev_fec_info(eth_dev);
- if (ret) {
- PMD_INIT_LOG(ERR,
- "failed to query FEC information, ret = %d", ret);
- return ret;
- }
-
/* Get PCI revision id */
ret = rte_pci_read_config(pci_dev, &revision, HNS3_PCI_REVISION_ID_LEN,
HNS3_PCI_REVISION_ID);
@@ -3139,8 +3132,15 @@ hns3_get_configuration(struct hns3_hw *hw)
}
ret = hns3_get_board_configuration(hw);
- if (ret)
+ if (ret) {
PMD_INIT_LOG(ERR, "failed to get board configuration: %d", ret);
+ return ret;
+ }
+
+ ret = hns3_query_dev_fec_info(hw);
+ if (ret)
+ PMD_INIT_LOG(ERR,
+ "failed to query FEC information, ret = %d", ret);
return ret;
}
@@ -5788,6 +5788,16 @@ get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
struct hns3_cmd_desc desc;
int ret;
+ /*
+ * CMD(HNS3_OPC_CONFIG_FEC_MODE) read is not supported
+ * in device of link speed
+ * below 10 Gbps.
+ */
+ if (hw->mac.link_speed < ETH_SPEED_NUM_10G) {
+ *state = 0;
+ return 0;
+ }
+
hns3_cmd_setup_basic_desc(&desc, HNS3_OPC_CONFIG_FEC_MODE, true);
req = (struct hns3_config_fec_cmd *)desc.data;
ret = hns3_cmd_send(hw, &desc, 1);
@@ -5994,14 +6004,14 @@ hns3_restore_fec(struct hns3_hw *hw)
}
static int
-hns3_query_dev_fec_info(struct rte_eth_dev *dev)
+hns3_query_dev_fec_info(struct hns3_hw *hw)
{
- struct hns3_adapter *hns = dev->data->dev_private;
- struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(hns);
- struct hns3_pf *pf = &hns->pf;
+ struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
+ struct hns3_pf *pf = HNS3_DEV_PRIVATE_TO_PF(hns);
+ struct rte_eth_dev *eth_dev = hns->eth_dev;
int ret;
- ret = hns3_fec_get(dev, &pf->fec_mode);
+ ret = hns3_fec_get(eth_dev, &pf->fec_mode);
if (ret)
hns3_err(hw, "query device FEC info failed, ret = %d", ret);
@@ -6087,6 +6097,8 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
PMD_INIT_FUNC_TRACE();
+ hns->eth_dev = eth_dev;
+
eth_dev->process_private = (struct hns3_process_private *)
rte_zmalloc_socket("hns3_filter_list",
sizeof(struct hns3_process_private),
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index 4c40df1cbb..d59418b8c8 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -743,6 +743,8 @@ struct hns3_adapter {
struct hns3_vf vf;
};
+ struct rte_eth_dev *eth_dev;
+
bool rx_simple_allowed;
bool rx_vec_allowed;
bool tx_simple_allowed;
--
2.29.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-02-05 11:18:30.817272548 +0000
+++ 0034-net-hns3-fix-FEC-state-query.patch 2021-02-05 11:18:28.670688522 +0000
@@ -1 +1 @@
-From 2390bf217f4df0228f238d4ba4b57097feef1d0e Mon Sep 17 00:00:00 2001
+From f5c23c81806c9ff09e5f4246bf5f2bf3cbe26a36 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2390bf217f4df0228f238d4ba4b57097feef1d0e ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index d6d3f03e5c..7c34e382fb 100644
+index 2011378879..c94a325d25 100644
@@ -34,3 +35,3 @@
- void hns3_ether_format_addr(char *buf, uint16_t size,
- const struct rte_ether_addr *ether_addr)
-@@ -3010,13 +3010,6 @@ hns3_get_capability(struct hns3_hw *hw)
+ static void
+ hns3_pf_disable_irq0(struct hns3_hw *hw)
+@@ -3001,13 +3001,6 @@ hns3_get_capability(struct hns3_hw *hw)
@@ -50 +51 @@
-@@ -3148,8 +3141,15 @@ hns3_get_configuration(struct hns3_hw *hw)
+@@ -3139,8 +3132,15 @@ hns3_get_configuration(struct hns3_hw *hw)
@@ -67 +68 @@
-@@ -5797,6 +5797,16 @@ get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
+@@ -5788,6 +5788,16 @@ get_current_fec_auto_state(struct hns3_hw *hw, uint8_t *state)
@@ -84 +85 @@
-@@ -6003,14 +6013,14 @@ hns3_restore_fec(struct hns3_hw *hw)
+@@ -5994,14 +6004,14 @@ hns3_restore_fec(struct hns3_hw *hw)
@@ -104 +105 @@
-@@ -6096,6 +6106,8 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
+@@ -6087,6 +6097,8 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)
@@ -114 +115 @@
-index 31f78a175d..8d6b8cdbbc 100644
+index 4c40df1cbb..d59418b8c8 100644
More information about the stable
mailing list