1 | There are some bugfix for the HNS3 ethernet driver | 1 | There are some bugfix for the HNS3 ethernet driver |
---|---|---|---|
2 | 2 | ||
3 | Hao Lan (1): | 3 | Hao Chen (2): |
4 | net: hns3: fix spelling mistake "reg_um" -> "reg_num" | 4 | net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read() |
5 | net: hns3: fix debugfs concurrency issue between kfree buffer and read | ||
5 | 6 | ||
6 | Jian Shen (1): | 7 | Jian Shen (1): |
7 | net: hns3: store rx VLAN tag offload state for VF | 8 | net: hns3: fix tx timeout issue |
8 | 9 | ||
9 | Yonglong Liu (1): | 10 | Jie Wang (1): |
10 | net: hns3: fix a use of uninitialized variable problem | 11 | net: hns3: remove GSO partial feature bit |
11 | 12 | ||
12 | .../hisilicon/hns3/hns3pf/hclge_main.c | 2 +- | 13 | Jijie Shao (2): |
13 | .../hisilicon/hns3/hns3vf/hclgevf_main.c | 25 ++++++++++++----- | 14 | net: hns3: Support query tx timeout threshold by debugfs |
14 | .../hisilicon/hns3/hns3vf/hclgevf_main.h | 3 ++- | 15 | net: hns3: fix invalid mutex between tc qdisc and dcb ets command |
15 | .../hisilicon/hns3/hns3vf/hclgevf_regs.c | 27 ++++++++++--------- | 16 | issue |
16 | 4 files changed, 36 insertions(+), 21 deletions(-) | 17 | |
18 | Yisen Zhuang (1): | ||
19 | net: hns3: fix the port information display when sfp is absent | ||
20 | |||
21 | drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + | ||
22 | .../ethernet/hisilicon/hns3/hns3_debugfs.c | 11 +++++++--- | ||
23 | .../net/ethernet/hisilicon/hns3/hns3_enet.c | 19 +++++++++++------- | ||
24 | .../ethernet/hisilicon/hns3/hns3_ethtool.c | 4 +++- | ||
25 | .../hisilicon/hns3/hns3pf/hclge_dcb.c | 20 +++++-------------- | ||
26 | .../hisilicon/hns3/hns3pf/hclge_debugfs.c | 14 ++++++------- | ||
27 | .../hisilicon/hns3/hns3pf/hclge_main.c | 5 +++-- | ||
28 | .../hisilicon/hns3/hns3pf/hclge_main.h | 2 -- | ||
29 | 8 files changed, 39 insertions(+), 37 deletions(-) | ||
17 | 30 | ||
18 | -- | 31 | -- |
19 | 2.33.0 | 32 | 2.30.0 | diff view generated by jsdifflib |
1 | From: Jian Shen <shenjian15@huawei.com> | 1 | From: Jian Shen <shenjian15@huawei.com> |
---|---|---|---|
2 | 2 | ||
3 | The VF driver missed to store the rx VLAN tag strip state when | 3 | Currently, the driver knocks the ring doorbell before updating |
4 | user change the rx VLAN tag offload state. And it will default | 4 | the ring->last_to_use in tx flow. if the hardware transmiting |
5 | to enable the rx vlan tag strip when re-init VF device after | 5 | packet and napi poll scheduling are fast enough, it may get |
6 | reset. So if user disable rx VLAN tag offload, and trig reset, | 6 | the old ring->last_to_use in drivers' napi poll. |
7 | then the HW will still strip the VLAN tag from packet nad fill | 7 | In this case, the driver will think the tx is not completed, and |
8 | into RX BD, but the VF driver will ignore it for rx VLAN tag | 8 | return directly without clear the flag __QUEUE_STATE_STACK_XOFF, |
9 | offload disabled. It may cause the rx VLAN tag dropped. | 9 | which may cause tx timeout. |
10 | 10 | ||
11 | Fixes: b2641e2ad456 ("net: hns3: Add support of hardware rx-vlan-offload to HNS3 VF driver") | 11 | Fixes: 20d06ca2679c ("net: hns3: optimize the tx clean process") |
12 | Signed-off-by: Jian Shen <shenjian15@huawei.com> | 12 | Signed-off-by: Jian Shen <shenjian15@huawei.com> |
13 | Signed-off-by: Jijie Shao <shaojijie@huawei.com> | 13 | Signed-off-by: Jijie Shao <shaojijie@huawei.com> |
14 | --- | 14 | --- |
15 | .../hisilicon/hns3/hns3vf/hclgevf_main.c | 25 ++++++++++++++----- | 15 | drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 17 ++++++++++++----- |
16 | .../hisilicon/hns3/hns3vf/hclgevf_main.h | 3 ++- | 16 | 1 file changed, 12 insertions(+), 5 deletions(-) |
17 | 2 files changed, 21 insertions(+), 7 deletions(-) | ||
18 | 17 | ||
19 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 18 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c |
20 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 20 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c |
22 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 21 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c |
23 | @@ -XXX,XX +XXX,XX @@ static void hclgevf_sync_vlan_filter(struct hclgevf_dev *hdev) | 22 | @@ -XXX,XX +XXX,XX @@ static void hns3_tx_doorbell(struct hns3_enet_ring *ring, int num, |
24 | rtnl_unlock(); | 23 | */ |
24 | if (test_bit(HNS3_NIC_STATE_TX_PUSH_ENABLE, &priv->state) && num && | ||
25 | !ring->pending_buf && num <= HNS3_MAX_PUSH_BD_NUM && doorbell) { | ||
26 | + /* This smp_store_release() pairs with smp_load_aquire() in | ||
27 | + * hns3_nic_reclaim_desc(). Ensure that the BD valid bit | ||
28 | + * is updated. | ||
29 | + */ | ||
30 | + smp_store_release(&ring->last_to_use, ring->next_to_use); | ||
31 | hns3_tx_push_bd(ring, num); | ||
32 | - WRITE_ONCE(ring->last_to_use, ring->next_to_use); | ||
33 | return; | ||
34 | } | ||
35 | |||
36 | @@ -XXX,XX +XXX,XX @@ static void hns3_tx_doorbell(struct hns3_enet_ring *ring, int num, | ||
37 | return; | ||
38 | } | ||
39 | |||
40 | + /* This smp_store_release() pairs with smp_load_aquire() in | ||
41 | + * hns3_nic_reclaim_desc(). Ensure that the BD valid bit is updated. | ||
42 | + */ | ||
43 | + smp_store_release(&ring->last_to_use, ring->next_to_use); | ||
44 | + | ||
45 | if (ring->tqp->mem_base) | ||
46 | hns3_tx_mem_doorbell(ring); | ||
47 | else | ||
48 | @@ -XXX,XX +XXX,XX @@ static void hns3_tx_doorbell(struct hns3_enet_ring *ring, int num, | ||
49 | ring->tqp->io_base + HNS3_RING_TX_RING_TAIL_REG); | ||
50 | |||
51 | ring->pending_buf = 0; | ||
52 | - WRITE_ONCE(ring->last_to_use, ring->next_to_use); | ||
25 | } | 53 | } |
26 | 54 | ||
27 | -static int hclgevf_en_hw_strip_rxvtag(struct hnae3_handle *handle, bool enable) | 55 | static void hns3_tsyn(struct net_device *netdev, struct sk_buff *skb, |
28 | +static int hclgevf_en_hw_strip_rxvtag_cmd(struct hclgevf_dev *hdev, bool enable) | 56 | @@ -XXX,XX +XXX,XX @@ static void hns3_reuse_buffer(struct hns3_enet_ring *ring, int i) |
57 | static bool hns3_nic_reclaim_desc(struct hns3_enet_ring *ring, | ||
58 | int *bytes, int *pkts, int budget) | ||
29 | { | 59 | { |
30 | - struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); | 60 | - /* pair with ring->last_to_use update in hns3_tx_doorbell(), |
31 | struct hclge_vf_to_pf_msg send_msg; | 61 | - * smp_store_release() is not used in hns3_tx_doorbell() because |
32 | 62 | - * the doorbell operation already have the needed barrier operation. | |
33 | hclgevf_build_send_msg(&send_msg, HCLGE_MBX_SET_VLAN, | 63 | + /* This smp_load_acquire() pairs with smp_store_release() in |
34 | @@ -XXX,XX +XXX,XX @@ static int hclgevf_en_hw_strip_rxvtag(struct hnae3_handle *handle, bool enable) | 64 | + * hns3_tx_doorbell(). |
35 | return hclgevf_send_mbx_msg(hdev, &send_msg, false, NULL, 0); | 65 | */ |
36 | } | 66 | int ltu = smp_load_acquire(&ring->last_to_use); |
37 | 67 | int ntc = ring->next_to_clean; | |
38 | +static int hclgevf_en_hw_strip_rxvtag(struct hnae3_handle *handle, bool enable) | ||
39 | +{ | ||
40 | + struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); | ||
41 | + int ret; | ||
42 | + | ||
43 | + ret = hclgevf_en_hw_strip_rxvtag_cmd(hdev, enable); | ||
44 | + if (ret) | ||
45 | + return ret; | ||
46 | + | ||
47 | + hdev->rxvtag_strip_en = enable; | ||
48 | + return 0; | ||
49 | +} | ||
50 | + | ||
51 | static int hclgevf_reset_tqp(struct hnae3_handle *handle) | ||
52 | { | ||
53 | #define HCLGEVF_RESET_ALL_QUEUE_DONE 1U | ||
54 | @@ -XXX,XX +XXX,XX @@ static int hclgevf_rss_init_hw(struct hclgevf_dev *hdev) | ||
55 | tc_valid, tc_size); | ||
56 | } | ||
57 | |||
58 | -static int hclgevf_init_vlan_config(struct hclgevf_dev *hdev) | ||
59 | +static int hclgevf_init_vlan_config(struct hclgevf_dev *hdev, | ||
60 | + bool rxvtag_strip_en) | ||
61 | { | ||
62 | struct hnae3_handle *nic = &hdev->nic; | ||
63 | int ret; | ||
64 | |||
65 | - ret = hclgevf_en_hw_strip_rxvtag(nic, true); | ||
66 | + ret = hclgevf_en_hw_strip_rxvtag(nic, rxvtag_strip_en); | ||
67 | if (ret) { | ||
68 | dev_err(&hdev->pdev->dev, | ||
69 | "failed to enable rx vlan offload, ret = %d\n", ret); | ||
70 | @@ -XXX,XX +XXX,XX @@ static int hclgevf_reset_hdev(struct hclgevf_dev *hdev) | ||
71 | if (ret) | ||
72 | return ret; | ||
73 | |||
74 | - ret = hclgevf_init_vlan_config(hdev); | ||
75 | + ret = hclgevf_init_vlan_config(hdev, hdev->rxvtag_strip_en); | ||
76 | if (ret) { | ||
77 | dev_err(&hdev->pdev->dev, | ||
78 | "failed(%d) to initialize VLAN config\n", ret); | ||
79 | @@ -XXX,XX +XXX,XX @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev) | ||
80 | goto err_config; | ||
81 | } | ||
82 | |||
83 | - ret = hclgevf_init_vlan_config(hdev); | ||
84 | + ret = hclgevf_init_vlan_config(hdev, true); | ||
85 | if (ret) { | ||
86 | dev_err(&hdev->pdev->dev, | ||
87 | "failed(%d) to initialize VLAN config\n", ret); | ||
88 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | ||
89 | index XXXXXXX..XXXXXXX 100644 | ||
90 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | ||
91 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | ||
92 | @@ -XXX,XX +XXX,XX @@ struct hclgevf_dev { | ||
93 | u16 *vector_status; | ||
94 | int *vector_irq; | ||
95 | |||
96 | - bool gro_en; | ||
97 | + u32 gro_en :1; | ||
98 | + u32 rxvtag_strip_en :1; | ||
99 | |||
100 | unsigned long vlan_del_fail_bmap[BITS_TO_LONGS(VLAN_N_VID)]; | ||
101 | |||
102 | -- | 68 | -- |
103 | 2.33.0 | 69 | 2.30.0 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | support query tx timeout threshold by debugfs | ||
1 | 2 | ||
3 | Signed-off-by: Jijie Shao <shaojijie@huawei.com> | ||
4 | --- | ||
5 | drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 4 ++++ | ||
6 | 1 file changed, 4 insertions(+) | ||
7 | |||
8 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | ||
9 | index XXXXXXX..XXXXXXX 100644 | ||
10 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | ||
11 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | ||
12 | @@ -XXX,XX +XXX,XX @@ hns3_dbg_dev_specs(struct hnae3_handle *h, char *buf, int len, int *pos) | ||
13 | struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev); | ||
14 | struct hnae3_dev_specs *dev_specs = &ae_dev->dev_specs; | ||
15 | struct hnae3_knic_private_info *kinfo = &h->kinfo; | ||
16 | + struct net_device *dev = kinfo->netdev; | ||
17 | |||
18 | *pos += scnprintf(buf + *pos, len - *pos, "dev_spec:\n"); | ||
19 | *pos += scnprintf(buf + *pos, len - *pos, "MAC entry num: %u\n", | ||
20 | @@ -XXX,XX +XXX,XX @@ hns3_dbg_dev_specs(struct hnae3_handle *h, char *buf, int len, int *pos) | ||
21 | dev_specs->mc_mac_size); | ||
22 | *pos += scnprintf(buf + *pos, len - *pos, "MAC statistics number: %u\n", | ||
23 | dev_specs->mac_stats_num); | ||
24 | + *pos += scnprintf(buf + *pos, len - *pos, | ||
25 | + "TX timeout threshold: %d seconds\n", | ||
26 | + dev->watchdog_timeo / HZ); | ||
27 | } | ||
28 | |||
29 | static int hns3_dbg_dev_info(struct hnae3_handle *h, char *buf, int len) | ||
30 | -- | ||
31 | 2.30.0 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Hao Chen <chenhao418@huawei.com> | ||
1 | 2 | ||
3 | req1->tcam_data is defined as "u8 tcam_data[8]", and we convert it as | ||
4 | (u32 *) without considerring byte order conversion, | ||
5 | it may result in printing wrong data for tcam_data. | ||
6 | |||
7 | Convert tcam_data to (__le32 *) first to fix it. | ||
8 | |||
9 | Fixes: b5a0b70d77b9 ("net: hns3: refactor dump fd tcam of debugfs") | ||
10 | Signed-off-by: Hao Chen <chenhao418@huawei.com> | ||
11 | Signed-off-by: Jijie Shao <shaojijie@huawei.com> | ||
12 | --- | ||
13 | .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 14 +++++++------- | ||
14 | 1 file changed, 7 insertions(+), 7 deletions(-) | ||
15 | |||
16 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | ||
19 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | ||
20 | @@ -XXX,XX +XXX,XX @@ static int hclge_dbg_fd_tcam_read(struct hclge_dev *hdev, bool sel_x, | ||
21 | struct hclge_desc desc[3]; | ||
22 | int pos = 0; | ||
23 | int ret, i; | ||
24 | - u32 *req; | ||
25 | + __le32 *req; | ||
26 | |||
27 | hclge_cmd_setup_basic_desc(&desc[0], HCLGE_OPC_FD_TCAM_OP, true); | ||
28 | desc[0].flag |= cpu_to_le16(HCLGE_COMM_CMD_FLAG_NEXT); | ||
29 | @@ -XXX,XX +XXX,XX @@ static int hclge_dbg_fd_tcam_read(struct hclge_dev *hdev, bool sel_x, | ||
30 | tcam_msg.loc); | ||
31 | |||
32 | /* tcam_data0 ~ tcam_data1 */ | ||
33 | - req = (u32 *)req1->tcam_data; | ||
34 | + req = (__le32 *)req1->tcam_data; | ||
35 | for (i = 0; i < 2; i++) | ||
36 | pos += scnprintf(tcam_buf + pos, HCLGE_DBG_TCAM_BUF_SIZE - pos, | ||
37 | - "%08x\n", *req++); | ||
38 | + "%08x\n", le32_to_cpu(*req++)); | ||
39 | |||
40 | /* tcam_data2 ~ tcam_data7 */ | ||
41 | - req = (u32 *)req2->tcam_data; | ||
42 | + req = (__le32 *)req2->tcam_data; | ||
43 | for (i = 0; i < 6; i++) | ||
44 | pos += scnprintf(tcam_buf + pos, HCLGE_DBG_TCAM_BUF_SIZE - pos, | ||
45 | - "%08x\n", *req++); | ||
46 | + "%08x\n", le32_to_cpu(*req++)); | ||
47 | |||
48 | /* tcam_data8 ~ tcam_data12 */ | ||
49 | - req = (u32 *)req3->tcam_data; | ||
50 | + req = (__le32 *)req3->tcam_data; | ||
51 | for (i = 0; i < 5; i++) | ||
52 | pos += scnprintf(tcam_buf + pos, HCLGE_DBG_TCAM_BUF_SIZE - pos, | ||
53 | - "%08x\n", *req++); | ||
54 | + "%08x\n", le32_to_cpu(*req++)); | ||
55 | |||
56 | return ret; | ||
57 | } | ||
58 | -- | ||
59 | 2.30.0 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Hao Chen <chenhao418@huawei.com> | ||
1 | 2 | ||
3 | Now in hns3_dbg_uninit(), there may be concurrency between | ||
4 | kfree buffer and read, it may result in memory error. | ||
5 | |||
6 | Moving debugfs_remove_recursive() in front of kfree buffer to ensure | ||
7 | they don't happen at the same time. | ||
8 | |||
9 | Fixes: 5e69ea7ee2a6 ("net: hns3: refactor the debugfs process") | ||
10 | Signed-off-by: Hao Chen <chenhao418@huawei.com> | ||
11 | Signed-off-by: Jijie Shao <shaojijie@huawei.com> | ||
12 | --- | ||
13 | drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 7 ++++--- | ||
14 | 1 file changed, 4 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | ||
19 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | ||
20 | @@ -XXX,XX +XXX,XX @@ int hns3_dbg_init(struct hnae3_handle *handle) | ||
21 | return 0; | ||
22 | |||
23 | out: | ||
24 | - mutex_destroy(&handle->dbgfs_lock); | ||
25 | debugfs_remove_recursive(handle->hnae3_dbgfs); | ||
26 | handle->hnae3_dbgfs = NULL; | ||
27 | + mutex_destroy(&handle->dbgfs_lock); | ||
28 | return ret; | ||
29 | } | ||
30 | |||
31 | @@ -XXX,XX +XXX,XX @@ void hns3_dbg_uninit(struct hnae3_handle *handle) | ||
32 | { | ||
33 | u32 i; | ||
34 | |||
35 | + debugfs_remove_recursive(handle->hnae3_dbgfs); | ||
36 | + handle->hnae3_dbgfs = NULL; | ||
37 | + | ||
38 | for (i = 0; i < ARRAY_SIZE(hns3_dbg_cmd); i++) | ||
39 | if (handle->dbgfs_buf[i]) { | ||
40 | kvfree(handle->dbgfs_buf[i]); | ||
41 | @@ -XXX,XX +XXX,XX @@ void hns3_dbg_uninit(struct hnae3_handle *handle) | ||
42 | } | ||
43 | |||
44 | mutex_destroy(&handle->dbgfs_lock); | ||
45 | - debugfs_remove_recursive(handle->hnae3_dbgfs); | ||
46 | - handle->hnae3_dbgfs = NULL; | ||
47 | } | ||
48 | |||
49 | void hns3_dbg_register_debugfs(const char *debugfs_dir_name) | ||
50 | -- | ||
51 | 2.30.0 | diff view generated by jsdifflib |
1 | From: Yonglong Liu <liuyonglong@huawei.com> | 1 | We hope that tc qdisc and dcb ets commands can not be used crosswise. |
---|---|---|---|
2 | If we want to use any of the commands to configure tc, | ||
3 | We must use the other command to clear the existing configuration. | ||
2 | 4 | ||
3 | In hclge_add_fd_entry(), if the flow type is FLOW_EXT, and the data of | 5 | However, when we configure a single tc with tc qdisc, |
4 | m_ext is all zero, then some members of the local variable "info" are | 6 | we can still configure it with dcb ets. |
5 | not initialized. | 7 | Because we use mqprio_active as the tag of tc qdisc configuration, |
8 | but with dcb ets, we do not check mqprio_active. | ||
6 | 9 | ||
7 | Fixes: 67b0e1428e2f ("net: hns3: add support for user-def data of flow director") | 10 | This patch fix this issue by check mqprio_active before |
8 | Signed-off-by: Yonglong Liu <liuyonglong@huawei.com> | 11 | executing the dcb ets command. and add dcb_ets_active to |
12 | replace HCLGE_FLAG_DCB_ENABLE and HCLGE_FLAG_MQPRIO_ENABLE | ||
13 | at the hclge layer, | ||
14 | |||
15 | Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature") | ||
9 | Signed-off-by: Jijie Shao <shaojijie@huawei.com> | 16 | Signed-off-by: Jijie Shao <shaojijie@huawei.com> |
10 | --- | 17 | --- |
11 | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- | 18 | drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + |
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | 19 | .../hisilicon/hns3/hns3pf/hclge_dcb.c | 20 +++++-------------- |
20 | .../hisilicon/hns3/hns3pf/hclge_main.c | 5 +++-- | ||
21 | .../hisilicon/hns3/hns3pf/hclge_main.h | 2 -- | ||
22 | 4 files changed, 9 insertions(+), 19 deletions(-) | ||
13 | 23 | ||
24 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h | ||
25 | index XXXXXXX..XXXXXXX 100644 | ||
26 | --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h | ||
27 | +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h | ||
28 | @@ -XXX,XX +XXX,XX @@ struct hnae3_tc_info { | ||
29 | u8 max_tc; /* Total number of TCs */ | ||
30 | u8 num_tc; /* Total number of enabled TCs */ | ||
31 | bool mqprio_active; | ||
32 | + bool dcb_ets_active; | ||
33 | }; | ||
34 | |||
35 | #define HNAE3_MAX_DSCP 64 | ||
36 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | ||
37 | index XXXXXXX..XXXXXXX 100644 | ||
38 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | ||
39 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | ||
40 | @@ -XXX,XX +XXX,XX @@ static int hclge_ieee_setets(struct hnae3_handle *h, struct ieee_ets *ets) | ||
41 | int ret; | ||
42 | |||
43 | if (!(hdev->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || | ||
44 | - hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE) | ||
45 | + h->kinfo.tc_info.mqprio_active) | ||
46 | return -EINVAL; | ||
47 | |||
48 | ret = hclge_ets_validate(hdev, ets, &num_tc, &map_changed); | ||
49 | @@ -XXX,XX +XXX,XX @@ static int hclge_ieee_setets(struct hnae3_handle *h, struct ieee_ets *ets) | ||
50 | } | ||
51 | |||
52 | hclge_tm_schd_info_update(hdev, num_tc); | ||
53 | - if (num_tc > 1) | ||
54 | - hdev->flag |= HCLGE_FLAG_DCB_ENABLE; | ||
55 | - else | ||
56 | - hdev->flag &= ~HCLGE_FLAG_DCB_ENABLE; | ||
57 | + h->kinfo.tc_info.dcb_ets_active = num_tc > 1; | ||
58 | |||
59 | ret = hclge_ieee_ets_to_tm_info(hdev, ets); | ||
60 | if (ret) | ||
61 | @@ -XXX,XX +XXX,XX @@ static u8 hclge_getdcbx(struct hnae3_handle *h) | ||
62 | struct hclge_vport *vport = hclge_get_vport(h); | ||
63 | struct hclge_dev *hdev = vport->back; | ||
64 | |||
65 | - if (hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE) | ||
66 | + if (h->kinfo.tc_info.mqprio_active) | ||
67 | return 0; | ||
68 | |||
69 | return hdev->dcbx_cap; | ||
70 | @@ -XXX,XX +XXX,XX @@ static int hclge_setup_tc(struct hnae3_handle *h, | ||
71 | if (!test_bit(HCLGE_STATE_NIC_REGISTERED, &hdev->state)) | ||
72 | return -EBUSY; | ||
73 | |||
74 | - if (hdev->flag & HCLGE_FLAG_DCB_ENABLE) | ||
75 | + kinfo = &vport->nic.kinfo; | ||
76 | + if (kinfo->tc_info.dcb_ets_active) | ||
77 | return -EINVAL; | ||
78 | |||
79 | ret = hclge_mqprio_qopt_check(hdev, mqprio_qopt); | ||
80 | @@ -XXX,XX +XXX,XX @@ static int hclge_setup_tc(struct hnae3_handle *h, | ||
81 | if (ret) | ||
82 | return ret; | ||
83 | |||
84 | - kinfo = &vport->nic.kinfo; | ||
85 | memcpy(&old_tc_info, &kinfo->tc_info, sizeof(old_tc_info)); | ||
86 | hclge_sync_mqprio_qopt(&kinfo->tc_info, mqprio_qopt); | ||
87 | kinfo->tc_info.mqprio_active = tc > 0; | ||
88 | @@ -XXX,XX +XXX,XX @@ static int hclge_setup_tc(struct hnae3_handle *h, | ||
89 | if (ret) | ||
90 | goto err_out; | ||
91 | |||
92 | - hdev->flag &= ~HCLGE_FLAG_DCB_ENABLE; | ||
93 | - | ||
94 | - if (tc > 1) | ||
95 | - hdev->flag |= HCLGE_FLAG_MQPRIO_ENABLE; | ||
96 | - else | ||
97 | - hdev->flag &= ~HCLGE_FLAG_MQPRIO_ENABLE; | ||
98 | - | ||
99 | return hclge_notify_init_up(hdev); | ||
100 | |||
101 | err_out: | ||
14 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 102 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c |
15 | index XXXXXXX..XXXXXXX 100644 | 103 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 104 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c |
17 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 105 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c |
18 | @@ -XXX,XX +XXX,XX @@ static int hclge_add_fd_entry(struct hnae3_handle *handle, | 106 | @@ -XXX,XX +XXX,XX @@ static void hclge_get_mdix_mode(struct hnae3_handle *handle, |
19 | struct ethtool_rxnfc *cmd) | 107 | |
108 | static void hclge_info_show(struct hclge_dev *hdev) | ||
20 | { | 109 | { |
21 | struct hclge_vport *vport = hclge_get_vport(handle); | 110 | + struct hnae3_handle *handle = &hdev->vport->nic; |
22 | + struct hclge_fd_user_def_info info = {0}; | 111 | struct device *dev = &hdev->pdev->dev; |
23 | struct hclge_dev *hdev = vport->back; | 112 | |
24 | - struct hclge_fd_user_def_info info; | 113 | dev_info(dev, "PF info begin:\n"); |
25 | u16 dst_vport_id = 0, q_index = 0; | 114 | @@ -XXX,XX +XXX,XX @@ static void hclge_info_show(struct hclge_dev *hdev) |
26 | struct ethtool_rx_flow_spec *fs; | 115 | dev_info(dev, "This is %s PF\n", |
27 | struct hclge_fd_rule *rule; | 116 | hdev->flag & HCLGE_FLAG_MAIN ? "main" : "not main"); |
117 | dev_info(dev, "DCB %s\n", | ||
118 | - hdev->flag & HCLGE_FLAG_DCB_ENABLE ? "enable" : "disable"); | ||
119 | + handle->kinfo.tc_info.dcb_ets_active ? "enable" : "disable"); | ||
120 | dev_info(dev, "MQPRIO %s\n", | ||
121 | - hdev->flag & HCLGE_FLAG_MQPRIO_ENABLE ? "enable" : "disable"); | ||
122 | + handle->kinfo.tc_info.mqprio_active ? "enable" : "disable"); | ||
123 | dev_info(dev, "Default tx spare buffer size: %u\n", | ||
124 | hdev->tx_spare_buf_size); | ||
125 | |||
126 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | ||
127 | index XXXXXXX..XXXXXXX 100644 | ||
128 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | ||
129 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h | ||
130 | @@ -XXX,XX +XXX,XX @@ struct hclge_dev { | ||
131 | |||
132 | #define HCLGE_FLAG_MAIN BIT(0) | ||
133 | #define HCLGE_FLAG_DCB_CAPABLE BIT(1) | ||
134 | -#define HCLGE_FLAG_DCB_ENABLE BIT(2) | ||
135 | -#define HCLGE_FLAG_MQPRIO_ENABLE BIT(3) | ||
136 | u32 flag; | ||
137 | |||
138 | u32 pkt_buf_size; /* Total pf buf size for tx/rx */ | ||
28 | -- | 139 | -- |
29 | 2.33.0 | 140 | 2.30.0 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Yisen Zhuang <yisen.zhuang@huawei.com> | ||
1 | 2 | ||
3 | When sfp is absent or unidentified, the port type should be | ||
4 | displayed as PORT_OTHERS, rather than PORT_FIBRE. | ||
5 | |||
6 | Fixes: 88d10bd6f730 ("net: hns3: add support for multiple media type") | ||
7 | Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com> | ||
8 | Signed-off-by: Jijie Shao <shaojijie@huawei.com> | ||
9 | --- | ||
10 | drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 +++- | ||
11 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | ||
16 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static int hns3_get_link_ksettings(struct net_device *netdev, | ||
18 | hns3_get_ksettings(h, cmd); | ||
19 | break; | ||
20 | case HNAE3_MEDIA_TYPE_FIBER: | ||
21 | - if (module_type == HNAE3_MODULE_TYPE_CR) | ||
22 | + if (module_type == HNAE3_MODULE_TYPE_UNKNOWN) | ||
23 | + cmd->base.port = PORT_OTHER; | ||
24 | + else if (module_type == HNAE3_MODULE_TYPE_CR) | ||
25 | cmd->base.port = PORT_DA; | ||
26 | else | ||
27 | cmd->base.port = PORT_FIBRE; | ||
28 | -- | ||
29 | 2.30.0 | diff view generated by jsdifflib |
1 | From: Hao Lan <lanhao@huawei.com> | 1 | From: Jie Wang <wangjie125@huawei.com> |
---|---|---|---|
2 | 2 | ||
3 | There are spelling mistakes in hclgevf_get_regs. Fix them. | 3 | HNS3 NIC does not support GSO partial packets segmentation. Actually tunnel |
4 | packets for example NvGRE packets segment offload and checksum offload is | ||
5 | already supported. There is no need to keep gso partial feature bit. So | ||
6 | this patch removes it. | ||
4 | 7 | ||
5 | Signed-off-by: Hao Lan <lanhao@huawei.com> | 8 | Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") |
9 | Signed-off-by: Jie Wang <wangjie125@huawei.com> | ||
6 | Signed-off-by: Jijie Shao <shaojijie@huawei.com> | 10 | Signed-off-by: Jijie Shao <shaojijie@huawei.com> |
7 | --- | 11 | --- |
8 | .../hisilicon/hns3/hns3vf/hclgevf_regs.c | 27 ++++++++++--------- | 12 | drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 -- |
9 | 1 file changed, 14 insertions(+), 13 deletions(-) | 13 | 1 file changed, 2 deletions(-) |
10 | 14 | ||
11 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_regs.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_regs.c | 15 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c |
12 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_regs.c | 17 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c |
14 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_regs.c | 18 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c |
15 | @@ -XXX,XX +XXX,XX @@ void hclgevf_get_regs(struct hnae3_handle *handle, u32 *version, | 19 | @@ -XXX,XX +XXX,XX @@ static void hns3_set_default_feature(struct net_device *netdev) |
16 | 20 | ||
17 | struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); | 21 | netdev->priv_flags |= IFF_UNICAST_FLT; |
18 | struct hnae3_queue *tqp; | 22 | |
19 | - int i, j, reg_um; | 23 | - netdev->gso_partial_features |= NETIF_F_GSO_GRE_CSUM; |
20 | + int i, j, reg_num; | 24 | - |
21 | u32 *reg = data; | 25 | netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | |
22 | 26 | NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | | |
23 | *version = hdev->fw_version; | 27 | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_GSO | |
24 | reg += hclgevf_reg_get_header(reg); | ||
25 | |||
26 | /* fetching per-VF registers values from VF PCIe register space */ | ||
27 | - reg_um = ARRAY_SIZE(cmdq_reg_addr_list); | ||
28 | - reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_CMDQ, reg_um, reg); | ||
29 | - for (i = 0; i < reg_um; i++) | ||
30 | + reg_num = ARRAY_SIZE(cmdq_reg_addr_list); | ||
31 | + reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_CMDQ, reg_num, reg); | ||
32 | + for (i = 0; i < reg_num; i++) | ||
33 | *reg++ = hclgevf_read_dev(&hdev->hw, cmdq_reg_addr_list[i]); | ||
34 | |||
35 | - reg_um = ARRAY_SIZE(common_reg_addr_list); | ||
36 | - reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_COMMON, reg_um, reg); | ||
37 | - for (i = 0; i < reg_um; i++) | ||
38 | + reg_num = ARRAY_SIZE(common_reg_addr_list); | ||
39 | + reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_COMMON, reg_num, reg); | ||
40 | + for (i = 0; i < reg_num; i++) | ||
41 | *reg++ = hclgevf_read_dev(&hdev->hw, common_reg_addr_list[i]); | ||
42 | |||
43 | - reg_um = ARRAY_SIZE(ring_reg_addr_list); | ||
44 | + reg_num = ARRAY_SIZE(ring_reg_addr_list); | ||
45 | for (j = 0; j < hdev->num_tqps; j++) { | ||
46 | - reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_RING, reg_um, reg); | ||
47 | + reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_RING, reg_num, reg); | ||
48 | tqp = &hdev->htqp[j].q; | ||
49 | - for (i = 0; i < reg_um; i++) | ||
50 | + for (i = 0; i < reg_num; i++) | ||
51 | *reg++ = readl_relaxed(tqp->io_base - | ||
52 | HCLGEVF_TQP_REG_OFFSET + | ||
53 | ring_reg_addr_list[i]); | ||
54 | } | ||
55 | |||
56 | - reg_um = ARRAY_SIZE(tqp_intr_reg_addr_list); | ||
57 | + reg_num = ARRAY_SIZE(tqp_intr_reg_addr_list); | ||
58 | for (j = 0; j < hdev->num_msi_used - 1; j++) { | ||
59 | - reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_TQP_INTR, reg_um, reg); | ||
60 | - for (i = 0; i < reg_um; i++) | ||
61 | + reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_TQP_INTR, | ||
62 | + reg_num, reg); | ||
63 | + for (i = 0; i < reg_num; i++) | ||
64 | *reg++ = hclgevf_read_dev(&hdev->hw, | ||
65 | tqp_intr_reg_addr_list[i] + | ||
66 | HCLGEVF_RING_INT_REG_OFFSET * j); | ||
67 | -- | 28 | -- |
68 | 2.33.0 | 29 | 2.30.0 | diff view generated by jsdifflib |