netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] net: hns3: fixes for -net
@ 2021-04-30  9:06 Huazhong Tan
  2021-04-30  9:06 ` [PATCH net-next 1/4] net: hns3: fix for vxlan gpe tx checksum bug Huazhong Tan
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Huazhong Tan @ 2021-04-30  9:06 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	linuxarm, Huazhong Tan

This series adds some bugfixes for the HNS3 ethernet driver.

Hao Chen (1):
  net: hns3: fix for vxlan gpe tx checksum bug

Peng Li (1):
  net: hns3: use netif_tx_disable to stop the transmit queue

Yufeng Mo (2):
  net: hns3: clear unnecessary reset request in hclge_reset_rebuild
  net: hns3: disable phy loopback setting in hclge_mac_start_phy

 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c         | 7 ++++---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 ++++++
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 2 ++
 3 files changed, 12 insertions(+), 3 deletions(-)

-- 
2.7.4


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

* [PATCH net-next 1/4] net: hns3: fix for vxlan gpe tx checksum bug
  2021-04-30  9:06 [PATCH net-next 0/4] net: hns3: fixes for -net Huazhong Tan
@ 2021-04-30  9:06 ` Huazhong Tan
  2021-04-30  9:06 ` [PATCH net-next 2/4] net: hns3: use netif_tx_disable to stop the transmit queue Huazhong Tan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Huazhong Tan @ 2021-04-30  9:06 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	linuxarm, Hao Chen, Huazhong Tan

From: Hao Chen <chenhao288@hisilicon.com>

When skb->ip_summed is CHECKSUM_PARTIAL, for non-tunnel udp packet,
which has a dest port as the IANA assigned, the hardware is expected
to do the checksum offload, but the hardware whose version is below
V3 will not do the checksum offload when udp dest port is 4790.

So fixes it by doing the checksum in software for this case.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 5dc6de5..a2b9a8a 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -824,7 +824,7 @@ static int hns3_get_l4_protocol(struct sk_buff *skb, u8 *ol4_proto,
  * and it is udp packet, which has a dest port as the IANA assigned.
  * the hardware is expected to do the checksum offload, but the
  * hardware will not do the checksum offload when udp dest port is
- * 4789 or 6081.
+ * 4789, 4790 or 6081.
  */
 static bool hns3_tunnel_csum_bug(struct sk_buff *skb)
 {
@@ -842,7 +842,8 @@ static bool hns3_tunnel_csum_bug(struct sk_buff *skb)
 
 	if (!(!skb->encapsulation &&
 	      (l4.udp->dest == htons(IANA_VXLAN_UDP_PORT) ||
-	      l4.udp->dest == htons(GENEVE_UDP_PORT))))
+	      l4.udp->dest == htons(GENEVE_UDP_PORT) ||
+	      l4.udp->dest == htons(4790))))
 		return false;
 
 	skb_checksum_help(skb);
-- 
2.7.4


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

* [PATCH net-next 2/4] net: hns3: use netif_tx_disable to stop the transmit queue
  2021-04-30  9:06 [PATCH net-next 0/4] net: hns3: fixes for -net Huazhong Tan
  2021-04-30  9:06 ` [PATCH net-next 1/4] net: hns3: fix for vxlan gpe tx checksum bug Huazhong Tan
@ 2021-04-30  9:06 ` Huazhong Tan
  2021-04-30  9:06 ` [PATCH net-next 3/4] net: hns3: clear unnecessary reset request in hclge_reset_rebuild Huazhong Tan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Huazhong Tan @ 2021-04-30  9:06 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	linuxarm, Peng Li, Huazhong Tan

From: Peng Li <lipeng321@huawei.com>

Currently, netif_tx_stop_all_queues() is used to ensure that
the xmit is not running, but for the concurrent case it will
not take effect, since netif_tx_stop_all_queues() just sets
a flag without locking to indicate that the xmit queue(s)
should not be run.

So use netif_tx_disable() to replace netif_tx_stop_all_queues(),
it takes the xmit queue lock while marking the queue stopped.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index a2b9a8a..783fdaf 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -575,8 +575,8 @@ static int hns3_nic_net_stop(struct net_device *netdev)
 	if (h->ae_algo->ops->set_timer_task)
 		h->ae_algo->ops->set_timer_task(priv->ae_handle, false);
 
