[1/7] net/bnxt: avoid an unnecessary delay in port stop

Message ID 20200206163314.12755-2-kalesh-anakkur.purayil@broadcom.com (mailing list archive)
State Superseded, archived
Headers
Series bnxt patchset with bug fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation fail apply issues

Commit Message

Kalesh A P Feb. 6, 2020, 4:33 p.m. UTC
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

VFs and multifunction PFs do not have the privilege to change
link configuration. We force the physical link down as a part
of device stop only for single physical function(SPF).

This change also helps in eliminating the logs when a VF port
is stopped:

"Port 0: link state change event"
"bnxt_print_link_info(): Port 0 Link Up - speed 25000 Mbps - full-duplex"

Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index c1cb401..5378209 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -948,9 +948,10 @@  static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 	bnxt_dev_set_link_down_op(eth_dev);
 
 	/* Wait for link to be reset and the async notification to process.
-	 * During reset recovery, there is no need to wait
+	 * During reset recovery, there is no need to wait and
+	 * VF/NPAR functions do not have privilege to change PHY config.
 	 */
-	if (!is_bnxt_in_error(bp))
+	if (!is_bnxt_in_error(bp) && BNXT_SINGLE_PF(bp))
 		bnxt_link_update(eth_dev, 1, ETH_LINK_DOWN);
 
 	/* Clean queue intr-vector mapping */