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 5C282A0032; Tue, 17 May 2022 15:36:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05C1A40041; Tue, 17 May 2022 15:36:10 +0200 (CEST) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by mails.dpdk.org (Postfix) with ESMTP id 19F894003C for ; Tue, 17 May 2022 15:36:08 +0200 (CEST) Received: by mail-io1-f52.google.com with SMTP id e3so19204798ios.6 for ; Tue, 17 May 2022 06:36:08 -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=VOMwtjAOKOqjWivBEaPDnBxh356w9mI10NwEY366rx0=; b=UdOcfKL7pIsvCtkjHlOD8acWbb+vgYbPiegxJ55bv6WjdmCU4CbtRuZmGgy+IioTeI AALUTJ3rJ3XHGhA+7ZzDFsCE8bwj7qIDeYqSqHgdO7qzXLUtW6DVVh65Akdywd+T/nxQ OszXiRsL2XEZvV5C6ikB3962ZERa1APAn45Hw4Uhn2/WlSTqlgCDqBXnWN5Kkll4T3EF UA4NNUeiTZ27WKtrvjRMDpU02l5AqLUCG4XInRMLVSMJjue5dDi/rQSYcdmBnEiPVt19 GQxsOdgRoLV8JQS9Etu0VDir91PUatP7Q8t1//GSHDSFQyRRkNbBTDYe8WPLljAv41cY sTQQ== 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=VOMwtjAOKOqjWivBEaPDnBxh356w9mI10NwEY366rx0=; b=T1evznP2exKS906y50yiNPLf4WooE4MGA1Exwd83NCOW+TZl0NhuYIdikfBH5AIifo 9O7ccmD/jv0j0FHOrZl2KWb5GBifhMrjsUtRsSnpMPSAknX6nH5mua73mTWiT0OgJS5B KxE5R+qidXg3gNIcjNWrOvjV2+5J0Ys5NbvqNQZp1/O09h2PqAnw97Cv8WNk9y5Pa4Ux QIXGGfkk/88M3yAfjAJK1CnRcsMI0EqHEOSw3ytGcZogvNElqFy1fQz2A8Uih5a50hHU KekhnH8BZblftl7kjcuE0JajkuyvlgMAwoXiz2rzCEqQJVehJ3K5nxuoyaJJ5EZzoRB+ FGhQ== X-Gm-Message-State: AOAM530lSo+nPQsVFCovzxRwZZlMGMq7cb6KnBn35sOwGQQHmW7KyMvm OTdRZHnDmOemLH/tMj90jBHjY8mVPiAg02EyptI= X-Google-Smtp-Source: ABdhPJz7CjrpTwQnMGbsSoL0mkvtm7OFLEDOl3R6TJ1x+o8G+gHKVr1mP/nkB3I058//v+4xRXM9oc+XXtJDcb+UoM4= X-Received: by 2002:a02:a517:0:b0:32e:5930:d026 with SMTP id e23-20020a02a517000000b0032e5930d026mr1190662jam.280.1652794565989; Tue, 17 May 2022 06:36:05 -0700 (PDT) MIME-Version: 1.0 References: <33fe903b38d712388230cfa58ee3a64987771918.1652722314.git.sthotton@marvell.com> <199aa940-2316-75e9-a2a0-5b288e4ef854@ericsson.com> In-Reply-To: <199aa940-2316-75e9-a2a0-5b288e4ef854@ericsson.com> From: Jerin Jacob Date: Tue, 17 May 2022 19:05:39 +0530 Message-ID: Subject: Re: [PATCH v4 1/5] eventdev: support to set queue attributes at runtime To: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= Cc: Shijith Thotton , dpdk-dev , Jerin Jacob , Pavan Nikhilesh , "Van Haaren, Harry" , 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 Tue, May 17, 2022 at 2:25 PM Mattias R=C3=B6nnblom wrote: > > On 2022-05-16 20:02, Jerin Jacob wrote: > > On Mon, May 16, 2022 at 11:09 PM Shijith Thotton = wrote: > >> > >> Added a new eventdev API rte_event_queue_attr_set(), to set event queu= e > >> attributes at runtime from the values set during initialization using > >> rte_event_queue_setup(). PMD's supporting this feature should expose t= he > >> 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? > > > > No. Series applied to dpdk-next-net-eventdev/for-main. Thanks > > > > >> --- > >> 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/ev= entdevs/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_n= otes/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 at= tributes > >> + 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_= eventdev *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 at= tr_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 = queue_id, uint32_t attr_id, > >> return 0; > >> } > >> > >> +int > >> +rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t a= ttr_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_i= d); > >> + 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 qu= eue attributes at runtime", > >> + dev_id); > >> + return -ENOTSUP; > >> + } > >> + > >> + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_attr_set, -ENOTSU= P); > >> + 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 associ= ated 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 associ= ated 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 runt= ime 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 = during > >> + * 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 a= ttr_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 > >> >