net: hns3: fix some bug for hns3
Subsystems (4)
cover net: hns3: fix some bug for hns3
There are some bugfixes for the HNS3 ethernet driver. patch#1 fix miss checking for rx packet. patch#2 fixes VF promisc mode not update when mac table full bug, and patch#3 fixes a nterrupts not initialization in VF FLR bug.
Jian Shen (2):
net: hns3: fix miss L3E checking for rx packet
net: hns3: fix VF promisc mode not update when mac table full
Jie Wang (1):
net: hns3: add interrupts re-initialization while doing VF FLR
.../net/ethernet/hisilicon/hns3/hns3_enet.c | 10 +-- .../hisilicon/hns3/hns3pf/hclge_main.c | 75 +++++++++++-------- .../hisilicon/hns3/hns3vf/hclgevf_main.c | 3 +- 3 files changed, 49 insertions(+), 39 deletions(-)
Signature · 1 line
2.30.0
PATCH 1/3 net: hns3: add interrupts re-initialization while doing VF FLR
From: Jie Wang <[email protected]>
Currently keep alive message between PF and VF may be lost and the VF is unalive in PF. So the VF will not do reset during PF FLR reset process. This would make the allocated interrupt resources of VF invalid and VF would't receive or respond to PF any more.
So this patch adds VF interrupts re-initialization during VF FLR for VF recovery in above cases.
--- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +2 -1
@@ -2767,7 +2767,8 @@ static int hclgevf_pci_reset(struct hclgevf_dev *hdev)struct pci_dev *pdev = hdev->pdev;int ret =0 ; -if (hdev->reset_type ==HNAE3_VF_FULL_RESET && +if ((hdev->reset_type ==HNAE3_VF_FULL_RESET || + hdev->reset_type ==HNAE3_FLR_RESET ) &&test_bit (HCLGEVF_STATE_IRQ_INITED , &hdev->state)) {hclgevf_misc_irq_uninit (hdev);hclgevf_uninit_msi (hdev);
Signature · 1 line
2.30.0
PATCH 2/3 net: hns3: fix miss L3E checking for rx packet
In reply to Hao LanFrom: Jian Shen <[email protected]>
For device supports RXD advanced layout, the driver will return directly if the hardware finish the checksum calculate. It cause missing L3E checking for ip packets. Fixes it.
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +4 -6
@@ -3855,18 +3855,16 @@ static int hns3_gro_complete(struct sk_buff *skb, u32 l234info)return 0 ; } -static bool hns3_checksum_complete (struct hns3_enet_ring *ring, +static void hns3_checksum_complete (struct hns3_enet_ring *ring,struct sk_buff *skb,u32 ptype,u16 csum) {if (ptype ==HNS3_INVALID_PTYPE || hns3_rx_ptype_tbl[ptype].ip_summed !=CHECKSUM_COMPLETE ) -return false; +return ;hns3_ring_stats_update (ring, csum_complete); skb->ip_summed =CHECKSUM_COMPLETE ; skb->csum =csum_unfold ((__force __sum16 )csum); - -return true; } static void hns3_rx_handle_csum(struct sk_buff *skb, u32 l234info,
@@ -3926,8 +3924,7 @@ static void hns3_rx_checksum(struct hns3_enet_ring *ring, struct sk_buff *skb, ptype =hnae3_get_field (ol_info,HNS3_RXD_PTYPE_M ,HNS3_RXD_PTYPE_S ); -if (hns3_checksum_complete (ring, skb, ptype, csum)) -return ; +hns3_checksum_complete (ring, skb, ptype, csum);/* check if hardware has done checksum */ if (!(bd_base_info &BIT (HNS3_RXD_L3L4P_B )))
@@ -3936,6 +3933,7 @@ static void hns3_rx_checksum(struct hns3_enet_ring *ring, struct sk_buff *skb,if (unlikely (l234info & (BIT (HNS3_RXD_L3E_B ) |BIT (HNS3_RXD_L4E_B ) |BIT (HNS3_RXD_OL3E_B ) |BIT (HNS3_RXD_OL4E_B )))) { + skb->ip_summed =CHECKSUM_NONE ;hns3_ring_stats_update (ring, l3l4_csum_err);return ;
Signature · 1 line
2.30.0
PATCH 3/3 net: hns3: fix VF promisc mode not update when mac table full
In reply to Hao LanFrom: Jian Shen <[email protected]>
Currently, it missed set HCLGE_VPORT_STATE_PROMISC_CHANGE flag for VF when vport->overflow_promisc_flags changed. So the VF won't check whether to update promisc mode in this case. So add it.
--- .../hisilicon/hns3/hns3pf/hclge_main.c | 75 +++++++++++-------- 1 file changed, 43 insertions(+), 32 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +43 -32
@@ -12754,60 +12754,71 @@ static int hclge_gro_en(struct hnae3_handle *handle, bool enable)return ret; } -static void hclge_sync_promisc_mode (struct hclge_dev *hdev) +static int hclge_sync_vport_promisc_mode (struct hclge_vport *vport) { -struct hclge_vport *vport = &hdev->vport[0 ];struct hnae3_handle *handle = &vport->nic; +struct hclge_dev *hdev = vport->back; +bool uc_en = false; +bool mc_en = false;u8 tmp_flags; +bool bc_en;int ret; -u16 i;if (vport->last_promisc_flags != vport->overflow_promisc_flags) {set_bit (HCLGE_VPORT_STATE_PROMISC_CHANGE , &vport->state); vport->last_promisc_flags = vport->overflow_promisc_flags; } -if (test_bit (HCLGE_VPORT_STATE_PROMISC_CHANGE , &vport->state)) { +if (!test_and_clear_bit (HCLGE_VPORT_STATE_PROMISC_CHANGE , + &vport->state)) +return 0 ; + +/* for PF */ +if (!vport->vport_id) { tmp_flags = handle->netdev_flags | vport->last_promisc_flags; ret =hclge_set_promisc_mode (handle, tmp_flags &HNAE3_UPE , tmp_flags &HNAE3_MPE ); -if (!ret) { -clear_bit (HCLGE_VPORT_STATE_PROMISC_CHANGE , - &vport->state); +if (!ret)set_bit (HCLGE_VPORT_STATE_VLAN_FLTR_CHANGE , &vport->state); - } +else +set_bit (HCLGE_VPORT_STATE_PROMISC_CHANGE , + &vport->state); +return ret; } -for (i =1 ; i < hdev->num_alloc_vport; i++) { -bool uc_en = false; -bool mc_en = false; -bool bc_en; +/* for VF */ +if (vport->vf_info.trusted) { + uc_en = vport->vf_info.request_uc_en >0 || + vport->overflow_promisc_flags &HNAE3_OVERFLOW_UPE ; + mc_en = vport->vf_info.request_mc_en >0 || + vport->overflow_promisc_flags &HNAE3_OVERFLOW_MPE ; + } + bc_en = vport->vf_info.request_bc_en >0 ; - vport = &hdev->vport[i]; + ret =hclge_cmd_set_promisc_mode (hdev, vport->vport_id, uc_en, + mc_en, bc_en); +if (ret) { +set_bit (HCLGE_VPORT_STATE_PROMISC_CHANGE , &vport->state); +return ret; + } +hclge_set_vport_vlan_fltr_change (vport); -if (!test_and_clear_bit (HCLGE_VPORT_STATE_PROMISC_CHANGE , - &vport->state)) -continue ; +return 0 ; +} -if (vport->vf_info.trusted) { - uc_en = vport->vf_info.request_uc_en >0 || - vport->overflow_promisc_flags & -HNAE3_OVERFLOW_UPE ; - mc_en = vport->vf_info.request_mc_en >0 || - vport->overflow_promisc_flags & -HNAE3_OVERFLOW_MPE ; - } - bc_en = vport->vf_info.request_bc_en >0 ; +static void hclge_sync_promisc_mode (struct hclge_dev *hdev) +{ +struct hclge_vport *vport; +int ret; +u16 i; - ret =hclge_cmd_set_promisc_mode (hdev, vport->vport_id, uc_en, - mc_en, bc_en); -if (ret) { -set_bit (HCLGE_VPORT_STATE_PROMISC_CHANGE , - &vport->state); +for (i =0 ; i < hdev->num_alloc_vport; i++) { + vport = &hdev->vport[i]; + + ret =hclge_sync_vport_promisc_mode (vport); +if (ret)return ; - } -hclge_set_vport_vlan_fltr_change (vport); } }
Signature · 1 line
2.30.0
This series was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Thu, 22 Dec 2022 14:43:40 +0800 you wrote:
There are some bugfixes for the HNS3 ethernet driver. patch#1 fix miss checking for rx packet. patch#2 fixes VF promisc mode not update when mac table full bug, and patch#3 fixes a nterrupts not initialization in VF FLR bug.
Jian Shen (2):
net: hns3: fix miss L3E checking for rx packet
net: hns3: fix VF promisc mode not update when mac table full[...]
Here is the summary with links:
- [net,1/3] net: hns3: add interrupts re-initialization while doing VF FLR
https://git.kernel.org/netdev/net/c/09e6b30eeb25 - [net,2/3] net: hns3: fix miss L3E checking for rx packet https://git.kernel.org/netdev/net/c/7d89b53cea1a - [net,3/3] net: hns3: fix VF promisc mode not update when mac table full https://git.kernel.org/netdev/net/c/8ee57c7b8406
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html