* [PATCH net 0/6] net: hns3: add some fixes for -net
@ 2022-06-11 12:25 Guangbin Huang
2022-06-11 12:25 ` [PATCH net 1/6] net: hns3: set port base vlan tbl_sta to false before removing old vlan Guangbin Huang
` (6 more replies)
0 siblings, 7 replies; 14+ messages in thread
From: Guangbin Huang @ 2022-06-11 12:25 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288
This series adds some fixes for the HNS3 ethernet driver.
Guangbin Huang (3):
net: hns3: set port base vlan tbl_sta to false before removing old
vlan
net: hns3: restore tm priority/qset to default settings when tc
disabled
net: hns3: fix tm port shapping of fibre port is incorrect after
driver initialization
Jian Shen (1):
net: hns3: don't push link state to VF if unalive
Jie Wang (2):
net: hns3: modify the ring param print info
net: hns3: fix PF rss size initialization bug
drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 +
.../ethernet/hisilicon/hns3/hns3_ethtool.c | 2 +-
.../hisilicon/hns3/hns3pf/hclge_main.c | 18 +++-
.../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 101 ++++++++++++------
.../ethernet/hisilicon/hns3/hns3pf/hclge_tm.h | 1 +
5 files changed, 86 insertions(+), 37 deletions(-)
--
2.33.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net 1/6] net: hns3: set port base vlan tbl_sta to false before removing old vlan
2022-06-11 12:25 [PATCH net 0/6] net: hns3: add some fixes for -net Guangbin Huang
@ 2022-06-11 12:25 ` Guangbin Huang
2022-06-11 12:25 ` [PATCH net 2/6] net: hns3: don't push link state to VF if unalive Guangbin Huang
` (5 subsequent siblings)
6 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2022-06-11 12:25 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288
When modify port base vlan, the port base vlan tbl_sta needs to set to
false before removing old vlan, to indicate this operation is not finish.
Fixes: c0f46de30c96 ("net: hns3: fix port base vlan add fail when concurrent with reset")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 1ebad0e50e6a..fc0265b63331 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -10117,6 +10117,7 @@ static int hclge_modify_port_base_vlan_tag(struct hclge_vport *vport,
if (ret)
return ret;
+ vport->port_base_vlan_cfg.tbl_sta = false;
/* remove old VLAN tag */
if (old_info->vlan_tag == 0)
ret = hclge_set_vf_vlan_common(hdev, vport->vport_id,
--
2.33.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net 2/6] net: hns3: don't push link state to VF if unalive
2022-06-11 12:25 [PATCH net 0/6] net: hns3: add some fixes for -net Guangbin Huang
2022-06-11 12:25 ` [PATCH net 1/6] net: hns3: set port base vlan tbl_sta to false before removing old vlan Guangbin Huang
@ 2022-06-11 12:25 ` Guangbin Huang
2022-06-11 12:25 ` [PATCH net 3/6] net: hns3: modify the ring param print info Guangbin Huang
` (4 subsequent siblings)
6 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2022-06-11 12:25 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288
From: Jian Shen <shenjian15@huawei.com>
It's unnecessary to push link state to unalive VF, and the VF will
query link state from PF when it being start works.
Fixes: 18b6e31f8bf4 ("net: hns3: PF add support for pushing link status to VFs")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@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 fc0265b63331..2e891b837c51 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -3376,6 +3376,12 @@ static int hclge_set_vf_link_state(struct hnae3_handle *handle, int vf,
link_state_old = vport->vf_info.link_state;
vport->vf_info.link_state = link_state;
+ /* return success directly if the VF is unalive, VF will
+ * query link state itself when it starts work.
+ */
+ if (!test_bit(HCLGE_VPORT_STATE_ALIVE, &vport->state))
+ return 0;
+
ret = hclge_push_vf_link_status(vport);
if (ret) {
vport->vf_info.link_state = link_state_old;
--
2.33.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net 3/6] net: hns3: modify the ring param print info
2022-06-11 12:25 [PATCH net 0/6] net: hns3: add some fixes for -net Guangbin Huang
2022-06-11 12:25 ` [PATCH net 1/6] net: hns3: set port base vlan tbl_sta to false before removing old vlan Guangbin Huang
2022-06-11 12:25 ` [PATCH net 2/6] net: hns3: don't push link state to VF if unalive Guangbin Huang
@ 2022-06-11 12:25 ` Guangbin Huang
2022-06-11 12:25 ` [PATCH net 4/6] net: hns3: restore tm priority/qset to default settings when tc disabled Guangbin Huang
` (3 subsequent siblings)
6 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2022-06-11 12:25 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288
From: Jie Wang <wangjie125@huawei.com>
Currently tx push is also a ring param. So the original ring param print
info in hns3_is_ringparam_changed should be adjusted.
Fixes: 07fdc163ac88 ("net: hns3: refactor hns3_set_ringparam()")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index 6d20974519fe..4c7988e308a2 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -1129,7 +1129,7 @@ hns3_is_ringparam_changed(struct net_device *ndev,
if (old_ringparam->tx_desc_num == new_ringparam->tx_desc_num &&
old_ringparam->rx_desc_num == new_ringparam->rx_desc_num &&
old_ringparam->rx_buf_len == new_ringparam->rx_buf_len) {
- netdev_info(ndev, "ringparam not changed\n");
+ netdev_info(ndev, "descriptor number and rx buffer length not changed\n");
return false;
}
--
2.33.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net 4/6] net: hns3: restore tm priority/qset to default settings when tc disabled
2022-06-11 12:25 [PATCH net 0/6] net: hns3: add some fixes for -net Guangbin Huang
` (2 preceding siblings ...)
2022-06-11 12:25 ` [PATCH net 3/6] net: hns3: modify the ring param print info Guangbin Huang
@ 2022-06-11 12:25 ` Guangbin Huang
2022-06-11 12:25 ` [PATCH net 5/6] net: hns3: fix PF rss size initialization bug Guangbin Huang
` (2 subsequent siblings)
6 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2022-06-11 12:25 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288
Currently, settings parameters of schedule mode, dwrr, shaper of tm
priority or qset of one tc are only be set when tc is enabled, they are
not restored to the default settings when tc is disabled. It confuses
users when they cat tm_priority or tm_qset files of debugfs. So this
patch fixes it.
Fixes: 848440544b41 ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 +
.../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 95 +++++++++++++------
2 files changed, 65 insertions(+), 31 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index 8a3a446219f7..94f80e1c4020 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -769,6 +769,7 @@ struct hnae3_tc_info {
u8 prio_tc[HNAE3_MAX_USER_PRIO]; /* TC indexed by prio */
u16 tqp_count[HNAE3_MAX_TC];
u16 tqp_offset[HNAE3_MAX_TC];
+ u8 max_tc; /* Total number of TCs */
u8 num_tc; /* Total number of enabled TCs */
bool mqprio_active;
};
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index 1f87a8a3fe32..ad53a3447322 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -282,8 +282,8 @@ static int hclge_tm_pg_to_pri_map_cfg(struct hclge_dev *hdev,
return hclge_cmd_send(&hdev->hw, &desc, 1);
}
-static int hclge_tm_qs_to_pri_map_cfg(struct hclge_dev *hdev,
- u16 qs_id, u8 pri)
+static int hclge_tm_qs_to_pri_map_cfg(struct hclge_dev *hdev, u16 qs_id, u8 pri,
+ bool link_vld)
{
struct hclge_qs_to_pri_link_cmd *map;
struct hclge_desc desc;
@@ -294,7 +294,7 @@ static int hclge_tm_qs_to_pri_map_cfg(struct hclge_dev *hdev,
map->qs_id = cpu_to_le16(qs_id);
map->priority = pri;
- map->link_vld = HCLGE_TM_QS_PRI_LINK_VLD_MSK;
+ map->link_vld = link_vld ? HCLGE_TM_QS_PRI_LINK_VLD_MSK : 0;
return hclge_cmd_send(&hdev->hw, &desc, 1);
}
@@ -642,11 +642,13 @@ static void hclge_tm_update_kinfo_rss_size(struct hclge_vport *vport)
* one tc for VF for simplicity. VF's vport_id is non zero.
*/
if (vport->vport_id) {
+ kinfo->tc_info.max_tc = 1;
kinfo->tc_info.num_tc = 1;
vport->qs_offset = HNAE3_MAX_TC +
vport->vport_id - HCLGE_VF_VPORT_START_NUM;
vport_max_rss_size = hdev->vf_rss_size_max;
} else {
+ kinfo->tc_info.max_tc = hdev->tc_max;
kinfo->tc_info.num_tc =
min_t(u16, vport->alloc_tqps, hdev->tm_info.num_tc);
vport->qs_offset = 0;
@@ -714,14 +716,22 @@ static void hclge_tm_vport_info_update(struct hclge_dev *hdev)
static void hclge_tm_tc_info_init(struct hclge_dev *hdev)
{
- u8 i;
+ u8 i, tc_sch_mode;
+ u32 bw_limit;
+
+ for (i = 0; i < hdev->tc_max; i++) {
+ if (i < hdev->tm_info.num_tc) {
+ tc_sch_mode = HCLGE_SCH_MODE_DWRR;
+ bw_limit = hdev->tm_info.pg_info[0].bw_limit;
+ } else {
+ tc_sch_mode = HCLGE_SCH_MODE_SP;
+ bw_limit = 0;
+ }
- for (i = 0; i < hdev->tm_info.num_tc; i++) {
hdev->tm_info.tc_info[i].tc_id = i;
- hdev->tm_info.tc_info[i].tc_sch_mode = HCLGE_SCH_MODE_DWRR;
+ hdev->tm_info.tc_info[i].tc_sch_mode = tc_sch_mode;
hdev->tm_info.tc_info[i].pgid = 0;
- hdev->tm_info.tc_info[i].bw_limit =
- hdev->tm_info.pg_info[0].bw_limit;
+ hdev->tm_info.tc_info[i].bw_limit = bw_limit;
}
for (i = 0; i < HNAE3_MAX_USER_PRIO; i++)
@@ -926,10 +936,13 @@ static int hclge_tm_pri_q_qs_cfg_tc_base(struct hclge_dev *hdev)
for (k = 0; k < hdev->num_alloc_vport; k++) {
struct hnae3_knic_private_info *kinfo = &vport[k].nic.kinfo;
- for (i = 0; i < kinfo->tc_info.num_tc; i++) {
+ for (i = 0; i < kinfo->tc_info.max_tc; i++) {
+ u8 pri = i < kinfo->tc_info.num_tc ? i : 0;
+ bool link_vld = i < kinfo->tc_info.num_tc;
+
ret = hclge_tm_qs_to_pri_map_cfg(hdev,
vport[k].qs_offset + i,
- i);
+ pri, link_vld);
if (ret)
return ret;
}
@@ -949,7 +962,7 @@ static int hclge_tm_pri_q_qs_cfg_vnet_base(struct hclge_dev *hdev)
for (i = 0; i < HNAE3_MAX_TC; i++) {
ret = hclge_tm_qs_to_pri_map_cfg(hdev,
vport[k].qs_offset + i,
- k);
+ k, true);
if (ret)
return ret;
}
@@ -989,33 +1002,39 @@ static int hclge_tm_pri_tc_base_shaper_cfg(struct hclge_dev *hdev)
{
u32 max_tm_rate = hdev->ae_dev->dev_specs.max_tm_rate;
struct hclge_shaper_ir_para ir_para;
- u32 shaper_para;
+ u32 shaper_para_c, shaper_para_p;
int ret;
u32 i;
- for (i = 0; i < hdev->tm_info.num_tc; i++) {
+ for (i = 0; i < hdev->tc_max; i++) {
u32 rate = hdev->tm_info.tc_info[i].bw_limit;
- ret = hclge_shaper_para_calc(rate, HCLGE_SHAPER_LVL_PRI,
- &ir_para, max_tm_rate);
- if (ret)
- return ret;
+ if (rate) {
+ ret = hclge_shaper_para_calc(rate, HCLGE_SHAPER_LVL_PRI,
+ &ir_para, max_tm_rate);
+ if (ret)
+ return ret;
+
+ shaper_para_c = hclge_tm_get_shapping_para(0, 0, 0,
+ HCLGE_SHAPER_BS_U_DEF,
+ HCLGE_SHAPER_BS_S_DEF);
+ shaper_para_p = hclge_tm_get_shapping_para(ir_para.ir_b,
+ ir_para.ir_u,
+ ir_para.ir_s,
+ HCLGE_SHAPER_BS_U_DEF,
+ HCLGE_SHAPER_BS_S_DEF);
+ } else {
+ shaper_para_c = 0;
+ shaper_para_p = 0;
+ }
- shaper_para = hclge_tm_get_shapping_para(0, 0, 0,
- HCLGE_SHAPER_BS_U_DEF,
- HCLGE_SHAPER_BS_S_DEF);
ret = hclge_tm_pri_shapping_cfg(hdev, HCLGE_TM_SHAP_C_BUCKET, i,
- shaper_para, rate);
+ shaper_para_c, rate);
if (ret)
return ret;
- shaper_para = hclge_tm_get_shapping_para(ir_para.ir_b,
- ir_para.ir_u,
- ir_para.ir_s,
- HCLGE_SHAPER_BS_U_DEF,
- HCLGE_SHAPER_BS_S_DEF);
ret = hclge_tm_pri_shapping_cfg(hdev, HCLGE_TM_SHAP_P_BUCKET, i,
- shaper_para, rate);
+ shaper_para_p, rate);
if (ret)
return ret;
}
@@ -1125,7 +1144,7 @@ static int hclge_tm_pri_tc_base_dwrr_cfg(struct hclge_dev *hdev)
int ret;
u32 i, k;
- for (i = 0; i < hdev->tm_info.num_tc; i++) {
+ for (i = 0; i < hdev->tc_max; i++) {
pg_info =
&hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid];
dwrr = pg_info->tc_dwrr[i];
@@ -1135,9 +1154,15 @@ static int hclge_tm_pri_tc_base_dwrr_cfg(struct hclge_dev *hdev)
return ret;
for (k = 0; k < hdev->num_alloc_vport; k++) {
+ struct hnae3_knic_private_info *kinfo = &vport[k].nic.kinfo;
+
+ if (i >= kinfo->tc_info.max_tc)
+ continue;
+
+ dwrr = i < kinfo->tc_info.num_tc ? vport[k].dwrr : 0;
ret = hclge_tm_qs_weight_cfg(
hdev, vport[k].qs_offset + i,
- vport[k].dwrr);
+ dwrr);
if (ret)
return ret;
}
@@ -1303,6 +1328,7 @@ static int hclge_tm_schd_mode_tc_base_cfg(struct hclge_dev *hdev, u8 pri_id)
{
struct hclge_vport *vport = hdev->vport;
int ret;
+ u8 mode;
u16 i;
ret = hclge_tm_pri_schd_mode_cfg(hdev, pri_id);
@@ -1310,9 +1336,16 @@ static int hclge_tm_schd_mode_tc_base_cfg(struct hclge_dev *hdev, u8 pri_id)
return ret;
for (i = 0; i < hdev->num_alloc_vport; i++) {
+ struct hnae3_knic_private_info *kinfo = &vport[i].nic.kinfo;
+
+ if (pri_id >= kinfo->tc_info.max_tc)
+ continue;
+
+ mode = pri_id < kinfo->tc_info.num_tc ? HCLGE_SCH_MODE_DWRR :
+ HCLGE_SCH_MODE_SP;
ret = hclge_tm_qs_schd_mode_cfg(hdev,
vport[i].qs_offset + pri_id,
- HCLGE_SCH_MODE_DWRR);
+ mode);
if (ret)
return ret;
}
@@ -1353,7 +1386,7 @@ static int hclge_tm_lvl34_schd_mode_cfg(struct hclge_dev *hdev)
u8 i;
if (hdev->tx_sch_mode == HCLGE_FLAG_TC_BASE_SCH_MODE) {
- for (i = 0; i < hdev->tm_info.num_tc; i++) {
+ for (i = 0; i < hdev->tc_max; i++) {
ret = hclge_tm_schd_mode_tc_base_cfg(hdev, i);
if (ret)
return ret;
--
2.33.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net 5/6] net: hns3: fix PF rss size initialization bug
2022-06-11 12:25 [PATCH net 0/6] net: hns3: add some fixes for -net Guangbin Huang
` (3 preceding siblings ...)
2022-06-11 12:25 ` [PATCH net 4/6] net: hns3: restore tm priority/qset to default settings when tc disabled Guangbin Huang
@ 2022-06-11 12:25 ` Guangbin Huang
2022-06-11 12:25 ` [PATCH net 6/6] net: hns3: fix tm port shapping of fibre port is incorrect after driver initialization Guangbin Huang
2022-06-13 11:00 ` [PATCH net 0/6] net: hns3: add some fixes for -net patchwork-bot+netdevbpf
6 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2022-06-11 12:25 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288
From: Jie Wang <wangjie125@huawei.com>
Currently hns3 driver misuses the VF rss size to initialize the PF rss size
in hclge_tm_vport_tc_info_update. So this patch fix it by checking the
vport id before initialization.
Fixes: 7347255ea389 ("net: hns3: refactor PF rss get APIs with new common rss get APIs")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index ad53a3447322..f5296ff60694 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -681,7 +681,9 @@ static void hclge_tm_vport_tc_info_update(struct hclge_vport *vport)
kinfo->num_tqps = hclge_vport_get_tqp_num(vport);
vport->dwrr = 100; /* 100 percent as init */
vport->bw_limit = hdev->tm_info.pg_info[0].bw_limit;
- hdev->rss_cfg.rss_size = kinfo->rss_size;
+
+ if (vport->vport_id == PF_VPORT_ID)
+ hdev->rss_cfg.rss_size = kinfo->rss_size;
/* when enable mqprio, the tc_info has been updated. */
if (kinfo->tc_info.mqprio_active)
--
2.33.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net 6/6] net: hns3: fix tm port shapping of fibre port is incorrect after driver initialization
2022-06-11 12:25 [PATCH net 0/6] net: hns3: add some fixes for -net Guangbin Huang
` (4 preceding siblings ...)
2022-06-11 12:25 ` [PATCH net 5/6] net: hns3: fix PF rss size initialization bug Guangbin Huang
@ 2022-06-11 12:25 ` Guangbin Huang
2022-06-13 11:00 ` [PATCH net 0/6] net: hns3: add some fixes for -net patchwork-bot+netdevbpf
6 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2022-06-11 12:25 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288
Currently in driver initialization process, driver will set shapping
parameters of tm port to default speed read from firmware. However, the
speed of SFP module may not be default speed, so shapping parameters of
tm port may be incorrect.
To fix this problem, driver sets new shapping parameters for tm port
after getting exact speed of SFP module in this case.
Fixes: 88d10bd6f730 ("net: hns3: add support for multiple media type")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
.../net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 11 ++++++++---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 2 +-
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h | 1 +
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 2e891b837c51..fae79764dc44 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -3268,7 +3268,7 @@ static int hclge_tp_port_init(struct hclge_dev *hdev)
static int hclge_update_port_info(struct hclge_dev *hdev)
{
struct hclge_mac *mac = &hdev->hw.mac;
- int speed = HCLGE_MAC_SPEED_UNKNOWN;
+ int speed;
int ret;
/* get the port info from SFP cmd if not copper port */
@@ -3279,10 +3279,13 @@ static int hclge_update_port_info(struct hclge_dev *hdev)
if (!hdev->support_sfp_query)
return 0;
- if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2)
+ if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2) {
+ speed = mac->speed;
ret = hclge_get_sfp_info(hdev, mac);
- else
+ } else {
+ speed = HCLGE_MAC_SPEED_UNKNOWN;
ret = hclge_get_sfp_speed(hdev, &speed);
+ }
if (ret == -EOPNOTSUPP) {
hdev->support_sfp_query = false;
@@ -3294,6 +3297,8 @@ static int hclge_update_port_info(struct hclge_dev *hdev)
if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2) {
if (mac->speed_type == QUERY_ACTIVE_SPEED) {
hclge_update_port_capability(hdev, mac);
+ if (mac->speed != speed)
+ (void)hclge_tm_port_shaper_cfg(hdev);
return 0;
}
return hclge_cfg_mac_speed_dup(hdev, mac->speed,
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index f5296ff60694..2f33b036a47a 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -420,7 +420,7 @@ static int hclge_tm_pg_shapping_cfg(struct hclge_dev *hdev,
return hclge_cmd_send(&hdev->hw, &desc, 1);
}
-static int hclge_tm_port_shaper_cfg(struct hclge_dev *hdev)
+int hclge_tm_port_shaper_cfg(struct hclge_dev *hdev)
{
struct hclge_port_shapping_cmd *shap_cfg_cmd;
struct hclge_shaper_ir_para ir_para;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
index 619cc30a2dfc..d943943912f7 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
@@ -237,6 +237,7 @@ int hclge_pause_addr_cfg(struct hclge_dev *hdev, const u8 *mac_addr);
void hclge_pfc_rx_stats_get(struct hclge_dev *hdev, u64 *stats);
void hclge_pfc_tx_stats_get(struct hclge_dev *hdev, u64 *stats);
int hclge_tm_qs_shaper_cfg(struct hclge_vport *vport, int max_tx_rate);
+int hclge_tm_port_shaper_cfg(struct hclge_dev *hdev);
int hclge_tm_get_qset_num(struct hclge_dev *hdev, u16 *qset_num);
int hclge_tm_get_pri_num(struct hclge_dev *hdev, u8 *pri_num);
int hclge_tm_get_qset_map_pri(struct hclge_dev *hdev, u16 qset_id, u8 *priority,
--
2.33.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net 0/6] net: hns3: add some fixes for -net
2022-06-11 12:25 [PATCH net 0/6] net: hns3: add some fixes for -net Guangbin Huang
` (5 preceding siblings ...)
2022-06-11 12:25 ` [PATCH net 6/6] net: hns3: fix tm port shapping of fibre port is incorrect after driver initialization Guangbin Huang
@ 2022-06-13 11:00 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-13 11:00 UTC (permalink / raw)
To: Guangbin Huang; +Cc: davem, kuba, netdev, linux-kernel, lipeng321, chenhao288
Hello:
This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Sat, 11 Jun 2022 20:25:23 +0800 you wrote:
> This series adds some fixes for the HNS3 ethernet driver.
>
> Guangbin Huang (3):
> net: hns3: set port base vlan tbl_sta to false before removing old
> vlan
> net: hns3: restore tm priority/qset to default settings when tc
> disabled
> net: hns3: fix tm port shapping of fibre port is incorrect after
> driver initialization
>
> [...]
Here is the summary with links:
- [net,1/6] net: hns3: set port base vlan tbl_sta to false before removing old vlan
https://git.kernel.org/netdev/net/c/9eda7d8bcbdb
- [net,2/6] net: hns3: don't push link state to VF if unalive
https://git.kernel.org/netdev/net/c/283847e3ef6d
- [net,3/6] net: hns3: modify the ring param print info
https://git.kernel.org/netdev/net/c/cfd80687a538
- [net,4/6] net: hns3: restore tm priority/qset to default settings when tc disabled
https://git.kernel.org/netdev/net/c/e93530ae0e5d
- [net,5/6] net: hns3: fix PF rss size initialization bug
https://git.kernel.org/netdev/net/c/71b215f36dca
- [net,6/6] net: hns3: fix tm port shapping of fibre port is incorrect after driver initialization
https://git.kernel.org/netdev/net/c/12a367088772
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] 14+ messages in thread
* Re: [PATCH net 0/6] net: hns3: add some fixes for -net
2022-04-24 12:57 Guangbin Huang
@ 2022-04-25 9:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-25 9:50 UTC (permalink / raw)
To: Guangbin Huang; +Cc: davem, kuba, netdev, linux-kernel, lipeng321, chenhao288
Hello:
This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Sun, 24 Apr 2022 20:57:19 +0800 you wrote:
> This series adds some fixes for the HNS3 ethernet driver.
>
> Hao Chen (1):
> net: hns3: align the debugfs output to the left
>
> Jian Shen (3):
> net: hns3: clear inited state and stop client after failed to register
> netdev
> net: hns3: add validity check for message data length
> net: hns3: add return value for mailbox handling in PF
>
> [...]
Here is the summary with links:
- [net,1/6] net: hns3: clear inited state and stop client after failed to register netdev
https://git.kernel.org/netdev/net/c/e98365afc1e9
- [net,2/6] net: hns3: align the debugfs output to the left
https://git.kernel.org/netdev/net/c/1ec1968e4e43
- [net,3/6] net: hns3: fix error log of tx/rx tqps stats
https://git.kernel.org/netdev/net/c/123521b6b260
- [net,4/6] net: hns3: modify the return code of hclge_get_ring_chain_from_mbx
https://git.kernel.org/netdev/net/c/48009e997297
- [net,5/6] net: hns3: add validity check for message data length
https://git.kernel.org/netdev/net/c/7d413735cb18
- [net,6/6] net: hns3: add return value for mailbox handling in PF
https://git.kernel.org/netdev/net/c/c59d60629684
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] 14+ messages in thread
* [PATCH net 0/6] net: hns3: add some fixes for -net
@ 2022-04-24 12:57 Guangbin Huang
2022-04-25 9:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 14+ messages in thread
From: Guangbin Huang @ 2022-04-24 12:57 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288
This series adds some fixes for the HNS3 ethernet driver.
Hao Chen (1):
net: hns3: align the debugfs output to the left
Jian Shen (3):
net: hns3: clear inited state and stop client after failed to register
netdev
net: hns3: add validity check for message data length
net: hns3: add return value for mailbox handling in PF
Jie Wang (1):
net: hns3: modify the return code of hclge_get_ring_chain_from_mbx
Peng Li (1):
net: hns3: fix error log of tx/rx tqps stats
.../hns3/hns3_common/hclge_comm_tqp_stats.c | 4 +-
.../ethernet/hisilicon/hns3/hns3_debugfs.c | 84 +++++++++----------
.../net/ethernet/hisilicon/hns3/hns3_enet.c | 9 ++
.../hisilicon/hns3/hns3pf/hclge_mbx.c | 31 ++++---
4 files changed, 73 insertions(+), 55 deletions(-)
--
2.33.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net 0/6] net: hns3: add some fixes for -net
2022-03-26 9:50 Guangbin Huang
@ 2022-03-26 16:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-26 16:20 UTC (permalink / raw)
To: Guangbin Huang; +Cc: davem, kuba, netdev, linux-kernel, lipeng321, chenhao288
Hello:
This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Sat, 26 Mar 2022 17:50:59 +0800 you wrote:
> This series adds some fixes for the HNS3 ethernet driver.
>
> Guangbin Huang (1):
> net: hns3: fix phy can not link up when autoneg off and reset
>
> Hao Chen (4):
> net: hns3: fix ethtool tx copybreak buf size indicating not aligned
> issue
> net: hns3: add max order judgement for tx spare buffer
> net: hns3: add netdev reset check for hns3_set_tunable()
> net: hns3: add NULL pointer check for hns3_set/get_ringparam()
>
> [...]
Here is the summary with links:
- [net,1/6] net: hns3: fix ethtool tx copybreak buf size indicating not aligned issue
https://git.kernel.org/netdev/net/c/877837211802
- [net,2/6] net: hns3: add max order judgement for tx spare buffer
https://git.kernel.org/netdev/net/c/a89cbb16995b
- [net,3/6] net: hns3: clean residual vf config after disable sriov
https://git.kernel.org/netdev/net/c/671cb8cbb9c9
- [net,4/6] net: hns3: add netdev reset check for hns3_set_tunable()
https://git.kernel.org/netdev/net/c/f5cd60169f98
- [net,5/6] net: hns3: add NULL pointer check for hns3_set/get_ringparam()
https://git.kernel.org/netdev/net/c/4d07c5936c25
- [net,6/6] net: hns3: fix phy can not link up when autoneg off and reset
https://git.kernel.org/netdev/net/c/ad0ecaef6a2c
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] 14+ messages in thread
* [PATCH net 0/6] net: hns3: add some fixes for -net
@ 2022-03-26 9:50 Guangbin Huang
2022-03-26 16:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 14+ messages in thread
From: Guangbin Huang @ 2022-03-26 9:50 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288
This series adds some fixes for the HNS3 ethernet driver.
Guangbin Huang (1):
net: hns3: fix phy can not link up when autoneg off and reset
Hao Chen (4):
net: hns3: fix ethtool tx copybreak buf size indicating not aligned
issue
net: hns3: add max order judgement for tx spare buffer
net: hns3: add netdev reset check for hns3_set_tunable()
net: hns3: add NULL pointer check for hns3_set/get_ringparam()
Peng Li (1):
net: hns3: clean residual vf config after disable sriov
drivers/net/ethernet/hisilicon/hns3/hnae3.h | 3 ++
.../net/ethernet/hisilicon/hns3/hns3_enet.c | 44 +++++++++++++---
.../ethernet/hisilicon/hns3/hns3_ethtool.c | 23 ++++++---
.../hisilicon/hns3/hns3pf/hclge_main.c | 50 +++++++++++++++++++
.../hisilicon/hns3/hns3pf/hclge_mdio.c | 4 +-
5 files changed, 107 insertions(+), 17 deletions(-)
--
2.33.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net 0/6] net: hns3: add some fixes for -net
@ 2021-09-15 13:52 Guangbin Huang
0 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-09-15 13:52 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2
This series adds some fixes for the HNS3 ethernet driver.
Jian Shen (2):
net: hns3: fix change RSS 'hfunc' ineffective issue
net: hns3: fix inconsistent vf id print
Jiaran Zhang (1):
net: hns3: fix misuse vf id and vport id in some logs
Yufeng Mo (2):
net: hns3: check queue id range before using
net: hns3: fix a return value error in hclge_get_reset_status()
liaoguojia (1):
net: hns3: check vlan id before using it
.../hisilicon/hns3/hns3pf/hclge_err.c | 8 +-
.../hisilicon/hns3/hns3pf/hclge_main.c | 80 +++++++++++++------
.../hisilicon/hns3/hns3pf/hclge_mbx.c | 10 ++-
.../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 2 +-
.../hisilicon/hns3/hns3vf/hclgevf_main.c | 52 +++++++-----
5 files changed, 103 insertions(+), 49 deletions(-)
--
2.33.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net 0/6] net: hns3: add some fixes for -net
@ 2021-09-13 13:08 Guangbin Huang
0 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-09-13 13:08 UTC (permalink / raw)
To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2
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
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2022-06-13 12:12 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-11 12:25 [PATCH net 0/6] net: hns3: add some fixes for -net Guangbin Huang
2022-06-11 12:25 ` [PATCH net 1/6] net: hns3: set port base vlan tbl_sta to false before removing old vlan Guangbin Huang
2022-06-11 12:25 ` [PATCH net 2/6] net: hns3: don't push link state to VF if unalive Guangbin Huang
2022-06-11 12:25 ` [PATCH net 3/6] net: hns3: modify the ring param print info Guangbin Huang
2022-06-11 12:25 ` [PATCH net 4/6] net: hns3: restore tm priority/qset to default settings when tc disabled Guangbin Huang
2022-06-11 12:25 ` [PATCH net 5/6] net: hns3: fix PF rss size initialization bug Guangbin Huang
2022-06-11 12:25 ` [PATCH net 6/6] net: hns3: fix tm port shapping of fibre port is incorrect after driver initialization Guangbin Huang
2022-06-13 11:00 ` [PATCH net 0/6] net: hns3: add some fixes for -net patchwork-bot+netdevbpf
-- strict thread matches above, loose matches on Subject: below --
2022-04-24 12:57 Guangbin Huang
2022-04-25 9:50 ` patchwork-bot+netdevbpf
2022-03-26 9:50 Guangbin Huang
2022-03-26 16:20 ` patchwork-bot+netdevbpf
2021-09-15 13:52 Guangbin Huang
2021-09-13 13:08 Guangbin Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome