linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver
@ 2024-03-07  1:01 Jijie Shao
  2024-03-07  1:01 ` [PATCH net 1/8] net: hns3: fix wrong judgment condition issue Jijie Shao
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Jijie Shao @ 2024-03-07  1:01 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev, linux-kernel

There are some bugfix for the HNS3 ethernet driver

Hao Lan (2):
  net: hns3: add new 200G link modes for hisilicon device
  net: hns3: Disable SerDes serial loopback for HiLink H60

Jian Shen (1):
  net: hns3: add checking for vf id of mailbox

Jie Wang (1):
  net: hns3: fix port duplex configure error in IMP reset

Jijie Shao (2):
  net: hns3: fix wrong judgment condition issue
  net: hns3: fix delete tc fail issue

Peiyang Wang (1):
  net: hns3: fix reset timeout under full functions and queues

Yonglong Liu (1):
  net: hns3: fix kernel crash when 1588 is received on HIP08 devices

 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |  2 +
 .../hns3/hns3_common/hclge_comm_cmd.c         |  2 +-
 .../hns3/hns3_common/hclge_comm_cmd.h         |  2 +-
 .../net/ethernet/hisilicon/hns3/hns3_dcbnl.c  |  2 +-
 .../ethernet/hisilicon/hns3/hns3_debugfs.c    |  2 +
 .../hisilicon/hns3/hns3pf/hclge_cmd.h         |  3 +-
 .../hisilicon/hns3/hns3pf/hclge_dcb.c         |  2 +
 .../hisilicon/hns3/hns3pf/hclge_main.c        | 44 +++++++++++++------
 .../hisilicon/hns3/hns3pf/hclge_main.h        | 11 ++++-
 .../hisilicon/hns3/hns3pf/hclge_mbx.c         |  7 +--
 .../hisilicon/hns3/hns3pf/hclge_ptp.c         |  2 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 16 +++++++
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.h |  1 +
 13 files changed, 74 insertions(+), 22 deletions(-)

-- 
2.30.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH net 1/8] net: hns3: fix wrong judgment condition issue
  2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
@ 2024-03-07  1:01 ` Jijie Shao
  2024-03-07  1:01 ` [PATCH net 2/8] net: hns3: add new 200G link modes for hisilicon device Jijie Shao
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Jijie Shao @ 2024-03-07  1:01 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev, linux-kernel

In hns3_dcbnl_ieee_delapp, should check ieee_delapp not ieee_setapp.
This path fix the wrong judgment.

Fixes: 0ba22bcb222d ("net: hns3: add support config dscp map to tc")
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_dcbnl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_dcbnl.c b/drivers/net/ethernet/hisilicon/hns3/hns3_dcbnl.c
index 3b6dbf158b98..f72dc0cee30e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_dcbnl.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_dcbnl.c
@@ -76,7 +76,7 @@ static int hns3_dcbnl_ieee_delapp(struct net_device *ndev, struct dcb_app *app)
 	if (hns3_nic_resetting(ndev))
 		return -EBUSY;
 
-	if (h->kinfo.dcb_ops->ieee_setapp)
+	if (h->kinfo.dcb_ops->ieee_delapp)
 		return h->kinfo.dcb_ops->ieee_delapp(h, app);
 
 	return -EOPNOTSUPP;
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH net 2/8] net: hns3: add new 200G link modes for hisilicon device
  2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
  2024-03-07  1:01 ` [PATCH net 1/8] net: hns3: fix wrong judgment condition issue Jijie Shao
@ 2024-03-07  1:01 ` Jijie Shao
  2024-03-07  1:01 ` [PATCH net 3/8] net: hns3: Disable SerDes serial loopback for HiLink H60 Jijie Shao
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Jijie Shao @ 2024-03-07  1:01 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev, linux-kernel

From: Hao Lan <lanhao@huawei.com>

The hisilicon device now supports a new 200G link interface,
which query from firmware in a new bit. Therefore,
the HCLGE_SUPPORT_200G_R4_BIT capability bit has been added.
The HCLGE_SUPPORT_200G_BIT has been renamed as
HCLGE_SUPPORT_200G_R4_EXT_BIT, and the firmware has
extended support for this mode.

Fixes: ae6f010cb1a7 ("net: hns3: add support for 200G device")
Signed-off-by: Hao Lan <lanhao@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 .../hisilicon/hns3/hns3pf/hclge_main.c        | 28 ++++++++++++-------
 .../hisilicon/hns3/hns3pf/hclge_main.h        |  5 +++-
 2 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 5ea9e59569ef..21f3e2bf5ef8 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -884,7 +884,7 @@ static const struct hclge_speed_bit_map speed_bit_map[] = {
 	{HCLGE_MAC_SPEED_40G, HCLGE_SUPPORT_40G_BIT},
 	{HCLGE_MAC_SPEED_50G, HCLGE_SUPPORT_50G_BITS},
 	{HCLGE_MAC_SPEED_100G, HCLGE_SUPPORT_100G_BITS},
-	{HCLGE_MAC_SPEED_200G, HCLGE_SUPPORT_200G_BIT},
+	{HCLGE_MAC_SPEED_200G, HCLGE_SUPPORT_200G_BITS},
 };
 
 static int hclge_get_speed_bit(u32 speed, u32 *speed_bit)
