Skip to content

Commit

Permalink
net/ngbe: fix link speed check
Browse files Browse the repository at this point in the history
[ upstream commit bf1bc99 ]

Since the bit of ETH_LINK_SPEED_FIXED was set for the force link
speed, it conflicts with '~allowed_speeds'.

Fixes: 3518df5 ("net/ngbe: support device start/stop")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
  • Loading branch information
Jiawen Wu authored and kevintraynor committed Jun 8, 2022
1 parent b6db13d commit c2f1874
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ngbe/ngbe_ethdev.c
Expand Up @@ -1041,7 +1041,7 @@ ngbe_dev_start(struct rte_eth_dev *dev)
if (hw->mac.default_speeds & NGBE_LINK_SPEED_10M_FULL)
allowed_speeds |= RTE_ETH_LINK_SPEED_10M;

if (*link_speeds & ~allowed_speeds) {
if (((*link_speeds) >> 1) & ~(allowed_speeds >> 1)) {
PMD_INIT_LOG(ERR, "Invalid link setting");
goto error;
}
Expand Down

0 comments on commit c2f1874

Please sign in to comment.