From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 3F54C5B12 for ; Wed, 14 Mar 2018 15:22:41 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2018 07:22:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,470,1515484800"; d="scan'208";a="211244024" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga006.fm.intel.com with ESMTP; 14 Mar 2018 07:22:34 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 14 Mar 2018 14:22:17 +0000 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.9]) by irsmsx112.ger.corp.intel.com ([169.254.1.242]) with mapi id 14.03.0319.002; Wed, 14 Mar 2018 14:22:17 +0000 From: "Rybalchenko, Kirill" To: Tushar Mulkar , "Zhang, Helin" , "dev@dpdk.org" CC: "Xing, Beilei" , "Zhang, Qi Z" Thread-Topic: [dpdk-dev] [PATCH v2] net/i40e: fix link_state update for i40e_ethdev_vf drv Thread-Index: AQHTpYrgIRh/5+Xo3E2D0Xa0Z1IJnKOjyr+QgCwppcA= Date: Wed, 14 Mar 2018 14:22:17 +0000 Message-ID: <696B43C21188DF4F9C9091AAE4789B824E2D6555@IRSMSX108.ger.corp.intel.com> References: <20180214115630.136681-1-tmulkar@sandvine.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDllZGFiZjgtYjBmZS00MGYwLTkzYTYtYmY2Y2NkOWU0MWJmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjJSaUIxRjNyc3FKSTJNeStEUDEwTkg2RmhIU1Q2aVwveW9JZG9pSWNJV2pRPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] 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: Wed, 14 Mar 2018 14:22:42 -0000 Hi, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tushar Mulkar > Sent: Wednesday 14 February 2018 12:00 > To: Zhang, Helin ; dev@dpdk.org > Cc: Xing, Beilei ; Zhang, Qi Z > Subject: [dpdk-dev] [PATCH v2] net/i40e: fix link_state update for > i40e_ethdev_vf drv >=20 > The check for bool was accounting unwanted bits in the calulation of trut= h > 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 othe= r 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 nee= d to > account LSB form the bool value . This can be easily done by anding the v= alue > with true. I didn't find any place where link_up is assigned to something other than B= oolean. But maybe I'm wrong or I misunderstood what you're saying. And there is another place in this file with similar evaluation in i40evf_r= ead_pfmsg() function. Format of commit message should be modified as well - it is formatted in on= e long line without line breaks. >=20 > Signed-off-by: Tushar Mulkar > --- > drivers/net/i40e/i40e_ethdev_vf.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > 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; > new_link.link_autoneg =3D > dev->data->dev_conf.link_speeds & > ETH_LINK_SPEED_FIXED; >=20 > -- > 2.11.0