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 65C4BA0032; Wed, 14 Sep 2022 14:35:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 057884021D; Wed, 14 Sep 2022 14:35:01 +0200 (CEST) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) by mails.dpdk.org (Postfix) with ESMTP id 106D240156 for ; Wed, 14 Sep 2022 14:35:00 +0200 (CEST) Received: by mail-qt1-f171.google.com with SMTP id h21so10975052qta.3 for ; Wed, 14 Sep 2022 05:34:59 -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=pnTImJNeVFJWMmCtmJfozBm753nGX97UWll7tNKZt7I=; b=Xtvmsr4HfhZZOcxIJmSTfTsur5Ht9pqSFLAIZ4ncAsKQeVbacdjl/Ufa1V4e4EXjhe tS1g8Nv4S+uxAVWEV//g1cmP6z6mejOz3oiPv6gCfCYj2MWCcQ08BoZGcsOmY25fgeiG 1rU6rRyIG+RkjLi1OtPwFk0/1yEgiu+VE0k6vGEgJguV0b6DyCjboCb6SSEvGh3MVE4w rt09kbefzjoEat/c2skDyWBhgi1AYRWbBoeU9p2yXSvPNV6QHFflSwCgWxj7/XjywoxN Js+6fDSeV7ehe8BHiS6MAr7zP1ImI/OsjnCwwxcR1WQfkQ/tbrzxrQcfDTvA7pkHbaVE 4Utg== 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=pnTImJNeVFJWMmCtmJfozBm753nGX97UWll7tNKZt7I=; b=4LNOIKJrwkAMy87VG/LA/d1R1EXmrJg1ROFlxyLB0P9mX4U+1vKXaw3s+CkPtIKXty 5It+zk5N3newwEdGYs7feUhvCSJ86DN8XBHHlzUYDpc2X65OhubozNxDoqnJ1aVBuOqN nqFeYNRlcXw8Dbm0552s76k2wy8z8IfJFifaLnEGYmmvJ22Ifsfh9khh13+WTM5YtINV WyxCXnOplUb1zslO0ZM72v1c38+9KPf/1grHYR9o0vcBJvIsiqsnEsAgC23LTaTxFeSV s9Xg837syleNelLIr3T3NTpiobDW4P2317s/JnnA5N7YVchdUz+A04v0PtH4qH/T6NE/ 1enQ== X-Gm-Message-State: ACgBeo3OBBHEd7syJCpc7BDKhDTHbr3O8k7Fp82l14BubZjm8Y8m/Mkh 6pItZX6rwUkoT/tyrxAcyzpgxlfar9PE6Fd8GDI= X-Google-Smtp-Source: AA6agR6iAup59EgrazH4lvwp5otXE/OStWLJXm2vytFOi0thQr/pD907ma1f8S1n8odp8h8QcefoqARE9kW612HqgMQ= X-Received: by 2002:ac8:5cc3:0:b0:35b:ba19:647c with SMTP id s3-20020ac85cc3000000b0035bba19647cmr10095757qta.502.1663158899262; Wed, 14 Sep 2022 05:34:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jerin Jacob Date: Wed, 14 Sep 2022 18:04:33 +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, 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 > --- > 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 >