Skip to content

Commit

Permalink
net/ixgbe: fix link status
Browse files Browse the repository at this point in the history
[ upstream commit 1ca0583 ]

The link status for 82599eb got from link status register was not
correct, check the enable/disable flag of tx laser when getting the link
status, set the link status down if tx laser disabled since the tx laser
flag could be set correctly when up/down the link status.

Fixes: dc66e5f ("net/ixgbe: improve link state check on VF")

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
  • Loading branch information
xiaozha3 authored and kevintraynor committed Dec 11, 2019
1 parent f4d7ffe commit c904c37
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/ixgbe/ixgbe_ethdev.c
Expand Up @@ -2943,6 +2943,7 @@ ixgbe_dev_set_link_up(struct rte_eth_dev *dev)
} else {
/* Turn on the laser */
ixgbe_enable_tx_laser(hw);
ixgbe_dev_link_update(dev, 0);
}

return 0;
Expand Down Expand Up @@ -2973,6 +2974,7 @@ ixgbe_dev_set_link_down(struct rte_eth_dev *dev)
} else {
/* Turn off the laser */
ixgbe_disable_tx_laser(hw);
ixgbe_dev_link_update(dev, 0);
}

return 0;
Expand Down Expand Up @@ -4086,6 +4088,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
int link_up;
int diag;
int wait = 1;
u32 esdp_reg;

memset(&link, 0, sizeof(link));
link.link_status = ETH_LINK_DOWN;
Expand Down Expand Up @@ -4113,6 +4116,10 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
return rte_eth_linkstatus_set(dev, &link);
}

esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
if ((esdp_reg & IXGBE_ESDP_SDP3))
link_up = 0;

if (link_up == 0) {
if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
Expand Down

0 comments on commit c904c37

Please sign in to comment.