From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0046.outbound.protection.outlook.com [104.47.34.46]) by dpdk.org (Postfix) with ESMTP id 34FA43B5 for ; Thu, 26 Jan 2017 10:39:50 +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=MGLXo4HizAUjX2F09HF9bLfCsJBPP15azgoeYq5F7Dg=; b=JjUvsx3lKwGaOH1b7AE73IXgX04vlG2oaEbI8XfmRGInB5h/9ZkUWYVr3FTHxREKGPCg4yrHztGDY5lx6Mvpgy0OGPrxSWN+QjIfWf6CVmYIQXzCf6xhDjOtlnR0ZRTtmpSURTAP2u9hBn9pplGA64HPYfX7cG4lGORJ4YlcUNo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (122.172.181.227) 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.874.12; Thu, 26 Jan 2017 09:39:44 +0000 Date: Thu, 26 Jan 2017 15:09:25 +0530 From: Jerin Jacob To: "Eads, Gage" CC: "Richardson, Bruce" , "'dev@dpdk.org'" , "'thomas.monjalon@6wind.com'" , "'hemant.agrawal@nxp.com'" , "Van Haaren, Harry" , "McDaniel, Timothy" Message-ID: <20170126093924.GA5276@localhost.localdomain> References: <1480996340-29871-1-git-send-email-jerin.jacob@caviumnetworks.com> <1482312326-2589-1-git-send-email-jerin.jacob@caviumnetworks.com> <1482312326-2589-2-git-send-email-jerin.jacob@caviumnetworks.com> <9184057F7FC11744A2107296B6B8EB1E01E5EF2C@FMSMSX108.amr.corp.intel.com> <59AF69C657FD0841A61C55336867B5B035B8EBB9@IRSMSX103.ger.corp.intel.com> <9184057F7FC11744A2107296B6B8EB1E01E5F0AC@FMSMSX108.amr.corp.intel.com> <9184057F7FC11744A2107296B6B8EB1E01E5F3D3@FMSMSX108.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <9184057F7FC11744A2107296B6B8EB1E01E5F3D3@FMSMSX108.amr.corp.intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [122.172.181.227] X-ClientProxiedBy: MAXPR01CA0047.INDPRD01.PROD.OUTLOOK.COM (10.164.146.147) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: 4b195809-f355-4d7a-8984-08d445cf44a1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:c3SMUWaa6MZ1SVovyEJLUMst7WBzRGBPgHd9u0pSCsvnM4AkU2LVKC+OBqaPdZq9p/XU020w9JzS5oXPK6KzrvQjIL9+4MhJl1ucXhZf6RrgSn4Enf7Ajm7mrQiZdz/jqILIqR2GewdxzvDoj49WDeB85p6JaX3VbrhI+cC/y0N7FQFeap5Z09VTgVhR0zB188xujbvbqOxZhCTGZFRxj5U30eeuAJR8URdAy6J91rlZLPXbCW5ImUzDwZYdF93G5AMM/XIx7TFiXuazSQLVUQ== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 25:JSgQ1+oFows1YNlHhRw0GuHlkb7T731J8F8WA/xLhU8uSSYOVNREYl8UxXkXrTm4sAwXdVfKvGHFIpRu1T7WTFvrQ0Kb9MUWxw6WDcZMb2V3ux9xljQ3zc49G/WQ9w433QPpSMz6diL6K1mk7Q6JuNPxgaZLlOLS95dqQM3MR5rT/SOy0xj4HyElCw4QHIZS7PJMKQ908KmNGHiNI6PUDc0hdENBPHBNltm4E52Y4Zp09/FypUR/1SX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/KBqf22dTOqonwyuxSAqGxMAHKNHladY4FeSObb4FLnXW/MZ6U9F5YswE5Hfa0G7nzUXxWRpaw9MzRhluQW+r/5M1gXsQnSLMRTsauxe/1epR5MfI9CZ/bd+vk/WBvooCefxD0U3KwYO977XhGBy/P65MtzYjkP63ziHYfTFSxwbOwfxdHFjTUuoR/7XWIjROkCdWUjnKlBm2lvNtpucA08XCMClPJI4z6K4ITDr9VDWXrzLCLpMUimlvIfs5LJi/bVrd1adbiAjndEgpuNlY7bfvXawHOw6tlmmuYk6ZA+98Qw8fsrZgvhXlP0Hkte7WeFRx3YW5WWQDofoENG8ECQ5bWL8qEhpx316akR+kkab0Q3s/beAqnIgHP0acZ3bNDrc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:brl1Uan7F0AhqBwK0V61EzQACpZ7zO4xj4QNVt2b139VhHRDsx7iRUQ5raAS4jTJvulBHAF/fV9w6K5m7jSAFyxrvR/+mrGIathB7Od1Tb0+0Hdaje+eW9ye3O36mVizrvij6olusQgLnxzBADQIkzTn+kVgVx5TPQBBME0sJbyy0vP5HFRGP4eg/0A0DPtZ9Qz8C7b9zqGIIvOe9GOFCpsIpNaYwqnecnpqzrVLBrLcTPW6l0GWvId60RS6D9n/gemxOBiZ9zklACRA13aXOqV3J9bYbmVFllQcR/wuHWqTbU6tF4d9CUgVBqiza08+K6CE4U7P/WEtTWrWcynfeTxvOK8UDfuoPhQ6Kqh23zIBRQ/rGYm9xhL9WYkyIWk4Q3PXWKifyR8QsGf1rvlQZvqCpLdsdK02iJY1Nn2NyQ33UCJnFZBPGJgsRuASiDHXdx5MzIyonJ2DBnbk4EzsHj2WqvtNWwZvJMT+d60hIhGKDkifOVEBMpoEoVITFMO/YK3DtDKux8GcMf9/ltV4xC091Wu2vEyBkXm5COLsH7rgBZlVlRVHZYhm3z7GYRYi6+ed4cXc2Vv6CO1S+vRzGw== X-Forefront-PRVS: 019919A9E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(189002)(24454002)(43544003)(199003)(6116002)(3846002)(97756001)(76176999)(7736002)(50466002)(23726003)(1076002)(305945005)(101416001)(47776003)(93886004)(66066001)(54356999)(50986999)(106356001)(105586002)(92566002)(42186005)(61506002)(46406003)(81156014)(81166006)(8676002)(25786008)(8656002)(55016002)(6506006)(9686003)(54906002)(83506001)(38730400001)(229853002)(68736007)(6666003)(110136003)(5660300001)(6916009)(2950100002)(42882006)(4326007)(33656002)(53936002)(189998001)(97736004)(4001350100001)(2906002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:RuoDcRQwVjmenbebnPoOV2wISdcZM1QiSg6uMTj?= =?us-ascii?Q?VXV1jUIpYqZ404IkWsO//A0KC3x7447JMSFbgj4WqmIs8Et9MFy80Khuw7Em?= =?us-ascii?Q?+CjLbbZogUXW8SHlLFKfbl8XcHFLGhyMSW3Vqu4Dl8qw0+1o+Br7HlARA9IY?= =?us-ascii?Q?gVPtwJS8KoXUQPxT9cyAJPw/sBhCAhG2NszEbBQL5rry5TZltBKs/HQW+WFA?= =?us-ascii?Q?gpdqwjDDaPmA5P4YsUo4PE8GhwHYaF4kkjGZe2mH/QAuAGGYaInCQZZnMhpE?= =?us-ascii?Q?TwqUzoBTybumSnlxwO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D3Y5avA+tvs?= =?us-ascii?Q?56linvejhtyBylNddISJ83ZsS4VX0QY37I29O0imZhqR9HdJxNX9LZqvGPUO?= =?us-ascii?Q?TszkRhfh7iuNfal6tKV5F1SiQRkdhZ27kJquT7NYcVxne66MmwtAzOv6zeay?= =?us-ascii?Q?jL9kyLBq6M8Elx3QJWrJ8SQeicZadJhg+8cudZ5odxiEURYJCfJiM+3t1okl?= =?us-ascii?Q?g/YiD6g=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 6:ogWd4ZYEaCtHHCYHJCa6YV1lFELuW0sd0fruuc0IJ/iFLMrJzH6ikR2+p+qvf0qnVEEFz94LTN8DWKMYsvqzYLDtdntkCLHJIlZv0RstY3l16v33J5pAUo+/aJdsNe0HnS8RUCquNsrQSc17K0U/KNPvvfWIMzETuh6Gw6CrlASyaGeMO8Vq0nUa0207PDh4trimaNkUkqrf21a4527vUyDnPWcr4Fb5/OJke3q6aun64I7UTQwUj2smr0UBgOGmuiS5jgNIh98gHvcipHUXgkowp9/5DaJ93/rpntvvxSUieKkvz3kjndeVOW+GLrQVbAgHEvr+pT3fmukj3yLMbz+xUU7/k7sExRVDMXgxAPicXrmL9z4Qrllx3Z0nxnPY0DOkIHRqa3DosE36BW3UcIa8o5NRDba8ZjT1eHGiPQk=; 5:dKqHNICBuzaiTjUywLayucDf7qQkrIzdeDIeXlvxSoCZzIyn1gzbSwZieTn/z5P5YvExj4y7tSWVh816lTcjTQfZdQpNyv3mxlvSUtbeqblEPf5eDxe6CWL35sBPVW9ic/bSWX+H4d524wIB4gXMug==; 24:N9AxG1saFJgBid3o/QCz6/By0RwU2kfv0PRNeV9d14fFaGmt6w/0FAFJu+/vECJiu5/1tmxov/rCPgEatgSuwb9lcbrI2dib3GYRxmAjk18= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:eGo71SefXtoZ3VS61SkesTaAKv9ZT63TZdLV15eWHNlI327Szb9eG09TJsRLp6fROJVQBfS1XHpBvLz60KiGgXMsS4Iu2hK/5vMhoyAZkl5tSkpDM8OIkz6du6dxgc6f4RIkkJFiJzUQ9jZU0QIVl+/Db0yUANEiNOyJZfaRzy3C11rrP/SgSI+CKxzoXcFJTZUgE66AqUcYdJTcpiGWkpoXUN7VGYIPI+VtdJ/4AXcEWPpSI4FKBfxtsRCGzKhoD3JhC38kWAh8TdIWrMQx7iBvSVFSRKBcp58kaRzoFmtRu4pl0gmzGQ9sIVcuwDDB6r4pwgmfgdzF9pygEz6JqVlUJpOeOxMo+B7XgqB0x6fBprOjHhW0eujLQHUPMHXN+N2Z6zp9NKLfDn151L3Iy8NW42SQd9p1qCQPDF54mediwAurV39yAaExz7DqiYpP6JpjCNi1Tj6W4Z0uGWRb6A== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2017 09:39:44.7478 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: Re: [dpdk-dev] [PATCH v4 1/6] eventdev: introduce event driven programming model 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, 26 Jan 2017 09:39:50 -0000 On Wed, Jan 25, 2017 at 10:36:21PM +0000, Eads, Gage wrote: > > > > > Subject: [dpdk-dev] [PATCH v4 > > > 1/6] eventdev: introduce event driven > > programming model > > > > > > > +/** > > + * Enqueue a burst > > > of events objects or an event object supplied > > in > > > > > *rte_event* > > + * structure on an event device designated by its > > > *dev_id* > > through the event + * port specified by *port_id*. Each > > > event > > object specifies the event queue on + * which it will be > > > enqueued. > > > > > + * > > > > > + * The *nb_events* parameter is the number of event objects to > > > > > enqueue which are + * supplied in the *ev* array of *rte_event* > > > > > structure. > > > > > + * > > > > > + * The rte_event_enqueue_burst() function returns the number of > > > + > > * events objects it actually enqueued. A return value equal to > > > > > *nb_events* + * means that all event objects have been enqueued. > > > > > + * > > > > > + * @param dev_id > > > > > + * The identifier of the device. > > > > > + * @param port_id > > > > > + * The identifier of the event port. > > > > > + * @param ev > > > > > + * Points to an array of *nb_events* objects of type *rte_event* > > > > structure > > > > > + * which contain the event object enqueue operations to be > > > > processed. > > > > > + * @param nb_events > > > > > + * The number of event objects to enqueue, typically number of > > > > > + * rte_event_port_enqueue_depth() available for this port. > > > > > + * > > > > > + * @return > > > > > + * 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 > > > > > + * > > > > > + * @see rte_event_port_enqueue_depth() + */ +uint16_t > > > > > +rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, > > > > > + const struct rte_event ev[], uint16_t nb_events); > > > > > > > > There are a number of reasons this operation could fail to enqueue > > > all > the events, including: > > > > - Backpressure > > > > - Invalid port ID > > > > - Invalid queue ID > > > > - Invalid sched type when a queue is configured for ATOMIC_ONLY, > > > > ORDERED_ONLY, or PARALLEL_ONLY > - ... > > > > > > > > The current API doesn't provide a straightforward way to determine > > > the > cause of a failure. This is a particular issue on event PMDs > > > that can > backpressure, where the app may want to treat that case > > > differently > than the other failure cases. > > > > > > > > Could we change the return type to int16_t, and define a set of > > > error > cases (e.g. -ENOSPC for backpressure, -EINVAL for an invalid > > argument)? > > > > (With corresponding changes needed in the PMD API) Similarly we > > > could > change rte_event_dequeue_burst() to return an int16_t, with > > > -EINVAL as > a possible error case. > > > > > > Use rte_errno instead, I suggest. That's what it's there for. > > > > > > /Bruce > > > > That makes sense. In that case, the API comment could be tweaked like so: > > > > * 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, 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. > > However it seems better to use a signed integer for the dequeue burst return value, if it is to use rte_errno. Application code could be simplified: > > (signed return value) > ret = rte_event_dequeue_burst(...); > if (ret < 0) > rte_panic("Dequeued returned errno %d\n", rte_errno); > > vs. > > (unsigned return value) > ret = rte_event_dequeue_burst(...); > if (ret == 0 && rte_errno != 0) > rte_panic("Dequeued returned errno %d\n", rte_errno); > > And with an unsigned return value, all dequeue implementations would have to clear rte_errno when no events are dequeued. Gage, Just to understand, what is the expected application behavior if the implementation returns -ENOSPC Apart for the above SW driver behavior, I think, HW implementation has two more different behavior a) Implementation make sure that it never returns -ENOSPC by allocating more space on the fly or any other scheme b) Tail drop Considering different implementation has different behaviors, How about enumerating the overflow policy at the port configuration time? and let implementation act accordingly to avoid fast-patch change in application(effects in all implementation irrespective of the capability) possible enumerating value at the port configuration time, - PANIC or similar scheme to denote it cannot proceed - TAIL DROP or any expected application behavior you want to add