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 0DBBEA0A02; Tue, 23 Mar 2021 17:56:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF9B0140F70; Tue, 23 Mar 2021 17:56:43 +0100 (CET) Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) by mails.dpdk.org (Postfix) with ESMTP id 7FEE34069E for ; Tue, 23 Mar 2021 17:56:42 +0100 (CET) Received: by mail-il1-f182.google.com with SMTP id d10so11980016ils.5 for ; Tue, 23 Mar 2021 09:56:42 -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=T6fK3U9/kQDuchGLTrZRI3qa/bRq6auXRSRUvqRly0Q=; b=KNmt5iCwi27Mx6q3aCarrrobzEykcRyj1V/ewkXH3vzryoGNtLLq4xPrdw8WM99Ub8 HAS8qGiaxnR8KL9fXOp8l2jCv0aj80NrPmSO0bAw4uYw2Jkt67YfcAyoWQ99n5xfySan jBBsfvK6iyfFwoXeCgxjN/rkSfL2kbKPI1ujvr7tdrHC5lY+TECoIpoinjD9TR8yookn Io2DTfTFozZv0mx/Rl9nj5lwrYWF6xGBhxvvCuNC3+zgkoPAF9BcY2cSO6oUzyHJ0eH4 STJakJBDHQCDJpHRs4X6d20x/Cahc2BQsfKqxInoi5pszlMRElR7+Hp4pwdfiq42tEsy iM+Q== 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=T6fK3U9/kQDuchGLTrZRI3qa/bRq6auXRSRUvqRly0Q=; b=WXawlAe+p/xCTQ7C6htSGTl05IonAM5qTjhCMdnPfaOYGspGqSkWA4Mj+NBGY37bUE OYRAgVnWnb6Nm8hXNOAt1ikq420b2YL2miqsKpU5KK3LFMy5X34J35ZNG9UaCMLdWUEr sWwLY9CcNPfdQ5NOJ2yxteTlmhXetnQuC+aIJEsG2jrgv/vRWrNSaxBmXPfH9rJUXztc OW0pnNjPsRdxSDP1T7msEu6Q+JXPlvPPd7elzZMXsSAwIf2sU2ILgrpEx/Elu1A5bnkY pTgEMGNfiu1p9LAEc8rir9iYvPEZXdhWubk/vkwrg/o5cj/HOgJWHdauCWlSAX5OOQM/ XzCA== X-Gm-Message-State: AOAM533LXpHV1oc5i2CsIDnxenr9GODyCr7JfDU/q08N7CcexrzdRq7P T7lV/783dOAHTLab4L45kkNI/dY3eFy7QdmHomU= X-Google-Smtp-Source: ABdhPJzaMMc/9B9SFR4Wnx8Qw5vNTI6evir3wFJvqB0tL18GU5OUCcyTab6MMFzP9We8v/Bt4I6nqcWEQ0gRLRj92qQ= X-Received: by 2002:a92:d6c8:: with SMTP id z8mr5486110ilp.162.1616518601824; Tue, 23 Mar 2021 09:56:41 -0700 (PDT) MIME-Version: 1.0 References: <20210316200156.252-1-pbhagavatula@marvell.com> <20210319205718.1436-1-pbhagavatula@marvell.com> <20210319205718.1436-3-pbhagavatula@marvell.com> In-Reply-To: <20210319205718.1436-3-pbhagavatula@marvell.com> From: Jerin Jacob Date: Tue, 23 Mar 2021 22:26:25 +0530 Message-ID: To: Pavan Nikhilesh Cc: Jerin Jacob , "Jayatheerthan, Jay" , Erik Gabriel Carrillo , "Gujjar, Abhinandan S" , "McDaniel, Timothy" , Hemant Agrawal , "Van Haaren, Harry" , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , Liang Ma , Ray Kinsella , Neil Horman , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v4 2/8] eventdev: introduce event vector Rx capability 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 Sat, Mar 20, 2021 at 2:27 AM wrote: > > From: Pavan Nikhilesh > > Introduce event ethernet Rx adapter event vector capability. > > If an event eth Rx adapter has the capability of > RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR then a given Rx queue > can be configured to enable event vectorization by passing the > flag RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR to > rte_event_eth_rx_adapter_queue_conf::rx_queue_flags while configuring > Rx adapter through rte_event_eth_rx_adapter_queue_add. through rte_event_eth_rx_adapter_queue_add() > > The max vector size, vector timeout define the vector size and > mempool used for allocating vector event are configured through > rte_event_eth_rx_adapter_queue_add. The element size of the element > in the vector pool should be equal to > sizeof(struct rte_event_vector) + (vector_sz * sizeof(uintptr_t)) > > Application can use `rte_event_vector_pool_create` to create the > vector mempool used for > rte_event_eth_rx_adapter_queue_conf::vector_mp. > > The Rx adapter would be responsible for vectorizing the mbufs > based on the flow, the vector limits configured by the application > and add the vector event of mbufs to the event queue set via > rte_event_eth_rx_adapter_queue_conf::ev::queue_id. > It should also mark rte_event_vector::union_valid and fill > rte_event_vector::port, rte_event_vector::queue. > > Signed-off-by: Pavan Nikhilesh Please find below some comments. Feel free to add Acked-by: Jerin Jacob after addressing those and Ray's comment. > --- > .../prog_guide/event_ethernet_rx_adapter.rst | 38 ++++++++ > .../rte_event_eth_rx_adapter.h | 95 +++++++++++++++++++ > lib/librte_eventdev/rte_eventdev.h | 30 +++++- > lib/librte_eventdev/version.map | 2 + > 4 files changed, 163 insertions(+), 2 deletions(-) > > /** > * A structure used to retrieve statistics for an eth rx adapter instance. > */ > @@ -199,6 +233,22 @@ struct rte_event_eth_rx_adapter_stats { > /**< Received packet count for interrupt mode Rx queues */ > }; > > +/** > + * A structure used to retrieve eth rx adapter vector limits. > + */ > +struct rte_event_eth_rx_adapter_vector_limits { > + uint16_t min_sz; > + /**< Minimum vector limit configurable. */ Please add @see to rte_event_eth_rx_adapter_event_vector_config::vector_sz > + uint16_t max_sz; Please add @see to rte_event_eth_rx_adapter_event_vector_config::vector_sz > + /**< Maximum vector limit configurable. */ > + uint8_t log2_sz; I think, we can change to bool and comment as "True if the size configured should be in log2" Please add @see to rte_event_eth_rx_adapter_event_vector_config::vector_sz > + /**< The size configured should be in log2. */ > + uint64_t min_timeout_ns; > + /**< Minimum vector timeout configurable. */ Please add @see to rte_event_eth_rx_adapter_event_vector_config::vector_timeout_ns > + uint64_t max_timeout_ns; > + /**< Maximum vector timeout configurable. */ Please add @see to rte_event_eth_rx_adapter_event_vector_config::vector_timeout_ns > +}; > + > /** > * > * Callback function invoked by the SW adapter before it continues > @@ -467,6 +517,51 @@ int rte_event_eth_rx_adapter_cb_register(uint8_t id, uint16_t eth_dev_id, > rte_event_eth_rx_adapter_cb_fn cb_fn, > void *cb_arg); > > +/** > + * Retrieve vector limits for a given event dev and eth dev pair. > + * @see rte_event_eth_rx_adapter_vector_limits > + * > + * @param dev_id > + * Event device identifier. > + * @param eth_port_id > + * Port identifier of the ethernet device. > + * @param [out] limits > + * A pointer to rte_event_eth_rx_adapter_vector_limits structure that has to > + * be filled. > + * > + * @return > + * - 0: Success. > + * - <0: Error code on failure. > + */ > +__rte_experimental > +int rte_event_eth_rx_adapter_vector_limits_get( > + uint8_t dev_id, uint16_t eth_port_id, > + struct rte_event_eth_rx_adapter_vector_limits *limits); > + > +/** > + * Configure event vectorization for a given ethernet device queue, that has > + * been added to a event eth Rx adapter. > + * > + * @param id > + * The identifier of the ethernet Rx event adapter. > + * > + * @param eth_dev_id > + * The identifier of the ethernet device. > + * > + * @param rx_queue_id > + * Ethernet device receive queue index. > + * If rx_queue_id is -1, then all Rx queues configured for the ethernet device > + * are configured with event vectorization. > + * > + * @return > + * - 0: Success, Receive queue configured correctly. > + * - <0: Error code on failure. > + */ > +__rte_experimental > +int rte_event_eth_rx_adapter_queue_event_vector_config( > + uint8_t id, uint16_t eth_dev_id, int32_t rx_queue_id, > + struct rte_event_eth_rx_adapter_event_vector_config *config); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h > index 5586a3f15..1be79b856 100644 > --- a/lib/librte_eventdev/rte_eventdev.h > +++ b/lib/librte_eventdev/rte_eventdev.h > @@ -919,9 +919,27 @@ rte_event_dev_close(uint8_t dev_id); > * Event vector structure. > */ > struct rte_event_vector { > - uint64_t nb_elem : 16; > + uint16_t nb_elem; > /**< Number of elements in this event vector. */ > - uint64_t rsvd : 48; > + uint16_t rsvd : 15; > + uint16_t attr_valid : 1; > + /**< Indicates that the below union attributes have valid information. > + */ > + union { > + /* Used by Rx adapter. > + * Indicats that all the elements in this vector belong to same Indicats -> Indicates to same -> to the same > + * port and queue pair when originating from Rx adapter, valid > + * only when event type is ETHDEV_VECTOR or > + * ETH_RX_ADAPTER_VECTOR. > + */ > + struct { > + uint16_t port; > + /* Ethernet device port id. */ > + uint16_t queue; > + /* Ethernet device queue id. */ > + }; > + }; > + /**< Union to hold common attributes of the vector array. */ > uint64_t impl_opaque; > union { > struct rte_mbuf *mbufs[0]; > @@ -1019,8 +1037,14 @@ struct rte_event_vector { > * // Classify and handle event. > * } > */ > +#define RTE_EVENT_TYPE_ETHDEV_VECTOR \ > + (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETHDEV) > +/**< The event vector generated from ethdev subsystem */ > #define RTE_EVENT_TYPE_CPU_VECTOR (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_CPU) > /**< The event vector generated from cpu for pipelining. */ > +#define RTE_EVENT_TYPE_ETH_RX_ADAPTER_VECTOR \ > + (RTE_EVENT_TYPE_VECTOR | RTE_EVENT_TYPE_ETH_RX_ADAPTER) > +/**< The event vector generated from eth Rx adapter. */ > > #define RTE_EVENT_TYPE_MAX 0x10 > /**< Maximum number of event types */ > @@ -1165,6 +1189,8 @@ struct rte_event { > * @see struct rte_event_eth_rx_adapter_queue_conf::ev > * @see struct rte_event_eth_rx_adapter_queue_conf::rx_queue_flags > */ > +#define RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR 0x8 > +/**< Adapter supports event vectorization per ethdev. */ > > /** > * Retrieve the event device's ethdev Rx adapter capabilities for the > diff --git a/lib/librte_eventdev/version.map b/lib/librte_eventdev/version.map > index a070ef56e..902df0ae3 100644 > --- a/lib/librte_eventdev/version.map > +++ b/lib/librte_eventdev/version.map > @@ -141,6 +141,8 @@ EXPERIMENTAL { > > #added in 21.05 > rte_event_vector_pool_create; > + rte_event_eth_rx_adapter_vector_limits_get; > + rte_event_eth_rx_adapter_queue_event_vector_config; > }; > > INTERNAL { > -- > 2.17.1 >