From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C45E67E75 for ; Wed, 12 Nov 2014 04:47:38 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 11 Nov 2014 19:57:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,366,1413270000"; d="scan'208";a="630530300" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by fmsmga002.fm.intel.com with ESMTP; 11 Nov 2014 19:57:28 -0800 Received: from pgsmsx108.gar.corp.intel.com (10.221.44.103) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 12 Nov 2014 11:57:26 +0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by PGSMSX108.gar.corp.intel.com (10.221.44.103) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 12 Nov 2014 11:57:26 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.62]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.130]) with mapi id 14.03.0195.001; Wed, 12 Nov 2014 11:57:25 +0800 From: "Zhang, Helin" To: Jia Yu , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/2] rte_ethdev: update link status (speed, duplex, link_up) after rte_eth_dev_start Thread-Index: AQHP+vUUEQUXezj7H0KAyd8hmQlizZxcYguA Date: Wed, 12 Nov 2014 03:57:26 +0000 Message-ID: References: <1415381511-43364-1-git-send-email-jyu@vmware.com> <1415381511-43364-2-git-send-email-jyu@vmware.com> In-Reply-To: <1415381511-43364-2-git-send-email-jyu@vmware.com> 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="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Wed, 12 Nov 2014 03:47:39 -0000 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, du= plex, > link_up) after rte_eth_dev_start >=20 > Since LSR interrupt is disabled by pmd drivers, link status in rte_eth_de= vice is > always down. If LSC interrupt is disabled by default, it will poll the link status durin= g the initialization or in dev_start, and then the link status should he correct. If I am not wr= ong. > Bond slave_configure() enables LSR interrupt on devices to get notificati= on 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 aft= er the port startup, the link status should be there. >=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 > 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 Regards, Helin