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: [PATCH v3 1/3] eventdev: introduce link profiles
Date: Wed, 27 Sep 2023 20:53:41 +0530	[thread overview]
Message-ID: <CALBAE1PGCMFvwVYQob784aQ6H8SLQ2L-RxoYKTwZK6NdcaAw7A@mail.gmail.com> (raw)
In-Reply-To: <20230921102830.2765-2-pbhagavatula@marvell.com>

On Thu, Sep 21, 2023 at 3:58 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

as a "link profile"

> such profiles can be created based on the event device capability
> using the function `rte_event_port_profile_links_set` 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_profile_switch`
> 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_profile_unlink` is provided
> to modify the links associated to a profile, and
> `rte_event_port_profile_links_get` can be used to retrieve the
> links associated with a profile.
>
> Using Link profiles can reduce the overhead of linking/unlinking and
> waiting for unlinks in progress in fast-path and gives applications
> the ability to switch between preset profiles on the fly.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---

> +Linking Queues to Ports with profiles
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +An application can use link profiles if supported by the underlying event device to setup up

use "link profiles"

> +multiple link profile per port and change them run time depending up on heuristic data.
> +Using Link profiles can reduce the overhead of linking/unlinking and wait for unlinks in progress
> +in fast-path and gives applications the ability to switch between preset profiles on the fly.
> +
> +An Example use case could be as follows.
> +
> +Config path:
> +
> +.. code-block:: c
> +
> +        uint8_t lq[4] = {4, 5, 6, 7};
> +        uint8_t hq[4] = {0, 1, 2, 3};
> +
> +        if (rte_event_dev_info.max_profiles_per_port < 2)
> +            return -ENOTSUP;
> +
> +        rte_event_port_profile_links_set(0, 0, hq, NULL, 4, 0);
> +        rte_event_port_profile_links_set(0, 0, lq, NULL, 4, 1);
> +
> +Worker path:
> +
> +.. code-block:: c
> +
> +        uint8_t profile_id_to_switch;
> +
> +        while (1) {
> +            deq = rte_event_dequeue_burst(0, 0, &ev, 1, 0);
> +            if (deq == 0) {
> +                profile_id_to_switch = app_findprofile_id_to_switch();

app_find_profile_id_to_switch()

> +                rte_event_port_profile_switch(0, 0, profile_id_to_switch);
> +                continue;
> +            }
> +
> +            // Process the event received.
> +        }
> +
>  Starting the EventDev
>  ~~~~~~~~~~~~~~~~~~~~~
>
> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
> index b34ddc0860..e714fc2be5 100644
> --- a/doc/guides/rel_notes/release_23_11.rst
> +++ b/doc/guides/rel_notes/release_23_11.rst
> @@ -89,6 +89,23 @@ New Features
>    * Added support for ``remaining_ticks_get`` timer adapter PMD callback
>      to get the remaining ticks to expire for a given event timer.
>
> +* **Added eventdev support to link queues to port with profile.**
> +
> +  Introduced event link profiles that can be used to associated links between

``link profiles``

> +  event queues and an event port with a unique identifier termed as profile.
> +  The profile can be used to switch between the associated links in fast-path
> +  without the additional overhead of linking/unlinking and waiting for unlinking.
Added ``rte_event_port_profile_links_set``, ``rte_event_port_profile_unlink``,
``rte_event_port_profile_links_get`` and  ``rte_event_port_profile_switch`` APIs
to enable this feature.

In order to reduce the verbose in release notes, below text can be
replaced with above text.


> +
> +  * Added ``rte_event_port_profile_links_set`` to link event queues to an event
> +    port with a unique profile identifier.
> +
> +  * Added ``rte_event_port_profile_unlink`` to unlink event queues from an event
> +    port associated with a profile.
> +
> +  * Added ``rte_event_port_profile_links_get`` to retrieve links associated to a
> +    profile.
> +
> +  * Added ``rte_event_port_profile_switch`` to switch between profiles as needed.


