All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/4] net: hns3: fixes for -net
@ 2021-05-18 11:35 Huazhong Tan
  2021-05-18 11:36 ` [PATCH net 1/4] net: hns3: fix incorrect resp_msg issue Huazhong Tan
                   ` (4 more replies)
  0 siblings, 5 replies; 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

* [PATCH net 1/4] net: hns3: fix incorrect resp_msg issue
  2021-05-18 11:35 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
@ 2021-05-18 11:36 ` Huazhong Tan
  2021-05-18 11:36 ` [PATCH net 2/4] net: hns3: put off calling register_netdev() until client initialize complete Huazhong Tan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Huazhong Tan @ 2021-05-18 11:36 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	Jiaran Zhang, Huazhong Tan

From: Jiaran Zhang <zhangjiaran@huawei.com>

In hclge_mbx_handler(), if there are two consecutive mailbox
messages that requires resp_msg, the resp_msg is not cleared
after processing the first message, which will cause the resp_msg
data of second message incorrect.

Fix it by clearing the resp_msg before processing every mailbox
message.

Fixes: bb5790b71bad ("net: hns3: refactor mailbox response scheme between PF and VF")
Signed-off-by: Jiaran Zhang <zhangjiaran@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
index 8e5f9dc..f1c9f4a 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
@@ -710,7 +710,6 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
 	unsigned int flag;
 	int ret = 0;
 
