DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: pbhagavatula@marvell.com
Cc: jerinj@marvell.com, sthotton@marvell.com,
	timothy.mcdaniel@intel.com,  hemant.agrawal@nxp.com,
	sachin.saxena@nxp.com, mattias.ronnblom@ericsson.com,
	 liangma@liangbit.com, peter.mccarthy@intel.com,
	harry.van.haaren@intel.com,  erik.g.carrillo@intel.com,
	abhinandan.gujjar@intel.com,  s.v.naga.harish.k@intel.com,
	anatoly.burakov@intel.com, dev@dpdk.org
Subject: Re: [RFC 1/3] eventdev: introduce link profiles
Date: Fri, 18 Aug 2023 15:57:06 +0530	[thread overview]
Message-ID: <CALBAE1OBtugMh-1Et7QcwSC08429KjZjF9LM8ZLdfQW+5dRREg@mail.gmail.com> (raw)
In-Reply-To: <20230809142617.6482-2-pbhagavatula@marvell.com>

On Wed, Aug 9, 2023 at 7:56 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> A collection of event queues linked to an event port can be
> associated with a unique identifier called as a profile, multiple
> such profiles can be created based on the event device capability
> using the function `rte_event_port_link_with_profile` which takes
> arguments similar to `rte_event_port_link` in addition to the profile
> identifier.
>
> The maximum link profiles that are supported by an event device
> is advertised through the structure member
> `rte_event_dev_info::max_profiles_per_port`.
> By default, event ports are configured to use the link profile 0
> on initialization.
>
> Once multiple link profiles are set up and the event device is started,
> the application can use the function `rte_event_port_change_profile`
> to change the currently active profile on an event port. This effects
> the next `rte_event_dequeue_burst` call, where the event queues
> associated with the newly active link profile will participate in
> scheduling.
>
> An unlink function `rte_event_port_unlink_with_profile` is provided
> to modify the links associated to a profile, and
> `rte_event_port_links_get_with_profile`can be used to retrieve the
> links associated with a profile.

in rte_flow APIs, similar concept is called as template.

I think "why" part is missing in the comment and programming guide.
i.e improving performance by creating template/profile in slow path
for faster link/unlink operation.

>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Some suggestion on API name to have proper prefix and keeping verb as last.


rte_event_port_profile_link_set()
rte_event_port_profile_link_get()
rte_event_port_profile_unlink()
rte_event_port_profile_switch()


>

Please start with heading for this new block

> +An application can also use link profiles if supported by the underlying event device to setup up
> +multiple link profile per port and change them run time depending up on heuristic data.
> +
> +An Example use case could be as follows.
> +
> +Config path:
> +
> +.. code-block:: c
> +
> +        uint8_t lowQ[4] = {4, 5, 6, 7};
> +        uint8_t highQ[4] = {0, 1, 2, 3};

Please remove Hungarian notation.


> +
> +        if (rte_event_dev_info.max_profiles_per_port < 2)
> +            return -ENOTSUP;
> +
> +        rte_event_port_link_with_profile(0, 0, highQ, NULL, 4, 0);
> +        rte_event_port_link_with_profile(0, 0, lowQ, NULL, 4, 1);
> +
> +Worker path:
> +
> +.. code-block:: c
> +
> +        uint8_t empty_high_deq = 0;
> +        uint8_t empty_low_deq = 0;
> +        uint8_t is_low_deq = 0;
> +        while (1) {
> +            deq = rte_event_dequeue_burst(0, 0, &ev, 1, 0);

> +            if (deq == 0) {
> +                /**
> +                 * Change link profile based on work activity on current
> +                 * active profile
> +                 */
> +                if (is_low_deq) {
> +                    empty_low_deq++;
> +                    if (empty_low_deq == MAX_LOW_RETRY) {
> +                        rte_event_port_change_profile(0, 0, 0);
> +                        is_low_deq = 0;
> +                        empty_low_deq = 0;
> +                    }
> +                    continue;
> +                }
> +
> +                if (empty_high_deq == MAX_HIGH_RETRY) {
> +                    rte_event_port_change_profile(0, 0, 1);
> +                    is_low_deq = 1;
> +                    empty_high_deq = 0;
> +                }
> +                continue;
> +            }
> +
> +            // Process the event received.
> +
> +            if (is_low_deq++ == MAX_LOW_EVENTS) {
> +                rte_event_port_change_profile(0, 0, 0);
> +                is_low_deq = 0;
> +            }
> +        }


As far programming document is concerned, we don't need to put such
complicated logic here.
We can put some comments something like “Find the profile ID to switch”

uint8_t profile_id_to_switch = app_find_profile_id_to_switch();
rte_event_port_profile_switch(.., profile_id_to_switch );


