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 DD105A00BE; Mon, 16 May 2022 20:02:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C29C640A7A; Mon, 16 May 2022 20:02:46 +0200 (CEST) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by mails.dpdk.org (Postfix) with ESMTP id BC9C74068B for ; Mon, 16 May 2022 20:02:45 +0200 (CEST) Received: by mail-io1-f47.google.com with SMTP id h85so16797806iof.12 for ; Mon, 16 May 2022 11:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Baw75M19HFdgUb5yHDVtdBHhkZSZGhEez8P7c/kiIlg=; b=h3Qtv97M6tFesR5yrc3AZKC+DgYsg4LK6VNMTKcvSYdD6tpvXdq1KVs991/k1O6D9M wlQREUZ10tm0lMnjDZLQNYeCoFJyMT6koJrPyeblBiEmSI+K/z/DIKwjwGlTyZBrMEmf tCsFoHrGMos1bCZYA8bXZYT1QpAyi1+R9Maqwh0+IyPQKsVCJPQkHh9aHlbB1jN+ZQ6u /iRQmgay9U9CDOkx+5Im8XTyO0a/GQS6GNMvHdncao9qLNHw+OR4xQLm02RXKdLWOEDi 0sSR57eEJWtLqI5HPCQvODrokAq2KBPPMYw6biU7o0kmMc0bG+/VzHHtbfY8YAfgQVg3 P6xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Baw75M19HFdgUb5yHDVtdBHhkZSZGhEez8P7c/kiIlg=; b=4B+cW6McohO7vhtVxspHMsVOuCVyFRnlCS1FYSrJuXkk1s0oQCK/dR2YsxFo5vsujI ZprUam68o3G+u4fY5C+/8tSvvarfULMbSHwj2zuKGfVDbuMNWaaWRlZDruH6vn2YEklW ho41KVkS9qeNexeJqtkuA36lEVoLfXuM6bp13PCAzs0R+nYxaz1LKk+8eCoyw0TZGOXy 6jLyoF767v9jrtgVjAAskPPvZNI4ZHCIp6oO/aecUoiPpYQ4bYftfpHh+qHDGlkIoQeD L3iu4psHBOeyjJflMzHnoNT5+/1sOflWXMISBnk8OMT+9m8lFHl++0X1KKj61QMyr7ps l1xg== X-Gm-Message-State: AOAM533cmtBp5WvnBGTIb3epSbzmCSpX/DD8yFoTQCig1VzyHmDmt6ud bkxqD1Bne2puT/xFh0JtUNro2pp81PQkeTiv0RKYNHdX X-Google-Smtp-Source: ABdhPJx+70Q+jwpiAB6I0lYuGeCacnD9Dq1KC8H62vRyj2xZruHm0D1bK+prfKTpO/UgeHVqfCfIAruozv94Igm3pXA= X-Received: by 2002:a05:6638:468e:b0:32b:fe24:906a with SMTP id bq14-20020a056638468e00b0032bfe24906amr9545027jab.123.1652724165064; Mon, 16 May 2022 11:02:45 -0700 (PDT) MIME-Version: 1.0 References: <33fe903b38d712388230cfa58ee3a64987771918.1652722314.git.sthotton@marvell.com> In-Reply-To: <33fe903b38d712388230cfa58ee3a64987771918.1652722314.git.sthotton@marvell.com> From: Jerin Jacob Date: Mon, 16 May 2022 23:32:18 +0530 Message-ID: Subject: Re: [PATCH v4 1/5] eventdev: support to set queue attributes at runtime To: Shijith Thotton Cc: dpdk-dev , Jerin Jacob , Pavan Nikhilesh , "Van Haaren, Harry" , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , Ray Kinsella 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 Mon, May 16, 2022 at 11:09 PM Shijith Thotton wro= te: > > Added a new eventdev API rte_event_queue_attr_set(), to set event queue > attributes at runtime from the values set during initialization using > rte_event_queue_setup(). PMD's supporting this feature should expose the > capability RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR. > > Signed-off-by: Shijith Thotton > Acked-by: Jerin Jacob Hi @Mattias R=C3=B6nnblom Planning to merge this version for -rc1. Do you have any more comments for this series? > --- > doc/guides/eventdevs/features/default.ini | 1 + > doc/guides/rel_notes/release_22_07.rst | 5 ++++ > lib/eventdev/eventdev_pmd.h | 22 ++++++++++++++++ > lib/eventdev/rte_eventdev.c | 26 ++++++++++++++++++ > lib/eventdev/rte_eventdev.h | 32 ++++++++++++++++++++++- > lib/eventdev/version.map | 3 +++ > 6 files changed, 88 insertions(+), 1 deletion(-) > > diff --git a/doc/guides/eventdevs/features/default.ini b/doc/guides/event= devs/features/default.ini > index 2ea233463a..00360f60c6 100644 > --- a/doc/guides/eventdevs/features/default.ini > +++ b/doc/guides/eventdevs/features/default.ini > @@ -17,6 +17,7 @@ runtime_port_link =3D > multiple_queue_port =3D > carry_flow_id =3D > maintenance_free =3D > +runtime_queue_attr =3D > > ; > ; Features of a default Ethernet Rx adapter. > diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_note= s/release_22_07.rst > index 88d6e96cc1..a7a912d665 100644 > --- a/doc/guides/rel_notes/release_22_07.rst > +++ b/doc/guides/rel_notes/release_22_07.rst > @@ -65,6 +65,11 @@ New Features > * Added support for promiscuous mode on Windows. > * Added support for MTU on Windows. > > +* **Added support for setting queue attributes at runtime in eventdev.** > + > + Added new API ``rte_event_queue_attr_set()``, to set event queue attri= butes > + at runtime. > + > > Removed Items > ------------- > diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h > index ce469d47a6..3b85d9f7a5 100644 > --- a/lib/eventdev/eventdev_pmd.h > +++ b/lib/eventdev/eventdev_pmd.h > @@ -341,6 +341,26 @@ typedef int (*eventdev_queue_setup_t)(struct rte_eve= ntdev *dev, > typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev, > uint8_t queue_id); > > +/** > + * Set an event queue attribute at runtime. > + * > + * @param dev > + * Event device pointer > + * @param queue_id > + * Event queue index > + * @param attr_id > + * Event queue attribute id > + * @param attr_value > + * Event queue attribute value > + * > + * @return > + * - 0: Success. > + * - <0: Error code on failure. > + */ > +typedef int (*eventdev_queue_attr_set_t)(struct rte_eventdev *dev, > + uint8_t queue_id, uint32_t attr_= id, > + uint64_t attr_value); > + > /** > * Retrieve the default event port configuration. > * > @@ -1211,6 +1231,8 @@ struct eventdev_ops { > /**< Set up an event queue. */ > eventdev_queue_release_t queue_release; > /**< Release an event queue. */ > + eventdev_queue_attr_set_t queue_attr_set; > + /**< Set an event queue attribute. */ > > eventdev_port_default_conf_get_t port_def_conf; > /**< Get default port configuration. */ > diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c > index 532a253553..a31e99be02 100644 > --- a/lib/eventdev/rte_eventdev.c > +++ b/lib/eventdev/rte_eventdev.c > @@ -844,6 +844,32 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t que= ue_id, uint32_t attr_id, > return 0; > } > > +int > +rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr= _id, > + uint64_t attr_value) > +{ > + struct rte_eventdev *dev; > + > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); > + dev =3D &rte_eventdevs[dev_id]; > + if (!is_valid_queue(dev, queue_id)) { > + RTE_EDEV_LOG_ERR("Invalid queue_id=3D%" PRIu8, queue_id); > + return -EINVAL; > + } > + > + if (!(dev->data->event_dev_cap & > + RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR)) { > + RTE_EDEV_LOG_ERR( > + "Device %" PRIu8 "does not support changing queue= attributes at runtime", > + dev_id); > + return -ENOTSUP; > + } > + > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_attr_set, -ENOTSUP); > + return (*dev->dev_ops->queue_attr_set)(dev, queue_id, attr_id, > + attr_value); > +} > + > int > rte_event_port_link(uint8_t dev_id, uint8_t port_id, > const uint8_t queues[], const uint8_t priorities[], > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h > index 42a5660169..a79b1397eb 100644 > --- a/lib/eventdev/rte_eventdev.h > +++ b/lib/eventdev/rte_eventdev.h > @@ -225,7 +225,7 @@ struct rte_event; > /**< Event scheduling prioritization is based on the priority associated= with > * each event queue. > * > - * @see rte_event_queue_setup() > + * @see rte_event_queue_setup(), rte_event_queue_attr_set() > */ > #define RTE_EVENT_DEV_CAP_EVENT_QOS (1ULL << 1) > /**< Event scheduling prioritization is based on the priority associated= with > @@ -307,6 +307,13 @@ struct rte_event; > * global pool, or process signaling related to load balancing. > */ > > +#define RTE_EVENT_DEV_CAP_RUNTIME_QUEUE_ATTR (1ULL << 11) > +/**< Event device is capable of changing the queue attributes at runtime= i.e > + * after rte_event_queue_setup() or rte_event_start() call sequence. If = this > + * flag is not set, eventdev queue attributes can only be configured dur= ing > + * rte_event_queue_setup(). > + */ > + > /* Event device priority levels */ > #define RTE_EVENT_DEV_PRIORITY_HIGHEST 0 > /**< Highest priority expressed across eventdev subsystem > @@ -702,6 +709,29 @@ int > rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr= _id, > uint32_t *attr_value); > > +/** > + * Set an event queue attribute. > + * > + * @param dev_id > + * Eventdev id > + * @param queue_id > + * Eventdev queue id > + * @param attr_id > + * The attribute ID to set > + * @param attr_value > + * The attribute value to set > + * > + * @return > + * - 0: Successfully set attribute. > + * - -EINVAL: invalid device, queue or attr_id. > + * - -ENOTSUP: device does not support setting the event attribute. > + * - <0: failed to set event queue attribute > + */ > +__rte_experimental > +int > +rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr= _id, > + uint64_t attr_value); > + > /* Event port specific APIs */ > > /* Event port configuration bitmap flags */ > diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map > index cd5dada07f..c581b75c18 100644 > --- a/lib/eventdev/version.map > +++ b/lib/eventdev/version.map > @@ -108,6 +108,9 @@ EXPERIMENTAL { > > # added in 22.03 > rte_event_eth_rx_adapter_event_port_get; > + > + # added in 22.07 > + rte_event_queue_attr_set; > }; > > INTERNAL { > -- > 2.25.1 >