DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: "Pavan Nikhilesh" <pbhagavatula@marvell.com>,
	"Jayatheerthan, Jay" <jay.jayatheerthan@intel.com>,
	"Erik Gabriel Carrillo" <erik.g.carrillo@intel.com>,
	"Gujjar, Abhinandan S" <abhinandan.gujjar@intel.com>,
	"McDaniel, Timothy" <timothy.mcdaniel@intel.com>,
	"Hemant Agrawal" <hemant.agrawal@nxp.com>,
	"Nipun Gupta" <nipun.gupta@nxp.com>,
	"Van Haaren, Harry" <harry.van.haaren@intel.com>,
	"Mattias Rönnblom" <mattias.ronnblom@ericsson.com>,
	"Liang Ma" <liangma@liangbit.com>,
	"Peter Mccarthy" <peter.mccarthy@intel.com>
Cc: Jerin Jacob <jerinj@marvell.com>, Ray Kinsella <mdr@ashroe.eu>,
	dpdk-dev <dev@dpdk.org>, Shijith Thotton <sthotton@marvell.com>
Subject: Re: [PATCH 1/3] eventdev: add function to quiesce an event port
Date: Mon, 9 May 2022 22:59:10 +0530	[thread overview]
Message-ID: <CALBAE1Pdu29hOWZgdivYaafpVq8y_U44EzjZ2HFzGdy+J=zkeA@mail.gmail.com> (raw)
In-Reply-To: <20220427113223.13948-1-pbhagavatula@marvell.com>

On Wed, Apr 27, 2022 at 5:02 PM Pavan Nikhilesh
<pbhagavatula@marvell.com> wrote:
>
> Add function to quiesce any core specific resources consumed by
> the event port.
>
> When the application decides to migrate the event port to another lcore
> or teardown the current lcore it may to call `rte_event_port_quiesce`
> to make sure that all the data associated with the event port are released
> from the lcore, this might also include any prefetched events.
>
> While releasing the event port from the lcore, this function calls the
> user-provided flush callback once per event.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

+ eventdev stake holder

@jay.jayatheerthan@intel.com @erik.g.carrillo@intel.com
@abhinandan.gujjar@intel.com timothy.mcdaniel@intel.com
sthotton@marvell.com hemant.agrawal@nxp.com nipun.gupta@nxp.com
harry.van.haaren@intel.com mattias.ronnblom@ericsson.com
liangma@liangbit.com peter.mccarthy@intel.com

Since it is in a slow path and allows port teardown on migration for
the implementations where core has some state for the port. The new
API addition looks good to me.

Any objection or alternative thought from eventdev stake holders?

Some comments below.



