From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0065.outbound.protection.outlook.com [104.47.38.65]) by dpdk.org (Postfix) with ESMTP id E6C083B5 for ; Wed, 22 Mar 2017 07:54:13 +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=X9cRQJl2j7HNvavha74NNHT2jdsDJK7tss6D8zFkfdM=; b=ZKGKDj8+FCl1JTtIUA40mxAxOfDgmOvecsusWgpE/pPZMxWXn2yWBjLsQkk3VYINy6Wu5Bcclw1Q4WYuJT80EpqNVFxX8uCq7XtlfFKYcQmpTA2a5o4i0Twdll4k50d/9YVdMvFO7drLJiEpp3JPQFphkl+8Dw8EJIXD/zkY4cs= 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 CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Wed, 22 Mar 2017 06:54:09 +0000 Date: Wed, 22 Mar 2017 12:23:53 +0530 From: Jerin Jacob To: "Eads, Gage" Cc: "dev@dpdk.org" , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "Van Haaren, Harry" , "nipun.gupta@nxp.com" Message-ID: <20170322065352.moetw2bwc7p4hhws@localhost.localdomain> 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> <9184057F7FC11744A2107296B6B8EB1E01E82F00@FMSMSX108.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9184057F7FC11744A2107296B6B8EB1E01E82F00@FMSMSX108.amr.corp.intel.com> User-Agent: NeoMutt/20170306 (1.8.0) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0009.INDPRD01.PROD.OUTLOOK.COM (10.164.117.16) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-Office365-Filtering-Correlation-Id: 9533bc4c-d9c4-4e0f-131c-08d470f03f2b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 3:IzQvEauU1+jqDzrjsFXvGo6XE67Lx8Oj6JqFcbYY8/6CR9FuA7gjpdBBC73wuVmdkwNqc+CUsX5MEd/GjWfMypxlP3okWJUngH/p9SWJ0uGZ8cxWQ2VBkhiT8S7Bs/SVRg75lh4IU9PqzvQDJufSSI/JsATJvlRFfTwPVRoY2Gab0gZ+yZwL9rvmvK8tVERElwL9jy5pRDEcnivahJajumyDak77suQdUzYoBlJCDY+AK/bqGULUR6ZHw9WfViMCCpYCKV/8Hth+NJK43ARllg==; 25:xFLdA9hkNZ4Ds4bt/eJcJAQYCL5nDl5XeP5AYbIZGxRAJ6Kt6rWMQ6R+ql3L97ri46s1eVXLqVxSQtbJ1Y1dqPa7XH9uQvvua+FimajKqekqpuGwPAvQge7joOackH6QZgzF8BvaSWiq68e+uwdwUdiFT9/LrMNonmcnRgZga9SVWQfSkL3aJsbNTqmXx5xu5tN8bNpYj4ttu6W9KeHwuMjc64/qkyV4r4eXqEtq1DbOBa4MuXi5WyClbeh7HFx86rEmIbJ0KE90zCBoNXpzgmcDiAd6hFumPvS25gAAK4SqIh3SbtiHVKiwehWOD50KxYxV3uObryiftJxjGKu6MYS5zxFO48Mr8xp3VTmx9goIpZDrVu/MB5W5NJbun0PjefxKWfz3QA5W7yAQfTntSSBekcZBWo/13FCGQP7ym/ludN3l0OPPQI5WSqwxPYMQSpeMVKqmKcyfoAL8RU52bQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 31:e2kEWCYGEisjpwTakSLARBnbSTVwKSwF0aFLR3Br+C1r+1FdtCfHsFlUby2HoQGX0u6x1rLOrt3e7tuRPwHzc0Av0hBAW2DOQuAuYmZU2mSN468JxbaeVnTrwohOp/Yaon2FmALOKa/FuZvxnj4cR8ouL1rF0yxP8xcmjEiYGF/L0LOvSEK/7EByPMpTSVf6tbfN43dJDW9T9rjAZZTA3kgQ4CirBJwQ8PSy2iyuY7bmxOaJ5FlNxnqb5VfATZeGzwQlLLgvXVk3q10p3jh9fe0c701TsHbOWkrjfi/vAW0=; 20:PyET7TYe7O/O8Yw6VvPdJlKC6Q5Jqs+G8Doa7SVMyaqUwMtK/559BT2C1uuUYAhQAHPipFE2ke5YRTVUKr/0DfBQYxrRAX6eGcQWiAHRixM0+1n488rmMo6zYSKiYNtgfNjHI/YcQXgtGiu2q0N5HpGgN444f+Xomr0LS1UHq3fOPfwBWlWvYLVVnpdpkhgCQzo7KupoDubog2X4bHB1yMZk7HUiJk1qQcDUayLBPI8G+t1lu2HfGeNTa8QNtavB7S9Hcumnb0y3nYgt08C2KaVgJ3LFq1NFzYpFWQrVMP8BfV10IrweNeUSzLiii9/v4UPTn9znYxUaKS5dmKtVDyw60Aw/9rXCP3u7+03m1mIeglFsHkQHI6b211AMGilQRT3M8t7pSXotQSQsmzey67FoytoJlnEtKNJ9SjZMNER1XnGPJd2vmPJPQOlONjzYI7+FVbau5zhxQsUUu/6aYlfnkxSPjAar2eVF7w50JvFnElN7JPJKyjXxFYGnlltXtrok8TJmA9GEaoGNiPJkuy+vi6e2g3SPpeuQk7XEhrtPWy//OmjAEv/qyi+98zzMGiZzFcHvkZSaBNs3UDDaIsLpkUSQePxc8uTztASBJ8A= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123558025)(20161123564025)(20161123560025)(20161123562025)(6072148); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 4:8D8hZGP4QFhVZ0JDJzduSqeOIMurSkMbBi1zTN1Z0DX9oogg2Yqcq9L5+NLX8JU9Lvkvy4t3/PneNymy7ilPPx3VN+tNe5cBtaLU2OBqK6CcYOnnXuFBWFrF5WsG8N66IX2HkvYwdciR/0UadaN4qlif2T9fbKxIGLWCqPd1vwxgV+EjcYm4LVFUsXlXVGlNPYvZAJh71pVkdKuEJNY3/erUkkFJxop0HDJC8RmzXN7vUzNKfh1P9hpf/XjWqB22FEyHsY4wUMqQpNWRMMrlD7Z5wv7IkmYN9UdgK/OyVE1I0etaJkjQ1a+3pCUABD5lx/VZ+aEDGOl2Pu4XkcVBlnD46METsm87FM17oWxaw9hATu2qycf8o6Lbr4+Glh5/rf80WYr+v1Ysu1KtBlryr1YmY/sKfSqAga/onMPKhcP7gytmRNykfpovKfcul8P3NsO5DgqRj/TgZXTuRzidIzcmKBMD8WD9BSXlYEhAFwHXvjxMf+I7TdCDn38XLC6yQAPiFY7bRKjR6NmxgiDQS7hJ6HiNAW8jJZWUt41zpnT1THK388gPl4BzrJcCyNKZl/dKuibtqzRk2OshwrjheN3/h3Zk/kRp77QHHbF6MOlEyiKYm6/nTWNRk/pML8uOG4ptpbzqltD25eKAyBYtrJLgvJ7E5Bg4P32RFPoxuFOtKyv2UgKd40I8ocuVmAOB X-Forefront-PRVS: 02543CD7CD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(377454003)(13464003)(24454002)(76104003)(43544003)(50466002)(5009440100003)(305945005)(42186005)(6506006)(47776003)(66066001)(189998001)(1076002)(25786009)(3846002)(4326008)(5890100001)(7736002)(23726003)(110136004)(4001350100001)(6116002)(229853002)(33646002)(55016002)(966004)(53376002)(61506002)(38730400002)(9686003)(53936002)(53546009)(54356999)(2906002)(76176999)(6246003)(81166006)(50986999)(2950100002)(6666003)(93886004)(6306002)(8676002)(6916009)(42882006)(8656002)(5660300001)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 23:UQG/2tcD3blt+uaS6h0y7KWuAHsJ2VYsPksncbl?= =?us-ascii?Q?5YlqqzAWSiWUjeKvtp/goMJG5KpBj81WXam9BBohWR4lSq8uPGfQsDAQ2Svu?= =?us-ascii?Q?EHSjt/QuAZQ3NWcGlR/X2RxkDnZ3kEcxhxiHVDjFd2mNfeWxYdUgy0YIJA6p?= =?us-ascii?Q?tzww4O3+9hDFLh0rx3jF/OUxi4bKwwMf1QwMp1yf4M3TvWAU3feHVxHZorLz?= =?us-ascii?Q?OSXgILSURVPq6OlFQ7app/gWGkqVdMcLGwjYGKuK2wI09yRt5jDmZxqxkr84?= =?us-ascii?Q?+gi82+GZXR3mVQY33yPTFW7E83YgNFIvD+LmRnjjlQxHCq+SY3vPWIGfy8Py?= =?us-ascii?Q?S5La0RFj6H1Oou1d9xlmXyqqkaKqfa34hN6wYUFHwf9RHocThCEXcFm8R1AS?= =?us-ascii?Q?zGLviyXWas6nV3fe1ft68j2FvmKJ4EoMBsJjy6XQSRtGLLD05zHqyuEag1uQ?= =?us-ascii?Q?VrEnguHNeS9Otb15bYAYdYD63QOY/vQPskx593PAp+sHvYJc1tZstZdH0qjx?= =?us-ascii?Q?IIkSOEIYs7Qat1UUN1vQwtLp5XUMcKWGh03r5KnQIOCFO09XsLH9xdVrJnMx?= =?us-ascii?Q?S6zGKMFt4Ft48B0OjzX+YRtIbmo5O2FBhzo/Gv3eoo+hkZ5tXWjqdehBTuRe?= =?us-ascii?Q?xgB5cjfw4a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IuD4df8D954+nWseL0CZelZx2gWuNjP/t+42iAQpVzXuDOVAV7nqHY4zbGO0L4p+zjXMqXjOHX1fOeLMH8sMbS0B3rEVb3W6gjaW5GPAVKCU3LKtGgnslhx+S67qgZo4baUICfMfFNoc7bw==; 5:caCTW/9NfZ25Hbi62eYLgfGW9b3ZJY7P44fE/0xfV+OyallMBcTkQe+wKB/PLD76uxoe7HtvtVG5XFS2drVRnvHd3V/QZVRVr1Zi9IRKCziAk8Ka2pUvuOoZEsGc/Cx25vL0zu0rxD4chyMr83cMYw==; 24:ngAbjWABNux4uBilO8E9AdV49OBv49jU74t3c66eR761oSsUR58aIA1nmigL264NhB/cG7wFFQB5SnmN2G+iOZnPi2sD+59yAV1TDUNw83w= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 7:UDAubYlFQgHbq3zX62FEjU8msptjNx08/QsWoOhld4BBqu5FNnJpR6fZneJSnc9uHcwthQe5sqyiWbU3JNI11oLBPw3khyEYALwlWuvk7sKDVFM3g4xJFKsjy0le6ZgoAJfev+8cGmi0YY9ybsOtXMNGpCsX4igGCJrfKv3hvoqENW4ok5ZslnUuQ9Evoi/sWkXeQ2vJSg8wdwd6k8EOLIPINI2bMmaRvMoBrLUEfErU1j5yFbiQXS9yQUvmCSGJccwrxRKhB5fZ8QP1m+7QAR7Vqjhfss3yAAd3eGSGAPk7r+TQn60zX+mvJPnELiov6wi0KBPHCvAkqexWGDHAEg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2017 06:54:09.7974 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 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: Wed, 22 Mar 2017 06:54:14 -0000 On Tue, Mar 21, 2017 at 08:38:25PM +0000, Eads, Gage wrote: > > > > -----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 > > > > 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 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. > > > > Some reason you haven't addressed the comments in v2.i.e add a note that - > > ENOSPC applicable only for *closed system* > > > > http://dpdk.org/ml/archives/dev/2017-March/060352.html > > > > Will fix. > > > > > > * @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 = &rte_eventdevs[dev_id]; > > > > > > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > > > > Some reason you haven't addressed the comments in v2.i.e Not fixed the build > > issue. > > http://dpdk.org/ml/archives/dev/2017-March/060352.html > > > > You can reproduce it by setting CONFIG_RTE_LIBRTE_EVENTDEV_DEBUG=y in > > common config. > > > > We have two approaches to fix it > > 1/ Pollute lib/librte_eventdev/rte_eventdev.h header with implementation > > specific header files > > > > Or > > > > 2/ Have neat pmd debug common function in rte_eventdev_pmd.h.Let all PMD > > driver call it by including rte_eventdev_pmd.h > > > > I'd prefer to avoid the issue by dropping the debug message and RTE_EVENTDEV_DETACHED, like so: > > #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 > > What do you think? Looks good to me.