netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/5] There are some bugfix for the HNS3 ethernet driver
@ 2023-09-15  9:53 Jijie Shao
  2023-09-15  9:53 ` [PATCH net 1/5] net: hns3: add cmdq check for vf periodic service task Jijie Shao
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Jijie Shao @ 2023-09-15  9:53 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev,
	linux-kernel

There are some bugfix for the HNS3 ethernet driver

Jian Shen (1):
  net: hns3: only enable unicast promisc when mac table full

Jie Wang (3):
  net: hns3: add cmdq check for vf periodic service task
  net: hns3: fix GRE checksum offload issue
  net: hns3: add 5ms delay before clear firmware reset irq source

Jijie Shao (1):
  net: hns3: fix fail to delete tc flower rules during reset issue

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

-- 
2.30.0


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

* [PATCH net 1/5] net: hns3: add cmdq check for vf periodic service task
  2023-09-15  9:53 [PATCH net 0/5] There are some bugfix for the HNS3 ethernet driver Jijie Shao
@ 2023-09-15  9:53 ` Jijie Shao
  2023-09-16 15:34   ` Simon Horman
  2023-09-15  9:53 ` [PATCH net 2/5] net: hns3: fix GRE checksum offload issue Jijie Shao
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Jijie Shao @ 2023-09-15  9:53 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev,
	linux-kernel

From: Jie Wang <wangjie125@huawei.com>

When the vf cmdq is disabled, there is no need to keep these task running.
So this patch skip these task when the cmdq is disabled.

Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 7a2f9233d695..a4d68fb216fb 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -1855,7 +1855,8 @@ static void hclgevf_periodic_service_task(struct hclgevf_dev *hdev)
 	unsigned long delta = round_jiffies_relative(HZ);
 	struct hnae3_handle *handle = &hdev->nic;
 
