DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ixgbevf: fix link status for PF up/down events
@ 2015-06-16 14:38 Sergio Gonzalez Monroy
  2015-06-22 10:17 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Sergio Gonzalez Monroy @ 2015-06-16 14:38 UTC (permalink / raw)
  To: dev

Current ixgbe VF base driver only really read the status register when:
 - get_link_status is true
 - link reset
 - mailbox timeout.

We only set get_link_status to true when we start the PF/VF, so
following calls to ixgbe_dev_link_update will just keep the old link
status unless the link has been reset.

Because of this behaviour, when the link status of the PF changes after
the VF has been initialized, we do not read the current status register
from the nic and instead we just keep the old link status.

Fix the problem by setting this field to true before calling
ixgbe_check_link function from base driver. We don't need to check after
this call for get_link_status anymore, so remove it.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 7414a2e..4affb01 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2128,11 +2128,14 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 	memset(&old, 0, sizeof(old));
 	rte_ixgbe_dev_atomic_read_link_status(dev, &old);
 
+	hw->mac.get_link_status = true;
+
 	/* check if it needs to wait to complete, if lsc interrupt is enabled */
 	if (wait_to_complete == 0 || dev->data->dev_conf.intr_conf.lsc != 0)
 		diag = ixgbe_check_link(hw, &link_speed, &link_up, 0);
 	else
 		diag = ixgbe_check_link(hw, &link_speed, &link_up, 1);
+
 	if (diag != 0) {
 		link.link_speed = ETH_LINK_SPEED_100;
 		link.link_duplex = ETH_LINK_HALF_DUPLEX;
@@ -2142,12 +2145,6 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 		return 0;
 	}
 
-	if (link_speed == IXGBE_LINK_SPEED_UNKNOWN &&
-	    !hw->mac.get_link_status) {
-		memcpy(&link, &old, sizeof(link));
-		return -1;
-	}
-
 	if (link_up == 0) {
 		rte_ixgbe_dev_atomic_write_link_status(dev, &link);
 		if (link.link_status == old.link_status)
-- 
1.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] ixgbevf: fix link status for PF up/down events
  2015-06-16 14:38 [dpdk-dev] [PATCH] ixgbevf: fix link status for PF up/down events Sergio Gonzalez Monroy
@ 2015-06-22 10:17 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-06-22 10:17 UTC (permalink / raw)
  To: Sergio Gonzalez Monroy; +Cc: dev

2015-06-16 15:38, Sergio Gonzalez Monroy:
> Current ixgbe VF base driver only really read the status register when:
>  - get_link_status is true
>  - link reset
>  - mailbox timeout.
> 
> We only set get_link_status to true when we start the PF/VF, so
> following calls to ixgbe_dev_link_update will just keep the old link
> status unless the link has been reset.
> 
> Because of this behaviour, when the link status of the PF changes after
> the VF has been initialized, we do not read the current status register
> from the nic and instead we just keep the old link status.
> 
> Fix the problem by setting this field to true before calling
> ixgbe_check_link function from base driver. We don't need to check after
> this call for get_link_status anymore, so remove it.
> 
> Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-22 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16 14:38 [dpdk-dev] [PATCH] ixgbevf: fix link status for PF up/down events Sergio Gonzalez Monroy
2015-06-22 10:17 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).