netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] net: hns3: fixes for -net
@ 2019-11-14  2:32 Huazhong Tan
  2019-11-14  2:32 ` [PATCH net 1/3] net: hns3: add compatible handling for MAC VLAN switch parameter configuration Huazhong Tan
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Huazhong Tan @ 2019-11-14  2:32 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	jakub.kicinski, Huazhong Tan

This series includes misc fixes for the HNS3 ethernet driver.

[patch 1/3] adds a compatible handling for configuration of
MAC VLAN swithch parameter.

[patch 2/3] re-allocates SSU buffer when pfc_en changed.

[patch 3/3] fixes a bug for ETS bandwidth validation.

Guangbin Huang (1):
  net: hns3: add compatible handling for MAC VLAN switch parameter
    configuration

Yonglong Liu (1):
  net: hns3: fix ETS bandwidth validation bug

Yunsheng Lin (1):
  net: hns3: reallocate SSU' buffer size when pfc_en changes

 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c    | 19 +++++++++++++++++--
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c   | 16 ++++++++++++++--
 2 files changed, 31 insertions(+), 4 deletions(-)

-- 
2.7.4


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

* [PATCH net 1/3] net: hns3: add compatible handling for MAC VLAN switch parameter configuration
  2019-11-14  2:32 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
@ 2019-11-14  2:32 ` Huazhong Tan
  2019-11-14  2:32 ` [PATCH net 2/3] net: hns3: reallocate SSU' buffer size when pfc_en changes Huazhong Tan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Huazhong Tan @ 2019-11-14  2:32 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	jakub.kicinski, Guangbin Huang, Huazhong Tan

From: Guangbin Huang <huangguangbin2@huawei.com>

Previously, hns3 driver just directly send specific setting bit
and mask bits of MAC VLAN switch parameter to the firmware, it
can not be compatible with the old firmware, because the old one
ignores mask bits and covers all bits with new setting bits.
So when running with old firmware, the communication between PF
and VF will fail after resetting or configuring spoof check, since
they will do the MAC VLAN switch parameter configuration.

This patch fixes this problem by reading switch parameter firstly,
then just modifies the corresponding bit and sends it to firmware.

Fixes: dd2956eab104 ("net: hns3: not allow SSU loopback while execute ethtool -t dev")
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 | 16 ++++++++++++++--
 1 file changed, 14 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 16f7d0e..c052bb3 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -6263,11 +6263,23 @@ static int hclge_config_switch_param(struct hclge_dev *hdev, int vfid,
 
 	func_id = hclge_get_port_number(HOST_PORT, 0, vfid, 0);
 	req = (struct hclge_mac_vlan_switch_cmd *)desc.data;
+
+	/* read current config parameter */
 	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MAC_VLAN_SWITCH_PARAM,
-				   false);
+				   true);
 	req->roce_sel = HCLGE_MAC_VLAN_NIC_SEL;
 	req->func_id = cpu_to_le32(func_id);
-	req->switch_param = switch_param;
+
+	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
+	if (ret) {
+		dev_err(&hdev->pdev->dev,
+			"read mac vlan switch parameter fail, ret = %d\n", ret);
+		return ret;
+	}
+
+	/* modify and write new config parameter */
+	hclge_cmd_reuse_desc(&desc, false);
+	req->switch_param = (req->switch_param & param_mask) | switch_param;
 	req->param_mask = param_mask;
 
 	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
-- 
2.7.4


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

* [PATCH net 2/3] net: hns3: reallocate SSU' buffer size when pfc_en changes
  2019-11-14  2:32 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
  2019-11-14  2:32 ` [PATCH net 1/3] net: hns3: add compatible handling for MAC VLAN switch parameter configuration Huazhong Tan