-	if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state))
+	if (test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state) ||
+	    test_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state))
 		return;
 
 	if (time_is_after_jiffies(hdev->last_serv_processed + HZ)) {
-- 
2.30.0


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

* [PATCH net 2/5] net: hns3: fix GRE checksum offload issue
  2023-09-15  9:53 [PATCH net 0/5] There are some bugfix for the HNS3 ethernet driver Jijie Shao
  2023-09-15  9:53 ` [PATCH net 1/5] net: hns3: add cmdq check for vf periodic service task Jijie Shao
@ 2023-09-15  9:53 ` Jijie Shao
  2023-09-15  9:53 ` [PATCH net 3/5] net: hns3: only enable unicast promisc when mac table full Jijie Shao
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Jijie Shao @ 2023-09-15  9:53 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev,
	linux-kernel

From: Jie Wang <wangjie125@huawei.com>

The device_version V3 hardware can't offload the checksum for IP in GRE
packets, but can do it for NvGRE. So default to disable the checksum and
GSO offload for GRE, but keep the ability to enable it when only using
NvGRE.

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

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index b4895c7b3efd..cf50368441b7 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3353,6 +3353,15 @@ static void hns3_set_default_feature(struct net_device *netdev)
 		  NETIF_F_HW_TC);
 
 	netdev->hw_enc_features |= netdev->vlan_features | NETIF_F_TSO_MANGLEID;
+
+	/* The device_version V3 hardware can't offload the checksum for IP in
+	 * GRE packets, but can do it for NvGRE. So default to disable the
+	 * checksum and GSO offload for GRE.
+	 */
+	if (ae_dev->dev_version > HNAE3_DEVICE_VERSION_V2) {
+		netdev->features &= ~NETIF_F_GSO_GRE;
+		netdev->features &= ~NETIF_F_GSO_GRE_CSUM;
+	}
 }
 
 static int hns3_alloc_buffer(struct hns3_enet_ring *ring,
-- 
2.30.0


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

* [PATCH net 3/5] net: hns3: only enable unicast promisc when mac table full
  2023-09-15  9:53 [PATCH net 0/5] There are some bugfix for the HNS3 ethernet driver Jijie Shao
  2023-09-15  9:53 ` [PATCH net 1/5] net: hns3: add cmdq check for vf periodic service task Jijie Shao
  2023-09-15  9:53 ` [PATCH net 2/5] net: hns3: fix GRE checksum offload issue Jijie Shao
@ 2023-09-15  9:53 ` Jijie Shao
  2023-09-15  9:53 ` [PATCH net 4/5] net: hns3: fix fail to delete tc flower rules during reset issue Jijie Shao
  2023-09-15  9:53 ` [PATCH net 5/5] net: hns3: add 5ms delay before clear firmware reset irq source Jijie Shao
  4 siblings, 0 replies; 8+ messages in thread
From: Jijie Shao @ 2023-09-15  9:53 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev,
	linux-kernel

From: Jian Shen <shenjian15@huawei.com>

Currently, the driver will enable unicast promisc for the function
once configure mac address fail. It's unreasonable when the failure
is caused by using same mac address with other functions. So only
enable unicast promisc when mac table full.

Fixes: c631c696823c ("net: hns3: refactor the promisc mode setting")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +-
 1 file changed, 1 insertion(+), 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 8ca368424436..c0d03283775f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -8824,7 +8824,7 @@ static void hclge_update_overflow_flags(struct hclge_vport *vport,
 	if (mac_type == HCLGE_MAC_ADDR_UC) {
 		if (is_all_added)
 			vport->overflow_promisc_flags &= ~HNAE3_OVERFLOW_UPE;
-		else
+		else if (hclge_is_umv_space_full(vport, true))
 			vport->overflow_promisc_flags |= HNAE3_OVERFLOW_UPE;
 	} else {
 		if (is_all_added)
-- 
2.30.0


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

* [PATCH net 4/5] net: hns3: fix fail to delete tc flower rules during reset issue
  2023-09-15  9:53 [PATCH net 0/5] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (2 preceding siblings ...)
  2023-09-15  9:53 ` [PATCH net 3/5] net: hns3: only enable unicast promisc when mac table full Jijie Shao
@ 2023-09-15  9:53 ` Jijie Shao
  2023-09-15  9:53 ` [PATCH net 5/5] net: hns3: add 5ms delay before clear firmware reset irq source Jijie Shao
  4 siblings, 0 replies; 8+ messages in thread
From: Jijie Shao @ 2023-09-15  9:53 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev,
	linux-kernel

Firmware does not respond driver commands during reset
Therefore, rule will fail to delete while the firmware is resetting

So, if failed to delete rule, set rule state to TO_DEL,
and the rule will be deleted when periodic task being scheduled.

Fixes: 0205ec041ec6 ("net: hns3: add support for hw tc offload of tc flower")
Signed-off-by: Jijie Shao <shaojijie@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 c0d03283775f..2bd77871f3bf 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -7348,6 +7348,12 @@ static int hclge_del_cls_flower(struct hnae3_handle *handle,
 	ret = hclge_fd_tcam_config(hdev, HCLGE_FD_STAGE_1, true, rule->location,
 				   NULL, false);
 	if (ret) {
+		/* if tcam config fail, set rule state to TO_DEL,
+		 * so the rule will be deleted when periodic
+		 * task being scheduled.
+		 */
+		hclge_update_fd_list(hdev, HCLGE_FD_TO_DEL, rule->location, NULL);
+		set_bit(HCLGE_STATE_FD_TBL_CHANGED, &hdev->state);
 		spin_unlock_bh(&hdev->fd_rule_lock);
 		return ret;
 	}
-- 
2.30.0


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

* [PATCH net 5/5] net: hns3: add 5ms delay before clear firmware reset irq source
  2023-09-15  9:53 [PATCH net 0/5] There are some bugfix for the HNS3 ethernet driver Jijie Shao
                   ` (3 preceding siblings ...)
  2023-09-15  9:53 ` [PATCH net 4/5] net: hns3: fix fail to delete tc flower rules during reset issue Jijie Shao
@ 2023-09-15  9:53 ` Jijie Shao
  2023-09-16 15:31   ` Simon Horman
  4 siblings, 1 reply; 8+ messages in thread
From: Jijie Shao @ 2023-09-15  9:53 UTC (permalink / raw)
  To: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni
  Cc: shenjian15, wangjie125, liuyonglong, shaojijie, netdev,
	linux-kernel

From: Jie Wang <wangjie125@huawei.com>

Currently the reset process in hns3 and firmware watchdog init process is
asynchronous. we think firmware watchdog initialization is completed
before hns3 clear the firmware interrupt source. However, firmware
initialization may not complete early.

so we add delay before hns3 clear firmware interrupt source and 5 ms delay
is enough to avoid second firmware reset interrupt.

Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 2bd77871f3bf..c42574e29747 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -3564,9 +3564,14 @@ static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval)
 static void hclge_clear_event_cause(struct hclge_dev *hdev, u32 event_type,
 				    u32 regclr)
 {
+#define HCLGE_IMP_RESET_DELAY		5
+
 	switch (event_type) {
 	case HCLGE_VECTOR0_EVENT_PTP:
 	case HCLGE_VECTOR0_EVENT_RST:
+		if (regclr == BIT(HCLGE_VECTOR0_IMPRESET_INT_B))
+			mdelay(HCLGE_IMP_RESET_DELAY);
+
 		hclge_write_dev(&hdev->hw, HCLGE_MISC_RESET_STS_REG, regclr);
 		break;
 	case HCLGE_VECTOR0_EVENT_MBX:
-- 
2.30.0


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

* Re: [PATCH net 5/5] net: hns3: add 5ms delay before clear firmware reset irq source
  2023-09-15  9:53 ` [PATCH net 5/5] net: hns3: add 5ms delay before clear firmware reset irq source Jijie Shao
@ 2023-09-16 15:31   ` Simon Horman
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2023-09-16 15:31 UTC (permalink / raw)
  To: Jijie Shao
  Cc: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni,
	shenjian15, wangjie125, liuyonglong, netdev, linux-kernel

On Fri, Sep 15, 2023 at 05:53:05PM +0800, Jijie Shao wrote:
> From: Jie Wang <wangjie125@huawei.com>
> 
> Currently the reset process in hns3 and firmware watchdog init process is
> asynchronous. we think firmware watchdog initialization is completed
> before hns3 clear the firmware interrupt source. However, firmware
> initialization may not complete early.
> 
> so we add delay before hns3 clear firmware interrupt source and 5 ms delay
> is enough to avoid second firmware reset interrupt.
> 
> Signed-off-by: Jie Wang <wangjie125@huawei.com>
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>

Hi Jijie Shao,

is it appropriate to add the following tag?

Fixes: c1a81619d73a ("net: hns3: Add mailbox interrupt handling to PF driver")

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

* Re: [PATCH net 1/5] net: hns3: add cmdq check for vf periodic service task
  2023-09-15  9:53 ` [PATCH net 1/5] net: hns3: add cmdq check for vf periodic service task Jijie Shao
@ 2023-09-16 15:34   ` Simon Horman
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2023-09-16 15:34 UTC (permalink / raw)
  To: Jijie Shao
  Cc: yisen.zhuang, salil.mehta, davem, edumazet, kuba, pabeni,
	shenjian15, wangjie125, liuyonglong, netdev, linux-kernel

On Fri, Sep 15, 2023 at 05:53:01PM +0800, Jijie Shao wrote:
> From: Jie Wang <wangjie125@huawei.com>
> 
> When the vf cmdq is disabled, there is no need to keep these task running.
> So this patch skip these task when the cmdq is disabled.
> 
> Signed-off-by: Jie Wang <wangjie125@huawei.com>
> Signed-off-by: Jijie Shao <shaojijie@huawei.com>

Hi Jinjie Shao,

if this is a fix then it's probably appropriate to include a Fixes tag.

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

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

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-15  9:53 [PATCH net 0/5] There are some bugfix for the HNS3 ethernet driver Jijie Shao
2023-09-15  9:53 ` [PATCH net 1/5] net: hns3: add cmdq check for vf periodic service task Jijie Shao
2023-09-16 15:34   ` Simon Horman
2023-09-15  9:53 ` [PATCH net 2/5] net: hns3: fix GRE checksum offload issue Jijie Shao
2023-09-15  9:53 ` [PATCH net 3/5] net: hns3: only enable unicast promisc when mac table full Jijie Shao
2023-09-15  9:53 ` [PATCH net 4/5] net: hns3: fix fail to delete tc flower rules during reset issue Jijie Shao
2023-09-15  9:53 ` [PATCH net 5/5] net: hns3: add 5ms delay before clear firmware reset irq source Jijie Shao
2023-09-16 15:31   ` Simon Horman

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