-	netif_tx_stop_all_queues(netdev);
 	netif_carrier_off(netdev);
+	netif_tx_disable(netdev);
 
 	hns3_nic_net_down(netdev);
 
-- 
2.7.4


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

* [PATCH net-next 3/4] net: hns3: clear unnecessary reset request in hclge_reset_rebuild
  2021-04-30  9:06 [PATCH net-next 0/4] net: hns3: fixes for -net Huazhong Tan
  2021-04-30  9:06 ` [PATCH net-next 1/4] net: hns3: fix for vxlan gpe tx checksum bug Huazhong Tan
  2021-04-30  9:06 ` [PATCH net-next 2/4] net: hns3: use netif_tx_disable to stop the transmit queue Huazhong Tan
@ 2021-04-30  9:06 ` Huazhong Tan
  2021-04-30  9:06 ` [PATCH net-next 4/4] net: hns3: disable phy loopback setting in hclge_mac_start_phy Huazhong Tan
  2021-04-30 22:00 ` [PATCH net-next 0/4] net: hns3: fixes for -net patchwork-bot+netdevbpf
  4 siblings, 0 replies; 8+ messages in thread
From: Huazhong Tan @ 2021-04-30  9:06 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	linuxarm, Yufeng Mo, Huazhong Tan

From: Yufeng Mo <moyufeng@huawei.com>

HW error and global reset are reported through MSIX interrupts.
The same error may be reported to different functions at the
same time. When global reset begins, the pending reset request
set by this error is unnecessary. So clear the pending reset
request after the reset is complete to avoid the repeated reset.

Fixes: f6162d44126c ("net: hns3: add handling of hw errors reported through MSIX")
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index c296ab6..6304aed 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -3978,6 +3978,12 @@ static void hclge_update_reset_level(struct hclge_dev *hdev)
 	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev);
 	enum hnae3_reset_type reset_level;
 
+	/* reset request will not be set during reset, so clear
+	 * pending reset request to avoid unnecessary reset
+	 * caused by the same reason.
+	 */
+	hclge_get_reset_level(ae_dev, &hdev->reset_request);
+
 	/* if default_reset_request has a higher level reset request,
 	 * it should be handled as soon as possible. since some errors
 	 * need this kind of reset to fix.
-- 
2.7.4


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

* [PATCH net-next 4/4] net: hns3: disable phy loopback setting in hclge_mac_start_phy
  2021-04-30  9:06 [PATCH net-next 0/4] net: hns3: fixes for -net Huazhong Tan
                   ` (2 preceding siblings ...)
  2021-04-30  9:06 ` [PATCH net-next 3/4] net: hns3: clear unnecessary reset request in hclge_reset_rebuild Huazhong Tan
@ 2021-04-30  9:06 ` Huazhong Tan
  2021-04-30 12:52   ` Andrew Lunn
  2021-04-30 22:00 ` [PATCH net-next 0/4] net: hns3: fixes for -net patchwork-bot+netdevbpf
  4 siblings, 1 reply; 8+ messages in thread
From: Huazhong Tan @ 2021-04-30  9:06 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, salil.mehta, yisen.zhuang, huangdaode, linuxarm,
	linuxarm, Yufeng Mo, Huazhong Tan

From: Yufeng Mo <moyufeng@huawei.com>

If selftest and reset are performed at the same time, the phy
loopback setting may be still in enable state after the reset,
and device cannot link up. So fix this issue by disabling phy
loopback before phy_start().

Fixes: 256727da7395 ("net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC")
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
index 08e88d9..1231c34 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
@@ -255,6 +255,8 @@ void hclge_mac_start_phy(struct hclge_dev *hdev)
 	if (!phydev)
 		return;
 
+	phy_loopback(phydev, false);
+
 	phy_start(phydev);
 }
 
-- 
2.7.4


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

