From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 59FBF9AC8 for ; Tue, 3 Feb 2015 09:35:09 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 03 Feb 2015 00:28:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,511,1418112000"; d="scan'208";a="660734031" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by fmsmga001.fm.intel.com with ESMTP; 03 Feb 2015 00:35:04 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX152.gar.corp.intel.com (172.21.73.87) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 3 Feb 2015 16:35:04 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.161]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.253]) with mapi id 14.03.0195.001; Tue, 3 Feb 2015 16:35:03 +0800 From: "Zhang, Helin" To: Jia Yu Thread-Topic: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start Thread-Index: AQHQPHeTe4WMz4hiRkaClB60kU3pRJzelgKAgAAIyaA= Date: Tue, 3 Feb 2015 08:35:03 +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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="windows-1257" 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:35:09 -0000 > -----Original Message----- > From: Jia Yu [mailto:jyu@vmware.com] > Sent: Tuesday, February 3, 2015 4:00 PM > To: Zhang, Helin > Cc: dev@dpdk.org; Thomas Monjalon > Subject: Re: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed= , > duplex, link_up) after rte_eth_dev_start >=20 > My answer to Helin=B9s comments: >=20 > This patch is needed for bond slave devices or other devices, when LSC > interrupt is enabled. > 1. slave_configure() -> slave_eth_dev->=D0.lsc =3D 1 >=20 > 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 show= ed > link down state. This patch initializes the device=B9s dev_link at > rte_eth_dev_start time. So the link update is for bond only? But your code changes is in rte_ethdev= , it will be used for all PMDs. For hardware NIC (e.g. 82599), this link update is no= t needed at all. It just need to wait the link status change event. So can those cod= e changes be put in librte_pmd_bond, but not in librte_ether? Regards, Helin >=20 > Please let me know if you have further questions/comments. >=20 > Thanks, > Jia >=20 > On 1/30/15, 2:28 AM, "Thomas Monjalon" > wrote: >=20 > >Jia, any news on this patchset? > > > >2014-11-12 03:57, Zhang, Helin: > >> Hi Jia > >> > >> > -----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 > >> > > >> > 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. > >> > >> > 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. > >> > >> > > >> > 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= ? > >> > >> > > >> > 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 !=3D 0) { > >> > + FUNC_PTR_OR_ERR_RET(*dev->dev_ops->link_update, > -ENOTSUP); > >> > + (*dev->dev_ops->link_update)(dev, 0); > >> > + } > >> > return 0; > >> > } > >> > > >> > -- > >> > 1.9.1 > >> > >> Regards, > >> Helin > >