All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver
@ 2023-09-06  7:20 Jijie Shao
  2023-09-06  7:20 ` [PATCH net 1/7] net: hns3: fix tx timeout issue Jijie Shao
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Jijie Shao @ 2023-09-06  7:20 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, chenhao418,
	netdev, linux-kernel

There are some bugfix for the HNS3 ethernet driver

Hao Chen (2):
  net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read()
  net: hns3: fix debugfs concurrency issue between kfree buffer and read

Jian Shen (1):
  net: hns3: fix tx timeout issue

Jie Wang (1):
  net: hns3: remove GSO partial feature bit

Jijie Shao (2):
  net: hns3: Support query tx timeout threshold by debugfs
  net: hns3: fix invalid mutex between tc qdisc and dcb ets command
    issue

Yisen Zhuang (1):
  net: hns3: fix the port information display when sfp is absent

 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |  1 +
 .../ethernet/hisilicon/hns3/hns3_debugfs.c    | 11 +++++++---
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   | 19 +++++++++++-------
 .../ethernet/hisilicon/hns3/hns3_ethtool.c    |  4 +++-
 .../hisilicon/hns3/hns3pf/hclge_dcb.c         | 20 +++++--------------
 .../hisilicon/hns3/hns3pf/hclge_debugfs.c     | 14 ++++++-------
 .../hisilicon/hns3/hns3pf/hclge_main.c        |  5 +++--
 .../hisilicon/hns3/hns3pf/hclge_main.h        |  2 --
 8 files changed, 39 insertions(+), 37 deletions(-)

-- 
2.30.0


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

* [PATCH net 1/7] net: hns3: fix tx timeout issue
  2023-09-06  7:20 [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver Jijie Shao
@ 2023-09-06  7:20 ` Jijie Shao
  2023-09-06  7:20 ` [PATCH net 2/7] net: hns3: Support query tx timeout threshold by debugfs Jijie Shao
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Jijie Shao @ 2023-09-06  7:20 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, chenhao418,
	netdev, linux-kernel

From: Jian Shen <shenjian15@huawei.com>

Currently, the driver knocks the ring doorbell before updating
the ring->last_to_use in tx flow. if the hardware transmiting
packet and napi poll scheduling are fast enough, it may get
the old ring->last_to_use in drivers' napi poll.
In this case, the driver will think the tx is not completed, and
return directly without clear the flag __QUEUE_STATE_STACK_XOFF,
which may cause tx timeout.

Fixes: 20d06ca2679c ("net: hns3: optimize the tx clean process")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index eac2d0573241..81947c4e5100 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -2103,8 +2103,12 @@ static void hns3_tx_doorbell(struct hns3_enet_ring *ring, int num,
 	 */
 	if (test_bit(HNS3_NIC_STATE_TX_PUSH_ENABLE, &priv->state) && num &&
 	    !ring->pending_buf && num <= HNS3_MAX_PUSH_BD_NUM && doorbell) {
+		/* This smp_store_release() pairs with smp_load_aquire() in
+		 * hns3_nic_reclaim_desc(). Ensure that the BD valid bit
+		 * is updated.
+		 */
+		smp_store_release(&ring->last_to_use, ring->next_to_use);
 		hns3_tx_push_bd(ring, num);
-		WRITE_ONCE(ring->last_to_use, ring->next_to_use);
 		return;
 	}
 
@@ -2115,6 +2119,11 @@ static void hns3_tx_doorbell(struct hns3_enet_ring *ring, int num,
 		return;
 	}
 
+	/* This smp_store_release() pairs with smp_load_aquire() in
+	 * hns3_nic_reclaim_desc(). Ensure that the BD valid bit is updated.
+	 */
+	smp_store_release(&ring->last_to_use, ring->next_to_use);
+
 	if (ring->tqp->mem_base)
 		hns3_tx_mem_doorbell(ring);
 	else
@@ -2122,7 +2131,6 @@ static void hns3_tx_doorbell(struct hns3_enet_ring *ring, int num,
 		       ring->tqp->io_base + HNS3_RING_TX_RING_TAIL_REG);
 
 	ring->pending_buf = 0;
-	WRITE_ONCE(ring->last_to_use, ring->next_to_use);
 }
 
 static void hns3_tsyn(struct net_device *netdev, struct sk_buff *skb,
@@ -3563,9 +3571,8 @@ static void hns3_reuse_buffer(struct hns3_enet_ring *ring, int i)
 static bool hns3_nic_reclaim_desc(struct hns3_enet_ring *ring,
 				  int *bytes, int *pkts, int budget)
 {
-	/* pair with ring->last_to_use update in hns3_tx_doorbell(),
-	 * smp_store_release() is not used in hns3_tx_doorbell() because
-	 * the doorbell operation already have the needed barrier operation.
+	/* This smp_load_acquire() pairs with smp_store_release() in
+	 * hns3_tx_doorbell().
 	 */
 	int ltu = smp_load_acquire(&ring->last_to_use);
 	int ntc = ring->next_to_clean;
-- 
2.30.0


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

* [PATCH net 2/7] net: hns3: Support query tx timeout threshold by debugfs
  2023-09-06  7:20 [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver Jijie Shao
  2023-09-06  7:20 ` [PATCH net 1/7] net: hns3: fix tx timeout issue Jijie Shao
