[dpdk-dev] [PATCH V10 1/2] eal: add uevent monitor api and callback func
Thomas Monjalon
thomas at monjalon.net
Mon Jan 15 00:16:26 CET 2018
Hi,
11/01/2018 15:05, Jeff Guo:
> +/* A genaral callback for all registerd devices */
Typos: genaral, registerd
So the callback is only for registered devices?
What about hotplugged devices?
> +/**
> + * It registers the callback for the specific event. Multiple
> + * callbacks cal be registered at the same time.
> + * @param event
> + * The device event type.
> + * @param cb_fn
> + * callback address.
> + * @param cb_arg
> + * address of parameter for callback.
> + *
> + * @return
> + * - On success, zero.
> + * - On failure, a negative value.
> + */
> +int rte_dev_callback_register(char *dev_name,
> + rte_dev_event_cb_fn cb_fn, void *cb_arg);
> +
> +/**
> + * It unregisters the callback according to the specified event.
> + *
> + * @param event
> + * The event type which corresponding to the callback.
> + * @param cb_fn
> + * callback address.
> + * address of parameter for callback, (void *)-1 means to remove all
> + * registered which has the same callback address.
> + *
> + * @return
> + * - On success, return the number of callback entities removed.
> + * - On failure, a negative value.
> + */
> +int rte_dev_callback_unregister(char *dev_name,
> + rte_dev_event_cb_fn cb_fn, void *cb_arg);
These new functions should be tagged as experimental.
> +/**
> + * Start the device event monitoring.
> + *
> + * @param none
> + * @return
> + * - On success, zero.
> + * - On failure, a negative value.
> + */
> +int
> +rte_dev_evt_mntr_start(void);
Should be experimental too, as every new public functions.
Please avoid shortening function name too much.
rte_dev_event_monitor_start is more pleasant to read.
More information about the dev
mailing list