>
> diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
> index cf2764364f..e645f7595a 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;
> +       dev_info->max_profiles_per_port = 1;
>  }
>
>  static int
> diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
> index fa1a1ade80..ffc5550f85 100644
> --- a/drivers/event/dpaa2/dpaa2_eventdev.c
> +++ b/drivers/event/dpaa2/dpaa2_eventdev.c
> @@ -411,7 +411,7 @@ dpaa2_eventdev_info_get(struct rte_eventdev *dev,
>                 RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES |
>                 RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
>                 RTE_EVENT_DEV_CAP_MAINTENANCE_FREE;
> -
> +       dev_info->max_profiles_per_port = 1;
>  }
>
>  static int
> diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c
> index 6c5cde2468..785c12f61f 100644
> --- a/drivers/event/dsw/dsw_evdev.c
> +++ b/drivers/event/dsw/dsw_evdev.c
> @@ -218,6 +218,7 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused,
>                 .max_event_port_dequeue_depth = DSW_MAX_PORT_DEQUEUE_DEPTH,
>                 .max_event_port_enqueue_depth = DSW_MAX_PORT_ENQUEUE_DEPTH,
>                 .max_num_events = DSW_MAX_EVENTS,
> +               .max_profiles_per_port = 1,
>                 .event_dev_cap = RTE_EVENT_DEV_CAP_BURST_MODE|
>                 RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED|
>                 RTE_EVENT_DEV_CAP_NONSEQ_MODE|
> diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c
> index 650266b996..0eb9358981 100644
> --- a/drivers/event/octeontx/ssovf_evdev.c
> +++ b/drivers/event/octeontx/ssovf_evdev.c
> @@ -158,7 +158,7 @@ ssovf_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *dev_info)
>                                         RTE_EVENT_DEV_CAP_NONSEQ_MODE |
>                                         RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
>                                         RTE_EVENT_DEV_CAP_MAINTENANCE_FREE;
> -
> +       dev_info->max_profiles_per_port = 1;
>  }
>
>  static int
> diff --git a/drivers/event/opdl/opdl_evdev.c b/drivers/event/opdl/opdl_evdev.c
> index 9ce8b39b60..dd25749654 100644
> --- a/drivers/event/opdl/opdl_evdev.c
> +++ b/drivers/event/opdl/opdl_evdev.c
> @@ -378,6 +378,7 @@ opdl_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info)
>                 .event_dev_cap = RTE_EVENT_DEV_CAP_BURST_MODE |
>                                  RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
>                                  RTE_EVENT_DEV_CAP_MAINTENANCE_FREE,
> +               .max_profiles_per_port = 1,
>         };
>
>         *info = evdev_opdl_info;
> diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c
> index 8513b9a013..dc9b131641 100644
> --- a/drivers/event/skeleton/skeleton_eventdev.c
> +++ b/drivers/event/skeleton/skeleton_eventdev.c
> @@ -104,6 +104,7 @@ skeleton_eventdev_info_get(struct rte_eventdev *dev,
>                                         RTE_EVENT_DEV_CAP_EVENT_QOS |
>                                         RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
>                                         RTE_EVENT_DEV_CAP_MAINTENANCE_FREE;
> +       dev_info->max_profiles_per_port = 1;
>  }
>
>  static int
> diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
> index cfd659d774..6d1816b76d 100644
> --- a/drivers/event/sw/sw_evdev.c
> +++ b/drivers/event/sw/sw_evdev.c
> @@ -609,6 +609,7 @@ sw_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *info)
>                                 RTE_EVENT_DEV_CAP_NONSEQ_MODE |
>                                 RTE_EVENT_DEV_CAP_CARRY_FLOW_ID |
>                                 RTE_EVENT_DEV_CAP_MAINTENANCE_FREE),
> +                       .max_profiles_per_port = 1,
>         };
>

In order to optimze for common case i.e chnages in all PMD, Please
move this logic to common code
i.e
[for-main]dell[dpdk-next-eventdev] $ git diff
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 30df0572d2..39018f23b6 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -95,6 +95,7 @@ rte_event_dev_info_get(uint8_t dev_id, struct
rte_event_dev_info *dev_info)

                return -EINVAL;

        memset(dev_info, 0, sizeof(struct rte_event_dev_info));
+       dev_info->max_profiles_per_port = 1;

        if (*dev->dev_ops->dev_infos_get == NULL)
                return -ENOTSUP;