-	memset(&resp_msg, 0, sizeof(resp_msg));
 	/* handle all the mailbox requests in the queue */
 	while (!hclge_cmd_crq_empty(&hdev->hw)) {
 		if (test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state)) {
@@ -738,6 +737,9 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
 
 		trace_hclge_pf_mbx_get(hdev, req);
 
+		/* clear the resp_msg before processing every mailbox message */
+		memset(&resp_msg, 0, sizeof(resp_msg));
+
 		switch (req->msg.code) {
 		case HCLGE_MBX_MAP_RING_TO_VECTOR:
 			ret = hclge_map_unmap_ring_to_vf_vector(vport, true,
-- 
2.7.4


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

* [PATCH net 2/4] net: hns3: put off calling register_netdev() until client initialize complete
  2021-05-18 11:35 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
  2021-05-18 11:36 ` [PATCH net 1/4] net: hns3: fix incorrect resp_msg issue Huazhong Tan
@ 2021-05-18 11:36 ` Huazhong Tan
  2021-05-18 11:36 ` [PATCH net 3/4] net: hns3: fix user's coalesce configuration lost issue Huazhong Tan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Huazhong Tan @ 2021-05-18 11:36 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	Jian Shen, Huazhong Tan

From: Jian Shen <shenjian15@huawei.com>

Currently, the netdevice is registered before client initializing
complete. So there is a timewindow between netdevice available
and usable. In this case, if user try to change the channel number
or ring param, it may cause the hns3_set_rx_cpu_rmap() being called
twice, and report bug.

[47199.416502] hns3 0000:35:00.0 eth1: set channels: tqp_num=1, rxfh=0
[47199.430340] hns3 0000:35:00.0 eth1: already uninitialized
[47199.438554] hns3 0000:35:00.0: rss changes from 4 to 1
[47199.511854] hns3 0000:35:00.0: Channels changed, rss_size from 4 to 1, tqps from 4 to 1
[47200.163524] ------------[ cut here ]------------
[47200.171674] kernel BUG at lib/cpu_rmap.c:142!
[47200.177847] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[47200.185259] Modules linked in: hclge(+) hns3(-) hns3_cae(O) hns_roce_hw_v2 hnae3 vfio_iommu_type1 vfio_pci vfio_virqfd vfio pv680_mii(O) [last unloaded: hclge]
[47200.205912] CPU: 1 PID: 8260 Comm: ethtool Tainted: G           O      5.11.0-rc3+ #1
[47200.215601] Hardware name:  , xxxxxx 02/04/2021
[47200.223052] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--)
[47200.230188] pc : cpu_rmap_add+0x38/0x40
[47200.237472] lr : irq_cpu_rmap_add+0x84/0x140
[47200.243291] sp : ffff800010e93a30
[47200.247295] x29: ffff800010e93a30 x28: ffff082100584880
[47200.254155] x27: 0000000000000000 x26: 0000000000000000
[47200.260712] x25: 0000000000000000 x24: 0000000000000004
[47200.267241] x23: ffff08209ba03000 x22: ffff08209ba038c0
[47200.273789] x21: 000000000000003f x20: ffff0820e2bc1680
[47200.280400] x19: ffff0820c970ec80 x18: 00000000000000c0
[47200.286944] x17: 0000000000000000 x16: ffffb43debe4a0d0
[47200.293456] x15: fffffc2082990600 x14: dead000000000122
[47200.300059] x13: ffffffffffffffff x12: 000000000000003e
[47200.306606] x11: ffff0820815b8080 x10: ffff53e411988000
[47200.313171] x9 : 0000000000000000 x8 : ffff0820e2bc1700
[47200.319682] x7 : 0000000000000000 x6 : 000000000000003f
[47200.326170] x5 : 0000000000000040 x4 : ffff800010e93a20
[47200.332656] x3 : 0000000000000004 x2 : ffff0820c970ec80
[47200.339168] x1 : ffff0820e2bc1680 x0 : 0000000000000004
[47200.346058] Call trace:
[47200.349324]  cpu_rmap_add+0x38/0x40
[47200.354300]  hns3_set_rx_cpu_rmap+0x6c/0xe0 [hns3]
[47200.362294]  hns3_reset_notify_init_enet+0x1cc/0x340 [hns3]
[47200.370049]  hns3_change_channels+0x40/0xb0 [hns3]
[47200.376770]  hns3_set_channels+0x12c/0x2a0 [hns3]
[47200.383353]  ethtool_set_channels+0x140/0x250
[47200.389772]  dev_ethtool+0x714/0x23d0
[47200.394440]  dev_ioctl+0x4cc/0x640
[47200.399277]  sock_do_ioctl+0x100/0x2a0
[47200.404574]  sock_ioctl+0x28c/0x470
[47200.409079]  __arm64_sys_ioctl+0xb4/0x100
[47200.415217]  el0_svc_common.constprop.0+0x84/0x210
[47200.422088]  do_el0_svc+0x28/0x34
[47200.426387]  el0_svc+0x28/0x70
[47200.431308]  el0_sync_handler+0x1a4/0x1b0
[47200.436477]  el0_sync+0x174/0x180
[47200.441562] Code: 11000405 79000c45 f8247861 d65f03c0 (d4210000)
[47200.448869] ---[ end trace a01efe4ce42e5f34 ]---

The process is like below:
excuting hns3_client_init
|
register_netdev()
|                           hns3_set_channels()
|                           |
hns3_set_rx_cpu_rmap()      hns3_reset_notify_uninit_enet()
|                               |
|                            quit without calling function
|                            hns3_free_rx_cpu_rmap for flag
|                            HNS3_NIC_STATE_INITED is unset.
|                           |
|                           hns3_reset_notify_init_enet()
|                               |
set HNS3_NIC_STATE_INITED    call hns3_set_rx_cpu_rmap()-- crash

Fix it by calling register_netdev() at the end of function
hns3_client_init().

Fixes: 08a100689d4b ("net: hns3: re-organize vector handle")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 783fdaf..c64d188 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -4317,12 +4317,6 @@ static int hns3_client_init(struct hnae3_handle *handle)
 	if (ret)
 		goto out_init_phy;
 
-	ret = register_netdev(netdev);
-	if (ret) {
-		dev_err(priv->dev, "probe register netdev fail!\n");
-		goto out_reg_netdev_fail;
-	}
-
 	/* the device can work without cpu rmap, only aRFS needs it */
 	ret = hns3_set_rx_cpu_rmap(netdev);
 	if (ret)
@@ -4355,17 +4349,23 @@ static int hns3_client_init(struct hnae3_handle *handle)
 	if (ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V3)
 		set_bit(HNAE3_PFLAG_LIMIT_PROMISC, &handle->supported_pflags);
 
+	ret = register_netdev(netdev);
+	if (ret) {
+		dev_err(priv->dev, "probe register netdev fail!\n");
+		goto out_reg_netdev_fail;
+	}
+
 	if (netif_msg_drv(handle))
 		hns3_info_show(priv);
 
 	return ret;
 
+out_reg_netdev_fail:
+	hns3_dbg_uninit(handle);
 out_client_start:
 	hns3_free_rx_cpu_rmap(netdev);
 	hns3_nic_uninit_irq(priv);
 out_init_irq_fail:
-	unregister_netdev(netdev);
-out_reg_netdev_fail:
 	hns3_uninit_phy(netdev);
 out_init_phy:
 	hns3_uninit_all_ring(priv);
-- 
2.7.4


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

* [PATCH net 3/4] net: hns3: fix user's coalesce configuration lost issue
  2021-05-18 11:35 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
  2021-05-18 11:36 ` [PATCH net 1/4] net: hns3: fix incorrect resp_msg issue Huazhong Tan
  2021-05-18 11:36 ` [PATCH net 2/4] net: hns3: put off calling register_netdev() until client initialize complete Huazhong Tan
@ 2021-05-18 11:36 ` Huazhong Tan
  2021-05-18 11:36 ` [PATCH net 4/4] net: hns3: check the return of skb_checksum_help() Huazhong Tan
  2021-05-18 21:00 ` [PATCH net 0/4] net: hns3: fixes for -net patchwork-bot+netdevbpf
  4 siblings, 0 replies; 16+ messages in thread
From: Huazhong Tan @ 2021-05-18 11:36 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm, Huazhong Tan

Currently, when adaptive is on, the user's coalesce configuration
may be overwritten by the dynamic one. The reason is that user's
configurations are saved in struct hns3_enet_tqp_vector whose
value maybe changed by the dynamic algorithm. To fix it, use
struct hns3_nic_priv instead of struct hns3_enet_tqp_vector to
save and get the user's configuration.

BTW, operations of storing and restoring coalesce info in the reset
process are unnecessary now, so remove them as well.

Fixes: 434776a5fae2 ("net: hns3: add ethtool_ops.set_coalesce support to PF")
Fixes: 7e96adc46633 ("net: hns3: add ethtool_ops.get_coalesce support to PF")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 84 +++++++++++-----------
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 64 ++++++-----------
 2 files changed, 63 insertions(+), 85 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index c64d188..6d6c0ac 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -264,22 +264,17 @@ static void hns3_vector_coalesce_init(struct hns3_enet_tqp_vector *tqp_vector,
 	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(priv->ae_handle->pdev);
 	struct hns3_enet_coalesce *tx_coal = &tqp_vector->tx_group.coal;
 	struct hns3_enet_coalesce *rx_coal = &tqp_vector->rx_group.coal;
+	struct hns3_enet_coalesce *ptx_coal = &priv->tx_coal;
+	struct hns3_enet_coalesce *prx_coal = &priv->rx_coal;
 
-	/* initialize the configuration for interrupt coalescing.
-	 * 1. GL (Interrupt Gap Limiter)
-	 * 2. RL (Interrupt Rate Limiter)
-	 * 3. QL (Interrupt Quantity Limiter)
-	 *
-	 * Default: enable interrupt coalescing self-adaptive and GL
-	 */
-	tx_coal->adapt_enable = 1;
-	rx_coal->adapt_enable = 1;
+	tx_coal->adapt_enable = ptx_coal->adapt_enable;
+	rx_coal->adapt_enable = prx_coal->adapt_enable;
 
-	tx_coal->int_gl = HNS3_INT_GL_50K;
-	rx_coal->int_gl = HNS3_INT_GL_50K;
+	tx_coal->int_gl = ptx_coal->int_gl;
+	rx_coal->int_gl = prx_coal->int_gl;
 
-	rx_coal->flow_level = HNS3_FLOW_LOW;
-	tx_coal->flow_level = HNS3_FLOW_LOW;
+	rx_coal->flow_level = prx_coal->flow_level;
+	tx_coal->flow_level = ptx_coal->flow_level;
 
 	/* device version above V3(include V3), GL can configure 1us
 	 * unit, so uses 1us unit.
@@ -294,8 +289,8 @@ static void hns3_vector_coalesce_init(struct hns3_enet_tqp_vector *tqp_vector,
 		rx_coal->ql_enable = 1;
 		tx_coal->int_ql_max = ae_dev->dev_specs.int_ql_max;
 		rx_coal->int_ql_max = ae_dev->dev_specs.int_ql_max;
-		tx_coal->int_ql = HNS3_INT_QL_DEFAULT_CFG;
-		rx_coal->int_ql = HNS3_INT_QL_DEFAULT_CFG;
+		tx_coal->int_ql = ptx_coal->int_ql;
+		rx_coal->int_ql = prx_coal->int_ql;
 	}
 }
 
@@ -3844,6 +3839,34 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv)
 	return ret;
 }
 
+static void hns3_nic_init_coal_cfg(struct hns3_nic_priv *priv)
+{
+	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(priv->ae_handle->pdev);
+	struct hns3_enet_coalesce *tx_coal = &priv->tx_coal;
+	struct hns3_enet_coalesce *rx_coal = &priv->rx_coal;
+
+	/* initialize the configuration for interrupt coalescing.
+	 * 1. GL (Interrupt Gap Limiter)
+	 * 2. RL (Interrupt Rate Limiter)
+	 * 3. QL (Interrupt Quantity Limiter)
+	 *
+	 * Default: enable interrupt coalescing self-adaptive and GL
+	 */
+	tx_coal->adapt_enable = 1;
+	rx_coal->adapt_enable = 1;
+
+	tx_coal->int_gl = HNS3_INT_GL_50K;
+	rx_coal->int_gl = HNS3_INT_GL_50K;
+
+	rx_coal->flow_level = HNS3_FLOW_LOW;
+	tx_coal->flow_level = HNS3_FLOW_LOW;
+
+	if (ae_dev->dev_specs.int_ql_max) {
+		tx_coal->int_ql = HNS3_INT_QL_DEFAULT_CFG;
+		rx_coal->int_ql = HNS3_INT_QL_DEFAULT_CFG;
+	}
+}
+
 static int hns3_nic_alloc_vector_data(struct hns3_nic_priv *priv)
 {
 	struct hnae3_handle *h = priv->ae_handle;
@@ -4295,6 +4318,8 @@ static int hns3_client_init(struct hnae3_handle *handle)
 		goto out_get_ring_cfg;
 	}
 
+	hns3_nic_init_coal_cfg(priv);
+
 	ret = hns3_nic_alloc_vector_data(priv);
 	if (ret) {
 		ret = -ENOMEM;
@@ -4571,31 +4596,6 @@ int hns3_nic_reset_all_ring(struct hnae3_handle *h)
 	return 0;
 }
 
-static void hns3_store_coal(struct hns3_nic_priv *priv)
-{
-	/* ethtool only support setting and querying one coal
-	 * configuration for now, so save the vector 0' coal
-	 * configuration here in order to restore it.
-	 */
-	memcpy(&priv->tx_coal, &priv->tqp_vector[0].tx_group.coal,
-	       sizeof(struct hns3_enet_coalesce));
-	memcpy(&priv->rx_coal, &priv->tqp_vector[0].rx_group.coal,
-	       sizeof(struct hns3_enet_coalesce));
-}
-
-static void hns3_restore_coal(struct hns3_nic_priv *priv)
-{
-	u16 vector_num = priv->vector_num;
-	int i;
-
-	for (i = 0; i < vector_num; i++) {
-		memcpy(&priv->tqp_vector[i].tx_group.coal, &priv->tx_coal,
-		       sizeof(struct hns3_enet_coalesce));
-		memcpy(&priv->tqp_vector[i].rx_group.coal, &priv->rx_coal,
-		       sizeof(struct hns3_enet_coalesce));
-	}
-}
-
 static int hns3_reset_notify_down_enet(struct hnae3_handle *handle)
 {
 	struct hnae3_knic_private_info *kinfo = &handle->kinfo;
@@ -4654,8 +4654,6 @@ static int hns3_reset_notify_init_enet(struct hnae3_handle *handle)
 	if (ret)
 		goto err_put_ring;
 
-	hns3_restore_coal(priv);
-
 	ret = hns3_nic_init_vector_data(priv);
 	if (ret)
 		goto err_dealloc_vector;
@@ -4721,8 +4719,6 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)
 
 	hns3_nic_uninit_vector_data(priv);
 
-	hns3_store_coal(priv);
-
 	hns3_nic_dealloc_vector_data(priv);
 
 	hns3_uninit_all_ring(priv);
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index b48faf7..c1ea403 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -1134,50 +1134,32 @@ static void hns3_get_channels(struct net_device *netdev,
 		h->ae_algo->ops->get_channels(h, ch);
 }
 
-static int hns3_get_coalesce_per_queue(struct net_device *netdev, u32 queue,
-				       struct ethtool_coalesce *cmd)
+static int hns3_get_coalesce(struct net_device *netdev,
+			     struct ethtool_coalesce *cmd)
 {
-	struct hns3_enet_tqp_vector *tx_vector, *rx_vector;
 	struct hns3_nic_priv *priv = netdev_priv(netdev);
+	struct hns3_enet_coalesce *tx_coal = &priv->tx_coal;
+	struct hns3_enet_coalesce *rx_coal = &priv->rx_coal;
 	struct hnae3_handle *h = priv->ae_handle;
-	u16 queue_num = h->kinfo.num_tqps;
 
 	if (hns3_nic_resetting(netdev))
 		return -EBUSY;
 
-	if (queue >= queue_num) {
-		netdev_err(netdev,
-			   "Invalid queue value %u! Queue max id=%u\n",
-			   queue, queue_num - 1);
-		return -EINVAL;
-	}
-
-	tx_vector = priv->ring[queue].tqp_vector;
-	rx_vector = priv->ring[queue_num + queue].tqp_vector;
+	cmd->use_adaptive_tx_coalesce = tx_coal->adapt_enable;
+	cmd->use_adaptive_rx_coalesce = rx_coal->adapt_enable;
 
-	cmd->use_adaptive_tx_coalesce =
-			tx_vector->tx_group.coal.adapt_enable;
-	cmd->use_adaptive_rx_coalesce =
-			rx_vector->rx_group.coal.adapt_enable;
-
-	cmd->tx_coalesce_usecs = tx_vector->tx_group.coal.int_gl;
-	cmd->rx_coalesce_usecs = rx_vector->rx_group.coal.int_gl;
+	cmd->tx_coalesce_usecs = tx_coal->int_gl;
+	cmd->rx_coalesce_usecs = rx_coal->int_gl;
 
 	cmd->tx_coalesce_usecs_high = h->kinfo.int_rl_setting;
 	cmd->rx_coalesce_usecs_high = h->kinfo.int_rl_setting;
 
-	cmd->tx_max_coalesced_frames = tx_vector->tx_group.coal.int_ql;
-	cmd->rx_max_coalesced_frames = rx_vector->rx_group.coal.int_ql;
+	cmd->tx_max_coalesced_frames = tx_coal->int_ql;
+	cmd->rx_max_coalesced_frames = rx_coal->int_ql;
 
 	return 0;
 }
 
-static int hns3_get_coalesce(struct net_device *netdev,
-			     struct ethtool_coalesce *cmd)
-{
-	return hns3_get_coalesce_per_queue(netdev, 0, cmd);
-}
-
 static int hns3_check_gl_coalesce_para(struct net_device *netdev,
 				       struct ethtool_coalesce *cmd)
 {
@@ -1292,19 +1274,7 @@ static int hns3_check_coalesce_para(struct net_device *netdev,
 		return ret;
 	}
 
-	ret = hns3_check_ql_coalesce_param(netdev, cmd);
-	if (ret)
-		return ret;
-
-	if (cmd->use_adaptive_tx_coalesce == 1 ||
-	    cmd->use_adaptive_rx_coalesce == 1) {
-		netdev_info(netdev,
-			    "adaptive-tx=%u and adaptive-rx=%u, tx_usecs or rx_usecs will changed dynamically.\n",
-			    cmd->use_adaptive_tx_coalesce,
-			    cmd->use_adaptive_rx_coalesce);
-	}
-
-	return 0;
+	return hns3_check_ql_coalesce_param(netdev, cmd);
 }
 
 static void hns3_set_coalesce_per_queue(struct net_device *netdev,
@@ -1350,6 +1320,9 @@ static int hns3_set_coalesce(struct net_device *netdev,
 			     struct ethtool_coalesce *cmd)
 {
 	struct hnae3_handle *h = hns3_get_handle(netdev);
+	struct hns3_nic_priv *priv = netdev_priv(netdev);
+	struct hns3_enet_coalesce *tx_coal = &priv->tx_coal;
+	struct hns3_enet_coalesce *rx_coal = &priv->rx_coal;
 	u16 queue_num = h->kinfo.num_tqps;
 	int ret;
 	int i;
@@ -1364,6 +1337,15 @@ static int hns3_set_coalesce(struct net_device *netdev,
 	h->kinfo.int_rl_setting =
 		hns3_rl_round_down(cmd->rx_coalesce_usecs_high);
 
+	tx_coal->adapt_enable = cmd->use_adaptive_tx_coalesce;
+	rx_coal->adapt_enable = cmd->use_adaptive_rx_coalesce;
+
+	tx_coal->int_gl = cmd->tx_coalesce_usecs;
+	rx_coal->int_gl = cmd->rx_coalesce_usecs;
+
+	tx_coal->int_ql = cmd->tx_max_coalesced_frames;
+	rx_coal->int_ql = cmd->rx_max_coalesced_frames;
+
 	for (i = 0; i < queue_num; i++)
 		hns3_set_coalesce_per_queue(netdev, cmd, i);
 
-- 
2.7.4


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

* [PATCH net 4/4] net: hns3: check the return of skb_checksum_help()
  2021-05-18 11:35 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
                   ` (2 preceding siblings ...)
  2021-05-18 11:36 ` [PATCH net 3/4] net: hns3: fix user's coalesce configuration lost issue Huazhong Tan
@ 2021-05-18 11:36 ` Huazhong Tan
  2021-05-18 21:00 ` [PATCH net 0/4] net: hns3: fixes for -net patchwork-bot+netdevbpf
  4 siblings, 0 replies; 16+ messages in thread
From: Huazhong Tan @ 2021-05-18 11:36 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	Yunsheng Lin, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

Currently skb_checksum_help()'s return is ignored, but it may
return error when it fails to allocate memory when linearizing.

So adds checking for the return of skb_checksum_help().

Fixes: 76ad4f0ee747("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Fixes: 3db084d28dc0("net: hns3: Fix for vxlan tx checksum bug")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 6d6c0ac..026558f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -841,8 +841,6 @@ static bool hns3_tunnel_csum_bug(struct sk_buff *skb)
 	      l4.udp->dest == htons(4790))))
 		return false;
 
-	skb_checksum_help(skb);
-
 	return true;
 }
 
@@ -919,8 +917,7 @@ static int hns3_set_l2l3l4(struct sk_buff *skb, u8 ol4_proto,
 			/* the stack computes the IP header already,
 			 * driver calculate l4 checksum when not TSO.
 			 */
-			skb_checksum_help(skb);
-			return 0;
+			return skb_checksum_help(skb);
 		}
 
 		hns3_set_outer_l2l3l4(skb, ol4_proto, ol_type_vlan_len_msec);
@@ -965,7 +962,7 @@ static int hns3_set_l2l3l4(struct sk_buff *skb, u8 ol4_proto,
 		break;
 	case IPPROTO_UDP:
 		if (hns3_tunnel_csum_bug(skb))
-			break;
+			return skb_checksum_help(skb);
 
 		hns3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4CS_B, 1);
 		hns3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4T_S,
@@ -990,8 +987,7 @@ static int hns3_set_l2l3l4(struct sk_buff *skb, u8 ol4_proto,
 		/* the stack computes the IP header already,
 		 * driver calculate l4 checksum when not TSO.
 		 */
-		skb_checksum_help(skb);
-		return 0;
+		return skb_checksum_help(skb);
 	}
 
 	return 0;
-- 
2.7.4


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

* Re: [PATCH net 0/4] net: hns3: fixes for -net
  2021-05-18 11:35 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
                   ` (3 preceding siblings ...)
  2021-05-18 11:36 ` [PATCH net 4/4] net: hns3: check the return of skb_checksum_help() Huazhong Tan
@ 2021-05-18 21:00 ` patchwork-bot+netdevbpf
  4 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

* 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
  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-28  7:09 Huazhong Tan
@ 2020-03-30 17:58 ` David Miller
  0 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

* [PATCH net 0/4] net: hns3: fixes for -net
@ 2020-03-28  7:09 Huazhong Tan
  2020-03-30 17:58 ` David Miller
  0 siblings, 1 reply; 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

* 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 --
2021-05-18 11:35 [PATCH net 0/4] net: hns3: fixes for -net Huazhong Tan
2021-05-18 11:36 ` [PATCH net 1/4] net: hns3: fix incorrect resp_msg issue Huazhong Tan
2021-05-18 11:36 ` [PATCH net 2/4] net: hns3: put off calling register_netdev() until client initialize complete Huazhong Tan
2021-05-18 11:36 ` [PATCH net 3/4] net: hns3: fix user's coalesce configuration lost issue Huazhong Tan
2021-05-18 11:36 ` [PATCH net 4/4] net: hns3: check the return of skb_checksum_help() Huazhong Tan
2021-05-18 21:00 ` [PATCH net 0/4] net: hns3: fixes for -net patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2021-07-19  9:13 Guangbin Huang
2021-07-20 11:50 ` 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-28  7:09 Huazhong Tan
2020-03-30 17:58 ` David Miller
2020-03-12  7:11 Huazhong Tan
2020-03-12 18:39 ` David Miller

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.