From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 99DC6A2F for ; Wed, 15 Feb 2017 01:14:03 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2017 16:14:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,163,1484035200"; d="scan'208";a="1126706641" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 14 Feb 2017 16:14:01 -0800 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 14 Feb 2017 16:14:01 -0800 Received: from fmsmsx108.amr.corp.intel.com ([169.254.9.130]) by fmsmsx123.amr.corp.intel.com ([169.254.7.244]) with mapi id 14.03.0248.002; Tue, 14 Feb 2017 16:14:01 -0800 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] eventdev: Add rte_errno return values to the enqueue and dequeue functions Thread-Index: AQHShnhW0giMOy97UUuFcS9dtcDuSqFpL0qA Date: Wed, 15 Feb 2017 00:14:00 +0000 Message-ID: <9184057F7FC11744A2107296B6B8EB1E01E66C0C@FMSMSX108.amr.corp.intel.com> References: <1486760541-12568-1-git-send-email-gage.eads@intel.com> <20170214041009.GB6091@localhost.localdomain> In-Reply-To: <20170214041009.GB6091@localhost.localdomain> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2Q4MzgyODItZjJhMy00ZGRkLWEzNTMtOTFjYWFiYmFlNGRlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlAyY1JkZmVGZlVDS2ZTWmNtSWRXakJYdm5YU1NySytcLzQrSnNEdDVYSUZjPSJ9 x-ctpclassification: CTP_IC 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] eventdev: Add rte_errno return values to the enqueue and dequeue functions 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, 15 Feb 2017 00:14:04 -0000 > -----Original Message----- > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Monday, February 13, 2017 10:10 PM > To: Eads, Gage > Cc: dev@dpdk.org; Richardson, Bruce ; > hemant.agrawal@nxp.com; Van Haaren, Harry ; > nipun.gupta@nxp.com > Subject: Re: [PATCH] eventdev: Add rte_errno return values to the enqueu= e and > dequeue functions > =20 > On Fri, Feb 10, 2017 at 03:02:21PM -0600, Gage Eads wrote: > > This change 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 > > --- > > static inline uint16_t > > @@ -1127,6 +1133,21 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t > > port_id, { > > struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > > > > + rte_errno =3D 0; > =20 > I don't think it is required. If at all required, move this under > RTE_LIBRTE_EVENTDEV_DEBUG to save store to rte_errno cycles on fastpath Agreed -- if we encounter an error we should set rte_errno, otherwise the r= eturn value will equal nb_events and the user shouldn't check it. Will fix in v2. > =20 > > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > > + if (rte_eventdevs[dev_id].attached =3D=3D RTE_EVENTDEV_DETACHED) { > > + RTE_EDEV_LOG_DEBUG("Invalid dev_id=3D%d\n", dev_id); > > + rte_errno =3D -EINVAL; > > + return 0; > > + } > > + > > + if (port_id >=3D dev->data->nb_ports) { > > + RTE_EDEV_LOG_DEBUG("Invalid port_id=3D%d\n", port_id); > > + rte_errno =3D -EINVAL; > > + return 0; > > + } > > +#endif > > + > > /* > > * Allow zero cost non burst mode routine invocation if application > > * requests nb_events as const one > > @@ -1235,6 +1256,21 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t > > port_id, struct rte_event ev[], { > > struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > > > > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > > + rte_errno =3D 0; > > + if (rte_eventdevs[dev_id].attached =3D=3D RTE_EVENTDEV_DETACHED) { > > + RTE_EDEV_LOG_DEBUG("Invalid dev_id=3D%d\n", dev_id); > > + rte_errno =3D -EINVAL; > > + return 0; > > + } > > + > > + if (port_id >=3D dev->data->nb_ports) { > > + RTE_EDEV_LOG_DEBUG("Invalid port_id=3D%d\n", port_id); > > + rte_errno =3D -EINVAL; > > + return 0; > > + } > > +#endif > > + > > /* > > * Allow zero cost non burst mode routine invocation if application > > * requests nb_events as const one > > -- > > 2.7.4 > >