[v1,3/5] eal: modify device event callback process func
Checks
Commit Message
This patch modify the device event callback process function name to be
more explicit, and exposure the API from private to public. The drivers
and apps would directly use this API to process device event callback.
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
lib/librte_eal/common/eal_common_dev.c | 5 +++--
lib/librte_eal/common/eal_private.h | 12 ------------
lib/librte_eal/common/include/rte_dev.h | 19 ++++++++++++++++++-
lib/librte_eal/linuxapp/eal/eal_dev.c | 2 +-
lib/librte_ethdev/rte_ethdev.c | 2 +-
5 files changed, 23 insertions(+), 17 deletions(-)
Comments
On 17-Aug-18 11:51 AM, Jeff Guo wrote:
> This patch modify the device event callback process function name to be
> more explicit, and exposure the API from private to public. The drivers
> and apps would directly use this API to process device event callback.
>
> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> ---
<snip>
> -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);
>
> @@ -439,6 +439,23 @@ rte_dev_event_callback_unregister(const char *device_name,
> * @warning
> * @b EXPERIMENTAL: this API may change without prior notice
> *
> + * Internal Executes all the user application registered callbacks for
it probably should say @internal instead of "Internal", with comment
starting on a new line.
On 17-Aug-18 11:51 AM, Jeff Guo wrote:
> This patch modify the device event callback process function name to be
> more explicit, and exposure the API from private to public. The drivers
> and apps would directly use this API to process device event callback.
>
> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> ---
<snip>
> *
> + * 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 __rte_experimental
> +rte_dev_event_callback_process(const char *device_name,
> + enum rte_dev_event_type event);
Also, you've exported it but haven't added it to the .map file.
On 9/26/2018 8:20 PM, Burakov, Anatoly wrote:
> On 17-Aug-18 11:51 AM, Jeff Guo wrote:
>> This patch modify the device event callback process function name to be
>> more explicit, and exposure the API from private to public. The drivers
>> and apps would directly use this API to process device event callback.
>>
>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
>> ---
>
> <snip>
>
>> -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);
>> @@ -439,6 +439,23 @@ rte_dev_event_callback_unregister(const char
>> *device_name,
>> * @warning
>> * @b EXPERIMENTAL: this API may change without prior notice
>> *
>> + * Internal Executes all the user application registered callbacks for
>
> it probably should say @internal instead of "Internal", with comment
> starting on a new line.
>
yes, you are here, and what i want is make it internal.
On 9/26/2018 8:20 PM, Burakov, Anatoly wrote:
> On 17-Aug-18 11:51 AM, Jeff Guo wrote:
>> This patch modify the device event callback process function name to be
>> more explicit, and exposure the API from private to public. The drivers
>> and apps would directly use this API to process device event callback.
>>
>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
>> ---
>
> <snip>
>
>> *
>> + * 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 __rte_experimental
>> +rte_dev_event_callback_process(const char *device_name,
>> + enum rte_dev_event_type event);
>
> Also, you've exported it but haven't added it to the .map file.
>
what i want is make it internal use, so i will modify the typo.
@@ -342,8 +342,9 @@ rte_dev_event_callback_unregister(const char *device_name,
return ret;
}
-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;
@@ -259,18 +259,6 @@ struct rte_bus *rte_bus_find_by_device_name(const char *str);
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
* rte_devargs structure.
@@ -40,7 +40,7 @@ struct rte_dev_event {
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);
@@ -439,6 +439,23 @@ rte_dev_event_callback_unregister(const char *device_name,
* @warning
* @b EXPERIMENTAL: this API may change without prior notice
*
+ * 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 __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
+ *
* Start the device event monitoring.
*
* @return
@@ -270,7 +270,7 @@ dev_uev_handler(__rte_unused void *param)
return;
}
}
- dev_callback_process(uevent.devname, uevent.type);
+ rte_dev_event_callback_process(uevent.devname, uevent.type);
}
}
@@ -4418,7 +4418,7 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da)
}
static void __rte_experimental
-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,
void *arg)
{
struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)arg;