From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 0E1882BC8 for ; Fri, 2 Feb 2018 11:04:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2018 02:04:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,448,1511856000"; d="scan'208";a="14493705" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga007.jf.intel.com with ESMTP; 02 Feb 2018 02:04:21 -0800 Received: from orsmsx111.amr.corp.intel.com (10.22.240.12) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 2 Feb 2018 02:04:21 -0800 Received: from orsmsx110.amr.corp.intel.com ([169.254.10.12]) by ORSMSX111.amr.corp.intel.com ([169.254.12.253]) with mapi id 14.03.0319.002; Fri, 2 Feb 2018 02:04:21 -0800 From: "Rao, Nikhil" To: "Varghese, Vipin" , Jerin Jacob CC: "dev@dpdk.org" , "Jacob, Jerin" , "Van Haaren, Harry" , Hemant Agrawal , "Jain, Deepak K" Thread-Topic: [PATCH] event/rx_adapter: fix ignore return of event start Thread-Index: AQHTmh2V4MesjoeA6U6jyVo30ybUyqONW/IQgAC2gwCAAzl+gP//fFCA Date: Fri, 2 Feb 2018 10:04:20 +0000 Message-ID: <1F668163772FA946975B9466A9DFF729E82E351A@ORSMSX110.amr.corp.intel.com> References: <1517352989-11720-1-git-send-email-vipin.varghese@intel.com> <1F668163772FA946975B9466A9DFF729E82E217A@ORSMSX110.amr.corp.intel.com> <20180131065407.GC24795@jerin> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D193E87@BGSMSX101.gar.corp.intel.com> In-Reply-To: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D193E87@BGSMSX101.gar.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMThiNDJkODgtY2ZmNS00ZGNkLWI1ODMtMTYwY2YxMTk1M2ViIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlBxdFJLVHpUWUpHZ0JJKysxcFVOd0FDeUpNNG1cL1JqRmNHUzlGdUxwaWlVPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] event/rx_adapter: fix ignore return of event start 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, 02 Feb 2018 10:04:24 -0000 > -----Original Message----- > From: Varghese, Vipin > Sent: Friday, February 2, 2018 1:39 PM > To: Jerin Jacob ; Rao, Nikhil > > Cc: dev@dpdk.org; Jacob, Jerin ; Van > Haaren, Harry ; Hemant Agrawal > ; Jain, Deepak K > Subject: RE: [PATCH] event/rx_adapter: fix ignore return of event start >=20 >=20 >=20 > > -----Original Message----- > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > > Sent: Wednesday, January 31, 2018 6:54 AM > > To: Rao, Nikhil > > Cc: Varghese, Vipin ; dev@dpdk.org; Jacob, > > Jerin ; Van Haaren, Harry > > ; Hemant Agrawal > ; > > Jain, Deepak K > > Subject: Re: [PATCH] event/rx_adapter: fix ignore return of event > > start > > > > -----Original Message----- > > > > > > > > > Adding eventdev PMD folks for their suggestions on how to handle the > > > return > > value from rte_event_dev_start() below. > > > > > > > -----Original Message----- > > > > From: Varghese, Vipin > > > > Sent: Wednesday, January 31, 2018 4:26 AM > > > > To: dev@dpdk.org; Rao, Nikhil > > > > Cc: Jain, Deepak K ; Varghese, Vipin > > > > > > > > Subject: [PATCH] event/rx_adapter: fix ignore return of event > > > > start > > > > > > > > Capture the return value for rte_event_dev_start. Return the > > > > result back to user. > > > > > > > > Coverity issue: 257000 > > > > Fixes: 9c38b704d280 ("eventdev: add eth Rx adapter > > > > implementation") > > > > Cc: nikhil.rao@intel.com > > > > > > > > Signed-off-by: Vipin Varghese > > > > --- > > > > lib/librte_eventdev/rte_event_eth_rx_adapter.c | 4 ++-- > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c > > > > b/lib/librte_eventdev/rte_event_eth_rx_adapter.c > > > > index 90106e6..a818bef 100644 > > > > --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c > > > > +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c > > > > @@ -603,7 +603,7 @@ static uint16_t gcd_u16(uint16_t a, uint16_t b) > > > > RTE_EDEV_LOG_ERR("failed to configure event dev %u\n", > > > > dev_id); > > > > if (started) > > > > - rte_event_dev_start(dev_id); > > > > + ret =3D rte_event_dev_start(dev_id); > > > > > > Currently the a non-zero return value at this point signifies an > > > error returned > > from rte_event_dev_configure(), so I suggest that the return value is > > typecasted to void. > > > > If I understand it correctly, Any one of the failure(configure() or > > start()) should result in bad state. Right? > > i.e If some reason PMD is not able to start() even after failure > > configuration() would result in bad state. > > If so, one option could be combine the error like ret |=3D operation or > > create a new logical error in Rx adapter which denotes this new error. > > >=20 > So do we agree to ACK these changes to get the code fix to the mainline?= =20 Sorry, if my original email wasn't clear, if rte_event_dev_configure() ret= urns an error and rte_eventdev_start() returns success that would be a prob= lem, i.e., the fix is incorrect. Of the 2 options suggested by Jerin - Since ret is not a bitmask ret |=3D = wouldn't work, if I understand the option correctly . A new error would wor= k. How about EIO ? and we also update the documentation to indicate that the e= vent device would be in a stopped state if the return code is EIO. > rework the logic as required? >=20 > > > > > > > return ret; > > > > } > > > > > > > > @@ -617,7 +617,7 @@ static uint16_t gcd_u16(uint16_t a, uint16_t b) > > > > conf->event_port_id =3D port_id; > > > > conf->max_nb_rx =3D 128; > > > > if (started) > > > > - rte_event_dev_start(dev_id); > > > > + ret =3D rte_event_dev_start(dev_id); > > > This change looks good to me. > > > > > > > rx_adapter->default_cb_arg =3D 1; > > > > return ret; > > > > } > > > > -- > > > > 1.9.1 > > >