[dpdk-stable] patch 'net/qede: fix incorrect link status update' has been queued to stable release 18.05.1
Christian Ehrhardt
christian.ehrhardt at canonical.com
Mon Jul 30 18:10:52 CEST 2018
Hi,
FYI, your patch has been queued to stable release 18.05.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/01/18. So please
shout if anyone has objections.
Thanks.
Christian Ehrhardt <christian.ehrhardt at canonical.com>
---
>From 61f9333f49122768aa4fbf6a00a94e81a315fc3a Mon Sep 17 00:00:00 2001
From: Shahed Shaikh <shahed.shaikh at cavium.com>
Date: Thu, 7 Jun 2018 09:30:51 -0700
Subject: [PATCH] net/qede: fix incorrect link status update
[ 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 using rte_eth_linkstatus_set().
Fixes: 2ea6f76aff40 ("qede: add core driver")
Signed-off-by: Shahed Shaikh <shahed.shaikh at cavium.com>
---
drivers/net/qede/qede_ethdev.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index cd9ec1070..7a63d0564 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -1590,18 +1590,20 @@ qede_link_update(struct rte_eth_dev *eth_dev, __rte_unused int wait_to_complete)
{
struct qede_dev *qdev = eth_dev->data->dev_private;
struct ecore_dev *edev = &qdev->edev;
+ struct qed_link_output q_link;
+ struct rte_eth_link link;
uint16_t link_duplex;
- struct qed_link_output link;
- struct rte_eth_link *curr = ð_dev->data->dev_link;
- memset(&link, 0, sizeof(struct qed_link_output));
- qdev->ops->common->get_link(edev, &link);
+ memset(&q_link, 0, sizeof(q_link));
+ memset(&link, 0, sizeof(link));
+
+ qdev->ops->common->get_link(edev, &q_link);
/* Link Speed */
- curr->link_speed = link.speed;
+ link.link_speed = q_link.speed;
/* Link Mode */
- switch (link.duplex) {
+ switch (q_link.duplex) {
case QEDE_DUPLEX_HALF:
link_duplex = ETH_LINK_HALF_DUPLEX;
break;
@@ -1612,21 +1614,20 @@ qede_link_update(struct rte_eth_dev *eth_dev, __rte_unused int wait_to_complete)
default:
link_duplex = -1;
}
- curr->link_duplex = link_duplex;
+ link.link_duplex = link_duplex;
/* Link Status */
- curr->link_status = (link.link_up) ? ETH_LINK_UP : ETH_LINK_DOWN;
+ link.link_status = q_link.link_up ? ETH_LINK_UP : ETH_LINK_DOWN;
/* AN */
- curr->link_autoneg = (link.supported_caps & QEDE_SUPPORTED_AUTONEG) ?
+ link.link_autoneg = (q_link.supported_caps & QEDE_SUPPORTED_AUTONEG) ?
ETH_LINK_AUTONEG : ETH_LINK_FIXED;
DP_INFO(edev, "Link - Speed %u Mode %u AN %u Status %u\n",
- curr->link_speed, curr->link_duplex,
- curr->link_autoneg, curr->link_status);
+ link.link_speed, link.link_duplex,
+ link.link_autoneg, link.link_status);
- /* return 0 means link status changed, -1 means not changed */
- return ((curr->link_status == link.link_up) ? -1 : 0);
+ return rte_eth_linkstatus_set(eth_dev, &link);
}
static void qede_promiscuous_enable(struct rte_eth_dev *eth_dev)
--
2.17.1
More information about the stable
mailing list