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,
	abdullah.sevincer@intel.com,  hemant.agrawal@nxp.com,
	sachin.saxena@oss.nxp.com, harry.van.haaren@intel.com,
	 mattias.ronnblom@ericsson.com, liangma@liangbit.com,
	peter.mccarthy@intel.com,  dev@dpdk.org
Subject: Re: [PATCH v4 2/6] eventdev: add event port pre-schedule modify
Date: Fri, 4 Oct 2024 10:32:10 +0530	[thread overview]
Message-ID: <CALBAE1Mmk3m-a1=Pdoz6kpmpCNxptxV18FnEN11JSTduDfXg9w@mail.gmail.com> (raw)
In-Reply-To: <20241001131901.7920-3-pbhagavatula@marvell.com>

On Tue, Oct 1, 2024 at 7:14 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Some event devices allow pre-schedule types to be modified at
> runtime on an event port.
> Add `RTE_EVENT_DEV_CAP_EVENT_PER_PORT_PRESCHEDULE` capability
> to indicate that the event device supports this feature.
>
> Add `rte_event_port_preschedule_modify()` API to modify the
> pre-schedule type at runtime.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

>
> +To enable or disable event pre-scheduling at a given event port, the application can use
> +``rte_event_port_preschedule_modify()`` API.

# Talk about RTE_EVENT_DEV_CAP_EVENT_PER_PORT_PRESCHEDULE capability.
# Also tell this is HINT. i.e application does not need to check this
cap in fast path.