[for-main]dell[dpdk-next-eventdev] $


> +/**
> + * Link multiple source event queues associated with a profile to a destination
> + * event port.
> + *
> + * @param dev
> + *   Event device pointer
> + * @param port
> + *   Event port pointer
> + * @param queues
> + *   Points to an array of *nb_links* event queues to be linked
> + *   to the event port.
> + * @param priorities
> + *   Points to an array of *nb_links* service priorities associated with each
> + *   event queue link to event port.
> + * @param nb_links
> + *   The number of links to establish.
> + * @param profile

profile_id


> + *   The profile ID to associate the links.
> + *
> + * @return
> + *   Returns 0 on success.
> + */
> +typedef int (*eventdev_port_link_profile_t)(struct rte_eventdev *dev, void *port,
> +                                           const uint8_t queues[], const uint8_t priorities[],
> +                                           uint16_t nb_links, uint8_t profile);

profile_id

> +
>  /**
>   * Unlink multiple source event queues from destination event port.
>   *
> @@ -455,6 +484,28 @@ typedef int (*eventdev_port_link_t)(struct rte_eventdev *dev, void *port,
>  typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port,
>                 uint8_t queues[], uint16_t nb_unlinks);
>
> +/**
> + * Unlink multiple source event queues associated with a profile from destination
> + * event port.
> + *
> + * @param dev
> + *   Event device pointer
> + * @param port
> + *   Event port pointer
> + * @param queues
> + *   An array of *nb_unlinks* event queues to be unlinked from the event port.
> + * @param nb_unlinks
> + *   The number of unlinks to establish
> + * @param profile

profile_id

> + *   The profile ID of the associated links.
> + *
> + * @return
> + *   Returns 0 on success.
> + */
> +typedef int (*eventdev_port_unlink_profile_t)(struct rte_eventdev *dev, void *port,
> +                                             uint8_t queues[], uint16_t nb_unlinks,
> +                                             uint8_t profile);

profile_id

>  RTE_TRACE_POINT(
>         rte_eventdev_trace_port_unlinks_in_progress,
>         RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id),
> diff --git a/lib/eventdev/eventdev_trace_points.c b/lib/eventdev/eventdev_trace_points.c
> index 76144cfe75..8024e07531 100644
> --- a/lib/eventdev/eventdev_trace_points.c
> +++ b/lib/eventdev/eventdev_trace_points.c
> @@ -19,9 +19,15 @@ RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_setup,
>  RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_link,
>         lib.eventdev.port.link)
>
> +RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_profile_links_set,
> +       lib.eventdev.port.profile.links.set)
> +
>  RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_unlink,
>         lib.eventdev.port.unlink)
>
> +RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_profile_unlink,
> +       lib.eventdev.port.profile.unlink)
> +
>  RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_start,
>         lib.eventdev.start)
>
> @@ -40,6 +46,9 @@ RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_deq_burst,
>  RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_maintain,
>         lib.eventdev.maintain)
>
> +RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_profile_switch,
> +       lib.eventdev.port.profile.switch)
> +
>  /* Eventdev Rx adapter trace points */
> diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
> index 6ab4524332..30df0572d2 100644
> --- a/lib/eventdev/rte_eventdev.c
> +++ b/lib/eventdev/rte_eventdev.c
> +int
> +rte_event_port_profile_unlink(uint8_t dev_id, uint8_t port_id, uint8_t queues[],
> +                             uint16_t nb_unlinks, uint8_t profile)

prfofile->profile_id

> +int
> +rte_event_port_profile_links_get(uint8_t dev_id, uint8_t port_id, uint8_t queues[],
> +                                uint8_t priorities[], uint8_t profile)

profile_id

> diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
> index 2ba8a7b090..f6ce45d160 100644
> --- a/lib/eventdev/rte_eventdev.h
> +++ b/lib/eventdev/rte_eventdev.h
> @@ -320,6 +320,12 @@ struct rte_event;
>   * rte_event_queue_setup().
>   */
>
> +#define RTE_EVENT_DEV_CAP_PROFILE_LINK (1ULL << 12)

