net/virtio-user: drop attribute "unused" for memory callback

Message ID 20191119071224.25816-1-tiwei.bie@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/virtio-user: drop attribute "unused" for memory callback |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/Intel-compilation success Compilation OK

Commit Message

Tiwei Bie Nov. 19, 2019, 7:12 a.m. UTC
  The "addr" param has been used since the event callbacks are enabled
for external memory. So the "__rte_unused" should be dropped.

Besides, slightly refine the coding style by consistently assuming
tabs are 8 characters.

Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Maxime Coquelin Nov. 21, 2019, 12:55 a.m. UTC | #1
On 11/19/19 8:12 AM, Tiwei Bie wrote:
> The "addr" param has been used since the event callbacks are enabled
> for external memory. So the "__rte_unused" should be dropped.
> 
> Besides, slightly refine the coding style by consistently assuming
> tabs are 8 characters.
> 
> Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>  drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> index a4400e772..ea016e85d 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> @@ -315,9 +315,9 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
>  
>  static void
>  virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused,
> -						 const void *addr __rte_unused,
> -						 size_t len __rte_unused,
> -						 void *arg)
> +			 const void *addr,
> +			 size_t len __rte_unused,
> +			 void *arg)
>  {
>  	struct virtio_user_dev *dev = arg;
>  	struct rte_memseg_list *msl;
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

David or Ferruh, could you pick it directly?
I don't plan to prepare a branch as I have this single patch for next
-rc.

Thanks,
Maxime
  
Ferruh Yigit Nov. 21, 2019, 8:58 a.m. UTC | #2
On 11/21/2019 12:55 AM, Maxime Coquelin wrote:
> 
> 
> On 11/19/19 8:12 AM, Tiwei Bie wrote:
>> The "addr" param has been used since the event callbacks are enabled
>> for external memory. So the "__rte_unused" should be dropped.
>>
>> Besides, slightly refine the coding style by consistently assuming
>> tabs are 8 characters.
>>
>> Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
>> ---
>>  drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
>> index a4400e772..ea016e85d 100644
>> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
>> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
>> @@ -315,9 +315,9 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
>>  
>>  static void
>>  virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused,
>> -						 const void *addr __rte_unused,
>> -						 size_t len __rte_unused,
>> -						 void *arg)
>> +			 const void *addr,
>> +			 size_t len __rte_unused,
>> +			 void *arg)
>>  {
>>  	struct virtio_user_dev *dev = arg;
>>  	struct rte_memseg_list *msl;
>>
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 
> David or Ferruh, could you pick it directly?
> I don't plan to prepare a branch as I have this single patch for next
> -rc.

I can get it, but can you please confirm that it is safe to go to rc4, since
already missed rc3?
Also can you please give your review/ack if you already reviewed.
  
Anatoly Burakov Nov. 21, 2019, 12:09 p.m. UTC | #3
On 21-Nov-19 8:58 AM, Ferruh Yigit wrote:
> On 11/21/2019 12:55 AM, Maxime Coquelin wrote:
>>
>>
>> On 11/19/19 8:12 AM, Tiwei Bie wrote:
>>> The "addr" param has been used since the event callbacks are enabled
>>> for external memory. So the "__rte_unused" should be dropped.
>>>
>>> Besides, slightly refine the coding style by consistently assuming
>>> tabs are 8 characters.
>>>
>>> Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
>>> ---
>>>   drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 +++---
>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
>>> index a4400e772..ea016e85d 100644
>>> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
>>> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
>>> @@ -315,9 +315,9 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
>>>   
>>>   static void
>>>   virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused,
>>> -						 const void *addr __rte_unused,
>>> -						 size_t len __rte_unused,
>>> -						 void *arg)
>>> +			 const void *addr,
>>> +			 size_t len __rte_unused,
>>> +			 void *arg)
>>>   {
>>>   	struct virtio_user_dev *dev = arg;
>>>   	struct rte_memseg_list *msl;
>>>
>>
>> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>>
>> David or Ferruh, could you pick it directly?
>> I don't plan to prepare a branch as I have this single patch for next
>> -rc.
> 
> I can get it, but can you please confirm that it is safe to go to rc4, since
> already missed rc3?
> Also can you please give your review/ack if you already reviewed.
> 

I don't think there's anything unsafe about removing __rte_unused 
parameter :) The code itself hasn't changed.
  