@ 2023-09-06  7:20 ` Jijie Shao
  2023-09-06  7:20 ` [PATCH net 3/7] net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read() Jijie Shao
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Jijie Shao @ 2023-09-06  7:20 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, chenhao418,
	netdev, linux-kernel

support query tx timeout threshold by debugfs

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index f276b5ecb431..8086722a56c0 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -1045,6 +1045,7 @@ hns3_dbg_dev_specs(struct hnae3_handle *h, char *buf, int len, int *pos)
 	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev);
 	struct hnae3_dev_specs *dev_specs = &ae_dev->dev_specs;
 	struct hnae3_knic_private_info *kinfo = &h->kinfo;
+	struct net_device *dev = kinfo->netdev;
 
 	*pos += scnprintf(buf + *pos, len - *pos, "dev_spec:\n");
 	*pos += scnprintf(buf + *pos, len - *pos, "MAC entry num: %u\n",
@@ -1087,6 +1088,9 @@ hns3_dbg_dev_specs(struct hnae3_handle *h, char *buf, int len, int *pos)
 			  dev_specs->mc_mac_size);
 	*pos += scnprintf(buf + *pos, len - *pos, "MAC statistics number: %u\n",
 			  dev_specs->mac_stats_num);
+	*pos += scnprintf(buf + *pos, len - *pos,
+			  "TX timeout threshold: %d seconds\n",
+			  dev->watchdog_timeo / HZ);
 }
 
 static int hns3_dbg_dev_info(struct hnae3_handle *h, char *buf, int len)
-- 
2.30.0


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

* [PATCH net 3/7] net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read()
  2023-09-06  7:20 [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver Jijie Shao
  2023-09-06  7:20 ` [PATCH net 1/7] net: hns3: fix tx timeout issue Jijie Shao
  2023-09-06  7:20 ` [PATCH net 2/7] net: hns3: Support query tx timeout threshold by debugfs Jijie Shao
@ 2023-09-06  7:20 ` Jijie Shao
  2023-09-06  7:20 ` [PATCH net 4/7] net: hns3: fix debugfs concurrency issue between kfree buffer and read Jijie Shao
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Jijie Shao @ 2023-09-06  7:20 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, chenhao418,
	netdev, linux-kernel

From: Hao Chen <chenhao418@huawei.com>

req1->tcam_data is defined as "u8 tcam_data[8]", and we convert it as
(u32 *) without considerring byte order conversion,
it may result in printing wrong data for tcam_data.

Convert tcam_data to (__le32 *) first to fix it.

Fixes: b5a0b70d77b9 ("net: hns3: refactor dump fd tcam of debugfs")
Signed-off-by: Hao Chen <chenhao418@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
index f01a7a9ee02c..ff3f8f424ad9 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
@@ -1519,7 +1519,7 @@ static int hclge_dbg_fd_tcam_read(struct hclge_dev *hdev, bool sel_x,
 	struct hclge_desc desc[3];
 	int pos = 0;
 	int ret, i;
-	u32 *req;
+	__le32 *req;
 
 	hclge_cmd_setup_basic_desc(&desc[0], HCLGE_OPC_FD_TCAM_OP, true);
 	desc[0].flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_NEXT);
@@ -1544,22 +1544,22 @@ static int hclge_dbg_fd_tcam_read(struct hclge_dev *hdev, bool sel_x,
 			 tcam_msg.loc);
 
 	/* tcam_data0 ~ tcam_data1 */
-	req = (u32 *)req1->tcam_data;
+	req = (__le32 *)req1->tcam_data;
 	for (i = 0; i < 2; i++)
 		pos += scnprintf(tcam_buf + pos, HCLGE_DBG_TCAM_BUF_SIZE - pos,
-				 "%08x\n", *req++);
+				 "%08x\n", le32_to_cpu(*req++));
 
 	/* tcam_data2 ~ tcam_data7 */
