From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id F3072374 for ; Mon, 26 Jun 2017 17:44:12 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP; 26 Jun 2017 08:44:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,396,1493708400"; d="scan'208";a="117572979" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 26 Jun 2017 08:44:11 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 26 Jun 2017 08:44:11 -0700 Received: from fmsmsx108.amr.corp.intel.com ([169.254.9.126]) by fmsmsx116.amr.corp.intel.com ([169.254.2.253]) with mapi id 14.03.0319.002; Mon, 26 Jun 2017 08:44:10 -0700 From: "Eads, Gage" To: Jerin Jacob , "dev@dpdk.org" CC: "Richardson, Bruce" , "Van Haaren, Harry" , "hemant.agrawal@nxp.com" , "nipun.gupta@nxp.com" , "Vangati, Narender" , "Rao, Nikhil" Thread-Topic: [dpdk-dev] [PATCH] eventdev: add producer enqueue hint Thread-Index: AQHS43GseS26yMwDpUKK6VZY8kynZqI3Xc0g Date: Mon, 26 Jun 2017 15:44:10 +0000 Message-ID: <9184057F7FC11744A2107296B6B8EB1E01ED7263@FMSMSX108.amr.corp.intel.com> References: <20170612114627.18893-1-jerin.jacob@caviumnetworks.com> In-Reply-To: <20170612114627.18893-1-jerin.jacob@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.1.200.108] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] eventdev: add producer enqueue hint 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: Mon, 26 Jun 2017 15:44:13 -0000 > -----Original Message----- > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Monday, June 12, 2017 6:46 AM > To: dev@dpdk.org > Cc: Richardson, Bruce ; Van Haaren, Harry > ; hemant.agrawal@nxp.com; Eads, Gage > ; nipun.gupta@nxp.com; Vangati, Narender > ; Rao, Nikhil ; Jerin J= acob > > Subject: [dpdk-dev] [PATCH] eventdev: add producer enqueue hint >=20 > Some PMD like OCTEONTX can have optimized handling of events if the PMD > knows it is a producer pattern in advance. > For instance, OCTEONTX PMD can support burst mode if op =3D=3D > RTE_EVENT_OP_NEW. >=20 > Since the event producer initialize(set all_op_new =3D=3D 1) the event ob= ject before > the main producer loop, This scheme does not call for any performance > regression on other PMDs. >=20 > Signed-off-by: Jerin Jacob > --- > Another option is to add a flag in enqueue API or have parallel enqueue A= PI. > --- > drivers/event/octeontx/ssovf_worker.c | 12 ++++++++++-- > lib/librte_eventdev/rte_eventdev.h | 10 +++++++++- > 2 files changed, 19 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/event/octeontx/ssovf_worker.c > b/drivers/event/octeontx/ssovf_worker.c > index ad3fe684d..209c595cf 100644 > --- a/drivers/event/octeontx/ssovf_worker.c > +++ b/drivers/event/octeontx/ssovf_worker.c > @@ -196,8 +196,16 @@ ssows_enq(void *port, const struct rte_event *ev) > uint16_t __hot ssows_enq_burst(void *port, const struct rte_event ev[], > uint16_t nb_events) { > - RTE_SET_USED(nb_events); > - return ssows_enq(port, ev); > + uint16_t i; > + struct ssows *ws =3D port; > + > + if (ev[0].all_op_new) { > + rte_smp_wmb(); > + for (i =3D 0; i < nb_events; i++) > + ssows_new_event(ws, &ev[i]); > + return i; > + } else > + return ssows_enq(port, ev); > } >=20 > void > diff --git a/lib/librte_eventdev/rte_eventdev.h > b/lib/librte_eventdev/rte_eventdev.h > index a248fe90e..1c1a46593 100644 > --- a/lib/librte_eventdev/rte_eventdev.h > +++ b/lib/librte_eventdev/rte_eventdev.h > @@ -933,7 +933,15 @@ struct rte_event { > * and is undefined on dequeue. > * @see RTE_EVENT_OP_NEW, (RTE_EVENT_OP_*) > */ > - uint8_t rsvd:4; > + uint8_t all_op_new:1; > + /**< Valid only with event enqueue operation - This hint > + * indicates that the enqueue request has only the > + * events with op =3D=3D RTE_EVENT_OP_NEW. > + * The event producer, typically use this pattern to > + * inject the events to eventdev. > + * @see RTE_EVENT_OP_NEW > rte_event_enqueue_burst() > + */ > + uint8_t rsvd:3; > /**< Reserved for future use */ > uint8_t sched_type:2; > /**< Scheduler synchronization type > (RTE_SCHED_TYPE_*) > -- > 2.13.1 I slightly prefer the parallel enqueue API -- I can see folks making the mi= stake of setting all_op_new without setting the op to RTE_EVENT_OP_NEW, and= later adding a "forward-only" enqueue API could be interesting for the sw = PMD -- but this looks fine to me. Curious if others have any thoughts.