From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0070.outbound.protection.outlook.com [104.47.40.70]) by dpdk.org (Postfix) with ESMTP id 5A0DB1396 for ; Thu, 16 Mar 2017 11:29:04 +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=aj5x2HQIeTI3aM9MSM08tISEHogX2vMqGoQYWPFKxwo=; b=PYWvFScDKzq8NXUnLngjzpUv1UZ5kddbV8i/tmCfBuLZhk4LGaN4MBNbujNaY8VbsZ2PdUv2v+YcBZYt2efgvBePv+VO7u/GFs9c/Jku4puKTZfu41xIoEgrrHfcLn4BPegVMT+0QP9Cb1LJsurKa6ojgjFDB522L8Bn5P94KZU= 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 (111.93.218.67) by BN3PR0701MB1720.namprd07.prod.outlook.com (10.163.39.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Thu, 16 Mar 2017 10:29:00 +0000 Date: Thu, 16 Mar 2017 15:58:43 +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: <20170316102842.tgpsmdd6ay7tys6u@localhost.localdomain> References: <1486760541-12568-1-git-send-email-gage.eads@intel.com> <1487178594-12912-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: <1487178594-12912-1-git-send-email-gage.eads@intel.com> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0056.INDPRD01.PROD.OUTLOOK.COM (10.164.116.156) To BN3PR0701MB1720.namprd07.prod.outlook.com (10.163.39.19) X-MS-Office365-Filtering-Correlation-Id: 111ecc98-9925-43dc-4b5d-08d46c5743f9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1720; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 3:V3+gJGLo5Gdif2U6yk/TDok9BLlT/v4RK4PavL9PXqjs5p5Y+aGcKsYBPDzcZ1WK9InIc0221q37Byl1HyBwNCX2xBOCKdjt/pQZjl2Acgv28mr+ZumiZD+dgpFrX6JLqMRdi0Y5RlO/Go9BmRP/GVjn3SMYnaXPru329igVtfZDqjat6sQSEozTBiZ6iVTP7NE93tup7DusfZiFT3NF5PzjDiSIwRR6TnrSIcfmRLbHfuyBx8F/aBv31wWMej2lf08NFL0fWdyfRhUbWue3kg==; 25:rSu6iHDyhMg1gxD+4RcjTAIfYldiZkEX/lwS5iHsZrpDX8vtxrJx24ArV2kwmjw/3mmI31x+ERWoT23o1sBP9aY2afspzS4S5Uqg4Ke2LRZVHgVaXorImH/lcdvyJYb34bE5DedSe0RaNbauSEms45sJIhL7b+x1GJEkragwBY5IaZAs4PSkRA96Vfyc8ugUv8GwHaW706ZaSgbUYVfBr904sCMMhcwf/AtgxkTOmy2Ya3EXNpA0E/+OKu6Cd4mNOMs/0zDUcjnMFALTP6TIg1wU6HTzSxI8+E7PVrQdDCTeDJMTiS7YaUvwqcwl2yy/NeuG72JBE+djL7lyri2EGwVzae7yj2wtQydttgZGlAkmatmij5epNp29sCUMCAt25z5LmAZK3x+V9NeECX6g+gyVf35IPsL8X4Y0kT0PA/Abxepr0NwkJegsnhuHQVQwVb+j7H1zYBsA2IW78F/bwQ== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 31:PlJztJJnz/cqVu5PoIrVVbOR3a+72bZHSfkuB4B98sEal51UldjwtWX794X67/8pmQR/G6AzzlEdJpHmdcbK8Hg/icfe+j5KvtKx7+7eWBwuxyWwhMt2yrDpnaTrRmz7wCP+Rzsit9MtzMZ2EZJ+bOWpGX2BDuReT5RG+Ywn4FkSvyWG8wS1G7mfPh8JCovVgBfJDvRH4ackSA2ohI/bLEX/NhiuQ/gddNr/UGyDZ+uUgXALZpYZN3AHNqWjxj7yfL2BHy25RAQTm6Bt8dK2aSnnjAAA2qm0QT1bNiCHecU=; 20:9O+8yrxz6ZK0RojeMqedtC1Au8WKSFQSyA1jcrCus+SquWil0DyUsJtt8xPxI6hBRBz6dfBb2AXIVSmC1cO4aT8DHU5B+wteHI8gR3Fg3MTypFiiThBnJMylEMnwYOT3E5LwXsHQtsW/WYDsjDSNbBoZccA8U1HAIjplqYBiKEgIVchR6s0tSuZpe2AdFheOm25g5d7o+EN1V019BKL9MpNFGJA4BuBhS9Bb96fjU67NOi8t/v0QQKf5lGWLv/Qs9sUxxwDF1x4wlMAguLY90h0u9lNx0IYhOxIE7fhHefsXpP7Y6pIAh5eGt5I98px6Jd018g8jfWP55/Z5431+SFOPJ0TZJXQA6c4B5uFWSyytY3eSAEvYqX2Hbh661qOgRTs9UxjpcwtclnCG584oPPbLJewP/5FWaLL1Jmv+ahMPxXQFF6VhSVr52MZKrerbCh8Ajhd+uht9X3/LD5P8m/IsrmmCymyKj+u0LFyDzkr06qmOlNVSaVFTNDeTDB1qg7pysbbmv04UBrKEdWu+hcCv303+RtavISJkd470k4LdSJ9htBmUllukITYi3+UY6PCMBGbPN0dKmKvE1SmBInwC22SoC3K+Gd85ytp7hCk= 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)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(20161123558025)(6042181)(6072148); SRVR:BN3PR0701MB1720; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1720; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 4:8GJ+AfNhAErjpw7fv3vNQQVbTz2eGjn/TlaJLswQUfUur2b6jRvyYrWXUEhdlOyOrWJvXXouri2ZKVoymADLSisJV6xEWC0pC9BGPlNDlPuiym/BA3XAm+bQpODYJLnl/ngXP3eoUfKUzM+VqCvZmX5JMYvfLqMfXKitFDyxOpc4FhX/OWiV/SDpmKX9EChhK10xEtWzew2YXKgEmWnzhZVFG/vga9vYXVdNvvP0TW2owZmMr3XZeN194bEJlVCDmlf7d/tMjtjm1uVgkrokNbrQ/s4ayq2gh35uLYpsRwNl07zQVntiyySN7qLD5hctJaFBORiZTLJB/rJjYJZBazJmNm3W4HjPxo72sA9aOKaizeDZTfoWYIZMUwRqf+HK4kPa99nisfJqI4Nx6OwTMdj84ZUvPCRgdJ50i0QGCvcBx0I1yKUcjpL+dO+3W2dCCUXU63+phsvhOeYDYgzLzt8d1TKqREmu5UDRHqEJb+M6qf5cTWxr2ol/F/IEDYVXQAPHpbt7WEeLGGIOofbk5q4Lu5ZPJag/qdyReyes9hNHPna6JeWI7/gzBpM12abrhsp6V83KfDJqhR+2I26Bv5IvIpByMb7/V9DjnGjozaGhyIM18Q1iHiSxT56cABc2f7SC8M79ZAOVaJWVk+WzKkUgK5eDBBW48/IMJq+DToM= X-Forefront-PRVS: 024847EE92 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(43544003)(24454002)(55016002)(5660300001)(25786008)(6506006)(83506001)(8656002)(5009440100003)(42186005)(50466002)(229853002)(9686003)(6306002)(61506002)(305945005)(1076002)(6116002)(3846002)(66066001)(7736002)(23676002)(53936002)(2950100002)(42882006)(6916009)(4001350100001)(54356999)(2870700001)(6666003)(81166006)(8676002)(966004)(47776003)(5890100001)(6246003)(50986999)(76176999)(4326008)(33646002)(189998001)(2906002)(110136004)(38730400002)(53376002); DIR:OUT; SFP:1101; SCL:1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Tk8ViJp8ihScDjBMqIvyKfKDz4VguPYEjMU1H5Mdo9pGoyKWaFzggQp7GlVfAoTkf0aXVsJnm40L31OEJss1PCA7FPe6jgUtUSv3uVJNK8z/8fplGsNnbU+M3jTxCL1HDoQRJfY4kZ6BDMzd8vxfN8g8Ad9BylwTS8St1LCHYLY9luPUi0s7bX2cY4JYXlT1cCFN8LB6qqspgO9Z+wY2YWLEu87XrPcjE0f9t+96uHuHgCMer+GdUl0w+/uhvdZ8j19GgrunJlJOjfaCWQXLM0tW48dCaPa6+7xaK/7XuLFUtgVXOApT/GXsJjmWnEFJw==; 5:vDpk7KdWtvzkuQdymwc5UFDc4MN0lbKMw9PwEKOPCra/dB9/Hn3WyVVj1AqiJgi8SwI2UXzxix1S++9y27AwD+pJwRxml8S7MhcXOYxSD3q87B1tJl9zedkkrp/lBvUM20xxwqU6hEBFEWB3RzVZEg==; 24:8BzbiWjHTVokCm9vCAaXNgBEAlomi1OQq73FhB1Cndq23GUdCINjdGH2n20Ol6ZyyRm61N5c8hWH3w1n9faTMQCRcQIC0sLIfkg4tq3JrNs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 7:DTa8VxvrNz/PjhemZdREEgJGZH/HRUHf7Ev8ryrysAXCrTct50QOcjSRXEcSPZkac4sOlnha2kciC+kjZaCK79gBIBIZp+RuFlZR+aZ8IipgCfdDmZJwiQR8OmhTxdqZDlFZPdQi2UNTdH1c4gt4NMCkI7Dhpogq+32knIdW/Y4JXgK9g4++zlJ4LCzEKlpoLTpZvbrOhtzLwEfscEZZET1LEmxAmF/WqEVqLvsONqOvvS5a2kfmmbgbHYIbeKWi3horJt3MsLIMf52lGWJtp2uWVD8Nw5KIpQg3paeSc0hcZ+D+zyRTdo3u25Cq6ye07/12jPSi9z83aJAL+Goa2A== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2017 10:29:00.2103 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1720 Subject: Re: [dpdk-dev] [PATCH v2] 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: Thu, 16 Mar 2017 10:29:05 -0000 On Wed, Feb 15, 2017 at 11:09:54AM -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. Please fix the checkpatch error. http://dpdk.org/ml/archives/test-report/2017-February/010896.html > > Signed-off-by: Gage Eads > --- > Changes for v2: > - Remove rte_errno initialization > > 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 c2f9310..31d1e31 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 */ > > @@ -1116,9 +1117,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. If I understand it correctly, -ENOSPC comes only for closed systems not for open systems. IMO, It is worth to mention that -ENOSPC is valid only of closed systems. > * @see rte_event_port_enqueue_depth() > */ > static inline uint16_t > @@ -1127,6 +1133,20 @@ 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 Please check with enabling RTE_LIBRTE_EVENTDEV_DEBUG. It has compilation errors. In 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:1139: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:1139: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:1140: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); ^ /export/dpdk-next-eventdev/lib/librte_eventdev/rte_eventdev.h:1140:3: error: nested extern declaration of ‘RTE_EDEV_LOG_DEBUG’ [-Werror=nested-externs] In 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_dequeue_burst’: /export/dpdk-next-eventdev/lib/librte_eventdev/rte_eventdev.h:1263:40: error: ‘RTE_EVENTDEV_DETACHED’ undeclared (first use in this function) if (rte_eventdevs[dev_id].attached == RTE_EVENTDEV_DETACHED) { > + 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 > @@ -1235,6 +1255,20 @@ 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 (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 >