* Re: [PATCH net-next 4/4] net: hns3: disable phy loopback setting in hclge_mac_start_phy
  2021-04-30  9:06 ` [PATCH net-next 4/4] net: hns3: disable phy loopback setting in hclge_mac_start_phy Huazhong Tan
@ 2021-04-30 12:52   ` Andrew Lunn
  2021-05-04  7:38     ` Huazhong Tan
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2021-04-30 12:52 UTC (permalink / raw)
  To: Huazhong Tan
  Cc: davem, kuba, netdev, salil.mehta, yisen.zhuang, huangdaode,
	linuxarm, linuxarm, Yufeng Mo

On Fri, Apr 30, 2021 at 05:06:22PM +0800, Huazhong Tan wrote:
> From: Yufeng Mo <moyufeng@huawei.com>
> 
> If selftest and reset are performed at the same time, the phy
> loopback setting may be still in enable state after the reset,
> and device cannot link up. So fix this issue by disabling phy
> loopback before phy_start().

This sounds like a generic problem, not specific to your
driver. Please look at solving this within phy_start().

	Andrew

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

* Re: [PATCH net-next 0/4] net: hns3: fixes for -net
  2021-04-30  9:06 [PATCH net-next 0/4] net: hns3: fixes for -net Huazhong Tan
                   ` (3 preceding siblings ...)
  2021-04-30  9:06 ` [PATCH net-next 4/4] net: hns3: disable phy loopback setting in hclge_mac_start_phy Huazhong Tan
@ 2021-04-30 22:00 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-30 22:00 UTC (permalink / raw)
  To: Huazhong Tan
  Cc: davem, kuba, netdev, salil.mehta, yisen.zhuang, huangdaode,
	linuxarm, linuxarm

Hello:

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

On Fri, 30 Apr 2021 17:06:18 +0800 you wrote:
> This series adds some bugfixes for the HNS3 ethernet driver.
> 
> Hao Chen (1):
>   net: hns3: fix for vxlan gpe tx checksum bug
> 
> Peng Li (1):
>   net: hns3: use netif_tx_disable to stop the transmit queue
> 
> [...]

Here is the summary with links:
  - [net-next,1/4] net: hns3: fix for vxlan gpe tx checksum bug
    https://git.kernel.org/netdev/net/c/905416f18fe7
  - [net-next,2/4] net: hns3: use netif_tx_disable to stop the transmit queue
    https://git.kernel.org/netdev/net/c/b416e872be06
  - [net-next,3/4] net: hns3: clear unnecessary reset request in hclge_reset_rebuild
    https://git.kernel.org/netdev/net/c/8c9200e38772
  - [net-next,4/4] net: hns3: disable phy loopback setting in hclge_mac_start_phy
    https://git.kernel.org/netdev/net/c/472497d0bdae

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

* Re: [PATCH net-next 4/4] net: hns3: disable phy loopback setting in hclge_mac_start_phy
  2021-04-30 12:52   ` Andrew Lunn
@ 2021-05-04  7:38     ` Huazhong Tan
  0 siblings, 0 replies; 8+ messages in thread
From: Huazhong Tan @ 2021-05-04  7:38 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: davem, kuba, netdev, salil.mehta, yisen.zhuang, huangdaode,
	linuxarm, linuxarm, Yufeng Mo


On 2021/4/30 20:52, Andrew Lunn wrote:
> On Fri, Apr 30, 2021 at 05:06:22PM +0800, Huazhong Tan wrote:
>> From: Yufeng Mo <moyufeng@huawei.com>
>>
>> If selftest and reset are performed at the same time, the phy
>> loopback setting may be still in enable state after the reset,
>> and device cannot link up. So fix this issue by disabling phy
>> loopback before phy_start().
> This sounds like a generic problem, not specific to your
> driver. Please look at solving this within phy_start().
>
> 	Andrew


I will try to send another patch to do that.

thanks.


> .


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

end of thread, other threads:[~2021-05-04  7:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-30  9:06 [PATCH net-next 0/4] net: hns3: fixes for -net Huazhong Tan
2021-04-30  9:06 ` [PATCH net-next 1/4] net: hns3: fix for vxlan gpe tx checksum bug Huazhong Tan
2021-04-30  9:06 ` [PATCH net-next 2/4] net: hns3: use netif_tx_disable to stop the transmit queue Huazhong Tan
2021-04-30  9:06 ` [PATCH net-next 3/4] net: hns3: clear unnecessary reset request in hclge_reset_rebuild Huazhong Tan
2021-04-30  9:06 ` [PATCH net-next 4/4] net: hns3: disable phy loopback setting in hclge_mac_start_phy Huazhong Tan
2021-04-30 12:52   ` Andrew Lunn
2021-05-04  7:38     ` Huazhong Tan
2021-04-30 22:00 ` [PATCH net-next 0/4] net: hns3: fixes for -net 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).