[PATCH v2 1/1] net/octeon_ep: add device removal event callback
Jerin Jacob
jerinjacobk at gmail.com
Tue Oct 1 10:17:41 CEST 2024
On Fri, Sep 20, 2024 at 10:14 AM Vamsi Krishna <vattunuru at marvell.com> wrote:
>
> From: Vamsi Attunuru <vattunuru at marvell.com>
>
> Adds an event callback to catch any device removal
> event occurred during driver probe. This callback helps
> in terminating the execution if there is any device removal
> event during the driver probe.
>
> Also moved global register configuration into dev_configure()
> routine and also validates register reads for any invalid
> return values from hardware during driver probe.
>
> Signed-off-by: Vamsi Attunuru <vattunuru at marvell.com>
> ---
> V2 changes:
> * Corrected commit message
> * Updated release notes
> * Used UINT64_MAX macro.
>
> doc/guides/rel_notes/release_24_11.rst | 5 +++
> drivers/net/octeon_ep/cnxk_ep_vf.c | 2 +
> drivers/net/octeon_ep/otx2_ep_vf.c | 2 +
> drivers/net/octeon_ep/otx_ep_ethdev.c | 58 +++++++++++++++++++-------
> drivers/net/octeon_ep/otx_ep_mbox.c | 11 +++++
> drivers/net/octeon_ep/otx_ep_vf.c | 2 +
> 6 files changed, 64 insertions(+), 16 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst
> index 0ff70d9057..ffb2d13a76 100644
> --- a/doc/guides/rel_notes/release_24_11.rst
> +++ b/doc/guides/rel_notes/release_24_11.rst
> @@ -68,6 +68,11 @@ Removed Items
> Also, make sure to start the actual text at the margin.
> =======================================================
>
> +* **Added device removal event callback in octeon_ep driver.**
> +
> + Added an event callback to catch any device removal event would occur during
> + driver probe. This callback helps in terminating the execution if there is
> + any device removal event during the driver probe.
Since the user may not be impacted with this, This update may not be needed.
>
> +static void
> +otx_epdev_event_callback(const char *device_name, enum rte_dev_event_type type,
> + __rte_unused void *arg)
> +{
> + if (type == RTE_DEV_EVENT_REMOVE)
> + otx_ep_info("Octeon epdev: %s has been removed!\n", device_name);
Please add good amount of comment here. i.e Purpose and how
> + RTE_VERIFY(type != RTE_DEV_EVENT_REMOVE);
> +}
> +
More information about the dev
mailing list