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 4995811C5 for ; Tue, 21 Mar 2017 21:38:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490128709; x=1521664709; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=7ivhSzR9JQDjYTr701OlpYOtmbDq8dMjzcwC31qFluQ=; b=TFbj6E/VQcS/xuEi1iev1wJyPBpywlTANSQRL3s6rvvwyqeFMLDxH0ap zuRNa5nmElqjetStAga/xoF9cLOyyA==; Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2017 13:38:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,201,1486454400"; d="scan'208";a="1145305685" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 21 Mar 2017 13:38:26 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 21 Mar 2017 13:38:26 -0700 Received: from fmsmsx108.amr.corp.intel.com ([169.254.9.46]) by FMSMSX109.amr.corp.intel.com ([169.254.15.99]) with mapi id 14.03.0319.002; Tue, 21 Mar 2017 13:38:25 -0700 From: "Eads, Gage" To: Jerin Jacob CC: "dev@dpdk.org" , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "Van Haaren, Harry" , "nipun.gupta@nxp.com" Thread-Topic: [PATCH v4] eventdev: add errno-style return values Thread-Index: AQHSny4YN8DkRU9m5E67AZor/NKGd6GfnVoAgAApj/A= Date: Tue, 21 Mar 2017 20:38:25 +0000 Message-ID: <9184057F7FC11744A2107296B6B8EB1E01E82F00@FMSMSX108.amr.corp.intel.com> References: <1489695139-13111-1-git-send-email-gage.eads@intel.com> <1489762288-4710-1-git-send-email-gage.eads@intel.com> <20170321110624.uknv46c2k7k4eh4r@localhost.localdomain> In-Reply-To: <20170321110624.uknv46c2k7k4eh4r@localhost.localdomain> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.200.106] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4] eventdev: add errno-style return values 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: Tue, 21 Mar 2017 20:38:29 -0000 > -----Original Message----- > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Tuesday, March 21, 2017 6:06 AM > To: Eads, Gage > Cc: dev@dpdk.org; Richardson, Bruce ; > hemant.agrawal@nxp.com; Van Haaren, Harry ; > nipun.gupta@nxp.com > Subject: Re: [PATCH v4] eventdev: add errno-style return values > =20 > On Fri, Mar 17, 2017 at 09:51:28AM -0500, Gage Eads wrote: > > From: "Eads, Gage" > > > > This commit adds rte_errno return values to rte_event_enqueue_burst() > > and rte_event_dequeue_burst(). > > > > These return values allows user software to differentiate between an > > invalid argument (such as an invalid queue_id or sched_type in an > > enqueued > > event) and backpressure from the event device. > > > > The port and device ID checks are placed in RTE_LIBRTE_EVENTDEV_DEBUG > > header guards to avoid the performance hit in non-debug execution. > > > > Signed-off-by: Gage Eads > > --- > > Changes for v2: > > - Remove rte_errno initialization > > Changes for v3: > > - Fix checkpatch and check-git-log.sh errors Changes for v4: > > - v3 was incorrectly based on v1, v4 is instead based on v2's > > changes > > > > lib/librte_eventdev/rte_eventdev.h | 40 > > +++++++++++++++++++++++++++++++++++--- > > 1 file changed, 37 insertions(+), 3 deletions(-) > > > > diff --git a/lib/librte_eventdev/rte_eventdev.h > > b/lib/librte_eventdev/rte_eventdev.h > > index 2b30a35..a45c81a 100644 > > --- a/lib/librte_eventdev/rte_eventdev.h > > +++ b/lib/librte_eventdev/rte_eventdev.h > > @@ -245,6 +245,7 @@ extern "C" { > > > > #include > > #include > > +#include > > > > struct rte_mbuf; /* we just use mbuf pointers; no need to include > > rte_mbuf.h */ > > > > @@ -1118,9 +1119,14 @@ rte_event_schedule(uint8_t dev_id) > > * The number of event objects actually enqueued on the event devic= e. The > > * return value can be less than the value of the *nb_events* param= eter > when > > * the event devices queue is full or if invalid parameters are spe= cified in a > > - * *rte_event*. If return value is less than *nb_events*, the remai= ning > events > > - * at the end of ev[] are not consumed,and the caller has to take c= are of > them > > - * > > + * *rte_event*. If the return value is less than *nb_events*, the r= emaining > > + * events at the end of ev[] are not consumed and the caller has to= take > care > > + * of them, and rte_errno is set accordingly. Possible errno values= include: > > + * -(-EINVAL) The port ID is invalid, device ID is invalid, an even= t's queue > > + * ID is invalid, or an event's sched type doesn't match= the > > + * capabilities of the destination queue. > > + * -(-ENOSPC) The event port was backpressured and unable to enqueu= e > > + * one or more events. > =20 > Some reason you haven't addressed the comments in v2.i.e add a note that= - > ENOSPC applicable only for *closed system* > =20 > http://dpdk.org/ml/archives/dev/2017-March/060352.html > =20 Will fix. > =20 > > * @see rte_event_port_enqueue_depth() > > */ > > static inline uint16_t > > @@ -1129,6 +1135,20 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t > > port_id, { > > struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > > > > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > =20 > Some reason you haven't addressed the comments in v2.i.e Not fixed the b= uild > issue. > http://dpdk.org/ml/archives/dev/2017-March/060352.html > =20 > You can reproduce it by setting CONFIG_RTE_LIBRTE_EVENTDEV_DEBUG=3Dy in > common config. > =20 > We have two approaches to fix it > 1/ Pollute lib/librte_eventdev/rte_eventdev.h header with implementation > specific header files > =20 > Or > =20 > 2/ Have neat pmd debug common function in rte_eventdev_pmd.h.Let all PMD > driver call it by including rte_eventdev_pmd.h > =20 I'd prefer to avoid the issue by dropping the debug message and RTE_EVENTDE= V_DETACHED, like so: #ifdef RTE_LIBRTE_EVENTDEV_DEBUG if (dev_id >=3D RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attach= ed) { rte_errno =3D -EINVAL; return 0; } if (port_id >=3D dev->data->nb_ports) { rte_errno =3D -EINVAL; return 0; } #endif What do you think?