From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-outbound-1.vmware.com (smtp-outbound-1.vmware.com [208.91.2.12]) by dpdk.org (Postfix) with ESMTP id CEBE29AAF for ; Tue, 3 Feb 2015 09:00:37 +0100 (CET) Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 2B71528FBD; Tue, 3 Feb 2015 00:00:35 -0800 (PST) Received: from EX13-CAS-013.vmware.com (EX13-CAS-013.vmware.com [10.113.191.65]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 2174F40610; Tue, 3 Feb 2015 00:00:35 -0800 (PST) Received: from EX13-MBX-018.vmware.com (10.113.191.38) by EX13-MBX-019.vmware.com (10.113.191.39) with Microsoft SMTP Server (TLS) id 15.0.913.22; Tue, 3 Feb 2015 00:00:34 -0800 Received: from EX13-MBX-018.vmware.com ([fe80::7cdc:b1ba:f507:8b02]) by EX13-MBX-018.vmware.com ([fe80::7cdc:b1ba:f507:8b02%15]) with mapi id 15.00.0913.011; Tue, 3 Feb 2015 00:00:28 -0800 From: Jia Yu To: "Zhang, Helin" Thread-Topic: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start Thread-Index: AQHQPHeTe4WMz4hiRkaClB60kU3pRJzelgKA Date: Tue, 3 Feb 2015 08:00:28 +0000 Message-ID: References: <1415381511-43364-1-git-send-email-jyu@vmware.com> <1415381511-43364-2-git-send-email-jyu@vmware.com> <3121142.D7ktn8xfBZ@xps13> In-Reply-To: <3121142.D7ktn8xfBZ@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.113.160.246] Content-Type: text/plain; charset="Windows-1252" Content-ID: <22DB6E6166183B4B83AF24176C22641F@pa-exch1.vmware.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2015 08:00:38 -0000 My answer to Helin=B9s comments: This patch is needed for bond slave devices or other devices, when LSC interrupt is enabled. 1. slave_configure() -> slave_eth_dev->=8A.lsc =3D 1 2. rte_eth_link_get() reads dev_link from eth_dev, when lsc interrupt is enabled. However, the dev_link on eth_dev has not be initialized and showed link down state. This patch initializes the device=B9s dev_link at rte_eth_dev_start time. Please let me know if you have further questions/comments. Thanks, Jia On 1/30/15, 2:28 AM, "Thomas Monjalon" wrote: >Jia, any news on this patchset? > >2014-11-12 03:57, Zhang, Helin: >> Hi Jia >>=20 >> > -----Original Message----- >> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jia Yu >> > Sent: Saturday, November 8, 2014 1:32 AM >> > To: dev@dpdk.org >> > Subject: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status >>(speed, duplex, >> > link_up) after rte_eth_dev_start >> >=20 >> > Since LSR interrupt is disabled by pmd drivers, link status in >>rte_eth_device is >> > always down. >> If LSC interrupt is disabled by default, it will poll the link status >>during the initialization >> or in dev_start, and then the link status should he correct. If I am >>not wrong. >>=20 >> > 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. >> Before enabling interrupt for LSC, the link status should be polled. So >>after the port >> startup, the link status should be there. >>=20 >> >=20 >> > In this fix, call link_update to read link status from hardware >>register at device >> > start time. >> Could you help to explain this code changes a bit more? Why we need it? >>=20 >> >=20 >> > Issue: >> > Change-Id: Ib57a1c9114f922485c7b0f4338bfe7b3d3f87d65 >> > Signed-off-by: Jia Yu >> > --- >> > lib/librte_ether/rte_ethdev.c | 4 ++++ >> > 1 file changed, 4 insertions(+) >> >=20 >> > 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) >> >=20 >> > rte_eth_dev_config_restore(port_id); >> >=20 >> > + if (dev->data->dev_conf.intr_conf.lsc !=3D 0) { >> > + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update, -ENOTSUP); >> > + (*dev->dev_ops->link_update)(dev, 0); >> > + } >> > return 0; >> > } >> >=20 >> > -- >> > 1.9.1 >>=20 >> Regards, >> Helin >