> +
> +.. code-block:: c
> +
> +   rte_event_port_preschedule_modify(dev_id, port_id, RTE_EVENT_DEV_PRESCHEDULE);
> +   // Dequeue events from the event port with normal dequeue() function.
> +   rte_event_port_preschedule_modify(dev_id, port_id, RTE_EVENT_DEV_PRESCHEDULE_NONE);
> +   // Disable pre-scheduling if thread is about to be scheduled out and issue dequeue() to drain
> +   // pending events.
> +
> +
>  Starting the EventDev
>  ~~~~~~~~~~~~~~~~~~~~~
>
> diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst
> index eae5cc326b..6e36ac7b7e 100644
> --- a/doc/guides/rel_notes/release_24_11.rst
> +++ b/doc/guides/rel_notes/release_24_11.rst
> @@ -62,6 +62,8 @@ New Features
>
>    * Added ``rte_event_dev_config::preschedule_type`` to configure the device
>      level pre-scheduling type.
> +  * Added ``rte_event_port_preschedule_modify`` to modify pre-scheduling type
> +    on a given event port.
>
>
>  Removed Items
> diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
> index 7a5699f14b..9ea23aa6cd 100644
> --- a/lib/eventdev/eventdev_pmd.h
> +++ b/lib/eventdev/eventdev_pmd.h
> @@ -184,6 +184,8 @@ struct __rte_cache_aligned rte_eventdev {
>         /**< Pointer to PMD DMA adapter enqueue function. */
>         event_profile_switch_t profile_switch;
>         /**< Pointer to PMD Event switch profile function. */
> +       event_preschedule_modify_t preschedule_modify;
> +       /**< Pointer to PMD Event port pre-schedule type modify function.  */
>
>         uint64_t reserved_64s[3]; /**< Reserved for future fields */
>         void *reserved_ptrs[3];   /**< Reserved for future fields */
> diff --git a/lib/eventdev/eventdev_private.c b/lib/eventdev/eventdev_private.c
> index 017f97ccab..dc37f736f8 100644
> --- a/lib/eventdev/eventdev_private.c
> +++ b/lib/eventdev/eventdev_private.c
> @@ -96,6 +96,21 @@ dummy_event_port_profile_switch(__rte_unused void *port, __rte_unused uint8_t pr
>         return -EINVAL;
>  }
>

> diff --git a/lib/eventdev/eventdev_trace_points.c b/lib/eventdev/eventdev_trace_points.c
> index 8024e07531..e41674123c 100644
> --- a/lib/eventdev/eventdev_trace_points.c
> +++ b/lib/eventdev/eventdev_trace_points.c
> @@ -49,6 +49,9 @@ RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_maintain,
>  RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_profile_switch,
>         lib.eventdev.port.profile.switch)
>
> +RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_port_preschedule_modify,
> +       lib.eventdev.port.preschedule.modify)
> +
>  /* Eventdev Rx adapter trace points */
>  RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_eth_rx_adapter_create,
>         lib.eventdev.rx.adapter.create)
> diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
> index 5ea7f5a07b..0add0093ac 100644
> --- a/lib/eventdev/rte_eventdev.h
> +++ b/lib/eventdev/rte_eventdev.h
> @@ -470,6 +470,16 @@ struct rte_event;
>   * @see rte_event_dev_configure()
>   */
>
> +#define RTE_EVENT_DEV_CAP_EVENT_PER_PORT_PRESCHEDULE (1ULL << 18)
> +/**< Event device supports event pre-scheduling per event port.
> + *
> + * When this flag is set, the event device allows controlling the event
> + * pre-scheduling at a event port granularity.

Tell it is HINT.

> + *
> + * @see rte_event_dev_configure()
> + * @see rte_event_port_preschedule_modify()
> + */
> +
>  /* Event device priority levels */
>  #define RTE_EVENT_DEV_PRIORITY_HIGHEST   0
>  /**< Highest priority level for events and queues.
> @@ -708,18 +718,23 @@ typedef enum {
>         RTE_EVENT_DEV_PRESCHEDULE_NONE = 0,
>         /* Disable pre-schedule across the event device or on a given event port.
>          * @ref rte_event_dev_config.preschedule_type
> +        * @ref rte_event_port_preschedule_modify()
>          */
>         RTE_EVENT_DEV_PRESCHEDULE,
>         /* Enable pre-schedule always across the event device or a given event port.
>          * @ref rte_event_dev_config.preschedule_type
> +        * @ref rte_event_port_preschedule_modify()
>          * @see RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE
> +        * @see RTE_EVENT_DEV_CAP_EVENT_PER_PORT_PRESCHEDULE
>          */
>         RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE,
>         /* Enable adaptive pre-schedule across the event device or a given event port.
>          * Delay issuing pre-schedule until there are no forward progress constraints with
>          * the held flow contexts.
>          * @ref rte_event_dev_config.preschedule_type
> +        * @ref rte_event_port_preschedule_modify()
>          * @see RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE
> +        * @see RTE_EVENT_DEV_CAP_EVENT_PER_PORT_PRESCHEDULE
>          */
>  } rte_event_dev_preschedule_type_t;
>
> @@ -2922,6 +2937,46 @@ rte_event_port_profile_switch(uint8_t dev_id, uint8_t port_id, uint8_t profile_i
>         return fp_ops->profile_switch(port, profile_id);
>  }
>
> +/**
> + * Change the pre-schedule type to use on an event port.

Modify the pre-schedule of the given event port ?

> + *
> + * This function is used to change the current pre-schedule type configured
> + * on an event port, the pre-schedule type can be set to none to disable pre-scheduling.
> + * This effects the subsequent ``rte_event_dequeue_burst`` call.
> + * The event device should support RTE_EVENT_DEV_CAP_PER_PORT_PRESCHEDULE capability.

Tell it is HINT and the application does not need to check the capa

> + *
> + * @param dev_id
> + *   The identifier of the device.
> + * @param port_id
> + *   The identifier of the event port.
> + * @param type
> + *   The preschedule type to use on the event port.
> + * @return
> + *  - 0 on success.
> + *  - -EINVAL if *dev_id*,  *port_id*, or *type* is invalid.
> + */
> +static inline int
> +rte_event_port_preschedule_modify(uint8_t dev_id, uint8_t port_id,
> +                                 rte_event_dev_preschedule_type_t type)

Remove rte_event_dev_preschedule_type_t  and use enum
rte_event_dev_preschedule_type

