From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <vipin.varghese@intel.com>
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id 960133250
 for <dev@dpdk.org>; Fri,  2 Feb 2018 09:08:48 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 02 Feb 2018 00:08:47 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.46,447,1511856000"; d="scan'208";a="24152290"
Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204])
 by orsmga003.jf.intel.com with ESMTP; 02 Feb 2018 00:08:47 -0800
Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by
 FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS)
 id 14.3.319.2; Fri, 2 Feb 2018 00:08:46 -0800
Received: from bgsmsx106.gar.corp.intel.com (10.223.43.196) by
 FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS)
 id 14.3.319.2; Fri, 2 Feb 2018 00:08:46 -0800
Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.25]) by
 BGSMSX106.gar.corp.intel.com ([169.254.1.43]) with mapi id 14.03.0319.002;
 Fri, 2 Feb 2018 13:38:43 +0530
From: "Varghese, Vipin" <vipin.varghese@intel.com>
To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "Rao, Nikhil"
 <nikhil.rao@intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>, "Jacob,  Jerin"
 <Jerin.JacobKollanukkaran@cavium.com>, "Van Haaren, Harry"
 <harry.van.haaren@intel.com>, Hemant Agrawal <hemant.agrawal@nxp.com>,
 "Jain, Deepak K" <deepak.k.jain@intel.com>
Thread-Topic: [PATCH] event/rx_adapter: fix ignore return of event start
Thread-Index: AQHTmh2XUkggx+EsfEqUorMdkULxzKONGW6AgAAWuACAA5VCQA==
Date: Fri, 2 Feb 2018 08:08:41 +0000
Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D193E87@BGSMSX101.gar.corp.intel.com>
References: <1517352989-11720-1-git-send-email-vipin.varghese@intel.com>
 <1F668163772FA946975B9466A9DFF729E82E217A@ORSMSX110.amr.corp.intel.com>
 <20180131065407.GC24795@jerin>
In-Reply-To: <20180131065407.GC24795@jerin>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ctpclassification: CTP_NT
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMThiNDJkODgtY2ZmNS00ZGNkLWI1ODMtMTYwY2YxMTk1M2ViIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJMWHJYTUpQUjJWR1dXMmhVcUtrTG1iWGZlQTZKalNEVE91VmZqUEJkSzZ4RjdOWnEyN2JhdlJMcnpIdGNPNUNMIn0=
dlp-product: dlpe-windows
dlp-version: 11.0.0.116
dlp-reaction: no-action
x-originating-ip: [10.223.10.10]
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 <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 02 Feb 2018 08:08:49 -0000



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Wednesday, January 31, 2018 6:54 AM
> To: Rao, Nikhil <nikhil.rao@intel.com>
> Cc: Varghese, Vipin <vipin.varghese@intel.com>; dev@dpdk.org; Jacob, Jeri=
n
> <Jerin.JacobKollanukkaran@cavium.com>; Van Haaren, Harry
> <harry.van.haaren@intel.com>; Hemant Agrawal <hemant.agrawal@nxp.com>;
> Jain, Deepak K <deepak.k.jain@intel.com>
> Subject: Re: [PATCH] event/rx_adapter: fix ignore return of event start
>=20
> -----Original Message-----
> >
> >
> > Adding eventdev PMD folks for their suggestions on how to handle the re=
turn
> 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 <nikhil.rao@intel.com>
> > > Cc: Jain, Deepak K <deepak.k.jain@intel.com>; Varghese, Vipin
> > > <vipin.varghese@intel.com>
> > > 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 <vipin.varghese@intel.com>
> > > ---
> > >  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 ty=
pecasted
> to void.
>=20
> 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 configur=
ation()
> would result in bad state.
> If so, one option could be combine the error like ret |=3D operation or c=
reate 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? Th=
en rework the logic as required?

> >
> > >  		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
> >