netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/4] net: hns3: fixes for -net
@ 2020-03-28  7:09 Huazhong Tan
  2020-03-28  7:09 ` [PATCH net 1/4] net: hns3: drop the WQ_MEM_RECLAIM flag when allocating WQ Huazhong Tan
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Huazhong Tan @ 2020-03-28  7:09 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

This patchset includes some bugfixes for the HNS3 ethernet driver.

[patch 1] removes flag WQ_MEM_RECLAIM flag when allocating WE,
since it will cause a warning when the reset task flushes a IB's WQ.

[patch 2] adds a new DESC_TYPE_FRAGLIST_SKB type to handle the
linear data of the fraglist SKB, since it is different with the frag
data.

[patch 3] adds different handings for RSS configuration when load
or reset.

[patch 4] fixes a link ksetting issue.

Guangbin Huang (1):
  net: hns3: fix set and get link ksettings issue

Guojia Liao (1):
  net: hns3: fix RSS config lost after VF reset.

Huazhong Tan (1):
  net: hns3: fix for fraglist SKB headlen not handling correctly

Yunsheng Lin (1):
  net: hns3: drop the WQ_MEM_RECLAIM flag when allocating WQ

 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |  1 +
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 18 ++++++--
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 10 +++-
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  | 54 ++++++++++++----------
 4 files changed, 51 insertions(+), 32 deletions(-)

-- 
2.7.4


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

* [PATCH net 1/4] net: hns3: drop the WQ_MEM_RECLAIM flag when allocating WQ
  2020-03-28  7:09 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
@ 2020-03-28  7:09 ` Huazhong Tan
  2020-03-28  7:09 ` [PATCH net 2/4] net: hns3: fix for fraglist SKB headlen not handling correctly Huazhong Tan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Huazhong Tan @ 2020-03-28  7:09 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Yunsheng Lin, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

The WQ in hns3 driver is allocated with WQ_MEM_RECLAIM flag
in order to guarantee forward progress, which may cause hns3'
WQ_MEM_RECLAIM WQ flushing infiniband' !WQ_MEM_RECLAIM WQ
warning:

[11246.200168] hns3 0000:bd:00.1: Reset done, hclge driver initialization finished.
[11246.209979] hns3 0000:bd:00.1 eth7: net open
[11246.227608] ------------[ cut here ]------------
[11246.237370] workqueue: WQ_MEM_RECLAIM hclge:hclge_service_task [hclge] is flushing !WQ_MEM_RECLAIM infiniband:0x0
[11246.237391] WARNING: CPU: 50 PID: 2279 at ./kernel/workqueue.c:2605 check_flush_dependency+0xcc/0x140
[11246.260412] Modules linked in: hclgevf hns_roce_hw_v2 rdma_test(O) hns3 xt_CHECKSUM iptable_mangle xt_conntrack ipt_REJECT nf_reject_ipv4 ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter bpfilter vfio_iommu_type1 vfio_pci vfio_virqfd vfio ib_isert iscsi_target_mod ib_ipoib ib_umad rpcrdma ib_iser libiscsi scsi_transport_iscsi aes_ce_blk crypto_simd cryptd aes_ce_cipher sunrpc nls_iso8859_1 crct10dif_ce ghash_ce sha2_ce sha256_arm64 sha1_ce joydev input_leds hid_generic usbkbd usbmouse sbsa_gwdt usbhid usb_storage hid ses hclge hisi_zip hisi_hpre hisi_sec2 hnae3 hisi_qm ahci hisi_trng_v2 evbug uacce rng_core gpio_dwapb autofs4 hisi_sas_v3_hw megaraid_sas hisi_sas_main libsas scsi_transport_sas [last unloaded: hns_roce_hw_v2]
[11246.325742] CPU: 50 PID: 2279 Comm: kworker/50:0 Kdump: loaded Tainted: G           O      5.4.0-rc4+ #1
[11246.335181] Hardware name: Huawei TaiShan 200 (Model 2280)/BC82AMDD, BIOS 2280-V2 CS V3.B140.01 12/18/2019
[11246.344802] Workqueue: hclge hclge_service_task [hclge]
[11246.350007] pstate: 60c00009 (nZCv daif +PAN +UAO)
[11246.354779] pc : check_flush_dependency+0xcc/0x140
[11246.359549] lr : check_flush_dependency+0xcc/0x140
[11246.364317] sp : ffff800268a73990
[11246.367618] x29: ffff800268a73990 x28: 0000000000000001
[11246.372907] x27: ffffcbe4f5868000 x26: ffffcbe4f5541000
[11246.378196] x25: 00000000000000b8 x24: ffff002fdd0ff868
[11246.383483] x23: ffff002fdd0ff800 x22: ffff2027401ba600
[11246.388770] x21: 0000000000000000 x20: ffff002fdd0ff800
[11246.394059] x19: ffff202719293b00 x18: ffffcbe4f5541948
[11246.399347] x17: 000000006f8ad8dd x16: 0000000000000002
[11246.404634] x15: ffff8002e8a734f7 x14: 6c66207369205d65
[11246.409922] x13: 676c63685b206b73 x12: 61745f6563697672
[11246.415208] x11: 65735f65676c6368 x10: 3a65676c6368204d
[11246.420494] x9 : 49414c4345525f4d x8 : 6e6162696e69666e
[11246.425782] x7 : 69204d49414c4345 x6 : ffffcbe4f5765145
[11246.431068] x5 : 0000000000000000 x4 : 0000000000000000
[11246.436355] x3 : 0000000000000030 x2 : 00000000ffffffff
[11246.441642] x1 : 3349eb1ac5310100 x0 : 0000000000000000
[11246.446928] Call trace:
[11246.449363]  check_flush_dependency+0xcc/0x140
[11246.453785]  flush_workqueue+0x110/0x410
[11246.457691]  ib_cache_cleanup_one+0x54/0x468
[11246.461943]  __ib_unregister_device+0x70/0xa8
[11246.466279]  ib_unregister_device+0x2c/0x40
[11246.470455]  hns_roce_exit+0x34/0x198 [hns_roce_hw_v2]
[11246.475571]  __hns_roce_hw_v2_uninit_instance.isra.56+0x3c/0x58 [hns_roce_hw_v2]
[11246.482934]  hns_roce_hw_v2_reset_notify+0xd8/0x210 [hns_roce_hw_v2]
[11246.489261]  hclge_notify_roce_client+0x84/0xe0 [hclge]
[11246.494464]  hclge_reset_rebuild+0x60/0x730 [hclge]
[11246.499320]  hclge_reset_service_task+0x400/0x5a0 [hclge]
[11246.504695]  hclge_service_task+0x54/0x698 [hclge]
[11246.509464]  process_one_work+0x15c/0x458
[11246.513454]  worker_thread+0x144/0x520
[11246.517186]  kthread+0xfc/0x128
[11246.520314]  ret_from_fork+0x10/0x18
[11246.523873] ---[ end trace eb980723699c2585 ]---
[11246.528710] hns3 0000:bd:00.2: Func clear success after reset.
[11246.528747] hns3 0000:bd:00.0: Func clear success after reset.
[11246.907710] hns3 0000:bd:00.1 eth7: link up

According to [1] and [2]:

There seems to be no specific guidance about how to handling the
forward progress guarantee of network device's WQ yet, and other
network device's WQ seem to be marked with WQ_MEM_RECLAIM without
a clear reason.

So this patch removes the WQ_MEM_RECLAIM flag when allocating WQ
to aviod the above warning.

1. https://www.spinics.net/lists/netdev/msg631646.html
2. https://www.spinics.net/lists/netdev/msg632097.html

Fixes: 0ea68902256e ("net: hns3: allocate WQ with WQ_MEM_RECLAIM flag")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c   | 2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index d3b0cd7..b351807 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -10666,7 +10666,7 @@ static int hclge_init(void)
 {
 	pr_info("%s is initializing\n", HCLGE_NAME);
 
-	hclge_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, HCLGE_NAME);
+	hclge_wq = alloc_workqueue("%s", 0, 0, HCLGE_NAME);
 	if (!hclge_wq) {
 		pr_err("%s: failed to create workqueue\n", HCLGE_NAME);
 		return -ENOMEM;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 0510d85..3c58f0b 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -3188,7 +3188,7 @@ static int hclgevf_init(void)
 {
 	pr_info("%s is initializing\n", HCLGEVF_NAME);
 
-	hclgevf_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, HCLGEVF_NAME);
+	hclgevf_wq = alloc_workqueue("%s", 0, 0, HCLGEVF_NAME);
 	if (!hclgevf_wq) {
 		pr_err("%s: failed to create workqueue\n", HCLGEVF_NAME);
 		return -ENOMEM;
-- 
2.7.4


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

* [PATCH net 2/4] net: hns3: fix for fraglist SKB headlen not handling correctly
  2020-03-28  7:09 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
  2020-03-28  7:09 ` [PATCH net 1/4] net: hns3: drop the WQ_MEM_RECLAIM flag when allocating WQ Huazhong Tan
