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 4BC6AA00C5; Thu, 15 Sep 2022 18:54:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E35ED4021D; Thu, 15 Sep 2022 18:54:25 +0200 (CEST) Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by mails.dpdk.org (Postfix) with ESMTP id CB16140156 for ; Thu, 15 Sep 2022 18:54:23 +0200 (CEST) Received: by mail-qv1-f49.google.com with SMTP id m9so14634561qvv.7 for ; Thu, 15 Sep 2022 09:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=LCC1phySxCyJpO1wlM86JZetIBQxvVhqvSsmu+k4PWQ=; b=OPoVz0vIEq4Js5AXW5QztHGJUGAwyVGMWBk/hCJtbuSIIH1fVTloKWRLMSb9lIoh44 zvUZtcMvgF8xK1EBSqmHzc+1jmzFNkpgb3MHVE+53bF6IxQ3wmKeV1oZOvikVNBIKK2K Vbjr8mEC3VIbobaP/c+PBEkWRAeUHHYP8KvKxgcSeO8mxx+Z+fJVOYhcGSUrUO583bJE MSbe2vEnpDfcIWVmlhHLDhopv9YTpXsBFohxTxE0OH0KAd+lqAw2cvgVG27jbmDuc4zp OTlGMd5E8VCJvAV/dwoUu69HIMIhfpGSzcfPYHdxMHMmZPjH8ZRup9sVp5Ob3C8sZBgs kKZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=LCC1phySxCyJpO1wlM86JZetIBQxvVhqvSsmu+k4PWQ=; b=H58VkrJKy15NpHC7cZPmfc1Q1tW//yhlf7TK7GqR8uKWkpIX7PDkNj32immdcFvHCS FhHjMP5OmIdjC/ZP5izvK1oX9oaF24WWvYIkgWJW40eIpiMuZ/EDbPcq8baIBa6YNs+4 GORZYn0WKKEg3OTxbYFYsYZzRCXZOg99pumQHc73DC6J+shrarhJPtCaIoavP48qB+BQ FkQlMzedHggEh46U0mZ2Bzfz+A+vmDAIvMirm6MvDa9072kZ0dJpeBmA79v+yssTZcvu GAGso1m3XpG9LoybiTx3YIRLfgQtatX9+IAke2HeT0VvkjgbrLXAn+wA+xUIBSLUTwgH X/bw== X-Gm-Message-State: ACrzQf0HGK6FwlzU6hqyq2Rf6UCZIaUrcjlvyg802OGtotFPWPwcde+k xXPs90NViV3rZHBwNwCaqetkzkW7qHv2yjvGwbo= X-Google-Smtp-Source: AMsMyM7xx2g0wisKuXeet7+YZLp/dSEDoo1kE3tKXk49R8uaUjF9wro7ixlxjBhloPi2RijLj0dipl5lOQsZiLfezjs= X-Received: by 2002:a05:6214:4005:b0:474:3c94:cdc2 with SMTP id kd5-20020a056214400500b004743c94cdc2mr480727qvb.17.1663260863000; Thu, 15 Sep 2022 09:54:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jerin Jacob Date: Thu, 15 Sep 2022 22:23:56 +0530 Message-ID: Subject: Re: [PATCH] eventdev: add weight and affinity attributes to queue conf To: Shijith Thotton , "McDaniel, Timothy" , "Gujjar, Abhinandan S" , "Van Haaren, Harry" , Hemant Agrawal , Liang Ma , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , Erik Gabriel Carrillo , Nipun Gupta , "Jayatheerthan, Jay" , Peter Mccarthy Cc: jerinj@marvell.com, dev@dpdk.org, Ray Kinsella , Pavan Nikhilesh Content-Type: text/plain; charset="UTF-8" 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 Wed, Sep 14, 2022 at 6:04 PM Jerin Jacob wrote: > > On Wed, Aug 10, 2022 at 1:13 PM Shijith Thotton wrote: > > > > Added new fields to represent event queue weight and affinity in > > rte_event_queue_conf structure. Internal op to get queue attribute is > > removed as it is no longer needed. Updated driver to use the new field. > > > > Signed-off-by: Shijith Thotton > > Acked-by: Jerin Jacob > > + eventdev PMD maintainers to raise any feedback before merging to next-eventdev Applied to dpdk-next-net-eventdev/for-main. Thanks > > > > --- > > doc/guides/rel_notes/deprecation.rst | 3 -- > > doc/guides/rel_notes/release_22_11.rst | 3 ++ > > drivers/event/cnxk/cn10k_eventdev.c | 1 - > > drivers/event/cnxk/cn9k_eventdev.c | 1 - > > drivers/event/cnxk/cnxk_eventdev.c | 42 ++++++-------------------- > > drivers/event/cnxk/cnxk_eventdev.h | 9 ------ > > lib/eventdev/eventdev_pmd.h | 22 -------------- > > lib/eventdev/rte_eventdev.c | 10 +++--- > > lib/eventdev/rte_eventdev.h | 16 ++++++++++ > > 9 files changed, 33 insertions(+), 74 deletions(-) > > > > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst > > index e7583cae4c..13e7c6370e 100644 > > --- a/doc/guides/rel_notes/deprecation.rst > > +++ b/doc/guides/rel_notes/deprecation.rst > > @@ -206,9 +206,6 @@ Deprecation Notices > > ``rte_event_vector::elem_offset`` gives the number of valid elements left > > to process from the ``rte_event_vector::elem_offset``. > > > > -* eventdev: New fields to represent event queue weight and affinity > > - will be added to ``rte_event_queue_conf`` structure in DPDK 22.11. > > - > > * metrics: The function ``rte_metrics_init`` will have a non-void return > > in order to notify errors instead of calling ``rte_exit``. > > > > diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst > > index 8c021cf050..8ffd71e650 100644 > > --- a/doc/guides/rel_notes/release_22_11.rst > > +++ b/doc/guides/rel_notes/release_22_11.rst > > @@ -88,6 +88,9 @@ API Changes > > ABI Changes > > ----------- > > > > +* eventdev: Added ``weight`` and ``affinity`` fields to ``rte_event_queue_conf`` > > + structure. > > + > > .. This section should contain ABI changes. Sample format: > > > > * sample: Add a short 1-2 sentence description of the ABI change > > diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c > > index 5a0cab40a9..aa8ae394bc 100644 > > --- a/drivers/event/cnxk/cn10k_eventdev.c > > +++ b/drivers/event/cnxk/cn10k_eventdev.c > > @@ -922,7 +922,6 @@ static struct eventdev_ops cn10k_sso_dev_ops = { > > .queue_def_conf = cnxk_sso_queue_def_conf, > > .queue_setup = cnxk_sso_queue_setup, > > .queue_release = cnxk_sso_queue_release, > > - .queue_attr_get = cnxk_sso_queue_attribute_get, > > .queue_attr_set = cnxk_sso_queue_attribute_set, > > > > .port_def_conf = cnxk_sso_port_def_conf, > > diff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c > > index 2e27030049..58c72a580a 100644 > > --- a/drivers/event/cnxk/cn9k_eventdev.c > > +++ b/drivers/event/cnxk/cn9k_eventdev.c > > @@ -1153,7 +1153,6 @@ static struct eventdev_ops cn9k_sso_dev_ops = { > > .queue_def_conf = cnxk_sso_queue_def_conf, > > .queue_setup = cnxk_sso_queue_setup, > > .queue_release = cnxk_sso_queue_release, > > - .queue_attr_get = cnxk_sso_queue_attribute_get, > > .queue_attr_set = cnxk_sso_queue_attribute_set, > > > > .port_def_conf = cnxk_sso_port_def_conf, > > diff --git a/drivers/event/cnxk/cnxk_eventdev.c b/drivers/event/cnxk/cnxk_eventdev.c > > index 97dcf7b66e..45c53ffb4e 100644 > > --- a/drivers/event/cnxk/cnxk_eventdev.c > > +++ b/drivers/event/cnxk/cnxk_eventdev.c > > @@ -321,6 +321,8 @@ cnxk_sso_queue_def_conf(struct rte_eventdev *event_dev, uint8_t queue_id, > > queue_conf->nb_atomic_order_sequences = (1ULL << 20); > > queue_conf->event_queue_cfg = RTE_EVENT_QUEUE_CFG_ALL_TYPES; > > queue_conf->priority = RTE_EVENT_DEV_PRIORITY_NORMAL; > > + queue_conf->weight = RTE_EVENT_QUEUE_WEIGHT_LOWEST; > > + queue_conf->affinity = RTE_EVENT_QUEUE_AFFINITY_HIGHEST; > > } > > > > int > > @@ -330,18 +332,12 @@ cnxk_sso_queue_setup(struct rte_eventdev *event_dev, uint8_t queue_id, > > struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); > > uint8_t priority, weight, affinity; > > > > - /* Default weight and affinity */ > > - dev->mlt_prio[queue_id].weight = RTE_EVENT_QUEUE_WEIGHT_LOWEST; > > - dev->mlt_prio[queue_id].affinity = RTE_EVENT_QUEUE_AFFINITY_HIGHEST; > > - > > priority = CNXK_QOS_NORMALIZE(queue_conf->priority, 0, > > RTE_EVENT_DEV_PRIORITY_LOWEST, > > CNXK_SSO_PRIORITY_CNT); > > - weight = CNXK_QOS_NORMALIZE( > > - dev->mlt_prio[queue_id].weight, CNXK_SSO_WEIGHT_MIN, > > - RTE_EVENT_QUEUE_WEIGHT_HIGHEST, CNXK_SSO_WEIGHT_CNT); > > - affinity = CNXK_QOS_NORMALIZE(dev->mlt_prio[queue_id].affinity, 0, > > - RTE_EVENT_QUEUE_AFFINITY_HIGHEST, > > + weight = CNXK_QOS_NORMALIZE(queue_conf->weight, CNXK_SSO_WEIGHT_MIN, > > + RTE_EVENT_QUEUE_WEIGHT_HIGHEST, CNXK_SSO_WEIGHT_CNT); > > + affinity = CNXK_QOS_NORMALIZE(queue_conf->affinity, 0, RTE_EVENT_QUEUE_AFFINITY_HIGHEST, > > CNXK_SSO_AFFINITY_CNT); > > > > plt_sso_dbg("Queue=%u prio=%u weight=%u affinity=%u", queue_id, > > @@ -358,22 +354,6 @@ cnxk_sso_queue_release(struct rte_eventdev *event_dev, uint8_t queue_id) > > RTE_SET_USED(queue_id); > > } > > > > -int > > -cnxk_sso_queue_attribute_get(struct rte_eventdev *event_dev, uint8_t queue_id, > > - uint32_t attr_id, uint32_t *attr_value) > > -{ > > - struct cnxk_sso_evdev *dev = cnxk_sso_pmd_priv(event_dev); > > - > > - if (attr_id == RTE_EVENT_QUEUE_ATTR_WEIGHT) > > - *attr_value = dev->mlt_prio[queue_id].weight; > > - else if (attr_id == RTE_EVENT_QUEUE_ATTR_AFFINITY) > > - *attr_value = dev->mlt_prio[queue_id].affinity; > > - else > > - return -EINVAL; > > - > > - return 0; > > -} > > - > > int > > cnxk_sso_queue_attribute_set(struct rte_eventdev *event_dev, uint8_t queue_id, > > uint32_t attr_id, uint64_t attr_value) > > @@ -389,10 +369,10 @@ cnxk_sso_queue_attribute_set(struct rte_eventdev *event_dev, uint8_t queue_id, > > conf->priority = attr_value; > > break; > > case RTE_EVENT_QUEUE_ATTR_WEIGHT: > > - dev->mlt_prio[queue_id].weight = attr_value; > > + conf->weight = attr_value; > > break; > > case RTE_EVENT_QUEUE_ATTR_AFFINITY: > > - dev->mlt_prio[queue_id].affinity = attr_value; > > + conf->affinity = attr_value; > > break; > > case RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_FLOWS: > > case RTE_EVENT_QUEUE_ATTR_NB_ATOMIC_ORDER_SEQUENCES: > > @@ -409,11 +389,9 @@ cnxk_sso_queue_attribute_set(struct rte_eventdev *event_dev, uint8_t queue_id, > > priority = CNXK_QOS_NORMALIZE(conf->priority, 0, > > RTE_EVENT_DEV_PRIORITY_LOWEST, > > CNXK_SSO_PRIORITY_CNT); > > - weight = CNXK_QOS_NORMALIZE( > > - dev->mlt_prio[queue_id].weight, CNXK_SSO_WEIGHT_MIN, > > - RTE_EVENT_QUEUE_WEIGHT_HIGHEST, CNXK_SSO_WEIGHT_CNT); > > - affinity = CNXK_QOS_NORMALIZE(dev->mlt_prio[queue_id].affinity, 0, > > - RTE_EVENT_QUEUE_AFFINITY_HIGHEST, > > + weight = CNXK_QOS_NORMALIZE(conf->weight, CNXK_SSO_WEIGHT_MIN, > > + RTE_EVENT_QUEUE_WEIGHT_HIGHEST, CNXK_SSO_WEIGHT_CNT); > > + affinity = CNXK_QOS_NORMALIZE(conf->affinity, 0, RTE_EVENT_QUEUE_AFFINITY_HIGHEST, > > CNXK_SSO_AFFINITY_CNT); > > > > return roc_sso_hwgrp_set_priority(&dev->sso, queue_id, weight, affinity, > > diff --git a/drivers/event/cnxk/cnxk_eventdev.h b/drivers/event/cnxk/cnxk_eventdev.h > > index bfd0c5627e..d78fb4ea2f 100644 > > --- a/drivers/event/cnxk/cnxk_eventdev.h > > +++ b/drivers/event/cnxk/cnxk_eventdev.h > > @@ -88,11 +88,6 @@ struct cnxk_sso_qos { > > uint16_t iaq_prcnt; > > }; > > > > -struct cnxk_sso_mlt_prio { > > - uint8_t weight; > > - uint8_t affinity; > > -}; > > - > > struct cnxk_sso_evdev { > > struct roc_sso sso; > > uint8_t max_event_queues; > > @@ -123,7 +118,6 @@ struct cnxk_sso_evdev { > > uint64_t *timer_adptr_sz; > > uint16_t vec_pool_cnt; > > uint64_t *vec_pools; > > - struct cnxk_sso_mlt_prio mlt_prio[RTE_EVENT_MAX_QUEUES_PER_DEV]; > > /* Dev args */ > > uint32_t xae_cnt; > > uint8_t qos_queue_cnt; > > @@ -250,9 +244,6 @@ void cnxk_sso_queue_def_conf(struct rte_eventdev *event_dev, uint8_t queue_id, > > int cnxk_sso_queue_setup(struct rte_eventdev *event_dev, uint8_t queue_id, > > const struct rte_event_queue_conf *queue_conf); > > void cnxk_sso_queue_release(struct rte_eventdev *event_dev, uint8_t queue_id); > > -int cnxk_sso_queue_attribute_get(struct rte_eventdev *event_dev, > > - uint8_t queue_id, uint32_t attr_id, > > - uint32_t *attr_value); > > int cnxk_sso_queue_attribute_set(struct rte_eventdev *event_dev, > > uint8_t queue_id, uint32_t attr_id, > > uint64_t attr_value); > > diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h > > index 69402668d8..8879e43feb 100644 > > --- a/lib/eventdev/eventdev_pmd.h > > +++ b/lib/eventdev/eventdev_pmd.h > > @@ -341,26 +341,6 @@ typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev, > > typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev, > > uint8_t queue_id); > > > > -/** > > - * Get 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[out] attr_value > > - * Event queue attribute value > > - * > > - * @return > > - * - 0: Success. > > - * - <0: Error code on failure. > > - */ > > -typedef int (*eventdev_queue_attr_get_t)(struct rte_eventdev *dev, > > - uint8_t queue_id, uint32_t attr_id, > > - uint32_t *attr_value); > > - > > /** > > * Set an event queue attribute at runtime. > > * > > @@ -1268,8 +1248,6 @@ struct eventdev_ops { > > /**< Set up an event queue. */ > > eventdev_queue_release_t queue_release; > > /**< Release an event queue. */ > > - eventdev_queue_attr_get_t queue_attr_get; > > - /**< Get an event queue attribute. */ > > eventdev_queue_attr_set_t queue_attr_set; > > /**< Set an event queue attribute. */ > > > > diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c > > index 1dc4f966be..b96185b25d 100644 > > --- a/lib/eventdev/rte_eventdev.c > > +++ b/lib/eventdev/rte_eventdev.c > > @@ -859,15 +859,13 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, > > break; > > case RTE_EVENT_QUEUE_ATTR_WEIGHT: > > *attr_value = RTE_EVENT_QUEUE_WEIGHT_LOWEST; > > - if (dev->dev_ops->queue_attr_get) > > - return (*dev->dev_ops->queue_attr_get)( > > - dev, queue_id, attr_id, attr_value); > > + if (dev->data->event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_QOS) > > + *attr_value = conf->weight; > > break; > > case RTE_EVENT_QUEUE_ATTR_AFFINITY: > > *attr_value = RTE_EVENT_QUEUE_AFFINITY_LOWEST; > > - if (dev->dev_ops->queue_attr_get) > > - return (*dev->dev_ops->queue_attr_get)( > > - dev, queue_id, attr_id, attr_value); > > + if (dev->data->event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_QOS) > > + *attr_value = conf->affinity; > > break; > > default: > > return -EINVAL; > > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h > > index 6a6f6ea4c1..f1908b82b2 100644 > > --- a/lib/eventdev/rte_eventdev.h > > +++ b/lib/eventdev/rte_eventdev.h > > @@ -640,6 +640,22 @@ struct rte_event_queue_conf { > > * event device supported priority value. > > * Valid when the device has RTE_EVENT_DEV_CAP_QUEUE_QOS capability > > */ > > + uint8_t weight; > > + /**< Weight of the event queue relative to other event queues. > > + * The requested weight should be in the range of > > + * [RTE_EVENT_DEV_WEIGHT_HIGHEST, RTE_EVENT_DEV_WEIGHT_LOWEST]. > > + * The implementation shall normalize the requested weight to event > > + * device supported weight value. > > + * Valid when the device has RTE_EVENT_DEV_CAP_QUEUE_QOS capability. > > + */ > > + uint8_t affinity; > > + /**< Affinity of the event queue relative to other event queues. > > + * The requested affinity should be in the range of > > + * [RTE_EVENT_DEV_AFFINITY_HIGHEST, RTE_EVENT_DEV_AFFINITY_LOWEST]. > > + * The implementation shall normalize the requested affinity to event > > + * device supported affinity value. > > + * Valid when the device has RTE_EVENT_DEV_CAP_QUEUE_QOS capability. > > + */ > > }; > > > > /** > > -- > > 2.25.1 > >