From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id BE41828F3 for ; Tue, 28 Mar 2017 18:18:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490717880; x=1522253880; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=LX8n/6Z11pzOhqC2z6WwTd2r312R7GcP2T+UPx6dD3o=; b=tYLGDHsptUcsKHsTroaFgFVOpToL0+iRAVbDpMtv0we6/C6TX4wl0VWY WAZVRqrzpX8BPG+VZ4mN7nAj3z9Prg==; Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2017 09:17:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,237,1486454400"; d="scan'208";a="1147998541" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga002.fm.intel.com with ESMTP; 28 Mar 2017 09:17:58 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.153]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0319.002; Tue, 28 Mar 2017 17:17:57 +0100 From: "Van Haaren, Harry" To: Jerin Jacob CC: "dev@dpdk.org" , "Richardson, Bruce" , "Eads, Gage" Thread-Topic: [PATCH v5 09/20] event/sw: add worker core functions Thread-Index: AQHSpL8rHfc3VkaZIk6WnMxq3n0glKGoqAcAgAHLT+A= Date: Tue, 28 Mar 2017 16:17:56 +0000 Message-ID: References: <489175012-101439-1-git-send-email-harry.van.haaren@intel.com> <1490374395-149320-1-git-send-email-harry.van.haaren@intel.com> <1490374395-149320-10-git-send-email-harry.van.haaren@intel.com> <20170327135048.5a6lqcc6pioriy2t@localhost.localdomain> In-Reply-To: <20170327135048.5a6lqcc6pioriy2t@localhost.localdomain> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWM0MDRlYmQtNDFmOC00NjY0LTkwMmMtOTVlNzY4YmJjYmEyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjYrSWgyNGc5NlNQQjFvSkxjdE1adWFYRVZRU29UV1wvTFpYTzZ4VkNzZUwwPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v5 09/20] event/sw: add worker core 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: Tue, 28 Mar 2017 16:18:01 -0000 > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Monday, March 27, 2017 2:51 PM > To: Van Haaren, Harry > Cc: dev@dpdk.org; Richardson, Bruce ; Eads, G= age > > Subject: Re: [PATCH v5 09/20] event/sw: add worker core functions >=20 > On Fri, Mar 24, 2017 at 04:53:04PM +0000, Harry van Haaren wrote: > > From: Bruce Richardson > > > > add the event enqueue, dequeue and release functions to the eventdev. > > These also include tracking of stats for observability in the load of > > the scheduler. > > Internally in the enqueue function, the various types of enqueue > > operations, to forward an existing event, to send a new event, to > > drop a previous event, are converted to a series of flags which will > > be used by the scheduler code to perform the needed actions for that > > event. > > > > Signed-off-by: Bruce Richardson > > Signed-off-by: Gage Eads > > Signed-off-by: Harry van Haaren > > --- > > drivers/event/sw/Makefile | 1 + > > drivers/event/sw/sw_evdev.c | 5 + > > drivers/event/sw/sw_evdev.h | 32 +++++++ > > drivers/event/sw/sw_evdev_worker.c | 188 +++++++++++++++++++++++++++++= ++++++++ > > 4 files changed, 226 insertions(+) > > create mode 100644 drivers/event/sw/sw_evdev_worker.c > > > > @@ -550,6 +551,10 @@ sw_probe(const char *name, const char *params) > > return -EFAULT; > > } > > dev->dev_ops =3D &evdev_sw_ops; > > + dev->enqueue =3D sw_event_enqueue; > > + dev->enqueue_burst =3D sw_event_enqueue_burst; > > + dev->dequeue =3D sw_event_dequeue; > > + dev->dequeue_burst =3D sw_event_dequeue_burst; >=20 > Is all the code in the sw_probe() valid for multi process? If not, after > function pointer assignment it can return[1] from sw_probe. Just like > another PMD's, we will support configuration API and fastpath API in prim= ary > process and secondary process will be limited to fast path functions. >=20 > [1] > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) > return 0; Yes, will be fixed in v6. > > sw =3D dev->data->dev_private; > > sw->data =3D dev->data; > > diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h > > index f5515e1..ab372fd 100644 > > --- a/drivers/event/sw/sw_evdev.h > > +++ b/drivers/event/sw/sw_evdev.h > > @@ -55,12 +55,36 @@ > > #define SCHED_DEQUEUE_BURST_SIZE 32 > > > > + > > +static inline void > > +sw_event_release(struct sw_port *p, uint8_t index) > > +{ > > + /* > > + * Drops the next outstanding event in our history. Used on dequeue > > + * to clear any history before dequeuing more events. > > + */ > > + RTE_SET_USED(index); > > + > > + /* create drop message */ > > + struct rte_event ev =3D { > > + .op =3D sw_qe_flag_map[RTE_EVENT_OP_RELEASE], > > + }; > > + > > + uint16_t free_count; > > + qe_ring_enqueue_burst(p->rx_worker_ring, &ev, 1, &free_count); > > + > > + /* each release returns one credit */ > > + p->outstanding_releases--; > > + p->inflight_credits++; > > +} > > + > > +uint16_t > > +sw_event_enqueue_burst(void *port, const struct rte_event ev[], uint16= _t num) > > +{ > > + int32_t i; > > + uint8_t new_ops[PORT_ENQUEUE_MAX_BURST_SIZE]; > > + struct sw_port *p =3D port; > > + struct sw_evdev *sw =3D (void *)p->sw; > > + uint32_t sw_inflights =3D rte_atomic32_read(&sw->inflights); > > + > > + if (p->inflight_max < sw_inflights) > > + return 0; >=20 > likely and unlikely attributes are missing in fastpath functions. > Worth to consider in using those in worker file. Initial (obvious ones) done in v6. Perhaps a candidate for future patches a= fter initial merge, as these are only performance improvements, not functio= nal. > > +uint16_t > > +sw_event_dequeue_burst(void *port, struct rte_event *ev, uint16_t num, > > + uint64_t wait) > > +{ > > + RTE_SET_USED(wait); > > + struct sw_port *p =3D (void *)port; > > + struct sw_evdev *sw =3D (void *)p->sw; > > + struct qe_ring *ring =3D p->cq_worker_ring; > > + uint32_t credit_update_quanta =3D sw->credit_update_quanta; > > + > > + /* check that all previous dequeues have been released */ > > + if (!p->is_directed) { > > + uint16_t out_rels =3D p->outstanding_releases; > > + uint16_t i; > > + for (i =3D 0; i < out_rels; i++) > > + sw_event_release(p, i); > > + } > > + > > + /* Intel modification: may not be in final API */ > > + if (ev =3D=3D 0) > > + return 0; >=20 > May be we can remove this one in fastpath. Maybe under DEBUG in common co= de > we can add this. Done, removed in v6.