From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 940B0A2EDB for ; Tue, 1 Oct 2019 16:42:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A032149DF; Tue, 1 Oct 2019 16:42:30 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 89BB0271 for ; Tue, 1 Oct 2019 16:42:29 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C2C60305B1C1; Tue, 1 Oct 2019 14:42:28 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C2C45D9C9; Tue, 1 Oct 2019 14:42:27 +0000 (UTC) From: Aaron Conole To: Nipun Gupta Cc: dev@dpdk.org, jerinj@marvell.com, pbhagavatula@marvell.com, skori@marvell.com, hemant.agrawal@nxp.com, bruce.richardson@intel.com, marko.kovacevic@intel.com, orika@mellanox.com, radu.nicolau@intel.com, tomasz.kantecki@intel.com, harry.van.haaren@intel.com, nikhil.rao@intel.com References: <20191001064641.28404-1-nipun.gupta@nxp.com> Date: Tue, 01 Oct 2019 10:42:26 -0400 In-Reply-To: <20191001064641.28404-1-nipun.gupta@nxp.com> (Nipun Gupta's message of "Tue, 1 Oct 2019 12:16:41 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 01 Oct 2019 14:42:28 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH] eventdev: flag to identify same destined packets enqueue 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Nipun Gupta writes: > This patch introduces a `flag` in the Eth TX adapter enqueue API. > Some drivers may support burst functionality only with the packets > having same destination device and queue. > > The flag `RTE_EVENT_ETH_TX_ADAPTER_ENQUEUE_SAME_DEST` can be used > to indicate this so the underlying driver, for drivers to utilize > burst functionality appropriately. > > Signed-off-by: Nipun Gupta > --- In addition to the ABI concerns (which I mirror), you also should compile test this patch. It currently doesn't build (for example, see a missed adapter_enqueue in examples/eventdev_pipeline/pipeline_worker_tx.c) > app/test-eventdev/test_pipeline_common.h | 6 +++--- > .../prog_guide/event_ethernet_tx_adapter.rst | 3 ++- > drivers/event/octeontx/ssovf_evdev.h | 2 +- > drivers/event/octeontx/ssovf_worker.c | 3 ++- > drivers/event/octeontx2/otx2_evdev.h | 12 ++++++++---- > drivers/event/octeontx2/otx2_worker.c | 8 ++++++-- > drivers/event/octeontx2/otx2_worker_dual.c | 8 ++++++-- > lib/librte_eventdev/rte_event_eth_tx_adapter.h | 15 +++++++++++++-- > lib/librte_eventdev/rte_eventdev.c | 3 ++- > lib/librte_eventdev/rte_eventdev.h | 2 +- > 10 files changed, 44 insertions(+), 18 deletions(-) > > diff --git a/app/test-eventdev/test_pipeline_common.h b/app/test-eventdev/test_pipeline_common.h > index 0440b9e29..6e73c6ab2 100644 > --- a/app/test-eventdev/test_pipeline_common.h > +++ b/app/test-eventdev/test_pipeline_common.h > @@ -106,7 +106,7 @@ pipeline_event_tx(const uint8_t dev, const uint8_t port, > struct rte_event * const ev) > { > rte_event_eth_tx_adapter_txq_set(ev->mbuf, 0); > - while (!rte_event_eth_tx_adapter_enqueue(dev, port, ev, 1)) > + while (!rte_event_eth_tx_adapter_enqueue(dev, port, ev, 1, 0)) > rte_pause(); > } > > @@ -116,10 +116,10 @@ pipeline_event_tx_burst(const uint8_t dev, const uint8_t port, > { > uint16_t enq; > > - enq = rte_event_eth_tx_adapter_enqueue(dev, port, ev, nb_rx); > + enq = rte_event_eth_tx_adapter_enqueue(dev, port, ev, nb_rx, 0); > while (enq < nb_rx) { > enq += rte_event_eth_tx_adapter_enqueue(dev, port, > - ev + enq, nb_rx - enq); > + ev + enq, nb_rx - enq, 0); > } > } > > diff --git a/doc/guides/prog_guide/event_ethernet_tx_adapter.rst b/doc/guides/prog_guide/event_ethernet_tx_adapter.rst > index 192f9e1cf..a8c13e136 100644 > --- a/doc/guides/prog_guide/event_ethernet_tx_adapter.rst > +++ b/doc/guides/prog_guide/event_ethernet_tx_adapter.rst > @@ -137,11 +137,12 @@ should use the ``rte_event_enqueue_burst()`` function. > if (cap & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT) { > > event.mbuf = m; > + eq_flags = 0; > > m->port = tx_port; > rte_event_eth_tx_adapter_txq_set(m, tx_queue_id); > > - rte_event_eth_tx_adapter_enqueue(dev_id, ev_port, &event, 1); > + rte_event_eth_tx_adapter_enqueue(dev_id, ev_port, &event, 1, eq_flags); > } else { > > event.queue_id = qid; /* event queue linked to adapter port */ > diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h > index 0e622152c..1b156edab 100644 > --- a/drivers/event/octeontx/ssovf_evdev.h > +++ b/drivers/event/octeontx/ssovf_evdev.h > @@ -181,7 +181,7 @@ void ssows_flush_events(struct ssows *ws, uint8_t queue_id, > ssows_handle_event_t fn, void *arg); > void ssows_reset(struct ssows *ws); > uint16_t sso_event_tx_adapter_enqueue(void *port, > - struct rte_event ev[], uint16_t nb_events); > + struct rte_event ev[], uint16_t nb_events, uint8_t eq_flags); > int ssovf_info(struct ssovf_info *info); > void *ssovf_bar(enum ssovf_type, uint8_t id, uint8_t bar); > int test_eventdev_octeontx(void); > diff --git a/drivers/event/octeontx/ssovf_worker.c b/drivers/event/octeontx/ssovf_worker.c > index d940b5dd6..1d0467af3 100644 > --- a/drivers/event/octeontx/ssovf_worker.c > +++ b/drivers/event/octeontx/ssovf_worker.c > @@ -264,7 +264,7 @@ ssows_reset(struct ssows *ws) > > uint16_t > sso_event_tx_adapter_enqueue(void *port, > - struct rte_event ev[], uint16_t nb_events) > + struct rte_event ev[], uint16_t nb_events, uint8_t eq_flags) > { > uint16_t port_id; > uint16_t queue_id; > @@ -275,6 +275,7 @@ sso_event_tx_adapter_enqueue(void *port, > octeontx_dq_t *dq; > > RTE_SET_USED(nb_events); > + RTE_SET_USED(eq_flags); > switch (ev->sched_type) { > case SSO_SYNC_ORDERED: > ssows_swtag_norm(ws, ev->event, SSO_SYNC_ATOMIC); > diff --git a/drivers/event/octeontx2/otx2_evdev.h b/drivers/event/octeontx2/otx2_evdev.h > index 5cd80e3b2..74b749a15 100644 > --- a/drivers/event/octeontx2/otx2_evdev.h > +++ b/drivers/event/octeontx2/otx2_evdev.h > @@ -333,16 +333,20 @@ SSO_RX_ADPTR_ENQ_FASTPATH_FUNC > > #define T(name, f4, f3, f2, f1, f0, sz, flags) \ > uint16_t otx2_ssogws_tx_adptr_enq_ ## name(void *port, struct rte_event ev[],\ > - uint16_t nb_events); \ > + uint16_t nb_events, \ > + uint8_t eq_flags); \ > uint16_t otx2_ssogws_tx_adptr_enq_seg_ ## name(void *port, \ > struct rte_event ev[], \ > - uint16_t nb_events); \ > + uint16_t nb_events, \ > + uint8_t eq_flags); \ > uint16_t otx2_ssogws_dual_tx_adptr_enq_ ## name(void *port, \ > struct rte_event ev[], \ > - uint16_t nb_events); \ > + uint16_t nb_events, \ > + uint8_t eq_flags); \ > uint16_t otx2_ssogws_dual_tx_adptr_enq_seg_ ## name(void *port, \ > struct rte_event ev[], \ > - uint16_t nb_events); \ > + uint16_t nb_events, \ > + uint8_t eq_flags); \ > > SSO_TX_ADPTR_ENQ_FASTPATH_FUNC > #undef T > diff --git a/drivers/event/octeontx2/otx2_worker.c b/drivers/event/octeontx2/otx2_worker.c > index cd14cd3d2..100e21669 100644 > --- a/drivers/event/octeontx2/otx2_worker.c > +++ b/drivers/event/octeontx2/otx2_worker.c > @@ -270,12 +270,14 @@ otx2_ssogws_enq_fwd_burst(void *port, const struct rte_event ev[], > #define T(name, f4, f3, f2, f1, f0, sz, flags) \ > uint16_t __hot \ > otx2_ssogws_tx_adptr_enq_ ## name(void *port, struct rte_event ev[], \ > - uint16_t nb_events) \ > + uint16_t nb_events, \ > + uint8_t eq_flags) \ > { \ > struct otx2_ssogws *ws = port; \ > uint64_t cmd[sz]; \ > \ > RTE_SET_USED(nb_events); \ > + RTE_SET_USED(eq_flags); \ > return otx2_ssogws_event_tx(ws, ev, cmd, flags); \ > } > SSO_TX_ADPTR_ENQ_FASTPATH_FUNC > @@ -284,12 +286,14 @@ SSO_TX_ADPTR_ENQ_FASTPATH_FUNC > #define T(name, f4, f3, f2, f1, f0, sz, flags) \ > uint16_t __hot \ > otx2_ssogws_tx_adptr_enq_seg_ ## name(void *port, struct rte_event ev[],\ > - uint16_t nb_events) \ > + uint16_t nb_events, \ > + uint8_t eq_flags) \ > { \ > struct otx2_ssogws *ws = port; \ > uint64_t cmd[(sz) + NIX_TX_MSEG_SG_DWORDS - 2]; \ > \ > RTE_SET_USED(nb_events); \ > + RTE_SET_USED(eq_flags); \ > return otx2_ssogws_event_tx(ws, ev, cmd, (flags) | \ > NIX_TX_MULTI_SEG_F); \ > } > diff --git a/drivers/event/octeontx2/otx2_worker_dual.c b/drivers/event/octeontx2/otx2_worker_dual.c > index 37c274a54..c3e48da42 100644 > --- a/drivers/event/octeontx2/otx2_worker_dual.c > +++ b/drivers/event/octeontx2/otx2_worker_dual.c > @@ -310,7 +310,8 @@ SSO_RX_ADPTR_ENQ_FASTPATH_FUNC > uint16_t __hot \ > otx2_ssogws_dual_tx_adptr_enq_ ## name(void *port, \ > struct rte_event ev[], \ > - uint16_t nb_events) \ > + uint16_t nb_events, \ > + uint8_t eq_flags) \ > { \ > struct otx2_ssogws_dual *ws = port; \ > struct otx2_ssogws *vws = \ > @@ -318,6 +319,7 @@ otx2_ssogws_dual_tx_adptr_enq_ ## name(void *port, \ > uint64_t cmd[sz]; \ > \ > RTE_SET_USED(nb_events); \ > + RTE_SET_USED(eq_flags); \ > return otx2_ssogws_event_tx(vws, ev, cmd, flags); \ > } > SSO_TX_ADPTR_ENQ_FASTPATH_FUNC > @@ -327,7 +329,8 @@ SSO_TX_ADPTR_ENQ_FASTPATH_FUNC > uint16_t __hot \ > otx2_ssogws_dual_tx_adptr_enq_seg_ ## name(void *port, \ > struct rte_event ev[], \ > - uint16_t nb_events) \ > + uint16_t nb_events, \ > + uint8_t eq_flags) \ > { \ > struct otx2_ssogws_dual *ws = port; \ > struct otx2_ssogws *vws = \ > @@ -335,6 +338,7 @@ otx2_ssogws_dual_tx_adptr_enq_seg_ ## name(void *port, \ > uint64_t cmd[(sz) + NIX_TX_MSEG_SG_DWORDS - 2]; \ > \ > RTE_SET_USED(nb_events); \ > + RTE_SET_USED(eq_flags); \ > return otx2_ssogws_event_tx(vws, ev, cmd, (flags) | \ > NIX_TX_MULTI_SEG_F); \ > } > diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.h b/lib/librte_eventdev/rte_event_eth_tx_adapter.h > index c848261c4..98be77568 100644 > --- a/lib/librte_eventdev/rte_event_eth_tx_adapter.h > +++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.h > @@ -300,6 +300,11 @@ rte_event_eth_tx_adapter_txq_get(struct rte_mbuf *pkt) > int > rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id); > > +#define RTE_EVENT_ETH_TX_ADAPTER_ENQUEUE_SAME_DEST 0x1 > +/**< This flag is used when all the packets enqueued in the tx adapter are > + * destined for the same Ethernet device, queue pair. > + */ > + > /** > * 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 > @@ -324,6 +329,10 @@ rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id); > * The number of event objects to enqueue, typically number of > * rte_event_port_attr_get(...RTE_EVENT_PORT_ATTR_ENQ_DEPTH...) > * available for this port. > + * @param flags > + * See RTE_EVENT_ETH_TX_ADAPTER_ENQUEUE_ flags. > + * #RTE_EVENT_ETH_TX_ADAPTER_ENQUEUE_SAME_DEST signifies that all the packets > + * which are enqueued are destined for the same Ethernet device, queue pair. > * > * @return > * The number of event objects actually enqueued on the event device. The > @@ -343,7 +352,8 @@ static inline uint16_t > rte_event_eth_tx_adapter_enqueue(uint8_t dev_id, > uint8_t port_id, > struct rte_event ev[], > - uint16_t nb_events) > + uint16_t nb_events, > + uint8_t flags) > { > const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; > > @@ -359,7 +369,8 @@ rte_event_eth_tx_adapter_enqueue(uint8_t dev_id, > return 0; > } > #endif > - return dev->txa_enqueue(dev->data->ports[port_id], ev, nb_events); > + return dev->txa_enqueue(dev->data->ports[port_id], ev, > + nb_events, flags); > } > > /** > diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c > index f44c869cb..3bf9d7115 100644 > --- a/lib/librte_eventdev/rte_eventdev.c > +++ b/lib/librte_eventdev/rte_eventdev.c > @@ -1324,7 +1324,8 @@ rte_eventdev_find_free_device_index(void) > static uint16_t > rte_event_tx_adapter_enqueue(__rte_unused void *port, > __rte_unused struct rte_event ev[], > - __rte_unused uint16_t nb_events) > + __rte_unused uint16_t nb_events, > + __rte_unused uint8_t flags) > { > rte_errno = ENOTSUP; > return 0; > diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h > index 5044a13d0..2a5643da3 100644 > --- a/lib/librte_eventdev/rte_eventdev.h > +++ b/lib/librte_eventdev/rte_eventdev.h > @@ -1227,7 +1227,7 @@ typedef uint16_t (*event_dequeue_burst_t)(void *port, struct rte_event ev[], > /**< @internal Dequeue burst of events from port of a device */ > > typedef uint16_t (*event_tx_adapter_enqueue)(void *port, > - struct rte_event ev[], uint16_t nb_events); > + struct rte_event ev[], uint16_t nb_events, uint8_t flags); > /**< @internal Enqueue burst of events on port of a device */ > > #define RTE_EVENTDEV_NAME_MAX_LEN (64)