@ 2019-11-14  2:32 ` Huazhong Tan
  2019-11-14  2:32 ` [PATCH net 3/3] net: hns3: fix ETS bandwidth validation bug Huazhong Tan
  2019-11-15  2:06 ` [PATCH net 0/3] net: hns3: fixes for -net David Miller
  3 siblings, 0 replies; 13+ messages in thread
From: Huazhong Tan @ 2019-11-14  2:32 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	jakub.kicinski, Yunsheng Lin, Huazhong Tan

From: Yunsheng Lin <linyunsheng@huawei.com>

When a TC's PFC is disabled or enabled, the RX private buffer for
this TC need to be changed too, otherwise this may cause packet
dropped problem.

This patch fixes it by calling hclge_buffer_alloc to reallocate
buffer when pfc_en changes.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
index c063301..8b42cae 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
@@ -318,6 +318,7 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
 	struct net_device *netdev = h->kinfo.netdev;
 	struct hclge_dev *hdev = vport->back;
 	u8 i, j, pfc_map, *prio_tc;
+	int ret;
 
 	if (!(hdev->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) ||
 	    hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE)
@@ -347,7 +348,21 @@ static int hclge_ieee_setpfc(struct hnae3_handle *h, struct ieee_pfc *pfc)
 
 	hclge_tm_pfc_info_update(hdev);
 
-	return hclge_pause_setup_hw(hdev, false);
+	ret = hclge_pause_setup_hw(hdev, false);
+	if (ret)
+		return ret;
+
+	ret = hclge_notify_client(hdev, HNAE3_DOWN_CLIENT);
+	if (ret)
+		return ret;
+
+	ret = hclge_buffer_alloc(hdev);
+	if (ret) {
+		hclge_notify_client(hdev, HNAE3_UP_CLIENT);
+		return ret;
+	}
+
+	return hclge_notify_client(hdev, HNAE3_UP_CLIENT);
 }
 
 /* DCBX configuration */
-- 
2.7.4


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

* [PATCH net 3/3] net: hns3: fix ETS bandwidth validation bug
  2019-11-14  2:32 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
  2019-11-14  2:32 ` [PATCH net 1/3] net: hns3: add compatible handling for MAC VLAN switch parameter configuration Huazhong Tan
  2019-11-14  2:32 ` [PATCH net 2/3] net: hns3: reallocate SSU' buffer size when pfc_en changes Huazhong Tan
@ 2019-11-14  2:32 ` Huazhong Tan
  2019-11-15  2:06 ` [PATCH net 0/3] net: hns3: fixes for -net David Miller
  3 siblings, 0 replies; 13+ messages in thread
From: Huazhong Tan @ 2019-11-14  2:32 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	jakub.kicinski, Yonglong Liu, Huazhong Tan

From: Yonglong Liu <liuyonglong@huawei.com>

Some device only support 4 TCs, but the driver check the total
bandwidth of 8 TCs, so may cause wrong configurations write to
the hw.

This patch uses hdev->tc_max to instead HNAE3_MAX_TC to fix it.

Fixes: e432abfb99e5 ("net: hns3: add common validation in hclge_dcb")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
index 8b42cae..a1790af 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
@@ -124,7 +124,7 @@ static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets,
 	if (ret)
 		return ret;
 
-	for (i = 0; i < HNAE3_MAX_TC; i++) {
+	for (i = 0; i < hdev->tc_max; i++) {
 		switch (ets->tc_tsa[i]) {
 		case IEEE_8021QAZ_TSA_STRICT:
 			if (hdev->tm_info.tc_info[i].tc_sch_mode !=
-- 
2.7.4


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

* Re: [PATCH net 0/3] net: hns3: fixes for -net
  2019-11-14  2:32 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
                   ` (2 preceding siblings ...)
  2019-11-14  2:32 ` [PATCH net 3/3] net: hns3: fix ETS bandwidth validation bug Huazhong Tan
@ 2019-11-15  2:06 ` David Miller
  3 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2019-11-15  2:06 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	jakub.kicinski

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Thu, 14 Nov 2019 10:32:38 +0800

> This series includes misc fixes for the HNS3 ethernet driver.
> 
> [patch 1/3] adds a compatible handling for configuration of
> MAC VLAN swithch parameter.
> 
> [patch 2/3] re-allocates SSU buffer when pfc_en changed.
> 
> [patch 3/3] fixes a bug for ETS bandwidth validation.

