This series adds some fixes for the HNS3 ethernet driver.
Jiaran Zhang (2):
net: hns3: fix the exception when query imp info
net: hns3: fix the timing issue of VF clearing interrupt sources
Yufeng Mo (3):
net: hns3: pad the short tunnel frame before sending to hardware
net: hns3: change affinity_mask to numa node range
net: hns3: disable mac in flr process
Yunsheng Lin (1):
net: hns3: add option to turn off page pool feature
.../net/ethernet/hisilicon/hns3/hns3_enet.c | 14 +++++++++++---
.../hisilicon/hns3/hns3pf/hclge_debugfs.c | 4 ++++
.../hisilicon/hns3/hns3pf/hclge_main.c | 19 +++++++++++--------
.../hisilicon/hns3/hns3vf/hclgevf_main.c | 6 +++---
4 files changed, 29 insertions(+), 14 deletions(-)
--
2.33.0
From: Yufeng Mo <redacted>
Currently, affinity_mask is set to a single cpu. As a result,
irqbalance becomes invalid in SUBSET or EXACT mode. To solve
this problem, change affinity_mask to numa node range. In this
way, irqbalance can be performed on the cpu of the numa node.
Fixes: 0812545487ec ("net: hns3: add interrupt affinity support for misc interrupt")
Signed-off-by: Yufeng Mo <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
@@ -1595,11 +1596,12 @@ static int hclge_configure(struct hclge_dev *hdev)hclge_init_kdump_kernel_config(hdev);-/* Set the init affinity based on pci func number */-i=cpumask_weight(cpumask_of_node(dev_to_node(&hdev->pdev->dev)));-i=i?PCI_FUNC(hdev->pdev->devfn)%i:0;-cpumask_set_cpu(cpumask_local_spread(i,dev_to_node(&hdev->pdev->dev)),-&hdev->affinity_mask);+/* Set the affinity based on numa node */+node=dev_to_node(&hdev->pdev->dev);+if(node!=NUMA_NO_NODE)+cpumask=cpumask_of_node(node);++cpumask_copy(&hdev->affinity_mask,cpumask);returnret;}
From: Yufeng Mo <redacted>
The hardware cannot handle short tunnel frames below 65 bytes,
and will cause vlan tag missing problem. So pads packet size to
65 bytes for tunnel frames to fix this bug.
Fixes: 3db084d28dc0("net: hns3: Fix for vxlan tx checksum bug")
Signed-off-by: Yufeng Mo <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
From: Jiaran Zhang <redacted>
Currently, the VF does not clear the interrupt source immediately after
receiving the interrupt. As a result, if the second interrupt task is
triggered when processing the first interrupt task, clearing the
interrupt source before exiting will clear the interrupt sources of the
two tasks at the same time. As a result, no interrupt is triggered for
the second task. The VF detects the missed message only when the next
interrupt is generated.
Clearing it immediately after executing check_evt_cause ensures that:
1. Even if two interrupt tasks are triggered at the same time, they can
be processed.
2. If the second task is triggered during the processing of the first
task and the interrupt source is not cleared, the interrupt is reported
after vector0 is enabled.
Fixes: b90fcc5bd904 ("net: hns3: add reset handling for VF when doing Core/Global/IMP reset")
Signed-off-by: Jiaran Zhang <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Jiaran Zhang <redacted>
When the command for querying imp info is issued to the firmware,
if the firmware does not support the command, the returned value
of bd num is 0.
Add protection mechanism before alloc memory to prevent apply for
0-length memory.
Fixes: 0b198b0d80ea ("net: hns3: refactor dump m7 info of debugfs")
Signed-off-by: Jiaran Zhang <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 4 ++++
1 file changed, 4 insertions(+)
From: Yufeng Mo <redacted>
The firmware will not disable mac in flr process. Therefore, the driver
needs to proactively disable mac during flr, which is the same as the
function reset.
Fixes: 35d93a30040c ("net: hns3: adjust the process of PF reset")
Signed-off-by: Yufeng Mo <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
@@ -8127,11 +8127,12 @@ static void hclge_ae_stop(struct hnae3_handle *handle)hclge_clear_arfs_rules(hdev);spin_unlock_bh(&hdev->fd_rule_lock);-/* If it is not PF reset, the firmware will disable the MAC,+/* If it is not PF reset or FLR, the firmware will disable the MAC,*soitonlyneedtostopphyhere.*/if(test_bit(HCLGE_STATE_RST_HANDLING,&hdev->state)&&-hdev->reset_type!=HNAE3_FUNC_RESET){+hdev->reset_type!=HNAE3_FUNC_RESET&&+hdev->reset_type!=HNAE3_FLR_RESET){hclge_mac_stop_phy(hdev);hclge_update_link_status(hdev);return;
From: Yunsheng Lin <redacted>
When page pool is added to the hns3 driver, it is always
enabled unconditionally, which means spilt page handling
in the hns3 driver is dead code.
As there is a requirement to test the performance between
spilt page handling in driver and page pool, so add a module
param to support disabling the page pool.
When the page pool is proved to perform better in most case,
the spilt page handling in driver can be removed.
Fixes: 93188e9642c3 ("net: hns3: support skb's frag page recycling based on page pool")
Signed-off-by: Yunsheng Lin <redacted>
Signed-off-by: Guangbin Huang <redacted>
---
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -61,6 +61,9 @@ static unsigned int tx_sgl = 1;module_param(tx_sgl,uint,0600);MODULE_PARM_DESC(tx_sgl,"Minimum number of frags when using dma_map_sg() to optimize the IOMMU mapping");+staticboolpage_pool_enabled=true;+module_param(page_pool_enabled,bool,0400);+#define HNS3_SGL_SIZE(nfrag) (sizeof(struct scatterlist) * (nfrag) + \sizeof(structsg_table))#define HNS3_MAX_SGL_SIZE ALIGN(HNS3_SGL_SIZE(HNS3_MAX_TSO_BD_NUM), \
@@ -4753,7 +4756,8 @@ static int hns3_alloc_ring_memory(struct hns3_enet_ring *ring)gotoout_with_desc_cb;if(!HNAE3_IS_TX_RING(ring)){-hns3_alloc_page_pool(ring);+if(page_pool_enabled)+hns3_alloc_page_pool(ring);ret=hns3_alloc_ring_buffers(ring);if(ret)