From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jyu@vmware.com>
Received: from smtp-outbound-1.vmware.com (smtp-outbound-1.vmware.com
 [208.91.2.12]) by dpdk.org (Postfix) with ESMTP id E65607F48
 for <dev@dpdk.org>; Sat,  8 Nov 2014 02:30:50 +0100 (CET)
Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com
 [10.113.161.72])
 by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 5DEB5281E8
 for <dev@dpdk.org>; Fri,  7 Nov 2014 17:40:23 -0800 (PST)
Received: from prmh-edge-ivybridge-13.eng.vmware.com
 (prmh-edge-ivybridge-13.eng.vmware.com [10.24.235.96])
 by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 58F9AB15E8;
 Fri,  7 Nov 2014 17:40:23 -0800 (PST)
From: Jia Yu <jyu@vmware.com>
To: dev@dpdk.org
Date: Fri,  7 Nov 2014 09:31:50 -0800
Message-Id: <1415381511-43364-2-git-send-email-jyu@vmware.com>
X-Mailer: git-send-email 1.9.1
In-Reply-To: <1415381511-43364-1-git-send-email-jyu@vmware.com>
References: <1415381511-43364-1-git-send-email-jyu@vmware.com>
Subject: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex,
	link_up) after rte_eth_dev_start
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Sat, 08 Nov 2014 01:30:51 -0000

Since LSR interrupt is disabled by pmd drivers, link status in rte_eth_device is always down.
Bond slave_configure() enables LSR interrupt on devices to get notification if link status
changes. However, the LSC interrupt at device start time is still lost.

In this fix, call link_update to read link status from hardware
register at device start time.

Issue:
Change-Id: Ib57a1c9114f922485c7b0f4338bfe7b3d3f87d65
Signed-off-by: Jia Yu <jyu@vmware.com>
---
 lib/librte_ether/rte_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index ff1c769..6c01b02 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -869,6 +869,10 @@ rte_eth_dev_start(uint8_t port_id)
 
 	rte_eth_dev_config_restore(port_id);
 
+	if (dev->data->dev_conf.intr_conf.lsc != 0) {
+		FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update, -ENOTSUP);
+		(*dev->dev_ops->link_update)(dev, 0);
+	}
 	return 0;
 }
 
-- 
1.9.1