Series applied.

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

* Re: [PATCH net 0/3] net: hns3: fixes for -net
  2021-02-09  9:03 Huazhong Tan
  2021-02-09 18:18 ` Jakub Kicinski
@ 2021-02-09 23:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 13+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-09 23:30 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, 9 Feb 2021 17:03:04 +0800 you wrote:
> The parameters sent from vf may be unreliable. If these
> parameters are used directly, memory overwriting may occur.
> 
> So this series adds some checks for this case.
> 
> Yufeng Mo (3):
>   net: hns3: add a check for queue_id in hclge_reset_vf_queue()
>   net: hns3: add a check for tqp_index in
>     hclge_get_ring_chain_from_mbx()
>   net: hns3: add a check for index in hclge_get_rss_key()
> 
> [...]

Here is the summary with links:
  - [net,1/3] net: hns3: add a check for queue_id in hclge_reset_vf_queue()
    https://git.kernel.org/netdev/net/c/67a69f84cab6
  - [net,2/3] net: hns3: add a check for tqp_index in hclge_get_ring_chain_from_mbx()
    https://git.kernel.org/netdev/net/c/326334aad024
  - [net,3/3] net: hns3: add a check for index in hclge_get_rss_key()
    https://git.kernel.org/netdev/net/c/532cfc0df1e4

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



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

* Re: [PATCH net 0/3] net: hns3: fixes for -net
  2021-02-09  9:03 Huazhong Tan
@ 2021-02-09 18:18 ` Jakub Kicinski
  2021-02-09 23:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 13+ messages in thread
From: Jakub Kicinski @ 2021-02-09 18:18 UTC (permalink / raw)
  To: Huazhong Tan
  Cc: davem, netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm

On Tue, 9 Feb 2021 17:03:04 +0800 Huazhong Tan wrote:
> The parameters sent from vf may be unreliable. If these
> parameters are used directly, memory overwriting may occur.

Acked-by: Jakub Kicinski <kuba@kernel.org>

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

* [PATCH net 0/3] net: hns3: fixes for -net
@ 2021-02-09  9:03 Huazhong Tan
  2021-02-09 18:18 ` Jakub Kicinski
  2021-02-09 23:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 13+ messages in thread
From: Huazhong Tan @ 2021-02-09  9:03 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm, Huazhong Tan

The parameters sent from vf may be unreliable. If these
parameters are used directly, memory overwriting may occur.

So this series adds some checks for this case.

Yufeng Mo (3):
  net: hns3: add a check for queue_id in hclge_reset_vf_queue()
  net: hns3: add a check for tqp_index in
    hclge_get_ring_chain_from_mbx()
  net: hns3: add a check for index in hclge_get_rss_key()

 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    |  7 ++++++
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 29 +++++++++++++++++++---
 2 files changed, 32 insertions(+), 4 deletions(-)

-- 
2.7.4


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

* Re: [PATCH net 0/3] net: hns3: fixes for -net
  2021-01-05  3:37 Huazhong Tan
@ 2021-01-06  0:47 ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2021-01-06  0:47 UTC (permalink / raw)
  To: tanhuazhong; +Cc: netdev, salil.mehta, yisen.zhuang, kuba, huangdaode

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Tue, 5 Jan 2021 11:37:25 +0800

> There are some bugfixes for the HNS3 ethernet driver.

Series applies and queued up for -stable, thanks

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

* [PATCH net 0/3] net: hns3: fixes for -net
@ 2021-01-05  3:37 Huazhong Tan
  2021-01-06  0:47 ` David Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Huazhong Tan @ 2021-01-05  3:37 UTC (permalink / raw)
  To: davem; +Cc: netdev, salil.mehta, yisen.zhuang, kuba, huangdaode, Huazhong Tan

There are some bugfixes for the HNS3 ethernet driver.

Jian Shen (1):
  net: hns3: fix incorrect handling of sctp6 rss tuple

Yonglong Liu (1):
  net: hns3: fix a phy loopback fail issue

