[v1,2/5] eal: add a new req event to device event

Message ID 1534503091-31910-3-git-send-email-jia.guo@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Enable hotplug in vfio |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Guo, Jia Aug. 17, 2018, 10:51 a.m. UTC
  Add a new req event in eal device event for vfio hotplug. When the req
request send from the vfio kernel module be detected, vfio userpace
driver could use this event to notify the app to handler it.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
 lib/librte_eal/common/include/rte_dev.h | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Andrew Rybchenko Aug. 20, 2018, 10:37 a.m. UTC | #1
On 17.08.2018 13:51, Jeff Guo wrote:
> Add a new req event in eal device event for vfio hotplug. When the req
> request send from the vfio kernel module be detected, vfio userpace
> driver could use this event to notify the app to handler it.
>
> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> ---
>   lib/librte_eal/common/include/rte_dev.h | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
> index ff580a0..0324c84 100644
> --- a/lib/librte_eal/common/include/rte_dev.h
> +++ b/lib/librte_eal/common/include/rte_dev.h
> @@ -30,6 +30,7 @@ extern "C" {
>   enum rte_dev_event_type {
>   	RTE_DEV_EVENT_ADD,	/**< device being added */
>   	RTE_DEV_EVENT_REMOVE,	/**< device being removed */
> +	RTE_DEV_EVENT_REQ,	/**< device being removed */

Comment is the copy of previous one.

>   	RTE_DEV_EVENT_MAX	/**< max value of this enum */
>   };
>
  
Guo, Jia Aug. 21, 2018, 6:56 a.m. UTC | #2
hi, andrew


On 8/20/2018 6:37 PM, Andrew Rybchenko wrote:
> On 17.08.2018 13:51, Jeff Guo wrote:
>> Add a new req event in eal device event for vfio hotplug. When the req
>> request send from the vfio kernel module be detected, vfio userpace
>> driver could use this event to notify the app to handler it.
>>
>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
>> ---
>>   lib/librte_eal/common/include/rte_dev.h | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/lib/librte_eal/common/include/rte_dev.h 
>> b/lib/librte_eal/common/include/rte_dev.h
>> index ff580a0..0324c84 100644
>> --- a/lib/librte_eal/common/include/rte_dev.h
>> +++ b/lib/librte_eal/common/include/rte_dev.h
>> @@ -30,6 +30,7 @@ extern "C" {
>>   enum rte_dev_event_type {
>>       RTE_DEV_EVENT_ADD,    /**< device being added */
>>       RTE_DEV_EVENT_REMOVE,    /**< device being removed */
>> +    RTE_DEV_EVENT_REQ,    /**< device being removed */
>
> Comment is the copy of previous one.
>

You are right here, even we process these type in the same way but 
should be considered it as the different type if we exactly want to add 
new one.
so base on the interpret from the vfio kernel driver, this req event is 
used to require the user space to release the device resources, so it 
should be
interpret it by "device release request". If you object and have other 
better idea, let me know.

>>       RTE_DEV_EVENT_MAX    /**< max value of this enum */
>>   };
>
  
Andrew Rybchenko Aug. 21, 2018, 7:20 a.m. UTC | #3
On 21.08.2018 09:56, Jeff Guo wrote:
> hi, andrew
>
>
> On 8/20/2018 6:37 PM, Andrew Rybchenko wrote:
>> On 17.08.2018 13:51, Jeff Guo wrote:
>>> Add a new req event in eal device event for vfio hotplug. When the req
>>> request send from the vfio kernel module be detected, vfio userpace
>>> driver could use this event to notify the app to handler it.
>>>
>>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
>>> ---
>>>   lib/librte_eal/common/include/rte_dev.h | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/lib/librte_eal/common/include/rte_dev.h 
>>> b/lib/librte_eal/common/include/rte_dev.h
>>> index ff580a0..0324c84 100644
>>> --- a/lib/librte_eal/common/include/rte_dev.h
>>> +++ b/lib/librte_eal/common/include/rte_dev.h
>>> @@ -30,6 +30,7 @@ extern "C" {
>>>   enum rte_dev_event_type {
>>>       RTE_DEV_EVENT_ADD,    /**< device being added */
>>>       RTE_DEV_EVENT_REMOVE,    /**< device being removed */
>>> +    RTE_DEV_EVENT_REQ,    /**< device being removed */
>>
>> Comment is the copy of previous one.
>>
>
> You are right here, even we process these type in the same way but 
> should be considered it as the different type if we exactly want to 
> add new one.
> so base on the interpret from the vfio kernel driver, this req event 
> is used to require the user space to release the device resources, so 
> it should be
> interpret it by "device release request". If you object and have other 
> better idea, let me know.


If so, may be it should be RTE_DEV_EVENT_RELEASE_REQ, since just _REQ is 
really misleading.

>
>>>       RTE_DEV_EVENT_MAX    /**< max value of this enum */
>>>   };
>>
  
Guo, Jia Aug. 21, 2018, 7:37 a.m. UTC | #4
On 8/21/2018 3:20 PM, Andrew Rybchenko wrote:
> On 21.08.2018 09:56, Jeff Guo wrote:
>> hi, andrew
>>
>>
>> On 8/20/2018 6:37 PM, Andrew Rybchenko wrote:
>>> On 17.08.2018 13:51, Jeff Guo wrote:
>>>> Add a new req event in eal device event for vfio hotplug. When the req
>>>> request send from the vfio kernel module be detected, vfio userpace
>>>> driver could use this event to notify the app to handler it.
>>>>
>>>> Signed-off-by: Jeff Guo <jia.guo@intel.com>
>>>> ---
>>>>   lib/librte_eal/common/include/rte_dev.h | 1 +
>>>>   1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/lib/librte_eal/common/include/rte_dev.h 
>>>> b/lib/librte_eal/common/include/rte_dev.h
>>>> index ff580a0..0324c84 100644
>>>> --- a/lib/librte_eal/common/include/rte_dev.h
>>>> +++ b/lib/librte_eal/common/include/rte_dev.h
>>>> @@ -30,6 +30,7 @@ extern "C" {
>>>>   enum rte_dev_event_type {
>>>>       RTE_DEV_EVENT_ADD,    /**< device being added */
>>>>       RTE_DEV_EVENT_REMOVE,    /**< device being removed */
>>>> +    RTE_DEV_EVENT_REQ,    /**< device being removed */
>>>
>>> Comment is the copy of previous one.
>>>
>>
>> You are right here, even we process these type in the same way but 
>> should be considered it as the different type if we exactly want to 
>> add new one.
>> so base on the interpret from the vfio kernel driver, this req event 
>> is used to require the user space to release the device resources, so 
>> it should be
>> interpret it by "device release request". If you object and have 
>> other better idea, let me know.
>
>
> If so, may be it should be RTE_DEV_EVENT_RELEASE_REQ, since just _REQ 
> is really misleading.
>

accept it , sounds better, thanks.

>>
>>>>       RTE_DEV_EVENT_MAX    /**< max value of this enum */
>>>>   };
>>>
>
  

Patch

diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h
index ff580a0..0324c84 100644
--- a/lib/librte_eal/common/include/rte_dev.h
+++ b/lib/librte_eal/common/include/rte_dev.h
@@ -30,6 +30,7 @@  extern "C" {
 enum rte_dev_event_type {
 	RTE_DEV_EVENT_ADD,	/**< device being added */
 	RTE_DEV_EVENT_REMOVE,	/**< device being removed */
+	RTE_DEV_EVENT_REQ,	/**< device being removed */
 	RTE_DEV_EVENT_MAX	/**< max value of this enum */
 };