From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0077.outbound.protection.outlook.com [104.47.36.77]) by dpdk.org (Postfix) with ESMTP id 3CC80D267 for ; Sat, 25 Mar 2017 06:11:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gwZjPDebrx8G+UTXLWNzNM4TvS+SRdXMTYEdl+Qv34U=; b=gHzwDa2rhaKctHPSxyjuP71EIB8Zpnt3cQteoUzheIFQ6fARGeePATb4WVHZjW4OgMJPsLpL2jnb9Q1L9CPHmisdDE+Ly4dcINQfYsQTS4hYB3zVDMcCJo5y6kCnzfSRU69LLEvdFimEwWZRcIXfeV8/gszby6HSnIIzNcJf47M= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (14.140.2.178) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Sat, 25 Mar 2017 05:11:49 +0000 Date: Sat, 25 Mar 2017 10:41:33 +0530 From: Jerin Jacob To: Gage Eads Cc: dev@dpdk.org, bruce.richardson@intel.com, hemant.agrawal@nxp.com, harry.van.haaren@intel.com, nipun.gupta@nxp.com Message-ID: <20170325051131.duy4o53gqbjktc75@localhost.localdomain> References: <1490194680-25484-1-git-send-email-gage.eads@intel.com> <1490308220-22603-1-git-send-email-gage.eads@intel.com> <20170324023806.pt3zwazljxdjb2zz@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170324023806.pt3zwazljxdjb2zz@localhost.localdomain> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MAXPR01CA0041.INDPRD01.PROD.OUTLOOK.COM (10.164.146.141) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: 71dda85e-5dba-494f-787f-08d4733d7327 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:Dk2J4JadxOAEPtM3LcCBF2YvXW9XDbC0hsqINF0RfTecUuMw3mQp1NuA6+AzbL5Z4+qQe6WpG0HvmxRsw2ez9rCrZxuo3F4ROdAc1oG8nmEsSXYgVqQKY8QHEb2yhTtsJrgpaV/q8yjN3jKha8OKgobFSLrN490WWO/J2DaQOWQAvbJ+NxIk7f3a+ADvGrb5JC285pU5ssiwczNtGCiXPBgjmxGOeFCKexnKjPJQ4qX22vUKED5/j8b0TpLpr+k0wCm4qqK41mgvRG2VU22FjA==; 25:Wjfuikh/WG+TVoCt/vD1rk0qfO6kZIwrgshFwlqzaa8JOeUMZIxpqIYvNPK1Wo0wmSk4z3eFC1VG35gAnHjp1+jBZXmO77woEetP4jH9X2R7CMspLNu33S4zdTXwPIlDFKVmFuMbJpWHIths6wDwQBDqslQ6XmH9NB7a5za7o/HFfsY8SPdopy0CajVeMlpioFt2r9W/tdXl2kw2tf/qJ+Dtl1nAcipHfKYMw2G9QM9NeZej3xGcnMFrruDVLsE3vB424RjtRoFrEasPaQAbjqUnl+Qa9skRp82kFzT7xIm6pA0nPmNecMwOWFU0HaavH9su0KyP9suAnYpDVZ1535heWVwW0C3MX5Bxl2Dbp6ax5STniUpy2dFOGRztHmv0YowTTej2UnRKTz2iklPABe/jflKIVBZZl12QumnAIWkCKF2/VTpdPqpEofui7AJDRq/dMKi4UHr+yKR/f5bDzA== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:PfzNmFUyjIJXtlqHGOsl9phTTn1eseK+/mU5Cw8nhPrg5yKUlJdemcOf/Gf+LbFV+nV4uxCiU3UTm6ZUUuBlmpOR6Hq4nlFrGDE6h13p9iD65G8gAK5PPx3jM1RnnJOmJWpQJC3O+qTrjRSakUTVN3DTwoeEnO4L0sgQIukMebvxS3JFvyRaDVJ5Okkhv/j8OhJMz0vnfs/UPpVMKfc379bzmCSPeUW/NRCrOvbw68Sz8Nc0oQut13KWhLtVbC4gR0LkDahDWXGqIVt4WgBwNce75tnApj/f5EWstWHE69s=; 20:0LsskT/TbFocVrd0kZJ53Jh5xm6gz+UEQXeTFJOh7z9ngPvT4V/t+x8taZj55pJ6rz7f2W/NSETKNvqqGpEEPAd6Dj2h/8ev9KNLU9C+ReZLOf+BeSN+G5N7sRml+VnfckQtxqLrl+xGXIFHlOH/DGr6ffthUIAiXSnQwK3aM9ca4QTXNUWvSOVb/dXtddrwdIZGh5Y7LQklGko0JjJ3hznEDiatbLb2mABhfM4Xz4DygOG+7fGlQjxoZS9k8PJrAkAGiZnLo3JE1OwOjYD9JCJX7cYqD3UMCwniy8RiK5DxIitZJ+v8qdTsl8twft2AGHq2hlvY9qj+a44fE/Y47ssLV3sTT6CLU3TrMI3UpPSZGCFwpmTz+84TEhnAesmytbTPWwmFUY9VFol6C8qhtMpx+QPlGoujCJIB0RFoa1Oai30LI9GqXhB6ark4+0ljtmULIowThWkjYM4jRFdDU48Z8jkSs1DyNhoz8YgWDs/HdUMncISB/61Bu2VLCE8L5ILX6LQr0AVOwU5u7H5cw18CqqZcxXF4xrdgntJ64YTG0LH88tW9RrIDKczWKwhZqywZJ68+MURNQ9NMzqGAMYRicrNJkE/xddXoMJE8CaM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123558025)(20161123562025)(20161123560025)(20161123564025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:6O/aOKLE2UjeJKR+J/AaMG2tMxeTz8b48MmJa8nSZ+Kvli1CYbyA7vFTXlcfPvZjkmrJQX4utZ+qnuo5654nP8eN00L9C8at/3vJ9alkjQnUWPRhWsQlSb0QfIXPYM0Z6dxNj3Lfvu2sh2oMbX5ZSMdw3ts/5gJZCipT6Emjr3NgsPnZwi6yJZrtNhcA+Tgg/AAserDhHxcmOqhaDXq6cpCZKeq7W7zpjmbbm8tRfo/zhj3HmvVJwHY09dnYUwugtOcsfsEsmCCMjZmhC0TfpDE5sBOUn66B+wkEROxKTTSHXCrYnFF4yiwD865SeCOcgyMYPnUZ8VQM2Mu6Lfr/vyY8kQYM1HzIYIyGcSLflQky6hzG2Db4/LXfDClnGpqgtGu/seK8osu8s0WrDZDjBLUhv1pPJqHQpZVY4zyzPuymePD1BUlR7LLGmgFgauSprjfXGyKOZqEBtjzD0UVNcbXAvCfGFLsW6PT2Jv0G9UxVnyKgcry0FjWh+pN6hhf6k3ygT+ACl7r/8yPPlvXJzvz3SsGVVh6hzWo4Lds8E2IhlWOvFKTAj/zf2zCN2aHzAN5rrjvnKKJH9Oy3Mg7z9rBwDjVy4ZdgjDLv6Z+vOZGz20Yuwwi92ZQ7+zRAv2mrgpKY5N4KOZPHdLo6UeUQnA== X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(39830400002)(39410400002)(39450400003)(24454002)(43544003)(23726003)(6506006)(4326008)(8656002)(61506002)(1076002)(229853002)(53936002)(55016002)(25786009)(33646002)(9686003)(110136004)(38730400002)(47776003)(66066001)(189998001)(6916009)(2906002)(42186005)(50466002)(6666003)(42882006)(6246003)(2950100002)(5660300001)(5890100001)(4001350100001)(76176999)(3846002)(7736002)(5009440100003)(6116002)(54356999)(305945005)(50986999)(8676002)(81166006)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:BurNcyClpJ3sNCg5csO8VRj0+L38B8SETSHJKN4?= =?us-ascii?Q?Z5PNHcQnYJNOAjUtvJpbGDzI7heER2d2sZZhZuZxF3T/RgaEvDxMomq+vHYV?= =?us-ascii?Q?CuqeWEYLQgASjMy34AsPUxOPhpepsQK3uoKaS8ghhPhP3fjKmlqcovrCk/ic?= =?us-ascii?Q?ZPMuQeADUFhSDH4zJB5Re0/pFUN03r81RYOfdnE5ik83v9ZZF9T2m480HA1p?= =?us-ascii?Q?XDzwcbVLKLLV9+RbT9zAX76STp0DrwDj3GStL55pP4CeBrlhJjCgo03TUSQx?= =?us-ascii?Q?Jz8wek8FFx/crRW4LcdGmsQQuYOZgTwWDqHfggal2eqKYzR5MjjMde5WnUUK?= =?us-ascii?Q?CXnyc2Mmgf8sQ72xHLLoADnEnVwlfFrXmv5EukM9o8Anr4jQWKiNzk5DUd2J?= =?us-ascii?Q?SgUtk1g89WLh6zT6V3Irs+OkW1gDJn9lSllp7WsdyWRnqp2LeqFZbVtzfbr1?= =?us-ascii?Q?fTcSE16YXmBarWQN7jOYXq6DhFf8u4vzL/sNpqDnBJnjTJZjSbOPbFBqKQKw?= =?us-ascii?Q?vzq0b5n8Yza6Wg82DJoZ2FZVjqMyNJligmggfrwmO+hgiMirENeMUfsxmDFi?= =?us-ascii?Q?dAkzDpFidz00DwEvFAeUMt7aC0rYkyK/kqbS9FVoZIPR7PP2p4BalHVvS2ha?= =?us-ascii?Q?IC2WAsjrtlOGo2zhMaAVE2Oidv0qHeY4m4s0jEpjtqKsMMf3ES+Dh0qWYGdl?= =?us-ascii?Q?SWtv+8znfr9AxnOmKwCIjuMOL56pHlz4TZe9fx8qsxUxuArCWeaFVoGhhly4?= =?us-ascii?Q?z8LV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RWCE4fqIuTa7T2CkmeE0fnlvonmV50TMaWA==; 24:mShVYpX5Huel02GUVgYMHrCWK691K5J5lqwKiH0v4BMap6Qs2Le96ifindU9wU2G6mOupODbGJF1jyvqe1G2k7btcGkL+CMc/BLt7CfX4yY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:sgJNwlqgpbdIQoVH7Syuv/SgAJhLvxALC3UGtgfHYdA4ayM1C+ld3P5uVdLhW3Avzg8yocoFkqxrcn7jNubGCI+Jq8vZhboVmmY3nSB8Ayla6zCYtNjPwClrSRL7LunW7j/kSAY7PBLyhsdMt+PPtvIYHnfgaJfNef+dzONWcp3+e8Ve+MVH28csOlwGQJjM3Z53KKT8nt/fHBtZOZ4LzlEn+QybyCMDnggnDtCVgeajls4gs0xI05rpyjXS4ctsC0wCr7P2hQPAoE3AMBQEwB3RN20uw2RJ1V9HSw5hvK8c39FtnoUjJXvVY0fwUBYCgVPPS1a5FX+lLe3+n18/HA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 05:11:49.8891 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: Re: [dpdk-dev] [PATCH v6] 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: Sat, 25 Mar 2017 05:11:57 -0000 On Fri, Mar 24, 2017 at 08:08:06AM +0530, Jerin Jacob wrote: > On Thu, Mar 23, 2017 at 05:30:20PM -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 > > Acked-by: Jerin Jacob Applied to dpdk-next-eventdev/master. Thanks. > > > --- > > 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 > > Changes for v5: > > - Clarify -ENOSPC description and fix compilation errors > > Changes for v6: > > - Fixed html doc rendering of bullet points for errno values > > > > lib/librte_eventdev/rte_eventdev.h | 37 ++++++++++++++++++++++++++++++++++--- > > 1 file changed, 34 insertions(+), 3 deletions(-) > > > > diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h > > index 5ce2f33..9971937 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 */ > > > > @@ -1119,9 +1120,15 @@ rte_event_schedule(uint8_t dev_id) > > * The number of event objects actually enqueued on the event device. The > > * return value can be less than the value of the *nb_events* parameter when > > * the event devices queue is full or if invalid parameters are specified in a > > - * *rte_event*. If return value is less than *nb_events*, the remaining events > > - * at the end of ev[] are not consumed,and the caller has to take care of them > > - * > > + * *rte_event*. If the return value is less than *nb_events*, the remaining > > + * 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 event'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 enqueue > > + * one or more events. This error code is only applicable to > > + * closed systems. > > * @see rte_event_port_enqueue_depth() > > */ > > static inline uint16_t > > @@ -1130,6 +1137,18 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, > > { > > struct rte_eventdev *dev = &rte_eventdevs[dev_id]; > > > > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > > + if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) { > > + rte_errno = -EINVAL; > > + return 0; > > + } > > + > > + if (port_id >= dev->data->nb_ports) { > > + rte_errno = -EINVAL; > > + return 0; > > + } > > +#endif > > + > > /* > > * Allow zero cost non burst mode routine invocation if application > > * requests nb_events as const one > > @@ -1240,6 +1259,18 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], > > { > > struct rte_eventdev *dev = &rte_eventdevs[dev_id]; > > > > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > > + if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) { > > + rte_errno = -EINVAL; > > + return 0; > > + } > > + > > + if (port_id >= dev->data->nb_ports) { > > + rte_errno = -EINVAL; > > + return 0; > > + } > > +#endif > > + > > /* > > * Allow zero cost non burst mode routine invocation if application > > * requests nb_events as const one > > -- > > 2.7.4 > >