-	req = (u32 *)req2->tcam_data;
+	req = (__le32 *)req2->tcam_data;
 	for (i = 0; i < 6; i++)
 		pos += scnprintf(tcam_buf + pos, HCLGE_DBG_TCAM_BUF_SIZE - pos,
-				 "%08x\n", *req++);
+				 "%08x\n", le32_to_cpu(*req++));
 
 	/* tcam_data8 ~ tcam_data12 */
-	req = (u32 *)req3->tcam_data;
+	req = (__le32 *)req3->tcam_data;
 	for (i = 0; i < 5; i++)
 		pos += scnprintf(tcam_buf + pos, HCLGE_DBG_TCAM_BUF_SIZE - pos,
-				 "%08x\n", *req++);
+				 "%08x\n", le32_to_cpu(*req++));
 
 	return ret;
 }
-- 
2.30.0


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

* [PATCH net 4/7] net: hns3: fix debugfs concurrency issue between kfree buffer and read
  2023-09-06  7:20 [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (2 preceding siblings ...)
  2023-09-06  7:20 ` [PATCH net 3/7] net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read() Jijie Shao
@ 2023-09-06  7:20 ` Jijie Shao
  2023-09-06  7:20 ` [PATCH net 5/7] net: hns3: fix invalid mutex between tc qdisc and dcb ets command issue Jijie Shao
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Jijie Shao @ 2023-09-06  7:20 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, chenhao418,
	netdev, linux-kernel

From: Hao Chen <chenhao418@huawei.com>

Now in hns3_dbg_uninit(), there may be concurrency between
kfree buffer and read, it may result in memory error.

Moving debugfs_remove_recursive() in front of kfree buffer to ensure
they don't happen at the same time.

Fixes: 5e69ea7ee2a6 ("net: hns3: refactor the debugfs process")
Signed-off-by: Hao Chen <chenhao418@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 8086722a56c0..b8508533878b 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -1415,9 +1415,9 @@ int hns3_dbg_init(struct hnae3_handle *handle)
 	return 0;
 
 out:
-	mutex_destroy(&handle->dbgfs_lock);
 	debugfs_remove_recursive(handle->hnae3_dbgfs);
 	handle->hnae3_dbgfs = NULL;
+	mutex_destroy(&handle->dbgfs_lock);
 	return ret;
 }
 
@@ -1425,6 +1425,9 @@ void hns3_dbg_uninit(struct hnae3_handle *handle)
 {
 	u32 i;
 
+	debugfs_remove_recursive(handle->hnae3_dbgfs);
+	handle->hnae3_dbgfs = NULL;
+
 	for (i = 0; i < ARRAY_SIZE(hns3_dbg_cmd); i++)
 		if (handle->dbgfs_buf[i]) {
 			kvfree(handle->dbgfs_buf[i]);
@@ -1432,8 +1435,6 @@ void hns3_dbg_uninit(struct hnae3_handle *handle)
 		}
 
 	mutex_destroy(&handle->dbgfs_lock);
-	debugfs_remove_recursive(handle->hnae3_dbgfs);
-	handle->hnae3_dbgfs = NULL;
 }
 
 void hns3_dbg_register_debugfs(const char *debugfs_dir_name)
-- 
2.30.0


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

* [PATCH net 5/7] net: hns3: fix invalid mutex between tc qdisc and dcb ets command issue
  2023-09-06  7:20 [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (3 preceding siblings ...)
  2023-09-06  7:20 ` [PATCH net 4/7] net: hns3: fix debugfs concurrency issue between kfree buffer and read Jijie Shao
@ 2023-09-06  7:20 ` Jijie Shao
  2023-09-06  7:20 ` [PATCH net 6/7] net: hns3: fix the port information display when sfp is absent Jijie Shao
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Jijie Shao @ 2023-09-06  7:20 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, chenhao418,
	netdev, linux-kernel

We hope that tc qdisc and dcb ets commands can not be used crosswise.
If we want to use any of the commands to configure tc,
We must use the other command to clear the existing configuration.

However, when we configure a single tc with tc qdisc,
we can still configure it with dcb ets.
Because we use mqprio_active as the tag of tc qdisc configuration,
but with dcb ets, we do not check mqprio_active.

This patch fix this issue by check mqprio_active before
executing the dcb ets command. and add dcb_ets_active to
replace HCLGE_FLAG_DCB_ENABLE and HCLGE_FLAG_MQPRIO_ENABLE
at the hclge layer,

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |  1 +
 .../hisilicon/hns3/hns3pf/hclge_dcb.c         | 20 +++++--------------
 .../hisilicon/hns3/hns3pf/hclge_main.c        |  5 +++--
 .../hisilicon/hns3/hns3pf/hclge_main.h        |  2 --
 4 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index a4b43bcd2f0c..aaf1f42624a7 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -814,6 +814,7 @@ struct hnae3_tc_info {
 	u8 max_tc; /* Total number of TCs */
 	u8 num_tc; /* Total number of enabled TCs */
 	bool mqprio_active;
+	bool dcb_ets_active;
 };
 
 #define HNAE3_MAX_DSCP			64
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
index fad5a5ff3cda..b98301e205f7 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
@@ -259,7 +259,7 @@ static int hclge_ieee_setets(struct hnae3_handle *h, struct ieee_ets *ets)
 	int ret;
 
 	if (!(hdev->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) ||
-	    hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE)
+	    h->kinfo.tc_info.mqprio_active)
 		return -EINVAL;
 
 	ret = hclge_ets_validate(hdev, ets, &num_tc, &map_changed);
