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 249AAA034C; Mon, 9 May 2022 14:46:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D34D0407FF; Mon, 9 May 2022 14:46:27 +0200 (CEST) Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) by mails.dpdk.org (Postfix) with ESMTP id 3262E4068F for ; Mon, 9 May 2022 14:46:27 +0200 (CEST) Received: by mail-il1-f175.google.com with SMTP id f5so9181257ilj.13 for ; Mon, 09 May 2022 05:46:27 -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; bh=1nXlEUpko8vitQ7F1OFAJ/dlVoS/jtcKOdqUF1AwSDs=; b=mbDb3YmN38JbfP4FFNWs7KUMbXOBCJ3HPKsYB9gKOSX2QTMNVdDOmWYh1tch6lqyGr qeBCMnADLtj0Rc9OF+zQMY5TGR3wNwPBRvZPattWgs6vKfbUrfpx400gNif13TEdibCz ZRJ3YERx7S/gxIQTo/qW+PNz3LSOK8O2RFvbymR3mgKceT3WdBUbOmkYVk7yyWGZCUVM uPy/Z+knmu2k0HccNXdOTVu6BpapG1AVMLPh3dJwi03o/t7W0LylsRVZ1n5iAfTbNdDp Lx1lTO5L0UC7rPY85sbgagIYYLSbvmO6SNRlWeItLD5/K+w2gPQWLdFr5gUZnBCJ5ZsO BuZw== 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; bh=1nXlEUpko8vitQ7F1OFAJ/dlVoS/jtcKOdqUF1AwSDs=; b=DYXXSeBdgmZDZFnJbIw1ZhRFwKP+zDD588mPji6LhXgse3jv5XCLypLRTq7gz9yoCj Bk10r6wrDaFzLD2uYzvkwSTCKCgsqLptozduFAe1NCvgcGeErcOH7YfadbmPUfqIeudv 7uHDgqsHkF871BXZkWONYTV0b2LAT5muysQ8pX0bCPyn/vHLozNd2OajauBhoVdbSniC Rr4tI49wZ7G8fPcWQfThIv4+hDbiwMDAoqwh6PjIOfQChO/eagGcY7woxGIzAmGNOKMH ek980OyKSWbvtVtB1nA0sk5JGo8awTb9zIFHKAo4e9OhSpf39C0z+lQgryHoo++/NuMb LE0Q== X-Gm-Message-State: AOAM531fp05Mer9ZF5AVm/11dG8rvhDSSR0ysKyizeYWz6JRUJgmP4vD GOPLq556b6agQX5wZbQPDiN3jghbrGhtt+JSkDYzjjWq/zs= X-Google-Smtp-Source: ABdhPJzTIhfyHxsaHHJNT6CCndwHzZXS9N8desNbXIvyMqkT1hIZLnyiDhdMSuG7aLwHQN36xCeO3YONpDnniwBnrmk= X-Received: by 2002:a05:6e02:1d8a:b0:2cd:fa75:6395 with SMTP id h10-20020a056e021d8a00b002cdfa756395mr6681432ila.294.1652100386480; Mon, 09 May 2022 05:46:26 -0700 (PDT) MIME-Version: 1.0 References: <3ca1a9399508dd7812cb9f36f8a2989a07e113e2.1649136534.git.sthotton@marvell.com> In-Reply-To: <3ca1a9399508dd7812cb9f36f8a2989a07e113e2.1649136534.git.sthotton@marvell.com> From: Jerin Jacob Date: Mon, 9 May 2022 18:16:00 +0530 Message-ID: Subject: Re: [PATCH v2 2/6] eventdev: add weight and affinity to queue attributes To: Shijith Thotton Cc: dpdk-dev , Jerin Jacob , Pavan Nikhilesh , "Van Haaren, Harry" , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= 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 Tue, Apr 5, 2022 at 11:11 AM Shijith Thotton wrote: > > Extended eventdev queue QoS attributes to support weight and affinity. > If queues are of same priority, events from the queue with highest the same priority > weight will be scheduled first. Affinity indicates the number of times, > the subsequent schedule calls from an event port will use the same event > queue. Schedule call selects another queue if current queue goes empty > or schedule count reaches affinity count. > > To avoid ABI break, weight and affinity attributes are not yet added to > queue config structure and relies on PMD for managing it. New eventdev rely on > op queue_attr_get can be used to get it from the PMD. > > Signed-off-by: Shijith Thotton Please update the release notes. With above change, Acked-by: Jerin Jacob > --- > lib/eventdev/eventdev_pmd.h | 22 +++++++++++++++++++++ > lib/eventdev/rte_eventdev.c | 12 ++++++++++++ > lib/eventdev/rte_eventdev.h | 38 +++++++++++++++++++++++++++++++++++-- > 3 files changed, 70 insertions(+), 2 deletions(-) > > diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h > index 3b85d9f7a5..5495aee4f6 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); > > +/** > + * 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. > * > @@ -1231,6 +1251,8 @@ 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 a31e99be02..12b261f923 100644 > --- a/lib/eventdev/rte_eventdev.c > +++ b/lib/eventdev/rte_eventdev.c > @@ -838,6 +838,18 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, > > *attr_value = conf->schedule_type; > 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); > + 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); > + break; > default: > return -EINVAL; > }; > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h > index 16e9d5fb5b..a6fbaf1c11 100644 > --- a/lib/eventdev/rte_eventdev.h > +++ b/lib/eventdev/rte_eventdev.h > @@ -222,8 +222,14 @@ struct rte_event; > > /* Event device capability bitmap flags */ > #define RTE_EVENT_DEV_CAP_QUEUE_QOS (1ULL << 0) > -/**< Event scheduling prioritization is based on the priority associated with > - * each event queue. > +/**< Event scheduling prioritization is based on the priority and weight > + * associated with each event queue. Events from a queue with highest priority > + * is scheduled first. If the queues are of same priority, weight of the queues > + * are considered to select a queue in a weighted round robin fashion. > + * Subsequent dequeue calls from an event port could see events from the same > + * event queue, if the queue is configured with an affinity count. Affinity > + * count is the number of subsequent dequeue calls, in which an event port > + * should use the same event queue if the queue is non-empty > * > * @see rte_event_queue_setup(), rte_event_queue_attr_set() > */ > @@ -331,6 +337,26 @@ struct rte_event; > * @see rte_event_port_link() > */ > > +/* Event queue scheduling weights */ > +#define RTE_EVENT_QUEUE_WEIGHT_HIGHEST 255 > +/**< Highest weight of an event queue > + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set() > + */ > +#define RTE_EVENT_QUEUE_WEIGHT_LOWEST 0 > +/**< Lowest weight of an event queue > + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set() > + */ > + > +/* Event queue scheduling affinity */ > +#define RTE_EVENT_QUEUE_AFFINITY_HIGHEST 255 > +/**< Highest scheduling affinity of an event queue > + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set() > + */ > +#define RTE_EVENT_QUEUE_AFFINITY_LOWEST 0 > +/**< Lowest scheduling affinity of an event queue > + * @see rte_event_queue_attr_get(), rte_event_queue_attr_set() > + */ > + > /** > * Get the total number of event devices that have been successfully > * initialised. > @@ -684,6 +710,14 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id, > * The schedule type of the queue. > */ > #define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4 > +/** > + * The weight of the queue. > + */ > +#define RTE_EVENT_QUEUE_ATTR_WEIGHT 5 > +/** > + * Affinity of the queue. > + */ > +#define RTE_EVENT_QUEUE_ATTR_AFFINITY 6 > > /** > * Get an attribute from a queue. > -- > 2.25.1 >