]> git.droids-corp.org - dpdk.git/commitdiff
net/ngbe: fix link speed check
authorJiawen Wu <jiawenwu@trustnetic.com>
Mon, 30 May 2022 09:30:08 +0000 (17:30 +0800)
committerFerruh Yigit <ferruh.yigit@xilinx.com>
Tue, 31 May 2022 07:42:16 +0000 (09:42 +0200)
Since the bit of ETH_LINK_SPEED_FIXED was set for the force link
speed, it conflicts with '~allowed_speeds'.

Fixes: 3518df5774c7 ("net/ngbe: support device start/stop")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
drivers/net/ngbe/ngbe_ethdev.c

index 4a2a9dde10b215afc77a462baece2a1c68ac67ce..c7301a9616e806c6a68c682df0244f92014d0305 100644 (file)
@@ -1048,7 +1048,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;
        }