Ferruh Yigit Nov. 21, 2019, 1:04 p.m. UTC | #4
On 11/21/2019 12:09 PM, Burakov, Anatoly wrote:
> On 21-Nov-19 8:58 AM, Ferruh Yigit wrote:
>> On 11/21/2019 12:55 AM, Maxime Coquelin wrote:
>>>
>>>
>>> On 11/19/19 8:12 AM, Tiwei Bie wrote:
>>>> The "addr" param has been used since the event callbacks are enabled
>>>> for external memory. So the "__rte_unused" should be dropped.
>>>>
>>>> Besides, slightly refine the coding style by consistently assuming
>>>> tabs are 8 characters.
>>>>
>>>> Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory")
>>>> Cc: stable@dpdk.org
>>>>
>>>> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
>>>> ---
>>>>   drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 +++---
>>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
>>>> index a4400e772..ea016e85d 100644
>>>> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
>>>> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
>>>> @@ -315,9 +315,9 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
>>>>   
>>>>   static void
>>>>   virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused,
>>>> -						 const void *addr __rte_unused,
>>>> -						 size_t len __rte_unused,
>>>> -						 void *arg)
>>>> +			 const void *addr,
>>>> +			 size_t len __rte_unused,
>>>> +			 void *arg)
>>>>   {
>>>>   	struct virtio_user_dev *dev = arg;
>>>>   	struct rte_memseg_list *msl;
>>>>
>>>
>>> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>
>>> David or Ferruh, could you pick it directly?
>>> I don't plan to prepare a branch as I have this single patch for next
>>> -rc.
>>
>> I can get it, but can you please confirm that it is safe to go to rc4, since
>> already missed rc3?
>> Also can you please give your review/ack if you already reviewed.
>>
> 
> I don't think there's anything unsafe about removing __rte_unused 
> parameter :) The code itself hasn't changed.
> 

I haven't checked the patch when I write it, agree it looks pretty safe to proceed.
  
Ferruh Yigit Nov. 21, 2019, 2:29 p.m. UTC | #5
On 11/21/2019 12:55 AM, Maxime Coquelin wrote:
> 
> 
> On 11/19/19 8:12 AM, Tiwei Bie wrote:
>> The "addr" param has been used since the event callbacks are enabled
>> for external memory. So the "__rte_unused" should be dropped.
>>
>> Besides, slightly refine the coding style by consistently assuming
>> tabs are 8 characters.
>>
>> Fixes: f32c7c9de961 ("malloc: enable event callbacks for external memory")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
>> ---
>>  drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
>> index a4400e772..ea016e85d 100644
>> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
>> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
>> @@ -315,9 +315,9 @@ virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
>>  
>>  static void
>>  virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused,
>> -						 const void *addr __rte_unused,
>> -						 size_t len __rte_unused,
>> -						 void *arg)
>> +			 const void *addr,
>> +			 size_t len __rte_unused,
>> +			 void *arg)
>>  {
>>  	struct virtio_user_dev *dev = arg;
>>  	struct rte_memseg_list *msl;
>>
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index a4400e772..ea016e85d 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -315,9 +315,9 @@  virtio_user_fill_intr_handle(struct virtio_user_dev *dev)
 
 static void
 virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused,
-						 const void *addr __rte_unused,
-						 size_t len __rte_unused,
-						 void *arg)
+			 const void *addr,
+			 size_t len __rte_unused,
+			 void *arg)
 {
 	struct virtio_user_dev *dev = arg;
 	struct rte_memseg_list *msl;