Skip to content

Commit

Permalink
net/hns3: fix never set MAC flow control
Browse files Browse the repository at this point in the history
[ upstream commit 2350eb39f337f9e8d798f8dd1d658834e3981e9e ]

When some hardware and firmware support speed auto-negotiation
but do not support flow control auto-negotiation, driver can
never successfully set MAC flow control by flow_ctrl_set() API.
So only tell user driver doesn't support flow control autoneg
when user enable it.

Fixes: 1f411e3 ("net/hns3: support flow control autoneg for copper port")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
  • Loading branch information
LiHuiSong1 authored and kevintraynor committed Jul 11, 2023
1 parent fbfa671 commit 4077943
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/net/hns3/hns3_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -5329,16 +5329,7 @@ hns3_check_fc_autoneg_valid(struct hns3_hw *hw, uint8_t autoneg)

if (!pf->support_fc_autoneg) {
if (autoneg != 0) {
hns3_err(hw, "unsupported fc auto-negotiation setting.");
return -EOPNOTSUPP;
}

/*
* Flow control auto-negotiation of the NIC is not supported,
* but other auto-negotiation features may be supported.
*/
if (autoneg != hw->mac.link_autoneg) {
hns3_err(hw, "please use 'link_speeds' in struct rte_eth_conf to disable autoneg!");
hns3_err(hw, "unsupported fc auto-negotiation.");
return -EOPNOTSUPP;
}

Expand Down

0 comments on commit 4077943

Please sign in to comment.