From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jia Yu Subject: [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start Date: Fri, 7 Nov 2014 09:31:50 -0800 Message-ID: <1415381511-43364-2-git-send-email-jyu@vmware.com> References: <1415381511-43364-1-git-send-email-jyu@vmware.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1415381511-43364-1-git-send-email-jyu-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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 --- 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