Yufeng Mo (1):
  net: hns3: fix the number of queues actually used by ARQ

 drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h           | 4 ++--
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c   | 9 ++++++---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h   | 2 ++
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 9 ++++++---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 2 ++
 5 files changed, 18 insertions(+), 8 deletions(-)

-- 
2.7.4


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

* Re: [PATCH net 0/3] net: hns3: fixes for -net
  2020-02-14  1:53 Huazhong Tan
@ 2020-02-14 15:05 ` David Miller
  0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2020-02-14 15:05 UTC (permalink / raw)
  To: tanhuazhong
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, huangdaode,
	linuxarm, kuba

From: Huazhong Tan <tanhuazhong@huawei.com>
Date: Fri, 14 Feb 2020 09:53:40 +0800

> This series includes three bugfixes for the HNS3 ethernet driver.
> 
> [patch 1] fixes a management table lost issue after IMP reset.
> [patch 2] fixes a VF bandwidth configuration not work problem.
> [patch 3] fixes a problem related to IPv6 address copying.

Series applied.

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

* [PATCH net 0/3] net: hns3: fixes for -net
@ 2020-02-14  1:53 Huazhong Tan
  2020-02-14 15:05 ` David Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Huazhong Tan @ 2020-02-14  1:53 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, huangdaode,
	linuxarm, kuba, Huazhong Tan

This series includes three bugfixes for the HNS3 ethernet driver.

[patch 1] fixes a management table lost issue after IMP reset.
[patch 2] fixes a VF bandwidth configuration not work problem.
[patch 3] fixes a problem related to IPv6 address copying.

Guangbin Huang (1):
  net: hns3: fix a copying IPv6 address error in
    hclge_fd_get_flow_tuples()

Yonglong Liu (1):
  net: hns3: fix VF bandwidth does not take effect in some case

Yufeng Mo (1):
  net: hns3: add management table after IMP reset

 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 22 ++++++++++++++++------
 .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c  |  2 +-
 2 files changed, 17 insertions(+), 7 deletions(-)

-- 
2.7.4


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

* [PATCH net 0/3] net: hns3: fixes for -net
@ 2019-12-03  3:08 Huazhong Tan
  0 siblings, 0 replies; 13+ messages in thread
From: Huazhong Tan @ 2019-12-03  3:08 UTC (permalink / raw)
  To: davem
  Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
	jakub.kicinski, Huazhong Tan

This series includes misc fixes for the HNS3 ethernet driver.

[patch 1/3] fixes a TX queue not restarted problem.

[patch 2/3] fixes a use-after-free issue.

[patch 3/3] fixes a VF ID issue for setting VF VLAN.


Jian Shen (1):
  net: hns3: fix VF ID issue for setting VF VLAN

Yunsheng Lin (2):
  net: hns3: fix for TX queue not restarted problem
  net: hns3: fix a use after free problem in hns3_nic_maybe_stop_tx()

 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c    | 53 ++++++++++++----------
 .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 18 +++-----
 2 files changed, 34 insertions(+), 37 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2021-02-10  0:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14  2:32 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
2019-11-14  2:32 ` [PATCH net 1/3] net: hns3: add compatible handling for MAC VLAN switch parameter configuration Huazhong Tan
2019-11-14  2:32 ` [PATCH net 2/3] net: hns3: reallocate SSU' buffer size when pfc_en changes Huazhong Tan
2019-11-14  2:32 ` [PATCH net 3/3] net: hns3: fix ETS bandwidth validation bug Huazhong Tan
2019-11-15  2:06 ` [PATCH net 0/3] net: hns3: fixes for -net David Miller
2019-12-03  3:08 Huazhong Tan
2020-02-14  1:53 Huazhong Tan
2020-02-14 15:05 ` David Miller
2021-01-05  3:37 Huazhong Tan
2021-01-06  0:47 ` David Miller
2021-02-09  9:03 Huazhong Tan
2021-02-09 18:18 ` Jakub Kicinski
2021-02-09 23:30 ` patchwork-bot+netdevbpf

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