@@ -940,7 +940,7 @@ static void hclge_update_fec_support(struct hclge_mac *mac)
 				 mac->supported);
 }
 
-static const struct hclge_link_mode_bmap hclge_sr_link_mode_bmap[8] = {
+static const struct hclge_link_mode_bmap hclge_sr_link_mode_bmap[] = {
 	{HCLGE_SUPPORT_10G_BIT, ETHTOOL_LINK_MODE_10000baseSR_Full_BIT},
 	{HCLGE_SUPPORT_25G_BIT, ETHTOOL_LINK_MODE_25000baseSR_Full_BIT},
 	{HCLGE_SUPPORT_40G_BIT, ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT},
@@ -948,10 +948,12 @@ static const struct hclge_link_mode_bmap hclge_sr_link_mode_bmap[8] = {
 	{HCLGE_SUPPORT_50G_R1_BIT, ETHTOOL_LINK_MODE_50000baseSR_Full_BIT},
 	{HCLGE_SUPPORT_100G_R4_BIT, ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT},
 	{HCLGE_SUPPORT_100G_R2_BIT, ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT},
-	{HCLGE_SUPPORT_200G_BIT, ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT},
+	{HCLGE_SUPPORT_200G_R4_EXT_BIT,
+	 ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT},
+	{HCLGE_SUPPORT_200G_R4_BIT, ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT},
 };
 
-static const struct hclge_link_mode_bmap hclge_lr_link_mode_bmap[6] = {
+static const struct hclge_link_mode_bmap hclge_lr_link_mode_bmap[] = {
 	{HCLGE_SUPPORT_10G_BIT, ETHTOOL_LINK_MODE_10000baseLR_Full_BIT},
 	{HCLGE_SUPPORT_40G_BIT, ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT},
 	{HCLGE_SUPPORT_50G_R1_BIT, ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT},
@@ -959,11 +961,13 @@ static const struct hclge_link_mode_bmap hclge_lr_link_mode_bmap[6] = {
 	 ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT},
 	{HCLGE_SUPPORT_100G_R2_BIT,
 	 ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT},
-	{HCLGE_SUPPORT_200G_BIT,
+	{HCLGE_SUPPORT_200G_R4_EXT_BIT,
+	 ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT},
+	{HCLGE_SUPPORT_200G_R4_BIT,
 	 ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT},
 };
 
-static const struct hclge_link_mode_bmap hclge_cr_link_mode_bmap[8] = {
+static const struct hclge_link_mode_bmap hclge_cr_link_mode_bmap[] = {
 	{HCLGE_SUPPORT_10G_BIT, ETHTOOL_LINK_MODE_10000baseCR_Full_BIT},
 	{HCLGE_SUPPORT_25G_BIT, ETHTOOL_LINK_MODE_25000baseCR_Full_BIT},
 	{HCLGE_SUPPORT_40G_BIT, ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT},
@@ -971,10 +975,12 @@ static const struct hclge_link_mode_bmap hclge_cr_link_mode_bmap[8] = {
 	{HCLGE_SUPPORT_50G_R1_BIT, ETHTOOL_LINK_MODE_50000baseCR_Full_BIT},
 	{HCLGE_SUPPORT_100G_R4_BIT, ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT},
 	{HCLGE_SUPPORT_100G_R2_BIT, ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT},
-	{HCLGE_SUPPORT_200G_BIT, ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT},
+	{HCLGE_SUPPORT_200G_R4_EXT_BIT,
+	 ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT},
+	{HCLGE_SUPPORT_200G_R4_BIT, ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT},
 };
 
-static const struct hclge_link_mode_bmap hclge_kr_link_mode_bmap[9] = {
+static const struct hclge_link_mode_bmap hclge_kr_link_mode_bmap[] = {
 	{HCLGE_SUPPORT_1G_BIT, ETHTOOL_LINK_MODE_1000baseKX_Full_BIT},
 	{HCLGE_SUPPORT_10G_BIT, ETHTOOL_LINK_MODE_10000baseKR_Full_BIT},
 	{HCLGE_SUPPORT_25G_BIT, ETHTOOL_LINK_MODE_25000baseKR_Full_BIT},
@@ -983,7 +989,9 @@ static const struct hclge_link_mode_bmap hclge_kr_link_mode_bmap[9] = {
 	{HCLGE_SUPPORT_50G_R1_BIT, ETHTOOL_LINK_MODE_50000baseKR_Full_BIT},
 	{HCLGE_SUPPORT_100G_R4_BIT, ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT},
 	{HCLGE_SUPPORT_100G_R2_BIT, ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT},
-	{HCLGE_SUPPORT_200G_BIT, ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT},
+	{HCLGE_SUPPORT_200G_R4_EXT_BIT,
+	 ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT},
+	{HCLGE_SUPPORT_200G_R4_BIT, ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT},
 };
 
 static void hclge_convert_setting_sr(u16 speed_ability,
@@ -1154,7 +1162,7 @@ static void hclge_parse_link_mode(struct hclge_dev *hdev, u16 speed_ability)
 
 static u32 hclge_get_max_speed(u16 speed_ability)
 {
-	if (speed_ability & HCLGE_SUPPORT_200G_BIT)
+	if (speed_ability & HCLGE_SUPPORT_200G_BITS)
 		return HCLGE_MAC_SPEED_200G;
 
 	if (speed_ability & HCLGE_SUPPORT_100G_BITS)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
index 51979cf71262..a2877b64e085 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
@@ -191,9 +191,10 @@ enum HLCGE_PORT_TYPE {
 #define HCLGE_SUPPORT_40G_BIT		BIT(5)
 #define HCLGE_SUPPORT_100M_BIT		BIT(6)
 #define HCLGE_SUPPORT_10M_BIT		BIT(7)
-#define HCLGE_SUPPORT_200G_BIT		BIT(8)
+#define HCLGE_SUPPORT_200G_R4_EXT_BIT	BIT(8)
 #define HCLGE_SUPPORT_50G_R1_BIT	BIT(9)
 #define HCLGE_SUPPORT_100G_R2_BIT	BIT(10)
+#define HCLGE_SUPPORT_200G_R4_BIT	BIT(11)
 
 #define HCLGE_SUPPORT_GE \
 	(HCLGE_SUPPORT_1G_BIT | HCLGE_SUPPORT_100M_BIT | HCLGE_SUPPORT_10M_BIT)
@@ -201,6 +202,8 @@ enum HLCGE_PORT_TYPE {
 	(HCLGE_SUPPORT_50G_R2_BIT | HCLGE_SUPPORT_50G_R1_BIT)
 #define HCLGE_SUPPORT_100G_BITS \
 	(HCLGE_SUPPORT_100G_R4_BIT | HCLGE_SUPPORT_100G_R2_BIT)
+#define HCLGE_SUPPORT_200G_BITS \
+	(HCLGE_SUPPORT_200G_R4_EXT_BIT | HCLGE_SUPPORT_200G_R4_BIT)
 
 enum HCLGE_DEV_STATE {
 	HCLGE_STATE_REINITING,
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH net 3/8] net: hns3: Disable SerDes serial loopback for HiLink H60
  2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
  2024-03-07  1:01 ` [PATCH net 1/8] net: hns3: fix wrong judgment condition issue Jijie Shao
  2024-03-07  1:01 ` [PATCH net 2/8] net: hns3: add new 200G link modes for hisilicon device Jijie Shao
@ 2024-03-07  1:01 ` Jijie Shao
  2024-03-07  1:01 ` [PATCH net 4/8] net: hns3: fix kernel crash when 1588 is received on HIP08 devices Jijie Shao
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Jijie Shao @ 2024-03-07  1:01 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev, linux-kernel

From: Hao Lan <lanhao@huawei.com>

When the hilink version is H60, the serdes serial loopback test is not
supported. This patch add hilink version detection. When the version
is H60, the serdes serial loopback test will be disable.

Signed-off-by: Hao Lan <lanhao@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hnae3.h             | 1 +
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c      | 2 ++
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h  | 3 ++-
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 9 +++++++--
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 6 ++++++
 5 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index d7e175a9cb49..a72caaf05475 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -388,6 +388,7 @@ struct hnae3_dev_specs {
 	u16 mc_mac_size;
 	u32 mac_stats_num;
 	u8 tnl_num;
+	u8 hilink_version;
 };
 
 struct hnae3_client_ops {
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index c083d1d10767..807eb3bbb11c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -1097,6 +1097,8 @@ hns3_dbg_dev_specs(struct hnae3_handle *h, char *buf, int len, int *pos)
 	*pos += scnprintf(buf + *pos, len - *pos,
 			  "TX timeout threshold: %d seconds\n",
 			  dev->watchdog_timeo / HZ);
+	*pos += scnprintf(buf + *pos, len - *pos, "Hilink Version: %u\n",
+			  dev_specs->hilink_version);
 }
 
 static int hns3_dbg_dev_info(struct hnae3_handle *h, char *buf, int len)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
index 4d15eb73b972..9bb708fa42f2 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
@@ -828,7 +828,8 @@ struct hclge_dev_specs_1_cmd {
 	__le16 mc_mac_size;
 	u8 rsv1[6];
 	u8 tnl_num;
-	u8 rsv2[5];
+	u8 hilink_version;
+	u8 rsv2[4];
 };
 
 /* mac speed type defined in firmware command */
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 21f3e2bf5ef8..16860eea9800 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -645,8 +645,12 @@ static int hclge_get_sset_count(struct hnae3_handle *handle, int stringset)
 			handle->flags |= HNAE3_SUPPORT_APP_LOOPBACK;
 		}
 
-		count += 1;
-		handle->flags |= HNAE3_SUPPORT_SERDES_SERIAL_LOOPBACK;
+		if (hdev->ae_dev->dev_specs.hilink_version !=
+		    HCLGE_HILINK_H60) {
+			count += 1;
+			handle->flags |= HNAE3_SUPPORT_SERDES_SERIAL_LOOPBACK;
+		}
+
 		count += 1;
 		handle->flags |= HNAE3_SUPPORT_SERDES_PARALLEL_LOOPBACK;
 		count += 1;
@@ -1358,6 +1362,7 @@ static void hclge_parse_dev_specs(struct hclge_dev *hdev,
 	ae_dev->dev_specs.umv_size = le16_to_cpu(req1->umv_size);
 	ae_dev->dev_specs.mc_mac_size = le16_to_cpu(req1->mc_mac_size);
 	ae_dev->dev_specs.tnl_num = req1->tnl_num;
+	ae_dev->dev_specs.hilink_version = req1->hilink_version;
 }
 
 static void hclge_check_dev_specs(struct hclge_dev *hdev)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
index a2877b64e085..e821dd2f1528 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
@@ -256,6 +256,12 @@ enum HCLGE_MAC_DUPLEX {
 	HCLGE_MAC_FULL
 };
 
+/* hilink version */
+enum hclge_hilink_version {
+	HCLGE_HILINK_H32 = 0,
+	HCLGE_HILINK_H60 = 1,
+};
+
 #define QUERY_SFP_SPEED		0
 #define QUERY_ACTIVE_SPEED	1
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH net 4/8] net: hns3: fix kernel crash when 1588 is received on HIP08 devices
  2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (2 preceding siblings ...)
  2024-03-07  1:01 ` [PATCH net 3/8] net: hns3: Disable SerDes serial loopback for HiLink H60 Jijie Shao
@ 2024-03-07  1:01 ` Jijie Shao
  2024-03-07  1:01 ` [PATCH net 5/8] net: hns3: fix delete tc fail issue Jijie Shao
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Jijie Shao @ 2024-03-07  1:01 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev, linux-kernel

From: Yonglong Liu <liuyonglong@huawei.com>

The HIP08 devices does not register the ptp devices, so the
hdev->ptp is NULL, but the hardware can receive 1588 messages,
and set the HNS3_RXD_TS_VLD_B bit, so, if match this case, the
access of hdev->ptp->flags will cause a kernel crash:

[ 5888.946472] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018
[ 5888.946475] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000018
...
[ 5889.266118] pc : hclge_ptp_get_rx_hwts+0x40/0x170 [hclge]
[ 5889.272612] lr : hclge_ptp_get_rx_hwts+0x34/0x170 [hclge]
[ 5889.279101] sp : ffff800012c3bc50
[ 5889.283516] x29: ffff800012c3bc50 x28: ffff2040002be040
[ 5889.289927] x27: ffff800009116484 x26: 0000000080007500
[ 5889.296333] x25: 0000000000000000 x24: ffff204001c6f000
[ 5889.302738] x23: ffff204144f53c00 x22: 0000000000000000
[ 5889.309134] x21: 0000000000000000 x20: ffff204004220080
[ 5889.315520] x19: ffff204144f53c00 x18: 0000000000000000
[ 5889.321897] x17: 0000000000000000 x16: 0000000000000000
[ 5889.328263] x15: 0000004000140ec8 x14: 0000000000000000
[ 5889.334617] x13: 0000000000000000 x12: 00000000010011df
[ 5889.340965] x11: bbfeff4d22000000 x10: 0000000000000000
[ 5889.347303] x9 : ffff800009402124 x8 : 0200f78811dfbb4d
[ 5889.353637] x7 : 2200000000191b01 x6 : ffff208002a7d480
[ 5889.359959] x5 : 0000000000000000 x4 : 0000000000000000
[ 5889.366271] x3 : 0000000000000000 x2 : 0000000000000000
[ 5889.372567] x1 : 0000000000000000 x0 : ffff20400095c080
[ 5889.378857] Call trace:
[ 5889.382285] hclge_ptp_get_rx_hwts+0x40/0x170 [hclge]
[ 5889.388304] hns3_handle_bdinfo+0x324/0x410 [hns3]
[ 5889.394055] hns3_handle_rx_bd+0x60/0x150 [hns3]
[ 5889.399624] hns3_clean_rx_ring+0x84/0x170 [hns3]
[ 5889.405270] hns3_nic_common_poll+0xa8/0x220 [hns3]
[ 5889.411084] napi_poll+0xcc/0x264
[ 5889.415329] net_rx_action+0xd4/0x21c
[ 5889.419911] __do_softirq+0x130/0x358
[ 5889.424484] irq_exit+0x134/0x154
[ 5889.428700] __handle_domain_irq+0x88/0xf0
[ 5889.433684] gic_handle_irq+0x78/0x2c0
[ 5889.438319] el1_irq+0xb8/0x140
[ 5889.442354] arch_cpu_idle+0x18/0x40
[ 5889.446816] default_idle_call+0x5c/0x1c0
[ 5889.451714] cpuidle_idle_call+0x174/0x1b0
[ 5889.456692] do_idle+0xc8/0x160
[ 5889.460717] cpu_startup_entry+0x30/0xfc
[ 5889.465523] secondary_start_kernel+0x158/0x1ec
[ 5889.470936] Code: 97ffab78 f9411c14 91408294 f9457284 (f9400c80)
[ 5889.477950] SMP: stopping secondary CPUs
[ 5890.514626] SMP: failed to stop secondary CPUs 0-69,71-95
[ 5890.522951] Starting crashdump kernel...

Fixes: 0bf5eb788512 ("net: hns3: add support for PTP")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c
index 80a2a0073d97..507d7ce26d83 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c
@@ -108,7 +108,7 @@ void hclge_ptp_get_rx_hwts(struct hnae3_handle *handle, struct sk_buff *skb,
 	u64 ns = nsec;
 	u32 sec_h;
 
-	if (!test_bit(HCLGE_PTP_FLAG_RX_EN, &hdev->ptp->flags))
+	if (!hdev->ptp || !test_bit(HCLGE_PTP_FLAG_RX_EN, &hdev->ptp->flags))
 		return;
 
 	/* Since the BD does not have enough space for the higher 16 bits of
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH net 5/8] net: hns3: fix delete tc fail issue
  2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (3 preceding siblings ...)
  2024-03-07  1:01 ` [PATCH net 4/8] net: hns3: fix kernel crash when 1588 is received on HIP08 devices Jijie Shao
@ 2024-03-07  1:01 ` Jijie Shao
  2024-03-07  1:01 ` [PATCH net 6/8] net: hns3: fix reset timeout under full functions and queues Jijie Shao
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 13+ messages in thread
From: Jijie Shao @ 2024-03-07  1:01 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev, linux-kernel

When the tc is removed during reset, hns3 driver will return a errcode.
But kernel ignores this errcode, As a result,
the driver status is inconsistent with the kernel status.

This patch retains the deletion status when the deletion fails
and continues to delete after the reset to ensure that
the status of the driver is consistent with that of kernel.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hnae3.h      |  1 +
 .../ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c   |  2 ++
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c  |  2 ++
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c    | 16 ++++++++++++++++
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.h    |  1 +
 5 files changed, 22 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index a72caaf05475..f19f1e1d1f9f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -820,6 +820,7 @@ struct hnae3_tc_info {
 	u8 max_tc; /* Total number of TCs */
 	u8 num_tc; /* Total number of enabled TCs */
 	bool mqprio_active;
+	bool mqprio_destroy;
 	bool dcb_ets_active;
 };
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
index b98301e205f7..eabbacb1c714 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
@@ -619,6 +619,8 @@ static int hclge_setup_tc(struct hnae3_handle *h,
 		return ret;
 	}
 
+	kinfo->tc_info.mqprio_destroy = !tc;
+
 	ret = hclge_notify_down_uinit(hdev);
 	if (ret)
 		return ret;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 16860eea9800..349e4a1946ab 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -12105,6 +12105,8 @@ static int hclge_reset_ae_dev(struct hnae3_ae_dev *ae_dev)
 		return ret;
 	}
 
+	hclge_reset_tc_config(hdev);
+
 	ret = hclge_tm_init_hw(hdev, true);
 	if (ret) {
 		dev_err(&pdev->dev, "tm init hw fail, ret =%d\n", ret);
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index c58c31221762..00c3f2548bf6 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -2143,3 +2143,19 @@ int hclge_tm_flush_cfg(struct hclge_dev *hdev, bool enable)
 
 	return ret;
 }
+
+void hclge_reset_tc_config(struct hclge_dev *hdev)
+{
+	struct hclge_vport *vport = &hdev->vport[0];
+	struct hnae3_knic_private_info *kinfo;
+
+	kinfo = &vport->nic.kinfo;
+
+	if (!kinfo->tc_info.mqprio_destroy)
+		return;
+
+	/* clear tc info, including mqprio_destroy and mqprio_active */
+	memset(&kinfo->tc_info, 0, sizeof(kinfo->tc_info));
+	hclge_tm_schd_info_update(hdev, 0);
+	hclge_comm_rss_indir_init_cfg(hdev->ae_dev, &hdev->rss_cfg);
+}
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
index 53eec6df5194..0985916629d3 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
@@ -277,4 +277,5 @@ int hclge_tm_get_port_shaper(struct hclge_dev *hdev,
 int hclge_up_to_tc_map(struct hclge_dev *hdev);
 int hclge_dscp_to_tc_map(struct hclge_dev *hdev);
 int hclge_tm_flush_cfg(struct hclge_dev *hdev, bool enable);
+void hclge_reset_tc_config(struct hclge_dev *hdev);
 #endif
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH net 6/8] net: hns3: fix reset timeout under full functions and queues
  2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (4 preceding siblings ...)
  2024-03-07  1:01 ` [PATCH net 5/8] net: hns3: fix delete tc fail issue Jijie Shao
@ 2024-03-07  1:01 ` Jijie Shao
  2024-03-07 11:24   ` Sunil Kovvuri Goutham
  2024-03-07  1:01 ` [PATCH net 7/8] net: hns3: fix port duplex configure error in IMP reset Jijie Shao
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 13+ messages in thread
From: Jijie Shao @ 2024-03-07  1:01 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev, linux-kernel

From: Peiyang Wang <wangpeiyang1@huawei.com>

The cmdq reset command times out when all VFs are enabled and the queue is
full. The hardware processing time exceeds the timeout set by the driver.
In order to avoid the above extreme situations, the driver extends the
reset timeout to 1 second.

Signed-off-by: Peiyang Wang <wangpeiyang1@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 .../net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c    | 2 +-
 .../net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c
index d92ad6082d8e..652d71326231 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c
@@ -351,7 +351,7 @@ static int hclge_comm_cmd_csq_done(struct hclge_comm_hw *hw)
 static u32 hclge_get_cmdq_tx_timeout(u16 opcode, u32 tx_timeout)
 {
 	static const struct hclge_cmdq_tx_timeout_map cmdq_tx_timeout_map[] = {
-		{HCLGE_OPC_CFG_RST_TRIGGER, HCLGE_COMM_CMDQ_TX_TIMEOUT_500MS},
+		{HCLGE_OPC_CFG_RST_TRIGGER, HCLGE_COMM_CMDQ_CFG_RST_TIMEOUT},
 	};
 	u32 i;
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h
index 533c19d25e4f..552396518e08 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h
@@ -55,7 +55,7 @@
 #define HCLGE_COMM_NIC_CMQ_DESC_NUM_S		3
 #define HCLGE_COMM_NIC_CMQ_DESC_NUM		1024
 #define HCLGE_COMM_CMDQ_TX_TIMEOUT_DEFAULT	30000
-#define HCLGE_COMM_CMDQ_TX_TIMEOUT_500MS	500000
+#define HCLGE_COMM_CMDQ_CFG_RST_TIMEOUT		1000000
 
 enum hclge_opcode_type {
 	/* Generic commands */
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH net 7/8] net: hns3: fix port duplex configure error in IMP reset
  2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (5 preceding siblings ...)
  2024-03-07  1:01 ` [PATCH net 6/8] net: hns3: fix reset timeout under full functions and queues Jijie Shao
@ 2024-03-07  1:01 ` Jijie Shao
  2024-03-07  1:01 ` [PATCH net 8/8] net: hns3: add checking for vf id of mailbox Jijie Shao
  2024-03-08 12:10 ` [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver patchwork-bot+netdevbpf
  8 siblings, 0 replies; 13+ messages in thread
From: Jijie Shao @ 2024-03-07  1:01 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev, linux-kernel

From: Jie Wang <wangjie125@huawei.com>

Currently, the mac port is fixed to configured as full dplex mode in
hclge_mac_init() when driver initialization or reset restore. Users may
change the mode to half duplex with ethtool,  so it may cause the user
configuration dropped after reset.

To fix it, don't change the duplex mode when resetting.

Fixes: 2d03eacc0b7e ("net: hns3: Only update mac configuation when necessary")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 349e4a1946ab..b4afb66efe5c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -2903,7 +2903,10 @@ static int hclge_mac_init(struct hclge_dev *hdev)
 	int ret;
 
 	hdev->support_sfp_query = true;
-	hdev->hw.mac.duplex = HCLGE_MAC_FULL;
+
+	if (!test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
+		hdev->hw.mac.duplex = HCLGE_MAC_FULL;
+
 	ret = hclge_cfg_mac_speed_dup_hw(hdev, hdev->hw.mac.speed,
 					 hdev->hw.mac.duplex, hdev->hw.mac.lane_num);
 	if (ret)
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH net 8/8] net: hns3: add checking for vf id of mailbox
  2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (6 preceding siblings ...)
  2024-03-07  1:01 ` [PATCH net 7/8] net: hns3: fix port duplex configure error in IMP reset Jijie Shao
@ 2024-03-07  1:01 ` Jijie Shao
  2024-03-07 11:09   ` Sunil Kovvuri Goutham
  2024-03-08 12:10 ` [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver patchwork-bot+netdevbpf
  8 siblings, 1 reply; 13+ messages in thread
From: Jijie Shao @ 2024-03-07  1:01 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev, linux-kernel

From: Jian Shen <shenjian15@huawei.com>

Add checking for vf id of mailbox, in order to avoid array
out-of-bounds risk.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
index 4b0d07ca2505..d4a0e0be7a72 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
@@ -1123,10 +1123,11 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
 		req = (struct hclge_mbx_vf_to_pf_cmd *)desc->data;
 
 		flag = le16_to_cpu(crq->desc[crq->next_to_use].flag);
-		if (unlikely(!hnae3_get_bit(flag, HCLGE_CMDQ_RX_OUTVLD_B))) {
+		if (unlikely(!hnae3_get_bit(flag, HCLGE_CMDQ_RX_OUTVLD_B) ||
+			     req->mbx_src_vfid > hdev->num_req_vfs)) {
 			dev_warn(&hdev->pdev->dev,
-				 "dropped invalid mailbox message, code = %u\n",
-				 req->msg.code);
+				 "dropped invalid mailbox message, code = %u, vfid = %u\n",
+				 req->msg.code, req->mbx_src_vfid);
 
 			/* dropping/not processing this invalid message */
 			crq->desc[crq->next_to_use].flag = 0;
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* RE: [PATCH net 8/8] net: hns3: add checking for vf id of mailbox
  2024-03-07  1:01 ` [PATCH net 8/8] net: hns3: add checking for vf id of mailbox Jijie Shao
@ 2024-03-07 11:09   ` Sunil Kovvuri Goutham
  0 siblings, 0 replies; 13+ messages in thread
From: Sunil Kovvuri Goutham @ 2024-03-07 11:09 UTC (permalink / raw)
  To: Jijie Shao, yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, netdev, linux-kernel



> -----Original Message-----
> From: Jijie Shao <shaojijie@huawei.com>
> Sent: Thursday, March 7, 2024 6:31 AM
> To: yisen.zhuang@huawei.com; salil.mehta@huawei.com;
> davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com
> Cc: shenjian15@huawei.com; wangjie125@huawei.com;
> liuyonglong@huawei.com; shaojijie@huawei.com; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [EXTERNAL] [PATCH net 8/8] net: hns3: add checking for vf id of
> mailbox
> 
> From: Jian Shen <shenjian15@huawei.com>
> 
> Add checking for vf id of mailbox, in order to avoid array out-of-bounds risk.
> 
> Signed-off-by: Jian Shen <shenjian15@huawei.com>
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>
> ---
>  drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
> b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
> index 4b0d07ca2505..d4a0e0be7a72 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
> @@ -1123,10 +1123,11 @@ void hclge_mbx_handler(struct hclge_dev
> *hdev)
>  		req = (struct hclge_mbx_vf_to_pf_cmd *)desc->data;
> 
>  		flag = le16_to_cpu(crq->desc[crq->next_to_use].flag);
> -		if (unlikely(!hnae3_get_bit(flag,
> HCLGE_CMDQ_RX_OUTVLD_B))) {
> +		if (unlikely(!hnae3_get_bit(flag,
> HCLGE_CMDQ_RX_OUTVLD_B) ||
> +			     req->mbx_src_vfid > hdev->num_req_vfs)) {
>  			dev_warn(&hdev->pdev->dev,
> -				 "dropped invalid mailbox message, code =
> %u\n",
> -				 req->msg.code);
> +				 "dropped invalid mailbox message, code =
> %u, vfid = %u\n",
> +				 req->msg.code, req->mbx_src_vfid);
> 
>  			/* dropping/not processing this invalid message */
>  			crq->desc[crq->next_to_use].flag = 0;
> --
> 2.30.0
> 

Reviewed-by: Sunil Goutham <sgoutham@marvell.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE:  [PATCH net 6/8] net: hns3: fix reset timeout under full functions and queues
  2024-03-07  1:01 ` [PATCH net 6/8] net: hns3: fix reset timeout under full functions and queues Jijie Shao
@ 2024-03-07 11:24   ` Sunil Kovvuri Goutham
  2024-03-08  9:38     ` Jijie Shao
  0 siblings, 1 reply; 13+ messages in thread
From: Sunil Kovvuri Goutham @ 2024-03-07 11:24 UTC (permalink / raw)
  To: Jijie Shao, yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, netdev, linux-kernel



> -----Original Message-----
> From: Jijie Shao <shaojijie@huawei.com>
> Sent: Thursday, March 7, 2024 6:31 AM
> To: yisen.zhuang@huawei.com; salil.mehta@huawei.com;
> davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com
> Cc: shenjian15@huawei.com; wangjie125@huawei.com;
> liuyonglong@huawei.com; shaojijie@huawei.com; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [EXTERNAL] [PATCH net 6/8] net: hns3: fix reset timeout under full
> functions and queues
> 
> From: Peiyang Wang <wangpeiyang1@huawei.com>
> 
> The cmdq reset command times out when all VFs are enabled and the
> queue is full. The hardware processing time exceeds the timeout set by the
> driver.
> In order to avoid the above extreme situations, the driver extends the reset
> timeout to 1 second.
> 

Reviewed-by: Sunil Goutham <sgoutham@marvell.com>

But one observation, loop of udelay(1) for 1sec seems a lot, probably better to use usleep_range().


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH net 6/8] net: hns3: fix reset timeout under full functions and queues
  2024-03-07 11:24   ` Sunil Kovvuri Goutham
@ 2024-03-08  9:38     ` Jijie Shao
  0 siblings, 0 replies; 13+ messages in thread
From: Jijie Shao @ 2024-03-08  9:38 UTC (permalink / raw)
  To: Sunil Kovvuri Goutham, yisen.zhuang, salil.mehta, davem,
	edumazet, kuba, pabeni
  Cc: shaojijie, shenjian15, wangjie125, liuyonglong, netdev, linux-kernel


on 2024/3/7 19:24, Sunil Kovvuri Goutham wrote:
>> In order to avoid the above extreme situations, the driver extends the reset
>> timeout to 1 second.
>>
> Reviewed-by: Sunil Goutham <sgoutham@marvell.com>
>
> But one observation, loop of udelay(1) for 1sec seems a lot, probably better to use usleep_range().

but this is protected by splock, so cannot use usleep_range().


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver
  2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (7 preceding siblings ...)
  2024-03-07  1:01 ` [PATCH net 8/8] net: hns3: add checking for vf id of mailbox Jijie Shao
@ 2024-03-08 12:10 ` patchwork-bot+netdevbpf
  8 siblings, 0 replies; 13+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-08 12:10 UTC (permalink / raw)
  To: Jijie Shao
  Cc: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni,
	shenjian15, wangjie125, liuyonglong, netdev, linux-kernel

Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 7 Mar 2024 09:01:07 +0800 you wrote:
> There are some bugfix for the HNS3 ethernet driver
> 
> Hao Lan (2):
>   net: hns3: add new 200G link modes for hisilicon device
>   net: hns3: Disable SerDes serial loopback for HiLink H60
> 
> Jian Shen (1):
>   net: hns3: add checking for vf id of mailbox
> 
> [...]

Here is the summary with links:
  - [net,1/8] net: hns3: fix wrong judgment condition issue
    https://git.kernel.org/netdev/net-next/c/07a1d6dc90ba
  - [net,2/8] net: hns3: add new 200G link modes for hisilicon device
    https://git.kernel.org/netdev/net-next/c/dd1f65f0db27
  - [net,3/8] net: hns3: Disable SerDes serial loopback for HiLink H60
    https://git.kernel.org/netdev/net-next/c/0448825b8992
  - [net,4/8] net: hns3: fix kernel crash when 1588 is received on HIP08 devices
    https://git.kernel.org/netdev/net-next/c/0fbcf2366ba9
  - [net,5/8] net: hns3: fix delete tc fail issue
    https://git.kernel.org/netdev/net-next/c/03f92287b251
  - [net,6/8] net: hns3: fix reset timeout under full functions and queues
    https://git.kernel.org/netdev/net-next/c/216bc415d663
  - [net,7/8] net: hns3: fix port duplex configure error in IMP reset
    https://git.kernel.org/netdev/net-next/c/11d80f79dd9f
  - [net,8/8] net: hns3: add checking for vf id of mailbox
    https://git.kernel.org/netdev/net-next/c/4e2969a0d6a7

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-03-08 12:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-07  1:01 [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver Jijie Shao
2024-03-07  1:01 ` [PATCH net 1/8] net: hns3: fix wrong judgment condition issue Jijie Shao
2024-03-07  1:01 ` [PATCH net 2/8] net: hns3: add new 200G link modes for hisilicon device Jijie Shao
2024-03-07  1:01 ` [PATCH net 3/8] net: hns3: Disable SerDes serial loopback for HiLink H60 Jijie Shao
2024-03-07  1:01 ` [PATCH net 4/8] net: hns3: fix kernel crash when 1588 is received on HIP08 devices Jijie Shao
2024-03-07  1:01 ` [PATCH net 5/8] net: hns3: fix delete tc fail issue Jijie Shao
2024-03-07  1:01 ` [PATCH net 6/8] net: hns3: fix reset timeout under full functions and queues Jijie Shao
2024-03-07 11:24   ` Sunil Kovvuri Goutham
2024-03-08  9:38     ` Jijie Shao
2024-03-07  1:01 ` [PATCH net 7/8] net: hns3: fix port duplex configure error in IMP reset Jijie Shao
2024-03-07  1:01 ` [PATCH net 8/8] net: hns3: add checking for vf id of mailbox Jijie Shao
2024-03-07 11:09   ` Sunil Kovvuri Goutham
2024-03-08 12:10 ` [PATCH net 0/8] There are some bugfix for the HNS3 ethernet driver patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).