> ---
>  lib/eventdev/eventdev_pmd.h | 19 +++++++++++++++++++
>  lib/eventdev/rte_eventdev.c | 19 +++++++++++++++++++
>  lib/eventdev/rte_eventdev.h | 33 +++++++++++++++++++++++++++++++++
>  lib/eventdev/version.map    |  3 +++
>  4 files changed, 74 insertions(+)
>
> diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h
> index ce469d47a6..cf9f2146a1 100644
> --- a/lib/eventdev/eventdev_pmd.h
> +++ b/lib/eventdev/eventdev_pmd.h
> @@ -381,6 +381,23 @@ typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev,
>   */
>  typedef void (*eventdev_port_release_t)(void *port);
>
> +/**
> + * Quiesce any core specific resources consumed by the event port
> + *
> + * @param dev
> + *   Event device pointer.
> + * @param port
> + *   Event port pointer.
> + * @param flush_cb
> + *   User-provided event flush function.
> + * @param args
> + *   Arguments to be passed to the user-provided event flush function.
> + *
> + */
> +typedef void (*eventdev_port_quiesce_t)(struct rte_eventdev *dev, void *port,

Please prefix rte_ for public symbols. i.e rte_event_port_quiesce_t.

I know we missed for existing eventdev_stop_flush_t, which we can fix
in the next ABI. I will send a patch for same.


> +                                       eventdev_port_flush_t flush_cb,
> +                                       void *args);
> +
>  /**
>   * Link multiple source event queues to destination event port.
>   *
> @@ -1218,6 +1235,8 @@ struct eventdev_ops {
>         /**< Set up an event port. */
>         eventdev_port_release_t port_release;
>         /**< Release an event port. */
> +       eventdev_port_quiesce_t port_quiesce;
> +       /**< Quiesce an event port. */
>
>         eventdev_port_link_t port_link;
>         /**< Link event queues to an event port. */
> diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
> index 532a253553..541fa5dc61 100644
> --- a/lib/eventdev/rte_eventdev.c
> +++ b/lib/eventdev/rte_eventdev.c
> @@ -730,6 +730,25 @@ rte_event_port_setup(uint8_t dev_id, uint8_t port_id,
>         return 0;
>  }
>
> +void
> +rte_event_port_quiesce(uint8_t dev_id, uint8_t port_id,
> +                      eventdev_port_flush_t release_cb, void *args)
> +{
> +       struct rte_eventdev *dev;
> +
> +       RTE_EVENTDEV_VALID_DEVID_OR_RET(dev_id);
> +       dev = &rte_eventdevs[dev_id];
> +
> +       if (!is_valid_port(dev, port_id)) {
> +               RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id);
> +               return;
> +       }
> +
> +       if (dev->dev_ops->port_quiesce)
> +               (*dev->dev_ops->port_quiesce)(dev, dev->data->ports[port_id],
> +                                             release_cb, args);
> +}
> +
>  int
>  rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id,
>                        uint32_t *attr_value)
> diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
> index 42a5660169..c86d8a5576 100644
> --- a/lib/eventdev/rte_eventdev.h
> +++ b/lib/eventdev/rte_eventdev.h
> @@ -830,6 +830,39 @@ int
>  rte_event_port_setup(uint8_t dev_id, uint8_t port_id,
>                      const struct rte_event_port_conf *port_conf);
>
> +typedef void (*eventdev_port_flush_t)(uint8_t dev_id, struct rte_event event,
> +                                     void *arg);
> +/**< Callback function prototype that can be passed during
> + * rte_event_port_release(), invoked once per a released event.
> + */
> +
> +/**
> + * Quiesce any core specific resources consumed by the event port.
> + *
> + * Event ports are generally coupled with lcores, and a given Hardware
> + * implementation might require the PMD to store port specific data in the
> + * lcore.
> + * When the application decides to migrate the event port to an other lcore

an other -> another

> + * or teardown the current lcore it may to call `rte_event_port_quiesce`
> + * to make sure that all the data associated with the event port are released
> + * from the lcore, this might also include any prefetched events.
> + * While releasing the event port from the lcore, this function calls the
> + * user-provided flush callback once per event.
> + *
> + * The event port specific config is not reset.

Make this as @note The event port-specific config shall not reset on
this API call or similar.


> + *
> + * @param dev_id
> + *   The identifier of the device.
> + * @param port_id
> + *   The index of the event port to setup. The value must be in the range
> + *   [0, nb_event_ports - 1] previously supplied to rte_event_dev_configure().
> + * @param release_cb
> + *   Callback function invoked once per flushed event.
> + */
> +__rte_experimental
> +void rte_event_port_quiesce(uint8_t dev_id, uint8_t port_id,
> +                           eventdev_port_flush_t release_cb, void *args);
>

Please update doc/guides/prog_guide/eventdev.rst and add section for teardown
and mention existing rte_event_dev_stop_flush_callback_register() and
this new API.

      parent reply	other threads:[~2022-05-09 17:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 11:32 Pavan Nikhilesh
2022-04-27 11:32 ` [PATCH 2/3] eventdev: update examples to use port quiesce Pavan Nikhilesh
2022-04-27 11:32 ` [PATCH 3/3] event/cnxk: implement event port quiesce function Pavan Nikhilesh
2022-04-27 11:37 ` [PATCH 1/3 v2] eventdev: add function to quiesce an event port Pavan Nikhilesh
2022-04-27 11:37   ` [PATCH 2/3 v2] eventdev: update examples to use port quiesce Pavan Nikhilesh
2022-04-27 11:37   ` [PATCH 3/3 v2] event/cnxk: implement event port quiesce function Pavan Nikhilesh
2022-05-13 17:58   ` [PATCH v3 1/3] eventdev: add function to quiesce an event port pbhagavatula
2022-05-13 17:58     ` [PATCH v3 2/3] eventdev: update examples to use port quiesce pbhagavatula
2022-05-13 17:58     ` [PATCH v3 3/3] event/cnxk: implement event port quiesce function pbhagavatula
2022-05-17 10:04     ` [PATCH v3 1/3] eventdev: add function to quiesce an event port Jerin Jacob
2022-05-04  9:02 ` [PATCH " Ray Kinsella
2022-05-09 17:29 ` Jerin Jacob [this message]

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='CALBAE1Pdu29hOWZgdivYaafpVq8y_U44EzjZ2HFzGdy+J=zkeA@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=abhinandan.gujjar@intel.com \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jay.jayatheerthan@intel.com \
    --cc=jerinj@marvell.com \
    --cc=liangma@liangbit.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=mdr@ashroe.eu \
    --cc=nipun.gupta@nxp.com \
    --cc=pbhagavatula@marvell.com \
    --cc=peter.mccarthy@intel.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).