Need to change as /**< in comment to show up in doxygen

> +/** Event device is capable of supporting multiple link profiles per event port
> + * i.e., the value of `rte_event_dev_info::max_profiles_per_port` is greater
> + * than one.
> + */
> +

> +/**
> + * Link multiple source event queues supplied in *queues* to the destination
> + * event port designated by its *port_id* with associated profile identifier
> + * supplied in *profile* with service priorities supplied in *priorities* on

profile_id

> + * the event device designated by its *dev_id*.
> + *
> + * If *profile* is set to 0 then, the links created by the call `rte_event_port_link`

profile_id

> + * will be overwritten.
> + *
> + * Event ports by default use profile 0 unless it is changed using the
> + * call ``rte_event_port_profile_switch()``.
> + *
> + * The link establishment shall enable the event port *port_id* from
> + * receiving events from the specified event queue(s) supplied in *queues*
> + *
> + * An event queue may link to one or more event ports.
> + * The number of links can be established from an event queue to event port is
> + * implementation defined.
> + *
> + * Event queue(s) to event port link establishment can be changed at runtime
> + * without re-configuring the device to support scaling and to reduce the
> + * latency of critical work by establishing the link with more event ports
> + * at runtime.
> + *
> + * @param dev_id
> + *   The identifier of the device.
> + *
> + * @param port_id
> + *   Event port identifier to select the destination port to link.
> + *
> + * @param queues
> + *   Points to an array of *nb_links* event queues to be linked
> + *   to the event port.
> + *   NULL value is allowed, in which case this function links all the configured
> + *   event queues *nb_event_queues* which previously supplied to
> + *   rte_event_dev_configure() to the event port *port_id*
> + *
> + * @param priorities
> + *   Points to an array of *nb_links* service priorities associated with each
> + *   event queue link to event port.
> + *   The priority defines the event port's servicing priority for
> + *   event queue, which may be ignored by an implementation.
> + *   The requested priority should in the range of
> + *   [RTE_EVENT_DEV_PRIORITY_HIGHEST, RTE_EVENT_DEV_PRIORITY_LOWEST].
> + *   The implementation shall normalize the requested priority to
> + *   implementation supported priority value.
> + *   NULL value is allowed, in which case this function links the event queues
> + *   with RTE_EVENT_DEV_PRIORITY_NORMAL servicing priority
> + *
> + * @param nb_links
> + *   The number of links to establish. This parameter is ignored if queues is
> + *   NULL.
> + *
> + * @param profile

profile_id

> + *   The profile identifier associated with the links between event queues and
> + *   event port. Should be less than the max capability reported by
> + *   ``rte_event_dev_info::max_profiles_per_port``
> + *
> + * @return
> + * The number of links actually established. The return value can be less than
> + * the value of the *nb_links* parameter when the implementation has the
> + * limitation on specific queue to port link establishment or if invalid
> + * parameters are specified in *queues*
> + * If the return value is less than *nb_links*, the remaining links at the end
> + * of link[] are not established, and the caller has to take care of them.
> + * If return value is less than *nb_links* then implementation shall update the
> + * rte_errno accordingly, Possible rte_errno values are
> + * (EDQUOT) Quota exceeded(Application tried to link the queue configured with
> + *  RTE_EVENT_QUEUE_CFG_SINGLE_LINK to more than one event ports)
> + * (EINVAL) Invalid parameter
> + *
> + */
> +__rte_experimental
> +int
> +rte_event_port_profile_links_set(uint8_t dev_id, uint8_t port_id, const uint8_t queues[],
> +                                const uint8_t priorities[], uint16_t nb_links, uint8_t profile);

profile_id

