[dpdk-dev] ixgbe: logic change in ixgbe_check_mac_link_vf().

Message ID 1414791289-6260-1-git-send-email-lee.roberts@hp.com (mailing list archive)
State Superseded, archived

Commit Message

lee.roberts@hp.com Oct. 31, 2014, 9:34 p.m. UTC
  From: Lee Roberts <lee.roberts@hp.com>

This patch corrects an issue where "testpmd" run against
ixgbevf ports in the host OS reports speed as 100 Mbps
and half-duplex.

If the link status is still needed, set speed to zero,
change ret_val and goto quick exit.  Otherwise, continue
processing to get the correct link speed.

Signed-off by: Lee Roberts <lee.roberts at hp.com>
 lib/librte_pmd_ixgbe/ixgbe/ixgbe_vf.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)


Balazs Nemeth Dec. 19, 2014, 10:31 a.m. UTC | #1
This patch is a workaround for the issue at the level of the ixgbe
driver code. The problem can actually be fixed at the level of DPDK
instead.  Furthermore, this patch circumvents the problem by moving the
check that determines if the link status needs to be read (which always
fails because get_link_status is not set before the
ixgbe_check_mac_link_vf function is called) into a portion of the code
that is skipped in most cases. I believe that this patch should be
superseded by the following patch:



diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_vf.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_vf.c
index e6b6c51..04a962b 100644
--- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_vf.c
+++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_vf.c
@@ -550,11 +550,12 @@  s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 	/* If we were hit with a reset drop the link */
-	if (!mbx->ops.check_for_rst(hw, 0) || !mbx->timeout)
+	if (!mbx->ops.check_for_rst(hw, 0) || !mbx->timeout) {
 		mac->get_link_status = true;
-	if (!mac->get_link_status)
+		*speed = 0;
+		ret_val = -1;
 		goto out;
+	}
 	/* if link status is down no point in checking to see if pf is up */
 	links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);