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 111AC2BC8 for ; Fri, 30 Mar 2018 05:07:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2018 20:07:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,378,1517904000"; d="scan'208";a="46490324" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 29 Mar 2018 20:07:50 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 29 Mar 2018 20:07:50 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 29 Mar 2018 20:07:49 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.235]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.108]) with mapi id 14.03.0319.002; Fri, 30 Mar 2018 11:07:47 +0800 From: "Zhang, Helin" To: "Zhang, Helin" , Tushar Mulkar , "dev@dpdk.org" CC: "Xing, Beilei" , "Zhang, Qi Z" Thread-Topic: [PATCH v2] net/i40e: fix link_state update for i40e_ethdev_vf drv Thread-Index: AQHTpYrgIRh/5+Xo3E2D0Xa0Z1IJnKOjyr+QgEC68mCAA9d08A== Date: Fri, 30 Mar 2018 03:07:47 +0000 Message-ID: References: <20180214115630.136681-1-tmulkar@sandvine.com> 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="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix link_state update for i40e_ethdev_vf drv X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Mar 2018 03:07:52 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Helin > Sent: Wednesday, March 28, 2018 12:30 AM > To: Tushar Mulkar; dev@dpdk.org > Cc: Xing, Beilei; Zhang, Qi Z > Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix link_state update for > i40e_ethdev_vf drv >=20 >=20 >=20 > > -----Original Message----- > > From: Tushar Mulkar [mailto:tmulkar@sandvine.com] > > Sent: Wednesday, February 14, 2018 8:00 PM > > To: Zhang, Helin; dev@dpdk.org > > Cc: Xing, Beilei; Zhang, Qi Z > > Subject: [PATCH v2] net/i40e: fix link_state update for i40e_ethdev_vf > > drv > > > > The check for bool was accounting unwanted bits in the calulation of > > truth value. In dpdk unsingned int is typedefed to bool but all it > > cares about is Least Significant Bit. But in calculation of condition > > expression the bits other than LSB was used which doesn't make sense. > > Some time these bits has values which results in to incorrect > > expression results. To fix this we just need to account LSB form the > > bool value . This can be easily done by anding the value with true. > > > > Signed-off-by: Tushar Mulkar > > --- > > drivers/net/i40e/i40e_ethdev_vf.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c > > b/drivers/net/i40e/i40e_ethdev_vf.c > > index b96d77a0c..d23dff044 100644 > > --- a/drivers/net/i40e/i40e_ethdev_vf.c > > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > > @@ -2095,8 +2095,8 @@ i40evf_dev_link_update(struct rte_eth_dev *dev, > > } > > /* full duplex only */ > > new_link.link_duplex =3D ETH_LINK_FULL_DUPLEX; > > - new_link.link_status =3D vf->link_up ? ETH_LINK_UP : > > - ETH_LINK_DOWN; > > + new_link.link_status =3D (vf->link_up & true) ? > > + ETH_LINK_UP : ETH_LINK_DOWN; > It is a bit strange to do bit manipunation on a bool type of value. > Do you see any wrong case with that variable? If yes, I'd suggest correct= that > one, rather than doing like this. I'd set it to change requested for now, if there no clarification for the c= omments, and no ACK. Feel free to set it back if there is anything new. Thanks! /Helin >=20 > Thanks, > Helin >=20 > > new_link.link_autoneg =3D > > dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED; > > > > -- > > 2.11.0