From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0059.outbound.protection.outlook.com [104.47.33.59]) by dpdk.org (Postfix) with ESMTP id 802F911DE for ; Fri, 17 Mar 2017 04:10: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=dqju/e9sH7wxmb0y03bbndYlq9EKwKr+A+vpb89BKzk=; b=HVsvbEPJFIsvRYoiPJt8G9cU4AurmibLD+AAnRh1RfohjiOkvkUtQQhjk9+s2JMXiuej6PJ89dsZVhpBxDzGqz7PeBGRCUn4rGfb7j+BLEJqXP2InvqzVH/e0HgY/ctLh4PiQZE1JRqhpWXtjoTOLI5Bp09f2YuR6/HZHY9RAv0= 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 (122.167.124.252) by CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.17; Fri, 17 Mar 2017 03:10:52 +0000 Date: Fri, 17 Mar 2017 08:40:34 +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: <20170317031033.pr3vjqmvixqtss47@localhost.localdomain> References: <1487178594-12912-1-git-send-email-gage.eads@intel.com> <1489695139-13111-1-git-send-email-gage.eads@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1489695139-13111-1-git-send-email-gage.eads@intel.com> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [122.167.124.252] X-ClientProxiedBy: BM1PR01CA0093.INDPRD01.PROD.OUTLOOK.COM (10.174.208.161) To CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) X-MS-Office365-Filtering-Correlation-Id: 23bcad92-9370-4f9e-b114-08d46ce339ef X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 3:BeKPnZ69oiK5wsYnrYMxILG193n1cNSp/9PdaFrZCdWZoLI95T7FF1GYgO4/MCP0gvgBRzR/LtpORkuhekzXugbV69cAkc4vPRK7d5EzYRN0gulfNoQJoDDIY6LuslqpYAdIGbNdjuFg2k6q+rjV8ACoNt76F/b9AaaSahgtm/t30lYq3yhDPsfkjoyoz4U2ltacRBrpXuEaeszuborOXy80kz1QChid7WhlyTjE7h3L1YSC8YNO+NLcTkVQpcDUUmW2/b/wF/edyIgW81Waiw==; 25:8HdKRQU4MMLId915MQoFES/D9bwg3M3gnbXSlZyPKwVhM6jB/RMfXeunieATMx+sZ8TnIXZD+ve/SHawR/9aFtQFuJun2DaUul1hEDUfchZkY/4MHocrrNaFzv5kp1ITAwwRLfWV50Nre7JIYPW3Vo7pI97X5B2AmmXLKtO+qjPtANagrXv5rG2ORv0dtBPR5TXKO2aD4V11Bl73ik9IHVufkh7PFMUvGXbMPXYJZz8JtaBGg5zOIrUd/i5DtAHty2h/QSQBoPngQyhxneUIJWpIFoi3JCdYJyMPmSAPgUENWfO7F11z6QLMd22J2mZfeIuRDg7A7bBXeKmZ8LraQn0Pe/ITYdNvXXFazQOhm8C15qi38E0vxcVzuSo669lLBP8wl377SY0HM3c/fn+QDSGRNtUu56BOFUixnDgWzmJlrHVS68TdYtC33i+t+EbSQhc3y4Qqau8Qa21XFdZcKA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 31:hA+5agTNlcxy2buIrjRD5E9MSILAlnGBhzH++Xs7PObtYnjnfefTY8sg49evln1RaTwUu8VGEWuK2lrao6+f8ovz6QMGE9BkRP+/lcOaJ32NqprKjDCo/qs0XdQnyZx+OenRtVkGZiROe0q6U+WRNfrT+lxzPOZwqjZT0KN6gYxn/UXkWBQOMkVmEjZxA3XtZHkN38oYyYr+agCfFeFqtJKOSwkFkM7mgHXkkyKbGhgeKsYDOZLlKFJjZ3/Gwjgq31SiUY9ozkjC6+Z2KwOsO+2jAZqtt3GCqOY8e+THkn4=; 20:V90zytQcF75FUfT+7/9HrZ6K2ZDE2C2CvucJuBsEErUfL2YYhXubxneb2SKcwGSnE6LvzBOLWiDCF6cWbJpGt2MlGUy1j14fnvwFR7dpfLvbhIqFDe0Wbk2beu2z4mDS8ylfrmihO2KrckSfAQLFmmyfKCJE8HvyllbeA07+FWIWrZMcPBe4qK0RFpmvNqh+dWxVuW5ovIR82V6ZA50fwnrmr3iSmKK4UyHpdJx6hothHkYj30r605rZdzkPNS9BivQDXvPbzGb6hPFuYjvhnUuxevGfPMehyKFXiSFQa8+Frvv65g0Wt5Gm/Eg80JMeeOKe6kNnvRW4qlIx+KxFcxWmNGDnPCx/3a+8YdjKqYfzRO8+eVu6uReI9R7dxcSJEW78gu+zVNC1+TcyU0WGWNATG7QztKyEMLV8vLITf+jG/3LfWv7FexE/0gaayOB10u5AkVDZSX2DLO8962nfQEYfeP7o++FeTZ2/E9nc1zg3HcJIoF5TpvPZei47RbhePwmZL1Ud0KkHMe1Y8p0ru8GAw0mtSnvJ9XsW7GDPIeXQ0oRiyi4Mm5keWjiOBql4zKNgogi0gZzkEV7BmphHKMxs89OlzAI35JlPoT5zw7k= 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)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123558025)(20161123562025)(20161123560025)(20161123564025)(6072148); SRVR:CY1PR0701MB1726; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 4:oPepr8jqZRKOeANaYjwk80f3jg6/f6o5wh4wsxjc0MCwKOjwDDviK9nM3PwBtTk5Xo3PdVTVuw2/YXMCWP651vf54wnlT+d5tM1aamuKjTrlhYWMtyf/3k00wdvDlarYdy4NZOXrDH+UK0rq+K+3xbpOyWyO0Poues5DZ9iYp7TmGcQwx4zg4Y0bihU0EfhEIJi3PBzDAS3MAr0vBdYI/GGrOQu1I9R1juJ6u7T0aq3JFupQc0dNupIjIH22H/skxys/0DK2gILZE2XqY71Wl0rMG0uAP2N63on5YFEjnbr1kqgfK2i+yEvYWDIwYM+081kchzmiEwCcuI3SahO9U6aNmKM022j7ojiXC9oQtgswVpml5l+fGh/H2Ioxm+GT3b+QeW69FVAeS4KyeuEPIMzSkpnxA4KWdl+OD/s0b2+Mi158RileskZ87WkSD18EKn6/yovReVjiv85B6qBzvgi1Je4EykbzqtWSzUWfsYrGuMEmkHHrQGvCr0roWOlLwPDx8LIgJp2ix24skhAwSX0p1++FOiYfpKkmC6+wjuxDPM5OnfxDgD8yQTpcJyzi3OxYAXD9BHdxOGorOlpUoiTrNfUs1AHEeej4SwNv1NBMOf6ooxPjeVKAHRKlvz6ehJ9gFND+00/Pfka+qA0rGQ== X-Forefront-PRVS: 0249EFCB0B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39830400002)(39450400003)(24454002)(43544003)(966004)(189998001)(2906002)(6246003)(110136004)(1076002)(2870700001)(53376002)(38730400002)(4326008)(23676002)(305945005)(25786008)(50466002)(9686003)(42186005)(83506001)(8676002)(81166006)(7736002)(6306002)(8656002)(6116002)(55016002)(3846002)(66066001)(47776003)(50986999)(4001350100001)(76176999)(33646002)(61506002)(6506006)(53936002)(5890100001)(5660300001)(54356999)(2950100002)(42882006)(229853002)(6916009)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1726;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g: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2017 03:10:52.6154 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1726 Subject: Re: [dpdk-dev] [PATCH v3] 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: Fri, 17 Mar 2017 03:10:58 -0000 On Thu, Mar 16, 2017 at 03:12:19PM -0500, Gage Eads wrote: > 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 > > lib/librte_eventdev/rte_eventdev.h | 42 +++++++++++++++++++++++++++++++++++--- > 1 file changed, 39 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h > index 2b30a35..3e54b27 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 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. Please check the review comments of v2 http://dpdk.org/ml/archives/dev/2017-March/060352.html > * @see rte_event_port_enqueue_depth() > */ > static inline uint16_t > @@ -1129,6 +1135,21 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, > { > struct rte_eventdev *dev = &rte_eventdevs[dev_id]; > > + rte_errno = 0; Why rte_errno = 0 is not in RTE_LIBRTE_EVENTDEV_DEBUG now in v3? > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG Please check the review comments of v2 http://dpdk.org/ml/archives/dev/2017-March/060352.html It still fails. n file included from /export/dpdk-next-eventdev/lib/librte_eventdev/rte_eventdev.c:61:0: /export/dpdk-next-eventdev/lib/librte_eventdev/rte_eventdev.h: In function ‘rte_event_enqueue_burst’: /export/dpdk-next-eventdev/lib/librte_eventdev/rte_eventdev.h:1140:40: error: ‘RTE_EVENTDEV_DETACHED’ undeclared (first use in this function) if (rte_eventdevs[dev_id].attached == RTE_EVENTDEV_DETACHED) { ^ /export/dpdk-next-eventdev/lib/librte_eventdev/rte_eventdev.h:1140:40: note: each undeclared identifier is reported only once for each function it appears in /export/dpdk-next-eventdev/lib/librte_eventdev/rte_eventdev.h:1141:3: error: implicit declaration of function ‘RTE_EDEV_LOG_DEBUG’ [-Werror=implicit-function-declaration] RTE_EDEV_LOG_DEBUG("Invalid dev_id=%d\n", dev_id); ^ > + if (rte_eventdevs[dev_id].attached == RTE_EVENTDEV_DETACHED) { > + RTE_EDEV_LOG_DEBUG("Invalid dev_id=%d\n", dev_id); > + rte_errno = -EINVAL; > + return 0; > + } > + > + if (port_id >= dev->data->nb_ports) { > + RTE_EDEV_LOG_DEBUG("Invalid port_id=%d\n", port_id); > + rte_errno = -EINVAL; > + return 0; > + } > +#endif > + > /* > * Allow zero cost non burst mode routine invocation if application > * requests nb_events as const one > @@ -1239,6 +1260,21 @@ 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 > + rte_errno = 0; > + if (rte_eventdevs[dev_id].attached == RTE_EVENTDEV_DETACHED) { > + RTE_EDEV_LOG_DEBUG("Invalid dev_id=%d\n", dev_id); > + rte_errno = -EINVAL; > + return 0; > + } > + > + if (port_id >= dev->data->nb_ports) { > + RTE_EDEV_LOG_DEBUG("Invalid port_id=%d\n", port_id); > + 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 >