[dpdk-stable] [PATCH 17.11 4/5] net/qede: fix incorrect link status update
Rasesh Mody
rasesh.mody at cavium.com
Fri Aug 3 03:00:31 CEST 2018
From: Shahed Shaikh <shahed.shaikh at cavium.com>
[ upstream commit c6034a20d9e221dc6125db57e4378520af3a515d ]
qede_link_update() always returns -1 i.e. link not changed,
because it compares the variables which always hold same value.
Fix this function by caching old link state and comparing it with
new one.
Fixes: 2ea6f76aff40 ("qede: add core driver")
Signed-off-by: Shahed Shaikh <shahed.shaikh at cavium.com>
---
drivers/net/qede/qede_ethdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 687104f..73947fc 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1478,7 +1478,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
{
struct qede_dev *qdev = eth_dev->data->dev_private;
struct ecore_dev *edev = &qdev->edev;
- uint16_t link_duplex;
+ uint16_t link_duplex, old_link_status;
struct qed_link_output link;
struct rte_eth_link *curr = ð_dev->data->dev_link;
@@ -1503,6 +1503,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
curr->link_duplex = link_duplex;
/* Link Status */
+ old_link_status = curr->link_status;
curr->link_status = (link.link_up) ? ETH_LINK_UP : ETH_LINK_DOWN;
/* AN */
@@ -1514,7 +1515,7 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
curr->link_autoneg, curr->link_status);
/* return 0 means link status changed, -1 means not changed */
- return ((curr->link_status == link.link_up) ? -1 : 0);
+ return ((curr->link_status == old_link_status) ? -1 : 0);
}
static void qede_promiscuous_enable(struct rte_eth_dev *eth_dev)
--
1.7.10.3
More information about the stable
mailing list