>
> diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
> index 60c5cd4804..580057870f 100644
> --- a/drivers/event/dlb2/dlb2.c
> +++ b/drivers/event/dlb2/dlb2.c
> @@ -79,6 +79,7 @@ static struct rte_event_dev_info evdev_dlb2_default_info = {
>                           RTE_EVENT_DEV_CAP_RUNTIME_PORT_LINK |
>                           RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT |
>                           RTE_EVENT_DEV_CAP_MAINTENANCE_FREE),
> +       .max_profiles_per_port = 1,
>  };
>
>  struct process_local_port_data
> diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
> index 4b3d16735b..f615da3813 100644
> --- a/drivers/event/dpaa/dpaa_eventdev.c
> +++ b/drivers/event/dpaa/dpaa_eventdev.c
> @@ -359,6 +359,7 @@ dpaa_event_dev_info_get(struct rte_eventdev *dev,
>                 RTE_EVENT_DEV_CAP_NONSEQ_MODE |
>                 RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
>                 RTE_EVENT_DEV_CAP_MAINTENANCE_FREE;

We are always adding CAPA for new eventdev features. Please add
RTE_EVENT_DEV_CAPA_PROFILE_LINK or so.

> @@ -131,6 +131,11 @@ EXPERIMENTAL {
>         rte_event_eth_tx_adapter_runtime_params_init;
>         rte_event_eth_tx_adapter_runtime_params_set;
>         rte_event_timer_remaining_ticks_get;
> +
> +       # added in 23.11
> +       rte_event_port_link_with_profile;
> +       rte_event_port_unlink_with_profile;
> +       rte_event_port_links_get_with_profile;

Missed the API to switch the profile.

>  };
>
>  INTERNAL {
> --
> 2.25.1
>

  reply	other threads:[~2023-08-18 10:27 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 14:26 [RFC 0/3] Introduce event " pbhagavatula
2023-08-09 14:26 ` [RFC 1/3] eventdev: introduce " pbhagavatula
2023-08-18 10:27   ` Jerin Jacob [this message]
2023-08-09 14:26 ` [RFC 2/3] event/cnxk: implement event " pbhagavatula
2023-08-09 14:26 ` [RFC 3/3] test/event: add event link profile test pbhagavatula
2023-08-09 19:45 ` [RFC 0/3] Introduce event link profiles Mattias Rönnblom
2023-08-10  5:17   ` [EXT] " Pavan Nikhilesh Bhagavatula
2023-08-12  5:52     ` Mattias Rönnblom
2023-08-14 11:29       ` Pavan Nikhilesh Bhagavatula
2023-08-25 18:44 ` [PATCH " pbhagavatula
2023-08-25 18:44   ` [PATCH 1/3] eventdev: introduce " pbhagavatula
2023-08-25 18:44   ` [PATCH 2/3] event/cnxk: implement event " pbhagavatula
2023-08-25 18:44   ` [PATCH 3/3] test/event: add event link profile test pbhagavatula
2023-08-31 20:44   ` [PATCH v2 0/3] Introduce event link profiles pbhagavatula
2023-08-31 20:44     ` [PATCH v2 1/3] eventdev: introduce " pbhagavatula
2023-09-20  4:22       ` Jerin Jacob
2023-08-31 20:44     ` [PATCH v2 2/3] event/cnxk: implement event " pbhagavatula
2023-08-31 20:44     ` [PATCH v2 3/3] test/event: add event link profile test pbhagavatula
2023-09-21 10:28     ` [PATCH v3 0/3] Introduce event link profiles pbhagavatula
2023-09-21 10:28       ` [PATCH v3 1/3] eventdev: introduce " pbhagavatula
2023-09-27 15:23         ` Jerin Jacob
2023-09-21 10:28       ` [PATCH v3 2/3] event/cnxk: implement event " pbhagavatula
2023-09-27 15:29         ` Jerin Jacob
2023-09-21 10:28       ` [PATCH v3 3/3] test/event: add event link profile test pbhagavatula
2023-09-27 14:56       ` [PATCH v3 0/3] Introduce event link profiles Jerin Jacob
2023-09-28 10:12       ` [PATCH v4 " pbhagavatula
2023-09-28 10:12         ` [PATCH v4 1/3] eventdev: introduce " pbhagavatula
2023-10-03  6:55           ` Jerin Jacob
2023-09-28 10:12         ` [PATCH v4 2/3] event/cnxk: implement event " pbhagavatula
2023-09-28 10:12         ` [PATCH v4 3/3] test/event: add event link profile test pbhagavatula
2023-09-28 14:45         ` [PATCH v4 0/3] Introduce event link profiles Jerin Jacob
2023-09-29  9:27           ` [EXT] " Pavan Nikhilesh Bhagavatula
2023-10-03  7:51         ` [PATCH v5 " pbhagavatula
2023-10-03  7:51           ` [PATCH v5 1/3] eventdev: introduce " pbhagavatula
2023-10-03  7:51           ` [PATCH v5 2/3] event/cnxk: implement event " pbhagavatula
2023-10-03  7:51           ` [PATCH v5 3/3] test/event: add event link profile test pbhagavatula
2023-10-03  9:47           ` [PATCH v6 0/3] Introduce event link profiles pbhagavatula
2023-10-03  9:47             ` [PATCH v6 1/3] eventdev: introduce " pbhagavatula
2023-10-03  9:47             ` [PATCH v6 2/3] event/cnxk: implement event " pbhagavatula
2023-10-03  9:47             ` [PATCH v6 3/3] test/event: add event link profile test pbhagavatula
2023-10-03 10:36             ` [PATCH v6 0/3] Introduce event link profiles Jerin Jacob
2023-10-03 14:12               ` Bruce Richardson
2023-10-03 15:17                 ` Jerin Jacob
2023-10-03 15:32                   ` [EXT] " Pavan Nikhilesh Bhagavatula

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=CALBAE1OBtugMh-1Et7QcwSC08429KjZjF9LM8ZLdfQW+5dRREg@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=abhinandan.gujjar@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerinj@marvell.com \
    --cc=liangma@liangbit.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=pbhagavatula@marvell.com \
    --cc=peter.mccarthy@intel.com \
    --cc=s.v.naga.harish.k@intel.com \
    --cc=sachin.saxena@nxp.com \
    --cc=sthotton@marvell.com \
    --cc=timothy.mcdaniel@intel.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).