From: Kalesh AP Date: Thu, 18 Jul 2019 03:35:58 +0000 (+0530) Subject: net/bnxt: fix unconditional wait in link update X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0a44537589454a9aba3e9ad392218ad433fbf529;p=dpdk.git net/bnxt: fix unconditional wait in link update There is an unconditional delay in link update op. Fixed it to wait only if wait for request completion is set. Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Lance Richardson --- diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 15048de3f1..55b030a2b4 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -973,11 +973,12 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete) "Failed to retrieve link rc = 0x%x!\n", rc); goto out; } - rte_delay_ms(BNXT_LINK_WAIT_INTERVAL); - if (!wait_to_complete) + if (!wait_to_complete || new.link_status) break; - } while (!new.link_status && cnt--); + + rte_delay_ms(BNXT_LINK_WAIT_INTERVAL); + } while (cnt--); out: /* Timed out or success */