From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E1A8CA0C46; Tue, 31 Aug 2021 14:29:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78F974013F; Tue, 31 Aug 2021 14:29:22 +0200 (CEST) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by mails.dpdk.org (Postfix) with ESMTP id 0BD0C40041 for ; Tue, 31 Aug 2021 14:29:21 +0200 (CEST) Received: by mail-io1-f48.google.com with SMTP id n24so24424503ion.10 for ; Tue, 31 Aug 2021 05:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ityIr3MY2uaY4/6oR9oeN9Or0vlG+S4nTPGNREioXBE=; b=WZdt5tz4uxLYyznVbxkc/L6HxGnJPRiw9v7+1VAa0kgdwsJ7hlciSeMuya9EflsVX+ Tur612OZ0p3NgrL0o8l7K7KjGFU2iN1dGiqFLUBcB/1A1jjxMf/OPgv9rQDVRjgaz9j6 3sCZ/UnAGB8jyOOlyLSOFv9IP+bbCTt+BRvh3H3caHjXfQyVV/otI4Z5nppfA54X3Ldd iotmN8aGuZwB9+htZ+f2BMe5V1ISyKn3kRejal/FDOWBnki65jTz1HmvH2dUZ8V6gOjv PdUHKk9WWgn1FdF3uS0dQNkn+1jgjewobSLgx9F9ErH/1uAPXcbgUSn3htNk6hAw2jHX pj9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ityIr3MY2uaY4/6oR9oeN9Or0vlG+S4nTPGNREioXBE=; b=MQ3wOBHgw4ALburty5LAfhi0lvlV0P69MAHkcd+9BmSczNwRAOz219V7BmK1dJCwqN 8gGHRNsa0/WxyR7767/DAj0vqdPHizouXJlA8f3GlFsx22bMUXHVzlBMQjExe8GmbYxF QNV41Urt4MWYuycsNu4lsYe8nNoRBO0eJOhudVJQESIaiJzHB2o5eCHyGBPrcO0TBPHY XSjj8pSA+iBnyrVqb/hOlh7Okommv76CO910oJ1ZtxTGOm1IlQGSfZmggyFYhLyUwAMX AqlWfoMnjdGw6SWD6V8r/zAoY6I8rXDSs8M33m54s03pWIjKd2Sv1iR66q2/m7glwGes Ck8g== X-Gm-Message-State: AOAM533PdJQ89znk1Pu9AgzSMEPc+gFckd1q8raLQ59dL9obSRd6JD9L CnAs8DA6fTKTWGSaxlkfQUrmdhuRcySlJeueGtc= X-Google-Smtp-Source: ABdhPJybHVv+QGSgBthLLnYqyvk/iLokzA13lPqhoCbccuDtn6bNO6+YiIiJ33RYch+VdaSF1PghT+VTWau1lkQzxgk= X-Received: by 2002:a02:2a88:: with SMTP id w130mr2619278jaw.60.1630412960241; Tue, 31 Aug 2021 05:29:20 -0700 (PDT) MIME-Version: 1.0 References: <316159da-d56d-7a25-00e5-c2004f4e77f7@ericsson.com> <20210830160020.3225-1-mattias.ronnblom@ericsson.com> In-Reply-To: <20210830160020.3225-1-mattias.ronnblom@ericsson.com> From: Jerin Jacob Date: Tue, 31 Aug 2021 17:58:54 +0530 Message-ID: To: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= Cc: Jerin Jacob , Pavan Nikhilesh , dpdk-dev , bogdan.tanasa@ericsson.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [RFC] eventdev: uninline inline API functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On Mon, Aug 30, 2021 at 9:30 PM Mattias R=C3=B6nnblom wrote: > > Replace the inline functions in the eventdev user application API with > regular non-inline API calls. This allows for a cleaner and more > simple API/ABI, but might well also cause performance regressions. > > The purpose of this RFC patch is to allow for performance testing. > > The rte_eventdev struct declaration should be moved off the public > API. > > Signed-off-by: Mattias R=C3=B6nnblom I think we need to align all DPDK subsystems to a similar scheme.[1] I see -5% kind of regression-based on workload. [1] https://patches.dpdk.org/project/dpdk/patch/20210820162834.12544-2-konstant= in.ananyev@intel.com/ > --- > drivers/net/octeontx/octeontx_ethdev.h | 1 + > lib/eventdev/rte_event_eth_rx_adapter.h | 1 + > lib/eventdev/rte_event_eth_tx_adapter.c | 31 ++++++++ > lib/eventdev/rte_event_eth_tx_adapter.h | 35 ++------- > lib/eventdev/rte_eventdev.c | 82 +++++++++++++++++++++ > lib/eventdev/rte_eventdev.h | 94 +++---------------------- > lib/eventdev/version.map | 4 ++ > 7 files changed, 134 insertions(+), 114 deletions(-) > > diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeont= x/octeontx_ethdev.h > index b73515de37..9402105fcf 100644 > --- a/drivers/net/octeontx/octeontx_ethdev.h > +++ b/drivers/net/octeontx/octeontx_ethdev.h > @@ -9,6 +9,7 @@ > > #include > #include > +#include > #include > #include > #include > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_e= vent_eth_rx_adapter.h > index 182dd2e5dd..79f4822fb0 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > @@ -84,6 +84,7 @@ extern "C" { > #include > > #include "rte_eventdev.h" > +#include "eventdev_pmd.h" > > #define RTE_EVENT_ETH_RX_ADAPTER_MAX_INSTANCE 32 > > diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_e= vent_eth_tx_adapter.c > index 18c0359db7..74f88e6147 100644 > --- a/lib/eventdev/rte_event_eth_tx_adapter.c > +++ b/lib/eventdev/rte_event_eth_tx_adapter.c > @@ -1154,6 +1154,37 @@ rte_event_eth_tx_adapter_start(uint8_t id) > return ret; > } > > +uint16_t > +rte_event_eth_tx_adapter_enqueue(uint8_t dev_id, > + uint8_t port_id, > + struct rte_event ev[], > + uint16_t nb_events, > + const uint8_t flags) > +{ > + const struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > + > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > + if (dev_id >=3D RTE_EVENT_MAX_DEVS || > + !rte_eventdevs[dev_id].attached) { > + rte_errno =3D EINVAL; > + return 0; > + } > + > + if (port_id >=3D dev->data->nb_ports) { > + rte_errno =3D EINVAL; > + return 0; > + } > +#endif > + rte_eventdev_trace_eth_tx_adapter_enqueue(dev_id, port_id, ev, > + nb_events, flags); > + if (flags) > + return dev->txa_enqueue_same_dest(dev->data->ports[port_i= d], > + ev, nb_events); > + else > + return dev->txa_enqueue(dev->data->ports[port_id], ev, > + nb_events); > +} > + > int > rte_event_eth_tx_adapter_stats_get(uint8_t id, > struct rte_event_eth_tx_adapter_stats *st= ats) > diff --git a/lib/eventdev/rte_event_eth_tx_adapter.h b/lib/eventdev/rte_e= vent_eth_tx_adapter.h > index 8c59547165..3cd65e8a09 100644 > --- a/lib/eventdev/rte_event_eth_tx_adapter.h > +++ b/lib/eventdev/rte_event_eth_tx_adapter.h > @@ -79,6 +79,7 @@ extern "C" { > #include > > #include "rte_eventdev.h" > +#include "eventdev_pmd.h" > > /** > * Adapter configuration structure > @@ -348,36 +349,12 @@ rte_event_eth_tx_adapter_event_port_get(uint8_t id,= uint8_t *event_port_id); > * one or more events. This error code is only applicable t= o > * closed systems. > */ > -static inline uint16_t > +uint16_t > rte_event_eth_tx_adapter_enqueue(uint8_t dev_id, > - uint8_t port_id, > - struct rte_event ev[], > - uint16_t nb_events, > - const uint8_t flags) > -{ > - const struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > - > -#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > - if (dev_id >=3D RTE_EVENT_MAX_DEVS || > - !rte_eventdevs[dev_id].attached) { > - rte_errno =3D EINVAL; > - return 0; > - } > - > - if (port_id >=3D dev->data->nb_ports) { > - rte_errno =3D EINVAL; > - return 0; > - } > -#endif > - rte_eventdev_trace_eth_tx_adapter_enqueue(dev_id, port_id, ev, > - nb_events, flags); > - if (flags) > - return dev->txa_enqueue_same_dest(dev->data->ports[port_i= d], > - ev, nb_events); > - else > - return dev->txa_enqueue(dev->data->ports[port_id], ev, > - nb_events); > -} > + uint8_t port_id, > + struct rte_event ev[], > + uint16_t nb_events, > + const uint8_t flags); > > /** > * Retrieve statistics for an adapter > diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c > index 594dd5e759..e2dad8a838 100644 > --- a/lib/eventdev/rte_eventdev.c > +++ b/lib/eventdev/rte_eventdev.c > @@ -1119,6 +1119,65 @@ rte_event_port_links_get(uint8_t dev_id, uint8_t p= ort_id, > return count; > } > > +static __rte_always_inline uint16_t > +__rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, > + const struct rte_event ev[], uint16_t nb_events, > + const event_enqueue_burst_t fn) > +{ > + const struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > + > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > + if (dev_id >=3D RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].atta= ched) { > + rte_errno =3D EINVAL; > + return 0; > + } > + > + if (port_id >=3D dev->data->nb_ports) { > + rte_errno =3D EINVAL; > + return 0; > + } > +#endif > + rte_eventdev_trace_enq_burst(dev_id, port_id, ev, nb_events, fn); > + /* > + * Allow zero cost non burst mode routine invocation if applicati= on > + * requests nb_events as const one > + */ > + if (nb_events =3D=3D 1) > + return (*dev->enqueue)(dev->data->ports[port_id], ev); > + else > + return fn(dev->data->ports[port_id], ev, nb_events); > +} > + > +uint16_t > +rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, > + const struct rte_event ev[], uint16_t nb_events) > +{ > + const struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > + > + return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events, > + dev->enqueue_burst); > +} > + > +uint16_t > +rte_event_enqueue_new_burst(uint8_t dev_id, uint8_t port_id, > + const struct rte_event ev[], uint16_t nb_even= ts) > +{ > + const struct rte_eventdev *dev =3D &rte_event_devices[dev_id]; > + > + return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events, > + dev->enqueue_new_burst); > +} > + > +uint16_t > +rte_event_enqueue_forward_burst(uint8_t dev_id, uint8_t port_id, > + const struct rte_event ev[], uint16_t nb_= events) > +{ > + const struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > + > + return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events, > + dev->enqueue_forward_burst); > +} > + > int > rte_event_dequeue_timeout_ticks(uint8_t dev_id, uint64_t ns, > uint64_t *timeout_ticks) > @@ -1135,6 +1194,29 @@ rte_event_dequeue_timeout_ticks(uint8_t dev_id, ui= nt64_t ns, > return (*dev->dev_ops->timeout_ticks)(dev, ns, timeout_ticks); > } > > +uint16_t > +rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_even= t ev[], > + uint16_t nb_events, uint64_t timeout_ticks) > +{ > + struct rte_eventdev *dev =3D &rte_event_devices[dev_id]; > + > +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > + if (dev_id >=3D RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].atta= ched) { > + rte_errno =3D EINVAL; > + return 0; > + } > + > + if (port_id >=3D dev->data->nb_ports) { > + rte_errno =3D EINVAL; > + return 0; > + } > +#endif > + rte_eventdev_trace_deq_burst(dev_id, port_id, ev, nb_events); > + > + return (*dev->dequeue_burst)(dev->data->ports[port_id], ev, nb_ev= ents, > + timeout_ticks); > +} > + > int > rte_event_dev_service_id_get(uint8_t dev_id, uint32_t *service_id) > { > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h > index a9c496fb62..451e9fb0a0 100644 > --- a/lib/eventdev/rte_eventdev.h > +++ b/lib/eventdev/rte_eventdev.h > @@ -1445,38 +1445,6 @@ struct rte_eventdev { > void *reserved_ptrs[3]; /**< Reserved for future fields */ > } __rte_cache_aligned; > > -extern struct rte_eventdev *rte_eventdevs; > -/** @internal The pool of rte_eventdev structures. */ > - > -static __rte_always_inline uint16_t > -__rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, > - const struct rte_event ev[], uint16_t nb_events, > - const event_enqueue_burst_t fn) > -{ > - const struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > - > -#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > - if (dev_id >=3D RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].atta= ched) { > - rte_errno =3D EINVAL; > - return 0; > - } > - > - if (port_id >=3D dev->data->nb_ports) { > - rte_errno =3D EINVAL; > - return 0; > - } > -#endif > - rte_eventdev_trace_enq_burst(dev_id, port_id, ev, nb_events, fn); > - /* > - * Allow zero cost non burst mode routine invocation if applicati= on > - * requests nb_events as const one > - */ > - if (nb_events =3D=3D 1) > - return (*dev->enqueue)(dev->data->ports[port_id], ev); > - else > - return fn(dev->data->ports[port_id], ev, nb_events); > -} > - > /** > * 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 > @@ -1520,15 +1488,9 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t = port_id, > * closed systems. > * @see rte_event_port_attr_get(), RTE_EVENT_PORT_ATTR_ENQ_DEPTH > */ > -static inline uint16_t > +uint16_t > rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, > - const struct rte_event ev[], uint16_t nb_events) > -{ > - const struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > - > - return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events, > - dev->enqueue_burst); > -} > + const struct rte_event ev[], uint16_t nb_events); > > /** > * Enqueue a burst of events objects of operation type *RTE_EVENT_OP_NEW= * on > @@ -1571,15 +1533,9 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t po= rt_id, > * @see rte_event_port_attr_get(), RTE_EVENT_PORT_ATTR_ENQ_DEPTH > * @see rte_event_enqueue_burst() > */ > -static inline uint16_t > +uint16_t > rte_event_enqueue_new_burst(uint8_t dev_id, uint8_t port_id, > - const struct rte_event ev[], uint16_t nb_events) > -{ > - const struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > - > - return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events, > - dev->enqueue_new_burst); > -} > + const struct rte_event ev[], uint16_t nb_even= ts); > > /** > * Enqueue a burst of events objects of operation type *RTE_EVENT_OP_FOR= WARD* > @@ -1622,15 +1578,10 @@ rte_event_enqueue_new_burst(uint8_t dev_id, uint8= _t port_id, > * @see rte_event_port_attr_get(), RTE_EVENT_PORT_ATTR_ENQ_DEPTH > * @see rte_event_enqueue_burst() > */ > -static inline uint16_t > +uint16_t > rte_event_enqueue_forward_burst(uint8_t dev_id, uint8_t port_id, > - const struct rte_event ev[], uint16_t nb_events) > -{ > - const struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > - > - return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events, > - dev->enqueue_forward_burst); > -} > + const struct rte_event ev[], > + uint16_t nb_events); > > /** > * Converts nanoseconds to *timeout_ticks* value for rte_event_dequeue_b= urst() > @@ -1727,36 +1678,9 @@ rte_event_dequeue_timeout_ticks(uint8_t dev_id, ui= nt64_t ns, > * > * @see rte_event_port_dequeue_depth() > */ > -static inline uint16_t > +uint16_t > rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_even= t ev[], > - uint16_t nb_events, uint64_t timeout_ticks) > -{ > - struct rte_eventdev *dev =3D &rte_eventdevs[dev_id]; > - > -#ifdef RTE_LIBRTE_EVENTDEV_DEBUG > - if (dev_id >=3D RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].atta= ched) { > - rte_errno =3D EINVAL; > - return 0; > - } > - > - if (port_id >=3D dev->data->nb_ports) { > - rte_errno =3D EINVAL; > - return 0; > - } > -#endif > - rte_eventdev_trace_deq_burst(dev_id, port_id, ev, nb_events); > - /* > - * Allow zero cost non burst mode routine invocation if applicati= on > - * requests nb_events as const one > - */ > - if (nb_events =3D=3D 1) > - return (*dev->dequeue)( > - dev->data->ports[port_id], ev, timeout_ticks); > - else > - return (*dev->dequeue_burst)( > - dev->data->ports[port_id], ev, nb_events, > - timeout_ticks); > -} > + uint16_t nb_events, uint64_t timeout_ticks); > > /** > * Link multiple source event queues supplied in *queues* to the destina= tion > diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map > index 88625621ec..8da79cbdc0 100644 > --- a/lib/eventdev/version.map > +++ b/lib/eventdev/version.map > @@ -13,7 +13,11 @@ DPDK_22 { > rte_event_crypto_adapter_stats_get; > rte_event_crypto_adapter_stats_reset; > rte_event_crypto_adapter_stop; > + rte_event_enqueue_burst; > + rte_event_enqueue_new_burst; > + rte_event_enqueue_forward_burst; > rte_event_dequeue_timeout_ticks; > + rte_event_dequeue_burst; > rte_event_dev_attr_get; > rte_event_dev_close; > rte_event_dev_configure; > -- > 2.17.1 >