From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [RFC] [PATCH v2] libeventdev: event driven programming model framework for DPDK Date: Mon, 17 Oct 2016 09:48:13 +0530 Message-ID: <20161017041812.GA3543@localhost.localdomain> References: <20161005072451.GA2358@localhost.localdomain> <1476214216-31982-1-git-send-email-jerin.jacob@caviumnetworks.com> <9184057F7FC11744A2107296B6B8EB1E01E179E0@FMSMSX108.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: "dev@dpdk.org" , "thomas.monjalon@6wind.com" , "Richardson, Bruce" , "Vangati, Narender" , "hemant.agrawal@nxp.com" To: "Eads, Gage" Return-path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0045.outbound.protection.outlook.com [104.47.33.45]) by dpdk.org (Postfix) with ESMTP id 322BD2C09 for ; Mon, 17 Oct 2016 06:18:41 +0200 (CEST) Content-Disposition: inline In-Reply-To: <9184057F7FC11744A2107296B6B8EB1E01E179E0@FMSMSX108.amr.corp.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Oct 14, 2016 at 03:00:57PM +0000, Eads, Gage wrote: > Thanks Jerin, this looks good. I've put a few notes/questions inline. Thanks Gage. > > > + > > +/** > > + * Get the device identifier for the named event device. > > + * > > + * @param name > > + * Event device name to select the event device identifier. > > + * > > + * @return > > + * Returns event device identifier on success. > > + * - <0: Failure to find named event device. > > + */ > > +extern uint8_t > > +rte_event_dev_get_dev_id(const char *name); > > This return type should be int8_t, or some signed type, to support the failure case. Makes sense. I will change to int to make consistent with rte_cryptodev_get_dev_id() > > > +}; > > + > > +/** > > + * Schedule one or more events in the event dev. > > + * > > + * An event dev implementation may define this is a NOOP, for instance if > > + * the event dev performs its scheduling in hardware. > > + * > > + * @param dev_id > > + * The identifier of the device. > > + */ > > +extern void > > +rte_event_schedule(uint8_t dev_id); > > One idea: Have the function return the number of scheduled packets (or 0 for implementations that do scheduling in hardware). This could be a helpful diagnostic for the software scheduler. How about returning an implementation specific value ? Rather than defining certain function associated with returned value. Just to make sure it works with all HW/SW implementations. Something like below, /** * Schedule one or more events in the event dev. * * An event dev implementation may define this is a NOOP, for instance if * the event dev performs its scheduling in hardware. * * @param dev_id * The identifier of the device. * @return * Implementation specific value from the event driver for diagnostic purpose */ extern int rte_event_schedule(uint8_t dev_id);