> +
> +/**
> + * Unlink multiple source event queues supplied in *queues* that belong to profile
> + * designated by *profile* from the destination event port designated by its
> + * *port_id* on the event device designated by its *dev_id*.
> + *
> + * If *profile* is set to 0 i.e., the default profile then, then this function will


profile_id

> + * act as ``rte_event_port_unlink``.
> + *
> + * The unlink call issues an async request to disable the event port *port_id*
> + * from receiving events from the specified event queue *queue_id*.
> + * Event queue(s) to event port unlink establishment can be changed at runtime
> + * without re-configuring the device.
> + *
> + * @see rte_event_port_unlinks_in_progress() to poll for completed unlinks.
> + *
> + * @param dev_id
> + *   The identifier of the device.
> + *
> + * @param port_id
> + *   Event port identifier to select the destination port to unlink.
> + *
> + * @param queues
> + *   Points to an array of *nb_unlinks* event queues to be unlinked
> + *   from the event port.
> + *   NULL value is allowed, in which case this function unlinks all the
> + *   event queue(s) from the event port *port_id*.
> + *
> + * @param nb_unlinks
> + *   The number of unlinks to establish. This parameter is ignored if queues is
> + *   NULL.
> + *
> + * @param profile

profile_id

> + *   The profile identifier associated with the links between event queues and
> + *   event port. Should be less than the max capability reported by
> + *   ``rte_event_dev_info::max_profiles_per_port``
> + *
> + * @return

> + * The number of unlinks successfully requested. The return value can be less
> + * than the value of the *nb_unlinks* parameter when the implementation has the
> + * limitation on specific queue to port unlink establishment or
> + * if invalid parameters are specified.
> + * If the return value is less than *nb_unlinks*, the remaining queues at the
> + * end of queues[] are not unlinked, and the caller has to take care of them.
> + * If return value is less than *nb_unlinks* then implementation shall update
> + * the rte_errno accordingly, Possible rte_errno values are
> + * (EINVAL) Invalid parameter
> + *
> + */
> +__rte_experimental
> +int
> +rte_event_port_profile_unlink(uint8_t dev_id, uint8_t port_id, uint8_t queues[],
> +                             uint16_t nb_unlinks, uint8_t profile);
> +

profile_id

> +/**
> + * Retrieve the list of source event queues and its service priority
> + * associated to a profile and linked to the destination event port
> + * designated by its *port_id* on the event device designated by its *dev_id*.
> + *
> + * @param dev_id
> + *   The identifier of the device.
> + *
> + * @param port_id
> + *   Event port identifier.
> + *
> + * @param[out] queues
> + *   Points to an array of *queues* for output.
> + *   The caller has to allocate *RTE_EVENT_MAX_QUEUES_PER_DEV* bytes to
> + *   store the event queue(s) linked with event port *port_id*
> + *
> + * @param[out] priorities
> + *   Points to an array of *priorities* for output.
> + *   The caller has to allocate *RTE_EVENT_MAX_QUEUES_PER_DEV* bytes to
> + *   store the service priority associated with each event queue linked
> + *
> + * @param profile

profile_id

> + *   The profile identifier associated with the links between event queues and
> + *   event port. Should be less than the max capability reported by
> + *   ``rte_event_dev_info::max_profiles_per_port``
> + *
> + * @return
> + * The number of links established on the event port designated by its
> + *  *port_id*.
> + * - <0 on failure.
> + */
> +__rte_experimental
> +int
> +rte_event_port_profile_links_get(uint8_t dev_id, uint8_t port_id, uint8_t queues[],
> +                                uint8_t priorities[], uint8_t profile);
> +
>  /**
>   * Retrieve the service ID of the event dev. If the adapter doesn't use
>   * a rte_service function, this function returns -ESRCH.
> @@ -2265,6 +2449,53 @@ rte_event_maintain(uint8_t dev_id, uint8_t port_id, int op)
>         return 0;
>  }
>
> +/**
> + * Change the active profile on an event port.
> + *
> + * This function is used to change the current active profile on an event port
> + * when multiple link profiles are configured on an event port through the
> + * function call ``rte_event_port_profile_links_set``.
> + *
> + * On the subsequent ``rte_event_dequeue_burst`` call, only the event queues
> + * that were associated with the newly active profile will participate in
> + * scheduling.

> + *
> + * @param dev_id
> + *   The identifier of the device.
> + * @param port_id
> + *   The identifier of the event port.
> + * @param profile

profile_id

> + *   The identifier of the profile.
> + * @return
> + *  - 0 on success.
> + *  - -EINVAL if *dev_id*,  *port_id*, or *profile* is invalid.
> + */
> +__rte_experimental
> +static inline uint8_t
> +rte_event_port_profile_switch(uint8_t dev_id, uint8_t port_id, uint8_t profile)

