This patch modify the device event callback process function name to be
more explicit, change the variable to be const. And more, because not only
eal device helper will use the callback, but also vfio bus will use the
callback to handle hot-unplug, so exposure the API out from private eal.
The bus drivers and eal device would directly use this API to process
device event callback.
Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
static int eth_event_callback(portid_t port_id,
enum rte_eth_event_type type,
void *param, void *ret_param);
static int eth_event_callback(portid_t port_id,
enum rte_eth_event_type type,
void *param, void *ret_param);
-static void eth_dev_event_callback(char *device_name,
+static void eth_dev_event_callback(const char *device_name,
enum rte_dev_event_type type,
void *param);
enum rte_dev_event_type type,
void *param);
/* This function is used by the interrupt thread */
static void
/* This function is used by the interrupt thread */
static void
-eth_dev_event_callback(char *device_name, enum rte_dev_event_type type,
+eth_dev_event_callback(const char *device_name, enum rte_dev_event_type type,
__rte_unused void *arg)
{
uint16_t port_id;
__rte_unused void *arg)
{
uint16_t port_id;
RTE_LOG(ERR, EAL, "Device event is not supported for FreeBSD\n");
return -1;
}
RTE_LOG(ERR, EAL, "Device event is not supported for FreeBSD\n");
return -1;
}
+
+void __rte_experimental
+rte_dev_event_callback_process(const char *device_name,
+ enum rte_dev_event_type event)
+{
+ RTE_LOG(ERR, EAL,
+ "Device event callback process is not supported for FreeBSD.\n");
+}
-void
-dev_callback_process(char *device_name, enum rte_dev_event_type event)
+void __rte_experimental
+rte_dev_event_callback_process(const char *device_name,
+ enum rte_dev_event_type event)
{
struct dev_event_callback *cb_lst;
{
struct dev_event_callback *cb_lst;
int rte_mp_channel_init(void);
int rte_mp_channel_init(void);
-/**
- * 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.
- *
- * @param device_name
- * The device name.
- * @param event
- * the device event type.
- */
-void dev_callback_process(char *device_name, enum rte_dev_event_type event);
-
/**
* @internal
* Parse a device string and store its information in an
/**
* @internal
* Parse a device string and store its information in an
char *devname; /**< device name */
};
char *devname; /**< device name */
};
-typedef void (*rte_dev_event_cb_fn)(char *device_name,
+typedef void (*rte_dev_event_cb_fn)(const char *device_name,
enum rte_dev_event_type event,
void *cb_arg);
enum rte_dev_event_type event,
void *cb_arg);
rte_dev_event_cb_fn cb_fn,
void *cb_arg);
rte_dev_event_cb_fn cb_fn,
void *cb_arg);
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Executes all the user application registered callbacks for
+ * the specific device.
+ *
+ * @param device_name
+ * The device name.
+ * @param event
+ * the device event type.
+ */
+void __rte_experimental
+rte_dev_event_callback_process(const char *device_name,
+ enum rte_dev_event_type event);
+
/**
* @warning
* @b EXPERIMENTAL: this API may change without prior notice
/**
* @warning
* @b EXPERIMENTAL: this API may change without prior notice
- dev_callback_process(uevent.devname, uevent.type);
+ rte_dev_event_callback_process(uevent.devname, uevent.type);
rte_class_register;
rte_class_unregister;
rte_ctrl_thread_create;
rte_class_register;
rte_class_unregister;
rte_ctrl_thread_create;
+ rte_dev_event_callback_process;
rte_dev_event_callback_register;
rte_dev_event_callback_unregister;
rte_dev_event_monitor_start;
rte_dev_event_callback_register;
rte_dev_event_callback_unregister;
rte_dev_event_monitor_start;