@ 2020-03-28  7:09 ` Huazhong Tan
  2020-03-28  7:09 ` [PATCH net 3/4] net: hns3: fix RSS config lost after VF reset Huazhong Tan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Huazhong Tan @ 2020-03-28  7:09 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan, Yunsheng Lin

When the fraglist SKB headlen is larger than zero, current code
still handle the fraglist SKB linear data as frag data, which may
cause TX error.

This patch adds a new DESC_TYPE_FRAGLIST_SKB type to handle the
mapping and unmapping of the fraglist SKB linear data buffer.

Fixes: 8ae10cfb5089 ("net: hns3: support tx-scatter-gather-fraglist feature")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hnae3.h     |  1 +
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 18 +++++++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index a3e4081..5587605 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -78,6 +78,7 @@
 
 enum hns_desc_type {
 	DESC_TYPE_SKB,
+	DESC_TYPE_FRAGLIST_SKB,
 	DESC_TYPE_PAGE,
 };
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index a7f40aa..6936384 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -1107,6 +1107,10 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv,
 			return ret;
 
 		dma = dma_map_single(dev, skb->data, size, DMA_TO_DEVICE);
+	} else if (type == DESC_TYPE_FRAGLIST_SKB) {
+		struct sk_buff *skb = (struct sk_buff *)priv;
+
+		dma = dma_map_single(dev, skb->data, size, DMA_TO_DEVICE);
 	} else {
 		frag = (skb_frag_t *)priv;
 		dma = skb_frag_dma_map(dev, frag, 0, size, DMA_TO_DEVICE);
@@ -1144,8 +1148,9 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, void *priv,
 		/* The txbd's baseinfo of DESC_TYPE_PAGE & DESC_TYPE_SKB */
 		desc_cb->priv = priv;
 		desc_cb->dma = dma + HNS3_MAX_BD_SIZE * k;
-		desc_cb->type = (type == DESC_TYPE_SKB && !k) ?
-				DESC_TYPE_SKB : DESC_TYPE_PAGE;
+		desc_cb->type = ((type == DESC_TYPE_FRAGLIST_SKB ||
+				  type == DESC_TYPE_SKB) && !k) ?
+				type : DESC_TYPE_PAGE;
 
 		/* now, fill the descriptor */
 		desc->addr = cpu_to_le64(dma + HNS3_MAX_BD_SIZE * k);
@@ -1354,7 +1359,9 @@ static void hns3_clear_desc(struct hns3_enet_ring *ring, int next_to_use_orig)
 		ring_ptr_move_bw(ring, next_to_use);
 
 		/* unmap the descriptor dma address */
-		if (ring->desc_cb[ring->next_to_use].type == DESC_TYPE_SKB)
+		if (ring->desc_cb[ring->next_to_use].type == DESC_TYPE_SKB ||
+		    ring->desc_cb[ring->next_to_use].type ==
+		    DESC_TYPE_FRAGLIST_SKB)
 			dma_unmap_single(dev,
 					 ring->desc_cb[ring->next_to_use].dma,
 					ring->desc_cb[ring->next_to_use].length,
@@ -1447,7 +1454,8 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
 		goto out;
 
 	skb_walk_frags(skb, frag_skb) {
-		ret = hns3_fill_skb_to_desc(ring, frag_skb, DESC_TYPE_PAGE);
+		ret = hns3_fill_skb_to_desc(ring, frag_skb,
+					    DESC_TYPE_FRAGLIST_SKB);
 		if (unlikely(ret < 0))
 			goto fill_err;
 
@@ -2356,7 +2364,7 @@ static int hns3_map_buffer(struct hns3_enet_ring *ring, struct hns3_desc_cb *cb)
 static void hns3_unmap_buffer(struct hns3_enet_ring *ring,
 			      struct hns3_desc_cb *cb)
 {
-	if (cb->type == DESC_TYPE_SKB)
+	if (cb->type == DESC_TYPE_SKB || cb->type == DESC_TYPE_FRAGLIST_SKB)
 		dma_unmap_single(ring_to_dev(ring), cb->dma, cb->length,
 				 ring_to_dma_dir(ring));
 	else if (cb->length)
-- 
2.7.4


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

* [PATCH net 3/4] net: hns3: fix RSS config lost after VF reset.
  2020-03-28  7:09 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
  2020-03-28  7:09 ` [PATCH net 1/4] net: hns3: drop the WQ_MEM_RECLAIM flag when allocating WQ Huazhong Tan
  2020-03-28  7:09 ` [PATCH net 2/4] net: hns3: fix for fraglist SKB headlen not handling correctly Huazhong Tan
@ 2020-03-28  7:09 ` Huazhong Tan
  2020-03-28  7:09 ` [PATCH net 4/4] net: hns3: fix set and get link ksettings issue Huazhong Tan
  2020-03-30 17:58 ` [PATCH net 0/4] net: hns3: fixes for -net David Miller
  4 siblings, 0 replies; 16+ messages in thread
From: Huazhong Tan @ 2020-03-28  7:09 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Guojia Liao, Huazhong Tan

From: Guojia Liao <liaoguojia@huawei.com>

Currently, VF's RSS configuration would be set to default
after VF reset, the the user's one will loss.

To fix it, this patch separates hclgevf_rss_init_hw() into
two parts, one sets up the default RSS configuration and
just be called when driver loading, one configures the hardware
and be called by driver loading or reset.

Fixes: d97b30721301 ("net: hns3: Add RSS tuples support for VF")
Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  | 52 ++++++++++++----------
 1 file changed, 28 insertions(+), 24 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 3c58f0b..768240f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -2124,50 +2124,51 @@ static int hclgevf_config_gro(struct hclgevf_dev *hdev, bool en)
 	return ret;
 }
 
-static int hclgevf_rss_init_hw(struct hclgevf_dev *hdev)
+static void hclgevf_rss_init_cfg(struct hclgevf_dev *hdev)
 {
 	struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg;
-	int ret;
+	struct hclgevf_rss_tuple_cfg *tuple_sets;
 	u32 i;
 
+	rss_cfg->hash_algo = HCLGEVF_RSS_HASH_ALGO_TOEPLITZ;
 	rss_cfg->rss_size = hdev->nic.kinfo.rss_size;
-
+	tuple_sets = &rss_cfg->rss_tuple_sets;
 	if (hdev->pdev->revision >= 0x21) {
 		rss_cfg->hash_algo = HCLGEVF_RSS_HASH_ALGO_SIMPLE;
 		memcpy(rss_cfg->rss_hash_key, hclgevf_hash_key,
 		       HCLGEVF_RSS_KEY_SIZE);
 
+		tuple_sets->ipv4_tcp_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
+		tuple_sets->ipv4_udp_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
+		tuple_sets->ipv4_sctp_en = HCLGEVF_RSS_INPUT_TUPLE_SCTP;
+		tuple_sets->ipv4_fragment_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
+		tuple_sets->ipv6_tcp_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
+		tuple_sets->ipv6_udp_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
+		tuple_sets->ipv6_sctp_en = HCLGEVF_RSS_INPUT_TUPLE_SCTP;
+		tuple_sets->ipv6_fragment_en = HCLGEVF_RSS_INPUT_TUPLE_OTHER;
+	}
+
+	/* Initialize RSS indirect table */
+	for (i = 0; i < HCLGEVF_RSS_IND_TBL_SIZE; i++)
+		rss_cfg->rss_indirection_tbl[i] = i % rss_cfg->rss_size;
+}
+
+static int hclgevf_rss_init_hw(struct hclgevf_dev *hdev)
+{
+	struct hclgevf_rss_cfg *rss_cfg = &hdev->rss_cfg;
+	int ret;
+
+	if (hdev->pdev->revision >= 0x21) {
 		ret = hclgevf_set_rss_algo_key(hdev, rss_cfg->hash_algo,
 					       rss_cfg->rss_hash_key);
 		if (ret)
 			return ret;
 
-		rss_cfg->rss_tuple_sets.ipv4_tcp_en =
-					HCLGEVF_RSS_INPUT_TUPLE_OTHER;
-		rss_cfg->rss_tuple_sets.ipv4_udp_en =
-					HCLGEVF_RSS_INPUT_TUPLE_OTHER;
-		rss_cfg->rss_tuple_sets.ipv4_sctp_en =
-					HCLGEVF_RSS_INPUT_TUPLE_SCTP;
-		rss_cfg->rss_tuple_sets.ipv4_fragment_en =
-					HCLGEVF_RSS_INPUT_TUPLE_OTHER;
-		rss_cfg->rss_tuple_sets.ipv6_tcp_en =
-					HCLGEVF_RSS_INPUT_TUPLE_OTHER;
-		rss_cfg->rss_tuple_sets.ipv6_udp_en =
-					HCLGEVF_RSS_INPUT_TUPLE_OTHER;
-		rss_cfg->rss_tuple_sets.ipv6_sctp_en =
-					HCLGEVF_RSS_INPUT_TUPLE_SCTP;
-		rss_cfg->rss_tuple_sets.ipv6_fragment_en =
-					HCLGEVF_RSS_INPUT_TUPLE_OTHER;
-
 		ret = hclgevf_set_rss_input_tuple(hdev, rss_cfg);
 		if (ret)
 			return ret;
 	}
 
-	/* Initialize RSS indirect table */
-	for (i = 0; i < HCLGEVF_RSS_IND_TBL_SIZE; i++)
-		rss_cfg->rss_indirection_tbl[i] = i % rss_cfg->rss_size;
-
 	ret = hclgevf_set_rss_indir_table(hdev);
 	if (ret)
 		return ret;
@@ -2764,6 +2765,7 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev)
 		goto err_config;
 
 	/* Initialize RSS for this VF */
+	hclgevf_rss_init_cfg(hdev);
 	ret = hclgevf_rss_init_hw(hdev);
 	if (ret) {
 		dev_err(&hdev->pdev->dev,
@@ -2936,6 +2938,8 @@ static int hclgevf_set_channels(struct hnae3_handle *handle, u32 new_tqps_num,
 	for (i = 0; i < HCLGEVF_RSS_IND_TBL_SIZE; i++)
 		rss_indir[i] = i % kinfo->rss_size;
 
+	hdev->rss_cfg.rss_size = kinfo->rss_size;
+
 	ret = hclgevf_set_rss(handle, rss_indir, NULL, 0);
 	if (ret)
 		dev_err(&hdev->pdev->dev, "set rss indir table fail, ret=%d\n",
-- 
2.7.4


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

* [PATCH net 4/4] net: hns3: fix set and get link ksettings issue
  2020-03-28  7:09 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
                   ` (2 preceding siblings ...)
  2020-03-28  7:09 ` [PATCH net 3/4] net: hns3: fix RSS config lost after VF reset Huazhong Tan
@ 2020-03-28  7:09 ` Huazhong Tan
  2020-03-30 17:58 ` [PATCH net 0/4] net: hns3: fixes for -net David Miller
  4 siblings, 0 replies; 16+ messages in thread
From: Huazhong Tan @ 2020-03-28  7:09 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Guangbin Huang, Huazhong Tan

From: Guangbin Huang <huangguangbin2@huawei.com>

When device is not open, the service task which update the port
information per second is not running. In this case, the port
capabilities, including speed ability, autoneg ability, media type,
may be incorrect. Then get/set link ksetting may fail.

This patch fixes it by updating the port information before getting/
setting link ksettings when device is not open, and start timer
task immediately by setting delay time to 0 when device opens.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 8 +++++++-
 1 file changed, 7 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 b351807..0e03c3a 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -6765,7 +6765,7 @@ static void hclge_set_timer_task(struct hnae3_handle *handle, bool enable)
 	struct hclge_dev *hdev = vport->back;
 
 	if (enable) {
-		hclge_task_schedule(hdev, round_jiffies_relative(HZ));
+		hclge_task_schedule(hdev, 0);
 	} else {
 		/* Set the DOWN flag here to disable link updating */
 		set_bit(HCLGE_STATE_DOWN, &hdev->state);
@@ -8979,6 +8979,12 @@ static void hclge_get_media_type(struct hnae3_handle *handle, u8 *media_type,
 	struct hclge_vport *vport = hclge_get_vport(handle);
 	struct hclge_dev *hdev = vport->back;
 
+	/* When nic is down, the service task is not running, doesn't update
+	 * the port information per second. Query the port information before
+	 * return the media type, ensure getting the correct media information.
+	 */
+	hclge_update_port_info(hdev);
+
 	if (media_type)
 		*media_type = hdev->hw.mac.media_type;
 
-- 
2.7.4


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

* Re: [PATCH net 0/4] net: hns3: fixes for -net
  2020-03-28  7:09 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
                   ` (3 preceding siblings ...)
  2020-03-28  7:09 ` [PATCH net 4/4] net: hns3: fix set and get link ksettings issue Huazhong Tan
@ 2020-03-30 17:58 ` David Miller
  4 siblings, 0 replies; 16+ messages in thread
From: David Miller @ 2020-03-30 17:58 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Sat, 28 Mar 2020 15:09:54 +0800

> This patchset includes some bugfixes for the HNS3 ethernet driver.
> 
> [patch 1] removes flag WQ_MEM_RECLAIM flag when allocating WE,
> since it will cause a warning when the reset task flushes a IB's WQ.
> 
> [patch 2] adds a new DESC_TYPE_FRAGLIST_SKB type to handle the
> linear data of the fraglist SKB, since it is different with the frag
> data.
> 
> [patch 3] adds different handings for RSS configuration when load
> or reset.
> 
> [patch 4] fixes a link ksetting issue.

Series applied, thanks.

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

* Re: [PATCH net 0/4] net: hns3: fixes for -net
  2021-07-19  9:13 Guangbin Huang
@ 2021-07-20 11:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 16+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-20 11:50 UTC (permalink / raw)
  To: Guangbin Huang
  Cc: davem, kuba, fengchengwen, netdev, linux-kernel, salil.mehta, lipeng321

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Mon, 19 Jul 2021 17:13:04 +0800 you wrote:
> This series includes some bugfixes for the HNS3 ethernet driver.
> 
> Chengwen Feng (1):
>   net: hns3: fix possible mismatches resp of mailbox
> 
> Jian Shen (2):
>   net: hns3: disable port VLAN filter when support function level VLAN
>     filter control
>   net: hns3: fix rx VLAN offload state inconsistent issue
> 
> [...]

Here is the summary with links:
  - [net,1/4] net: hns3: fix possible mismatches resp of mailbox
    https://git.kernel.org/netdev/net/c/1b713d14dc3c
  - [net,2/4] net: hns3: add match_id to check mailbox response from PF to VF
    https://git.kernel.org/netdev/net/c/4671042f1ef0
  - [net,3/4] net: hns3: disable port VLAN filter when support function level VLAN filter control
    https://git.kernel.org/netdev/net/c/184cd221a863
  - [net,4/4] net: hns3: fix rx VLAN offload state inconsistent issue
    https://git.kernel.org/netdev/net/c/bbfd4506f962

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

* [PATCH net 0/4] net: hns3: fixes for -net
@ 2021-07-19  9:13 Guangbin Huang
  2021-07-20 11:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 16+ messages in thread
From: Guangbin Huang @ 2021-07-19  9:13 UTC (permalink / raw)
  To: davem, kuba, fengchengwen
  Cc: netdev, linux-kernel, salil.mehta, lipeng321, huangguangbin2

This series includes some bugfixes for the HNS3 ethernet driver.

Chengwen Feng (1):
  net: hns3: fix possible mismatches resp of mailbox

Jian Shen (2):
  net: hns3: disable port VLAN filter when support function level VLAN
    filter control
  net: hns3: fix rx VLAN offload state inconsistent issue

Peng Li (1):
  net: hns3: add match_id to check mailbox response from PF to VF

 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h       |  7 +++++--
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c   |  8 ++++++--
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c    |  1 +
 .../net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 10 ++++++++++
 .../net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c  | 19 +++++++++++++++++++
 5 files changed, 41 insertions(+), 4 deletions(-)

-- 
2.8.1


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

* Re: [PATCH net 0/4] net: hns3: fixes for -net
  2021-05-18 11:35 Huazhong Tan
@ 2021-05-18 21:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 16+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-18 21:00 UTC (permalink / raw)
  To: Huazhong Tan
  Cc: davem, kuba, netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Tue, 18 May 2021 19:35:59 +0800 you wrote:
> This series includes some bugfixes for the HNS3 ethernet driver.
> 
> Huazhong Tan (1):
>   net: hns3: fix user's coalesce configuration lost issue
> 
> Jian Shen (1):
>   net: hns3: put off calling register_netdev() until client initialize
>     complete
> 
> [...]

Here is the summary with links:
  - [net,1/4] net: hns3: fix incorrect resp_msg issue
    https://git.kernel.org/netdev/net/c/a710b9ffbeba
  - [net,2/4] net: hns3: put off calling register_netdev() until client initialize complete
    https://git.kernel.org/netdev/net/c/a289a7e5c1d4
  - [net,3/4] net: hns3: fix user's coalesce configuration lost issue
    https://git.kernel.org/netdev/net/c/73a13d8dbe33
  - [net,4/4] net: hns3: check the return of skb_checksum_help()
    https://git.kernel.org/netdev/net/c/9bb5a495424f

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

* [PATCH net 0/4] net: hns3: fixes for -net
@ 2021-05-18 11:35 Huazhong Tan
  2021-05-18 21:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 16+ messages in thread
From: Huazhong Tan @ 2021-05-18 11:35 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm, Huazhong Tan

This series includes some bugfixes for the HNS3 ethernet driver.

Huazhong Tan (1):
  net: hns3: fix user's coalesce configuration lost issue

Jian Shen (1):
  net: hns3: put off calling register_netdev() until client initialize
    complete

Jiaran Zhang (1):
  net: hns3: fix incorrect resp_msg issue

Yunsheng Lin (1):
  net: hns3: check the return of skb_checksum_help()

 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 110 ++++++++++-----------
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c |  64 +++++-------
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |   4 +-
 3 files changed, 77 insertions(+), 101 deletions(-)

-- 
2.7.4


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

* Re: [PATCH net 0/4] net: hns3: fixes for -net
  2020-07-21 11:03 Huazhong Tan
@ 2020-07-21 22:49 ` David Miller
  0 siblings, 0 replies; 16+ messages in thread
From: David Miller @ 2020-07-21 22:49 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Tue, 21 Jul 2020 19:03:50 +0800

> There are some bugfixes for the HNS3 ethernet driver.

Series applied, thank you.

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

* [PATCH net 0/4] net: hns3: fixes for -net
@ 2020-07-21 11:03 Huazhong Tan
  2020-07-21 22:49 ` David Miller
  0 siblings, 1 reply; 16+ messages in thread
From: Huazhong Tan @ 2020-07-21 11:03 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

There are some bugfixes for the HNS3 ethernet driver.

Jian Shen (1):
  net: hns3: fix return value error when query MAC link status fail

Yunsheng Lin (3):
  net: hns3: fix for not unmapping TX buffer correctly
  net: hns3: fix for not calculating TX BD send size correctly
  net: hns3: fix error handling for desc filling

 drivers/net/ethernet/hisilicon/hns3/hnae3.h        |  1 +
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 24 +++++------
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h    |  2 -
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 49 ++++++++++------------
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |  3 ++
 5 files changed, 38 insertions(+), 41 deletions(-)

-- 
2.7.4


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

* Re: [PATCH net 0/4] net: hns3: fixes for -net
  2020-07-06 11:25 Huazhong Tan
@ 2020-07-06 19:33 ` David Miller
  0 siblings, 0 replies; 16+ messages in thread
From: David Miller @ 2020-07-06 19:33 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Mon, 6 Jul 2020 19:25:58 +0800

> There are some fixes about reset issue and a use-after-free
> of self-test.

Series applied, thank you.

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

* [PATCH net 0/4] net: hns3: fixes for -net
@ 2020-07-06 11:25 Huazhong Tan
  2020-07-06 19:33 ` David Miller
  0 siblings, 1 reply; 16+ messages in thread
From: Huazhong Tan @ 2020-07-06 11:25 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

There are some fixes about reset issue and a use-after-free
of self-test.

Huazhong Tan (3):
  net: hns3: check reset pending after FLR prepare
  net: hns3: fix for mishandle of asserting VF reset fail
  net: hns3: add a missing uninit debugfs when unload driver

Yonglong Liu (1):
  net: hns3: fix use-after-free when doing self test

 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c           | 3 +--
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c        | 9 ++++++---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c   | 2 +-
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +++++
 4 files changed, 13 insertions(+), 6 deletions(-)

-- 
2.7.4


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

* Re: [PATCH net 0/4] net: hns3: fixes for -net
  2020-03-12  7:11 Huazhong Tan
@ 2020-03-12 18:39 ` David Miller
  0 siblings, 0 replies; 16+ messages in thread
From: David Miller @ 2020-03-12 18:39 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Thu, 12 Mar 2020 15:11:02 +0800

> This series includes several bugfixes for the HNS3 ethernet driver.
> 
> [patch 1] fixes an "tc qdisc del" failure.
> [patch 2] fixes SW & HW VLAN table not consistent issue.
> [patch 3] fixes a RMW issue related to VLAN filter switch.
> [patch 4] clears port based VLAN when uploading PF.

Series applied and queued up for -stable.

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

* [PATCH net 0/4] net: hns3: fixes for -net
@ 2020-03-12  7:11 Huazhong Tan
  2020-03-12 18:39 ` David Miller
  0 siblings, 1 reply; 16+ messages in thread
From: Huazhong Tan @ 2020-03-12  7:11 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm, kuba,
	Huazhong Tan

This series includes several bugfixes for the HNS3 ethernet driver.

[patch 1] fixes an "tc qdisc del" failure.
[patch 2] fixes SW & HW VLAN table not consistent issue.
[patch 3] fixes a RMW issue related to VLAN filter switch.
[patch 4] clears port based VLAN when uploading PF.

Jian Shen (3):
  net: hns3: fix VF VLAN table entries inconsistent issue
  net: hns3: fix RMW issue for VLAN filter switch
  net: hns3: clear port base VLAN when unload PF

Yonglong Liu (1):
  net: hns3: fix "tc qdisc del" failed issue

 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h    |  1 +
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    |  2 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 43 ++++++++++++++++++++--
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |  1 +
 .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c  |  3 ++
 5 files changed, 45 insertions(+), 5 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2021-07-20 11:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-28  7:09 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
2020-03-28  7:09 ` [PATCH net 1/4] net: hns3: drop the WQ_MEM_RECLAIM flag when allocating WQ Huazhong Tan
2020-03-28  7:09 ` [PATCH net 2/4] net: hns3: fix for fraglist SKB headlen not handling correctly Huazhong Tan
2020-03-28  7:09 ` [PATCH net 3/4] net: hns3: fix RSS config lost after VF reset Huazhong Tan
2020-03-28  7:09 ` [PATCH net 4/4] net: hns3: fix set and get link ksettings issue Huazhong Tan
2020-03-30 17:58 ` [PATCH net 0/4] net: hns3: fixes for -net David Miller
  -- strict thread matches above, loose matches on Subject: below --
2021-07-19  9:13 Guangbin Huang
2021-07-20 11:50 ` patchwork-bot+netdevbpf
2021-05-18 11:35 Huazhong Tan
2021-05-18 21:00 ` patchwork-bot+netdevbpf
2020-07-21 11:03 Huazhong Tan
2020-07-21 22:49 ` David Miller
2020-07-06 11:25 Huazhong Tan
2020-07-06 19:33 ` David Miller
2020-03-12  7:11 Huazhong Tan
2020-03-12 18:39 ` David Miller

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).