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 D8827A2F67 for ; Fri, 4 Oct 2019 10:22:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C139F1C1D6; Fri, 4 Oct 2019 10:22:04 +0200 (CEST) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by dpdk.org (Postfix) with ESMTP id 467801C1C9; Fri, 4 Oct 2019 10:22:03 +0200 (CEST) Received: by mail-io1-f66.google.com with SMTP id h144so11677501iof.7; Fri, 04 Oct 2019 01:22:03 -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; bh=Ug484k2ZbnFzhDe71291FLmPmYBlk2/qjN+cs6Ra8CY=; b=HQtJib+7Z8t4rpdWLBId0633mFtVp0XNbsWvmu0nuhJPujw8AKFSaXS3x1d5f7a1xx IYB/FHblhHSEOZOS44v+0E59doEf412WnIbQfdHRer0H42b/YA2ras1cCodRK2A30t8g 2VBxCCV9X5jLggr8fere08sCgy7piDEroPVJTsAWDyHGwE3krCaktNa4kj5/xqWTr+N+ gkefwY/bF1BdrqwzlJHJ9mo+6PsH0Xg33Rs8zacOl9bBehlBg0kdN1TzLgJ8VMzgkaZF 5pP5F10Dc7PnvGTXJWsZdDnDVTWoPr2c8k5ZEqCJKsLWhhV/woxNbVoyEBg/l1anoR4o IHcQ== 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; bh=Ug484k2ZbnFzhDe71291FLmPmYBlk2/qjN+cs6Ra8CY=; b=SyghYbZ9yTIjvaHXGEAulw34J3rtpJWhM/QsSR+WfmvPy/99yW2UrGhNTQH9QdDGN/ DUfChJMz5MQScg/BLtM7EWOldb5Skl7b7wvHcNuv/6ytQ1bF03wAToDOrGHdngL6qc31 Oiw1UHBVfm4px01ol4zDdmsqMYkS9y4W049YbDWDW6Y/yYyVYZ6K4ouXNhK7URg75Zc4 Ei0jOnRFAxa8qzzOMgqT645LEdz+XF0LJhwTQu5TDrzarYhoP6S2x7SaGfT3aORT+kBo coGvv2faPH3T8i2GdHAqLD1iAqIZ3CExXPH91LLmXbAg5lV7S4ADVZJ9TuGnc4KjErs9 QlRw== X-Gm-Message-State: APjAAAXl/mG0G1kwG01JS6DcqTtfJy8oyufvyw/BNQ8iROuRHWU8I1Qk kdUtkPPO1hbc6xJaG/vDHcEXT0K5NWJsNzdM7ts= X-Google-Smtp-Source: APXvYqyl88Qc5gtTvqVweIrtnb2BK3wGIv3VUla3CV1EDh07UK4YGn6+wcUCQROf2DyGIUuQn9unEiz+8/kDmSawmVo= X-Received: by 2002:a5d:9f15:: with SMTP id q21mr12223418iot.130.1570177322263; Fri, 04 Oct 2019 01:22:02 -0700 (PDT) MIME-Version: 1.0 References: <20191001064641.28404-1-nipun.gupta@nxp.com> <20191004065546.11942-1-nipun.gupta@nxp.com> In-Reply-To: <20191004065546.11942-1-nipun.gupta@nxp.com> From: Jerin Jacob Date: Fri, 4 Oct 2019 13:51:51 +0530 Message-ID: To: Nipun Gupta Cc: dpdk-dev , Jerin Jacob , aconole@redhat.com, Pavan Nikhilesh , Sunil Kumar Kori , Hemant Agrawal , "Richardson, Bruce" , Marko Kovacevic , Ori Kam , Radu Nicolau , Tomasz Kantecki , "Van Haaren, Harry" , "Rao, Nikhil" , Ray Kinsella , Thomas Monjalon , techboard@dpdk.org Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] 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" On Fri, Oct 4, 2019 at 12:41 PM Nipun Gupta wrote: > > 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 > --- > > Changes in v2: > - have separate internal API in tx adapter for sending burst packets to > same eth dev, queue pair on the basis of the passed flag > - fix compilation of examples/eventdev_pipeline/ > > app/test-eventdev/test_pipeline_common.h | 6 +++--- > .../prog_guide/event_ethernet_tx_adapter.rst | 3 ++- > .../eventdev_pipeline/pipeline_worker_tx.c | 2 +- > .../rte_event_eth_tx_adapter.h | 19 +++++++++++++++++-- > lib/librte_eventdev/rte_eventdev.c | 12 ++++++++++++ > lib/librte_eventdev/rte_eventdev.h | 9 +++++++++ It is an ABI change so please update a) lib/librte_eventdev/Makefile b) lib/librte_eventdev/meson.build c) doc/guides/rel_notes/release_19_11.rst Please see c2189c907dd191b909ce1f18487d46410782e370 as reference. If anyone has any objection for treating this ABI change as an exception(ABI change without depreciation notice in advance) then please shout. > 6 files changed, 44 insertions(+), 7 deletions(-) > > diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.h b/lib/librte_eventdev/rte_event_eth_tx_adapter.h > index c848261c4..f552b6023 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. I would say "Ethernet port and Tx queue" > + */ > + > /** > * 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. Change to @see > + * #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. Same as above. Please check generated doxgen API output. > * > * @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, > + const uint8_t flags) > { > const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; > > @@ -359,7 +369,12 @@ 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); > + if (flags) > + return dev->txa_enqueue_same_dest(dev->data->ports[port_id], > + ev, nb_events, flags); > + else > + return dev->txa_enqueue(dev->data->ports[port_id], ev, > + nb_events); > } > > /** > diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c > index f44c869cb..7c8ffdfef 100644 > --- a/lib/librte_eventdev/rte_eventdev.c > +++ b/lib/librte_eventdev/rte_eventdev.c > @@ -1330,6 +1330,16 @@ rte_event_tx_adapter_enqueue(__rte_unused void *port, > return 0; > } > > +static uint16_t > +rte_event_tx_adapter_enqueue_same_dest(__rte_unused void *port, > + __rte_unused struct rte_event ev[], > + __rte_unused uint16_t nb_events, > + __rte_unused const uint8_t flags) > +{ > + rte_errno = ENOTSUP; > + return 0; > +} > + > struct rte_eventdev * > rte_event_pmd_allocate(const char *name, int socket_id) > { > @@ -1351,6 +1361,8 @@ rte_event_pmd_allocate(const char *name, int socket_id) > eventdev = &rte_eventdevs[dev_id]; > > eventdev->txa_enqueue = rte_event_tx_adapter_enqueue; > + eventdev->txa_enqueue_same_dest = > + rte_event_tx_adapter_enqueue_same_dest; > > if (eventdev->data == NULL) { > struct rte_eventdev_data *eventdev_data = NULL; > diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h > index 5044a13d0..ea61f52f6 100644 > --- a/lib/librte_eventdev/rte_eventdev.h > +++ b/lib/librte_eventdev/rte_eventdev.h > @@ -1230,6 +1230,13 @@ typedef uint16_t (*event_tx_adapter_enqueue)(void *port, > struct rte_event ev[], uint16_t nb_events); > /**< @internal Enqueue burst of events on port of a device */ > > +typedef uint16_t (*event_tx_adapter_enqueue_same_dest)(void *port, > + struct rte_event ev[], uint16_t nb_events, > + const uint8_t flags); > +/**< @internal Enqueue burst of events on port of a device supporting flag to > + * indicate burst having same dest eth port and queue. s/queue/Tx queue > + */ > + > #define RTE_EVENTDEV_NAME_MAX_LEN (64) > /**< @internal Max length of name of event PMD */ > > @@ -1292,6 +1299,8 @@ struct rte_eventdev { > /**< Pointer to PMD dequeue function. */ > event_dequeue_burst_t dequeue_burst; > /**< Pointer to PMD dequeue burst function. */ > + event_tx_adapter_enqueue_same_dest txa_enqueue_same_dest; > + /**< Pointer to PMD eth Tx adapter enqueue burst function. */ Is it really burst function? enqueue supports already support burst. Please change the description. > event_tx_adapter_enqueue txa_enqueue; > /**< Pointer to PMD eth Tx adapter enqueue function. */ > struct rte_eventdev_data *data; > -- > 2.17.1 >