profile_id

> +{
> +       const struct rte_event_fp_ops *fp_ops;
> +       void *port;
> +
> +       fp_ops = &rte_event_fp_ops[dev_id];
> +       port = fp_ops->data[port_id];
> +
> +#ifdef RTE_LIBRTE_EVENTDEV_DEBUG
> +       if (dev_id >= RTE_EVENT_MAX_DEVS ||
> +           port_id >= RTE_EVENT_MAX_PORTS_PER_DEV)
> +               return -EINVAL;
> +
> +       if (port == NULL)
> +               return -EINVAL;
> +
> +       if (profile >= RTE_EVENT_MAX_PROFILES_PER_PORT)
> +               return -EINVAL;
> +#endif
> +       rte_eventdev_trace_port_profile_switch(dev_id, port_id, profile);
> +
> +       return fp_ops->profile_switch(port, profile);
> +}
> +
>  #ifdef __cplusplus
>  }
>  #endif
> diff --git a/lib/eventdev/rte_eventdev_core.h b/lib/eventdev/rte_eventdev_core.h
> index c27a52ccc0..5af646ed5c 100644
> --- a/lib/eventdev/rte_eventdev_core.h
> +++ b/lib/eventdev/rte_eventdev_core.h
> @@ -42,6 +42,8 @@ typedef uint16_t (*event_crypto_adapter_enqueue_t)(void *port,
>                                                    uint16_t nb_events);
>  /**< @internal Enqueue burst of events on crypto adapter */
>
> +typedef int (*event_profile_switch_t)(void *port, uint8_t profile);
> +
>  struct rte_event_fp_ops {
>         void **data;
>         /**< points to array of internal port data pointers */
> @@ -65,7 +67,9 @@ struct rte_event_fp_ops {
>         /**< PMD Tx adapter enqueue same destination function. */
>         event_crypto_adapter_enqueue_t ca_enqueue;
>         /**< PMD Crypto adapter enqueue function. */
> -       uintptr_t reserved[5];
> +       event_profile_switch_t profile_switch;
> +       /**< PMD Event switch profile function. */
> +       uintptr_t reserved[4];
>  } __rte_cache_aligned;
>
>  extern struct rte_event_fp_ops rte_event_fp_ops[RTE_EVENT_MAX_DEVS];
> diff --git a/lib/eventdev/rte_eventdev_trace_fp.h b/lib/eventdev/rte_eventdev_trace_fp.h
> index af2172d2a5..04d510ad00 100644
> --- a/lib/eventdev/rte_eventdev_trace_fp.h
> +++ b/lib/eventdev/rte_eventdev_trace_fp.h
> @@ -46,6 +46,14 @@ RTE_TRACE_POINT_FP(
>         rte_trace_point_emit_int(op);
>  )
>
> +RTE_TRACE_POINT_FP(
> +       rte_eventdev_trace_port_profile_switch,
> +       RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, uint8_t profile),
> +       rte_trace_point_emit_u8(dev_id);
> +       rte_trace_point_emit_u8(port_id);
> +       rte_trace_point_emit_u8(profile);
> +)
> +
>  RTE_TRACE_POINT_FP(
>         rte_eventdev_trace_eth_tx_adapter_enqueue,
>         RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id, void *ev_table,
> diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map
> index 7ce09a87bb..f88decee39 100644
> --- a/lib/eventdev/version.map
> +++ b/lib/eventdev/version.map
> @@ -134,6 +134,10 @@ EXPERIMENTAL {
>
>         # added in 23.11
>         rte_event_eth_rx_adapter_create_ext_with_params;
> +       rte_event_port_profile_links_set;
> +       rte_event_port_profile_unlink;
> +       rte_event_port_profile_links_get;
> +       __rte_eventdev_trace_port_profile_switch;
>  };


With above changes,


Acked-by: Jerin Jacob <jerinj@marvell.com>


>
>  INTERNAL {
> --
> 2.25.1
>

  reply	other threads:[~2023-09-27 15:24 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
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 [this message]
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=CALBAE1PGCMFvwVYQob784aQ6H8SLQ2L-RxoYKTwZK6NdcaAw7A@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).