From: Shijith Thotton <sthotton@marvell.com>
To: "Mattias Rönnblom" <mattias.ronnblom@ericsson.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Jerin Jacob Kollanukkaran" <jerinj@marvell.com>
Cc: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
Subject: RE: [PATCH 2/6] eventdev: add weight and affinity to queue attributes
Date: Mon, 4 Apr 2022 09:33:24 +0000 [thread overview]
Message-ID: <PH0PR18MB4425E3E0AC306C9F2EF99E1FD9E59@PH0PR18MB4425.namprd18.prod.outlook.com> (raw)
In-Reply-To: <a401481e-d431-5e3c-0513-fd6bfd5a732c@ericsson.com>
>> Extended eventdev queue QoS attributes to support weight and affinity.
>> If queues are of same priority, events from the queue with highest
>> 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
>> op queue_attr_get can be used to get it from the PMD.
>
>Have you considered using a PMD-specific command line parameter as a
>stop-gap until you can extend the config struct?
>
>> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
>> ---
>> lib/eventdev/eventdev_pmd.h | 22 ++++++++++++++++++++
>> lib/eventdev/rte_eventdev.c | 12 +++++++++++
>> lib/eventdev/rte_eventdev.h | 41 +++++++++++++++++++++++++++++++++-
>---
>> 3 files changed, 71 insertions(+), 4 deletions(-)
>>
>> diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
>> index 6182749503..f19df98a7a 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 13c8af877e..37f0e54bf3 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 19710cd0c5..fa16fc5dcb 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, a queue with highest
>> + * weight is selected. Subsequent schedules from an event port could see
>events
>> + * from the same event queue if the queue is configured with an affinity count.
>> + * Affinity count of a queue indicates the number of times, the subsequent
>> + * schedule calls from an event port should use the same queue if the queue is
>> + * non-empty.
>
>Is this specifying something else than WRR scheduling for equal-priority
>queues?
>
It is WRR for equal-priority queues. I will update the text as follows. Please check.
/**< 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 used 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 of a queue
* indicates the number of subsequent dequeue calls from an event port which
* should use the same queue if the queue is non-empty.
>What is a schedule call? I must say I don't understand this description.
Schedule call indicates a dequeue call. I have updated the text to avoid confusion.
>Is affinity the per-port batch size from the queue that is "next in
>line" for an opportunity to be scheduled to a port?
>
Not exactly batch size. It is the number of subsequent dequeue calls which
should use the same queue. So the subsequent dequeue calls could return a max of
affinity * batch_size number of events from the same queue.
>> *
>> * @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,11 +710,18 @@ 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
>> /**
>> * Maximum supported attribute ID.
>> */
>> -#define RTE_EVENT_QUEUE_ATTR_MAX
>RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE
>> +#define RTE_EVENT_QUEUE_ATTR_MAX RTE_EVENT_QUEUE_ATTR_AFFINITY
>>
>
>> /**
>> * Get an attribute from a queue.
next prev parent reply other threads:[~2022-04-04 9:33 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-29 13:10 [PATCH 0/6] Extend and set event queue attributes at runtime Shijith Thotton
2022-03-29 13:11 ` [PATCH 1/6] eventdev: support to set " Shijith Thotton
2022-03-30 10:58 ` Van Haaren, Harry
2022-04-04 9:35 ` Shijith Thotton
2022-04-04 9:45 ` Van Haaren, Harry
2022-03-30 12:14 ` Mattias Rönnblom
2022-04-04 11:45 ` Shijith Thotton
2022-03-29 13:11 ` [PATCH 2/6] eventdev: add weight and affinity to queue attributes Shijith Thotton
2022-03-30 12:12 ` Mattias Rönnblom
2022-04-04 9:33 ` Shijith Thotton [this message]
2022-03-29 13:11 ` [PATCH 3/6] doc: announce change in event queue conf structure Shijith Thotton
2022-03-29 13:11 ` [PATCH 4/6] test/event: test cases to test runtime queue attribute Shijith Thotton
2022-03-29 13:11 ` [PATCH 5/6] event/cnxk: support to set runtime queue attributes Shijith Thotton
2022-03-30 11:05 ` Van Haaren, Harry
2022-04-04 7:59 ` Shijith Thotton
2022-03-29 13:11 ` [PATCH 6/6] common/cnxk: use lock when accessing mbox of SSO Shijith Thotton
2022-03-29 18:49 ` [PATCH 0/6] Extend and set event queue attributes at runtime Jerin Jacob
2022-03-30 10:52 ` Van Haaren, Harry
2022-04-04 7:57 ` Shijith Thotton
2022-04-05 5:40 ` [PATCH v2 " Shijith Thotton
2022-04-05 5:40 ` [PATCH v2 1/6] eventdev: support to set " Shijith Thotton
2022-05-09 12:43 ` Jerin Jacob
2022-04-05 5:40 ` [PATCH v2 2/6] eventdev: add weight and affinity to queue attributes Shijith Thotton
2022-05-09 12:46 ` Jerin Jacob
2022-04-05 5:41 ` [PATCH v2 3/6] doc: announce change in event queue conf structure Shijith Thotton
2022-05-09 12:47 ` Jerin Jacob
2022-05-15 10:24 ` [PATCH v3] " Shijith Thotton
2022-07-12 14:05 ` Jerin Jacob
2022-07-13 6:52 ` [EXT] " Pavan Nikhilesh Bhagavatula
2022-07-13 8:55 ` Mattias Rönnblom
2022-07-13 9:56 ` Pavan Nikhilesh Bhagavatula
2022-07-17 12:52 ` Thomas Monjalon
2022-04-05 5:41 ` [PATCH v2 4/6] test/event: test cases to test runtime queue attribute Shijith Thotton
2022-05-09 12:55 ` Jerin Jacob
2022-04-05 5:41 ` [PATCH v2 5/6] event/cnxk: support to set runtime queue attributes Shijith Thotton
2022-05-09 12:57 ` Jerin Jacob
2022-04-05 5:41 ` [PATCH v2 6/6] common/cnxk: use lock when accessing mbox of SSO Shijith Thotton
2022-04-11 11:07 ` [PATCH v2 0/6] Extend and set event queue attributes at runtime Shijith Thotton
2022-05-15 9:53 ` [PATCH v3 0/5] " Shijith Thotton
2022-05-15 9:53 ` [PATCH v3 1/5] eventdev: support to set " Shijith Thotton
2022-05-15 13:11 ` Mattias Rönnblom
2022-05-16 3:57 ` Shijith Thotton
2022-05-16 10:23 ` Mattias Rönnblom
2022-05-16 12:12 ` Shijith Thotton
2022-05-15 9:53 ` [PATCH v3 2/5] eventdev: add weight and affinity to queue attributes Shijith Thotton
2022-05-15 9:53 ` [PATCH v3 3/5] test/event: test cases to test runtime queue attribute Shijith Thotton
2022-05-15 9:53 ` [PATCH v3 4/5] common/cnxk: use lock when accessing mbox of SSO Shijith Thotton
2022-05-15 9:53 ` [PATCH v3 5/5] event/cnxk: support to set runtime queue attributes Shijith Thotton
2022-05-16 17:35 ` [PATCH v4 0/5] Extend and set event queue attributes at runtime Shijith Thotton
2022-05-16 17:35 ` [PATCH v4 1/5] eventdev: support to set " Shijith Thotton
2022-05-16 18:02 ` Jerin Jacob
2022-05-17 8:55 ` Mattias Rönnblom
2022-05-17 13:35 ` Jerin Jacob
2022-05-19 8:49 ` Ray Kinsella
2022-05-16 17:35 ` [PATCH v4 2/5] eventdev: add weight and affinity to queue attributes Shijith Thotton
2022-05-16 17:35 ` [PATCH v4 3/5] test/event: test cases to test runtime queue attribute Shijith Thotton
2022-05-16 17:35 ` [PATCH v4 4/5] common/cnxk: use lock when accessing mbox of SSO Shijith Thotton
2022-05-16 17:35 ` [PATCH v4 5/5] event/cnxk: support to set runtime queue attributes Shijith Thotton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PH0PR18MB4425E3E0AC306C9F2EF99E1FD9E59@PH0PR18MB4425.namprd18.prod.outlook.com \
--to=sthotton@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=mattias.ronnblom@ericsson.com \
--cc=pbhagavatula@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).