> +{
> +       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;
> +#endif
> +       rte_eventdev_trace_port_preschedule_modify(dev_id, port_id, type);
> +
> +       return fp_ops->preschedule_modify(port, type);
> +}
> +
>  #ifdef __cplusplus
>  }
>  #endif
> diff --git a/lib/eventdev/rte_eventdev_core.h b/lib/eventdev/rte_eventdev_core.h
> index fc8e1556ab..2275888a6b 100644
> --- a/lib/eventdev/rte_eventdev_core.h
> +++ b/lib/eventdev/rte_eventdev_core.h
> @@ -49,6 +49,10 @@ typedef uint16_t (*event_dma_adapter_enqueue_t)(void *port, struct rte_event ev[
>  typedef int (*event_profile_switch_t)(void *port, uint8_t profile);
>  /**< @internal Switch active link profile on the event port. */
>
> +typedef int (*event_preschedule_modify_t)(void *port,
> +                                         rte_event_dev_preschedule_type_t preschedule_type);
> +/**< @internal Modify pre-schedule type on the event port. */
> +
>  struct __rte_cache_aligned rte_event_fp_ops {
>         void **data;
>         /**< points to array of internal port data pointers */
> @@ -76,6 +80,8 @@ struct __rte_cache_aligned rte_event_fp_ops {
>         /**< PMD DMA adapter enqueue function. */
>         event_profile_switch_t profile_switch;
>         /**< PMD Event switch profile function. */
> +       event_preschedule_modify_t preschedule_modify;
> +       /**< PMD Event port pre-schedule switch. */

Use reserved not to break ABI

>         uintptr_t reserved[4];
>  };
>
> diff --git a/lib/eventdev/rte_eventdev_trace_fp.h b/lib/eventdev/rte_eventdev_trace_fp.h
> index 04d510ad00..78baed94de 100644
> --- a/lib/eventdev/rte_eventdev_trace_fp.h
> +++ b/lib/eventdev/rte_eventdev_trace_fp.h
> @@ -8,7 +8,7 @@
>  /**
>   * @file
>   *
> - * API for ethdev trace support
> + * API for eventdev trace support
>   */
>
>  #ifdef __cplusplus
> @@ -54,6 +54,15 @@ RTE_TRACE_POINT_FP(
>         rte_trace_point_emit_u8(profile);
>  )
>
> +RTE_TRACE_POINT_FP(
> +       rte_eventdev_trace_port_preschedule_modify,
> +       RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint8_t port_id,
> +                            int type),
> +       rte_trace_point_emit_u8(dev_id);
> +       rte_trace_point_emit_u8(port_id);
> +       rte_trace_point_emit_int(type);
> +)
> +
>  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 4947bb4ec6..b6d63ba576 100644
> --- a/lib/eventdev/version.map
> +++ b/lib/eventdev/version.map
> @@ -147,6 +147,10 @@ EXPERIMENTAL {
>         rte_event_port_profile_unlink;
>         rte_event_port_profile_links_get;
>         __rte_eventdev_trace_port_profile_switch;
> +
> +       # added in 24.11
> +       rte_event_port_preschedule_modify;
> +       __rte_eventdev_trace_port_preschedule_modify;
>  };
>
>  INTERNAL {
> --
> 2.25.1
>

  reply	other threads:[~2024-10-04  5:02 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10  8:31 [RFC 0/3] Introduce event prefetching pbhagavatula
2024-09-10  8:31 ` [RFC 1/3] eventdev: introduce " pbhagavatula
2024-09-10  8:31 ` [RFC 2/3] eventdev: allow event ports to modified prefetches pbhagavatula
2024-09-10  8:31 ` [RFC 3/3] eventdev: add SW event prefetch hint pbhagavatula
2024-09-10  9:08 ` [RFC 0/3] Introduce event prefetching Mattias Rönnblom
2024-09-10 11:53   ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2024-09-17  7:11 ` [PATCH v2 0/3] Introduce event pre-scheduling pbhagavatula
2024-09-17  7:11   ` [PATCH v2 1/3] eventdev: introduce " pbhagavatula
2024-09-18 22:38     ` Pathak, Pravin
2024-09-19 13:13       ` Pavan Nikhilesh Bhagavatula
2024-09-23  8:57         ` Mattias Rönnblom
2024-09-25 10:30           ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2024-09-26  2:54             ` Pathak, Pravin
2024-09-26 10:03               ` Pavan Nikhilesh Bhagavatula
2024-09-27  3:31                 ` Pathak, Pravin
2024-09-17  7:11   ` [PATCH v2 2/3] eventdev: add event port pre-schedule modify pbhagavatula
2024-09-17  7:11   ` [PATCH v2 3/3] eventdev: add SW event preschedule hint pbhagavatula
2024-10-01  6:14   ` [PATCH v3 0/6] Introduce event pre-scheduling pbhagavatula
2024-10-01  6:14     ` [PATCH v3 1/6] eventdev: introduce " pbhagavatula
2024-10-01  6:14     ` [PATCH v3 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-01  6:14     ` [PATCH v3 3/6] eventdev: add SW event preschedule hint pbhagavatula
2024-10-01  6:14     ` [PATCH v3 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-01  6:14     ` [PATCH v3 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-01  6:14     ` [PATCH v3 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-01 13:18     ` [PATCH v4 0/6] Introduce event pre-scheduling pbhagavatula
2024-10-01 13:18       ` [PATCH v4 1/6] eventdev: introduce " pbhagavatula
2024-10-04  4:47         ` Jerin Jacob
2024-10-01 13:18       ` [PATCH v4 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-04  5:02         ` Jerin Jacob [this message]
2024-10-01 13:18       ` [PATCH v4 3/6] eventdev: add SW event preschedule hint pbhagavatula
2024-10-04  5:14         ` Jerin Jacob
2024-10-01 13:18       ` [PATCH v4 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-01 13:19       ` [PATCH v4 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-01 13:19       ` [PATCH v4 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-01 15:33       ` [PATCH v4 0/6] Introduce event pre-scheduling Stephen Hemminger
2024-10-03  5:46         ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2024-10-04 16:24       ` [PATCH v5 " pbhagavatula
2024-10-04 16:24         ` [PATCH v5 1/6] eventdev: introduce " pbhagavatula
2024-10-04 16:24         ` [PATCH v5 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-04 16:24         ` [PATCH v5 3/6] eventdev: add event preschedule hint pbhagavatula
2024-10-04 16:24         ` [PATCH v5 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-04 16:24         ` [PATCH v5 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-04 16:24         ` [PATCH v5 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-04 16:35         ` [PATCH v5 0/6] Introduce event pre-scheduling Stephen Hemminger
2024-10-04 16:50           ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2024-10-05  7:25         ` [PATCH v6 " pbhagavatula
2024-10-05  7:25           ` [PATCH v6 1/6] eventdev: introduce " pbhagavatula
2024-10-05  7:25           ` [PATCH v6 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-05  7:25           ` [PATCH v6 3/6] eventdev: add event preschedule hint pbhagavatula
2024-10-05  7:25           ` [PATCH v6 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-05  7:25           ` [PATCH v6 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-05  7:26           ` [PATCH v6 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-05  7:59           ` [PATCH v7 0/6] Introduce event pre-scheduling pbhagavatula
2024-10-05  7:59             ` [PATCH v7 1/6] eventdev: introduce " pbhagavatula
2024-10-05 16:11               ` Stephen Hemminger
2024-10-06 17:03                 ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2024-10-05  7:59             ` [PATCH v7 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-05  7:59             ` [PATCH v7 3/6] eventdev: add event preschedule hint pbhagavatula
2024-10-05  7:59             ` [PATCH v7 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-05  8:00             ` [PATCH v7 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-05  8:00             ` [PATCH v7 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-06 17:06             ` [PATCH v8 0/6] Introduce event pre-scheduling pbhagavatula
2024-10-06 17:06               ` [PATCH v8 1/6] eventdev: introduce " pbhagavatula
2024-10-06 17:06               ` [PATCH v8 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-06 17:06               ` [PATCH v8 3/6] eventdev: add event preschedule hint pbhagavatula
2024-10-07 12:24                 ` Jerin Jacob
2024-10-06 17:06               ` [PATCH v8 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-06 17:06               ` [PATCH v8 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-06 17:06               ` [PATCH v8 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-07 13:09               ` [PATCH v9 0/6] Introduce event pre-scheduling pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 1/6] eventdev: introduce " pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 3/6] eventdev: add event preschedule hint pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-08  5:17                 ` [PATCH v9 0/6] Introduce event pre-scheduling Jerin Jacob

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='CALBAE1Mmk3m-a1=Pdoz6kpmpCNxptxV18FnEN11JSTduDfXg9w@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=abdullah.sevincer@intel.com \
    --cc=dev@dpdk.org \
    --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=sachin.saxena@oss.nxp.com \
    --cc=sthotton@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).