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 9FA1242A3E; Tue, 2 May 2023 12:33:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C2EE40E2D; Tue, 2 May 2023 12:33:02 +0200 (CEST) Received: from mail-ua1-f53.google.com (mail-ua1-f53.google.com [209.85.222.53]) by mails.dpdk.org (Postfix) with ESMTP id AE08D406A2 for ; Tue, 2 May 2023 12:33:00 +0200 (CEST) Received: by mail-ua1-f53.google.com with SMTP id a1e0cc1a2514c-77115450b8fso2140096241.0 for ; Tue, 02 May 2023 03:33:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683023580; x=1685615580; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3PwalmK55Rc0MEfCWddcxArRcMYSBHF4VXg1UitPMhY=; b=GGqgpiHlgBqIHXfRhl1QhZnT2siY3eAw6nQxWu499+JJl537+P7WGYW3ta/bNyWHZt wkIn8x3h1iZoNa2c/86pZ+aqClgEEsNwFy6EY2yzLhUPPm68VuG8QisecaL2DjGCXJbe koNZqmNaEDqH0vPaLykaCJsHUKLi7zCbSzrIU1V6wO/8JD/n+57SLwMspxWqf/Eh8v6O qY0IjdEK4MIx9Km4DuNVOXPJBFkJSaQXQyYtHAMZVOt4hEti5UjiTXNSWVxFK1OM+HLz 0So1hO+DTkW73/eVfHEdDeP70OM03Yz7PNw9K3JbzrY/L1lA7erBVX+VUpNmYAdDBVfD tHcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683023580; x=1685615580; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3PwalmK55Rc0MEfCWddcxArRcMYSBHF4VXg1UitPMhY=; b=VXpFrjR05iEF/jyECkfaTEGCfGorg0xHh6x47tPOB5R0/tvT6TzjzTOmShsRNexagC bEdjXW08avyTd4W90osGhGCHStHWl0VnaA9uf54YGGa8kHFJcFZWw76u/0kOVWy/Hx/B o8oY9/TxyZ1FECEcKHgwWSYIsah0xBeCY8ouaLo+tv9pQBMheuJcgzjdss6sj4vyXlCz UELkZ35FIe/Fs0boUojSm5sJPtdJc5fGY5YhDT2Aw1owK3m3RQ9E2FtaaONhn34zTqu7 FnEB+1+JSBjSy7grU9mh0PgkUHE4mjpOCPyYeO4ZanxFl0nNiqJm3BFjY3d5xgltmges j0+A== X-Gm-Message-State: AC+VfDwod2Nm6oJNMXql+KylF4en1EbrZ0rg1CAKl6XKigWxGtk9OLqB zy5uOY744fNyNAWrpHP0y2zgrv4vuT7RSBkyITM= X-Google-Smtp-Source: ACHHUZ5fhW137ooamGRqr98HBVXsGceYz1YU+Qqz4PXmshjGz/VvpK04VfRiy1EH7OETlxvn09guOG2bFcffxEhMZkg= X-Received: by 2002:a05:6102:3bd1:b0:430:1162:1f74 with SMTP id a17-20020a0561023bd100b0043011621f74mr6712859vsv.14.1683023579932; Tue, 02 May 2023 03:32:59 -0700 (PDT) MIME-Version: 1.0 References: <20230403131346.1070133-1-mattias.ronnblom@ericsson.com> In-Reply-To: From: Jerin Jacob Date: Tue, 2 May 2023 16:02:33 +0530 Message-ID: Subject: Re: [PATCH 1/2] eventdev: add bulk type event ring operations To: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , "Richardson, Bruce" Cc: Jerin Jacob , dev@dpdk.org, Peter Nilsson J Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Tue, Apr 4, 2023 at 12:33=E2=80=AFPM Jerin Jacob = wrote: > > On Mon, Apr 3, 2023 at 6:49=E2=80=AFPM Mattias R=C3=B6nnblom > wrote: > > > > Introduce bulk enqueue and dequeue operations into the > > API, to supplement the already-existing burst > > calls. > > > > Signed-off-by: Mattias R=C3=B6nnblom > > Looks good to me. > As the original author adding @Richardson, Bruce for review. Acked-by: Jerin Jacob Series applied to dpdk-next-net-eventdev/for-main. Thanks > > > > --- > > lib/eventdev/rte_event_ring.h | 74 +++++++++++++++++++++++++++++++++++ > > 1 file changed, 74 insertions(+) > > > > diff --git a/lib/eventdev/rte_event_ring.h b/lib/eventdev/rte_event_rin= g.h > > index 7efa64444b..f9cf19ae16 100644 > > --- a/lib/eventdev/rte_event_ring.h > > +++ b/lib/eventdev/rte_event_ring.h > > @@ -67,6 +67,80 @@ rte_event_ring_free_count(const struct rte_event_rin= g *r) > > return rte_ring_free_count(&r->r); > > } > > > > + > > +/** > > + * Enqueue several objects on a ring. > > + * > > + * This function calls the multi-producer or the single-producer > > + * version depending on the default behavior that was specified at > > + * ring creation time (see flags). > > + * > > + * @param r > > + * pointer to the event ring > > + * @param events > > + * pointer to an array of struct rte_event objects > > + * @param n > > + * The number of events in the array to enqueue > > + * @param free_space > > + * if non-NULL, returns the amount of space in the ring after the > > + * enqueue operation has completed > > + * @return > > + * the number of objects enqueued, either 0 or n > > + */ > > +static __rte_always_inline unsigned int > > +rte_event_ring_enqueue_bulk(struct rte_event_ring *r, > > + const struct rte_event *events, > > + unsigned int n, uint16_t *free_space) > > +{ > > + unsigned int num; > > + uint32_t space; > > + > > + num =3D rte_ring_enqueue_bulk_elem(&r->r, events, > > + sizeof(struct rte_event), n, > > + &space); > > + > > + if (free_space !=3D NULL) > > + *free_space =3D space; > > + > > + return num; > > +} > > + > > +/** > > + * Dequeue a set of events from a ring > > + * > > + * Note: this API does not work with pointers to events, rather it cop= ies > > + * the events themselves to the destination ``events`` buffer. > > + * > > + * @param r > > + * pointer to the event ring > > + * @param events > > + * pointer to an array to hold the struct rte_event objects > > + * @param n > > + * number of events that can be held in the ``events`` array > > + * @param available > > + * if non-null, is updated to indicate the number of events remainin= g in > > + * the ring once the dequeue has completed > > + * @return > > + * the number of objects dequeued, either 0 or n > > + */ > > +static __rte_always_inline unsigned int > > +rte_event_ring_dequeue_bulk(struct rte_event_ring *r, > > + struct rte_event *events, > > + unsigned int n, uint16_t *available) > > +{ > > + unsigned int num; > > + uint32_t remaining; > > + > > + num =3D rte_ring_dequeue_bulk_elem(&r->r, events, > > + sizeof(struct rte_event), n, > > + &remaining); > > + > > + if (available !=3D NULL) > > + *available =3D remaining; > > + > > + return num; > > +} > > + > > /** > > * Enqueue a set of events onto a ring > > * > > -- > > 2.34.1 > >