[dpdk-dev] [PATCH v3 1/4] ethdev: Add eal device event callback

Zhang, Qi Z qi.z.zhang at intel.com
Tue Jul 10 11:10:46 CEST 2018


Hi Jeff:

> -----Original Message-----
> From: Guo, Jia
> Sent: Monday, July 9, 2018 7:46 PM
> To: stephen at networkplumber.org; Richardson, Bruce
> <bruce.richardson at intel.com>; Yigit, Ferruh <ferruh.yigit at intel.com>;
> Ananyev, Konstantin <konstantin.ananyev at intel.com>;
> gaetan.rivet at 6wind.com; Wu, Jingjing <jingjing.wu at intel.com>;
> thomas at monjalon.net; motih at mellanox.com; matan at mellanox.com; Van
> Haaren, Harry <harry.van.haaren at intel.com>; Zhang, Qi Z
> <qi.z.zhang at intel.com>; He, Shaopeng <shaopeng.he at intel.com>; Iremonger,
> Bernard <bernard.iremonger at intel.com>; arybchenko at solarflare.com; Lu,
> Wenzhuo <wenzhuo.lu at intel.com>
> Cc: jblunck at infradead.org; shreyansh.jain at nxp.com; dev at dpdk.org; Guo, Jia
> <jia.guo at intel.com>; Zhang, Helin <helin.zhang at intel.com>
> Subject: [PATCH v3 1/4] ethdev: Add eal device event callback
> 
> Implement a eal device event callback "rte_eth_dev_event_callback"
> in ethdev, it could let pmd driver have chance to manage the eal device event,
> such as process hotplug event.
> 
> Signed-off-by: Jeff Guo <jia.guo at intel.com>
> ---
<...>
> 
>  /**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Implement a rte eth eal device event callbacks for the specific device.
> + *
> + * @param device_name
> + *  Pointer to the name of the rte device.
> + * @param event
> + *  Eal device event type.
> + * @param ret_param
> + *  To pass data back to user application.
> + *
> + * @return
> + *  void
> + */
> +void __rte_experimental
> +rte_eth_dev_event_callback(char *device_name,
> +		enum rte_dev_event_type event, void *cb_arg);

I don't think we should expose the callback function to PMD directly
It should be a function like rte_eth_dev_event_callback_register(struct rte_ethdev *dev) which looks more like an ethdev help API for drivers.
And inside the function , we do the rte_dev_event_callback_register ...
And rte_eth_dev_event_callback should be rename to eth_dev_event_callback as a static function.

Regards
Qi
> +
> +/**
>   * @internal Executes all the user application registered callbacks for
>   * the specific device. It is for DPDK internal user only. User
>   * application should not call it directly.
> --
> 2.7.4



More information about the dev mailing list