@@ -275,10 +275,7 @@ static int hclge_ieee_setets(struct hnae3_handle *h, struct ieee_ets *ets)
 	}
 
 	hclge_tm_schd_info_update(hdev, num_tc);
-	if (num_tc > 1)
-		hdev->flag |= HCLGE_FLAG_DCB_ENABLE;
-	else
-		hdev->flag &= ~HCLGE_FLAG_DCB_ENABLE;
+	h->kinfo.tc_info.dcb_ets_active = num_tc > 1;
 
 	ret = hclge_ieee_ets_to_tm_info(hdev, ets);
 	if (ret)
@@ -487,7 +484,7 @@ static u8 hclge_getdcbx(struct hnae3_handle *h)
 	struct hclge_vport *vport = hclge_get_vport(h);
 	struct hclge_dev *hdev = vport->back;
 
-	if (hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE)
+	if (h->kinfo.tc_info.mqprio_active)
 		return 0;
 
 	return hdev->dcbx_cap;
@@ -611,7 +608,8 @@ static int hclge_setup_tc(struct hnae3_handle *h,
 	if (!test_bit(HCLGE_STATE_NIC_REGISTERED, &hdev->state))
 		return -EBUSY;
 
-	if (hdev->flag & HCLGE_FLAG_DCB_ENABLE)
+	kinfo = &vport->nic.kinfo;
+	if (kinfo->tc_info.dcb_ets_active)
 		return -EINVAL;
 
 	ret = hclge_mqprio_qopt_check(hdev, mqprio_qopt);
@@ -625,7 +623,6 @@ static int hclge_setup_tc(struct hnae3_handle *h,
 	if (ret)
 		return ret;
 
-	kinfo = &vport->nic.kinfo;
 	memcpy(&old_tc_info, &kinfo->tc_info, sizeof(old_tc_info));
 	hclge_sync_mqprio_qopt(&kinfo->tc_info, mqprio_qopt);
 	kinfo->tc_info.mqprio_active = tc > 0;
@@ -634,13 +631,6 @@ static int hclge_setup_tc(struct hnae3_handle *h,
 	if (ret)
 		goto err_out;
 
-	hdev->flag &= ~HCLGE_FLAG_DCB_ENABLE;
-
-	if (tc > 1)
-		hdev->flag |= HCLGE_FLAG_MQPRIO_ENABLE;
-	else
-		hdev->flag &= ~HCLGE_FLAG_MQPRIO_ENABLE;
-
 	return hclge_notify_init_up(hdev);
 
 err_out:
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 0f50dba6cc47..8ca368424436 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -11026,6 +11026,7 @@ static void hclge_get_mdix_mode(struct hnae3_handle *handle,
 
 static void hclge_info_show(struct hclge_dev *hdev)
 {
+	struct hnae3_handle *handle = &hdev->vport->nic;
 	struct device *dev = &hdev->pdev->dev;
 
 	dev_info(dev, "PF info begin:\n");
@@ -11042,9 +11043,9 @@ static void hclge_info_show(struct hclge_dev *hdev)
 	dev_info(dev, "This is %s PF\n",
 		 hdev->flag & HCLGE_FLAG_MAIN ? "main" : "not main");
 	dev_info(dev, "DCB %s\n",
-		 hdev->flag & HCLGE_FLAG_DCB_ENABLE ? "enable" : "disable");
+		 handle->kinfo.tc_info.dcb_ets_active ? "enable" : "disable");
 	dev_info(dev, "MQPRIO %s\n",
-		 hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE ? "enable" : "disable");
+		 handle->kinfo.tc_info.mqprio_active ? "enable" : "disable");
 	dev_info(dev, "Default tx spare buffer size: %u\n",
 		 hdev->tx_spare_buf_size);
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
index ec233ec57222..7bc2049b723d 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h
@@ -919,8 +919,6 @@ struct hclge_dev {
 
 #define HCLGE_FLAG_MAIN			BIT(0)
 #define HCLGE_FLAG_DCB_CAPABLE		BIT(1)
-#define HCLGE_FLAG_DCB_ENABLE		BIT(2)
-#define HCLGE_FLAG_MQPRIO_ENABLE	BIT(3)
 	u32 flag;
 
 	u32 pkt_buf_size; /* Total pf buf size for tx/rx */
-- 
2.30.0


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

* [PATCH net 6/7] net: hns3: fix the port information display when sfp is absent
  2023-09-06  7:20 [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (4 preceding siblings ...)
  2023-09-06  7:20 ` [PATCH net 5/7] net: hns3: fix invalid mutex between tc qdisc and dcb ets command issue Jijie Shao
@ 2023-09-06  7:20 ` Jijie Shao
  2023-09-06  7:20 ` [PATCH net 7/7] net: hns3: remove GSO partial feature bit Jijie Shao
  2023-09-07  9:20 ` [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver patchwork-bot+netdevbpf
  7 siblings, 0 replies; 9+ messages in thread
From: Jijie Shao @ 2023-09-06  7:20 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, chenhao418,
	netdev, linux-kernel

From: Yisen Zhuang <yisen.zhuang@huawei.com>

When sfp is absent or unidentified, the port type should be
displayed as PORT_OTHERS, rather than PORT_FIBRE.

Fixes: 88d10bd6f730 ("net: hns3: add support for multiple media type")
Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index 36858a72d771..682239f33082 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -773,7 +773,9 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
 		hns3_get_ksettings(h, cmd);
 		break;
 	case HNAE3_MEDIA_TYPE_FIBER:
-		if (module_type == HNAE3_MODULE_TYPE_CR)
+		if (module_type == HNAE3_MODULE_TYPE_UNKNOWN)
+			cmd->base.port = PORT_OTHER;
+		else if (module_type == HNAE3_MODULE_TYPE_CR)
 			cmd->base.port = PORT_DA;
 		else
 			cmd->base.port = PORT_FIBRE;
-- 
2.30.0


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

* [PATCH net 7/7] net: hns3: remove GSO partial feature bit
  2023-09-06  7:20 [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (5 preceding siblings ...)
  2023-09-06  7:20 ` [PATCH net 6/7] net: hns3: fix the port information display when sfp is absent Jijie Shao
@ 2023-09-06  7:20 ` Jijie Shao
  2023-09-07  9:20 ` [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver patchwork-bot+netdevbpf
  7 siblings, 0 replies; 9+ messages in thread
From: Jijie Shao @ 2023-09-06  7:20 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, chenhao418,
	netdev, linux-kernel

From: Jie Wang <wangjie125@huawei.com>

HNS3 NIC does not support GSO partial packets segmentation. Actually tunnel
packets for example NvGRE packets segment offload and checksum offload is
already supported. There is no need to keep gso partial feature bit. So
this patch removes it.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 81947c4e5100..b4895c7b3efd 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3316,8 +3316,6 @@ static void hns3_set_default_feature(struct net_device *netdev)
 
 	netdev->priv_flags |= IFF_UNICAST_FLT;
 
-	netdev->gso_partial_features |= NETIF_F_GSO_GRE_CSUM;
-
 	netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER |
 		NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
 		NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_GSO |
-- 
2.30.0


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

* Re: [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver
  2023-09-06  7:20 [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (6 preceding siblings ...)
  2023-09-06  7:20 ` [PATCH net 7/7] net: hns3: remove GSO partial feature bit Jijie Shao
@ 2023-09-07  9:20 ` patchwork-bot+netdevbpf
  7 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-09-07  9:20 UTC (permalink / raw)
  To: Jijie Shao
  Cc: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni,
	shenjian15, wangjie125, liuyonglong, chenhao418, netdev,
	linux-kernel

Hello:

This series was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 6 Sep 2023 15:20:11 +0800 you wrote:
> There are some bugfix for the HNS3 ethernet driver
> 
> Hao Chen (2):
>   net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read()
>   net: hns3: fix debugfs concurrency issue between kfree buffer and read
> 
> Jian Shen (1):
>   net: hns3: fix tx timeout issue
> 
> [...]

Here is the summary with links:
  - [net,1/7] net: hns3: fix tx timeout issue
    https://git.kernel.org/netdev/net/c/61a1deacc3d4
  - [net,2/7] net: hns3: Support query tx timeout threshold by debugfs
    https://git.kernel.org/netdev/net/c/dd2bbc2ef69a
  - [net,3/7] net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read()
    https://git.kernel.org/netdev/net/c/efccf655e99b
  - [net,4/7] net: hns3: fix debugfs concurrency issue between kfree buffer and read
    https://git.kernel.org/netdev/net/c/c295160b1d95
  - [net,5/7] net: hns3: fix invalid mutex between tc qdisc and dcb ets command issue
    https://git.kernel.org/netdev/net/c/fa5564945f7d
  - [net,6/7] net: hns3: fix the port information display when sfp is absent
    https://git.kernel.org/netdev/net/c/674d9591a32d
  - [net,7/7] net: hns3: remove GSO partial feature bit
    https://git.kernel.org/netdev/net/c/60326634f6c5

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] 9+ messages in thread

end of thread, other threads:[~2023-09-07 16:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-06  7:20 [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver Jijie Shao
2023-09-06  7:20 ` [PATCH net 1/7] net: hns3: fix tx timeout issue Jijie Shao
2023-09-06  7:20 ` [PATCH net 2/7] net: hns3: Support query tx timeout threshold by debugfs Jijie Shao
2023-09-06  7:20 ` [PATCH net 3/7] net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read() Jijie Shao
2023-09-06  7:20 ` [PATCH net 4/7] net: hns3: fix debugfs concurrency issue between kfree buffer and read Jijie Shao
2023-09-06  7:20 ` [PATCH net 5/7] net: hns3: fix invalid mutex between tc qdisc and dcb ets command issue Jijie Shao
2023-09-06  7:20 ` [PATCH net 6/7] net: hns3: fix the port information display when sfp is absent Jijie Shao
2023-09-06  7:20 ` [PATCH net 7/7] net: hns3: remove GSO partial feature bit Jijie Shao
2023-09-07  9:20 ` [PATCH net 0/7] There are some bugfix for the HNS3 ethernet driver patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.