Virtio TX: reverting a small change causing Virtio standard TX broken

Message ID 20200807125731.1287-1-vipul.ashri@oracle.com (mailing list archive)
State Superseded, archived
Delegated to: Chenbo Xia
Headers
Series Virtio TX: reverting a small change causing Virtio standard TX broken |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Vipul Ashri Aug. 7, 2020, 12:57 p.m. UTC
  Virtio Standard TX broken : Reverting a small change added few months back which has caused breakage in Virtio Standard TX path.

During basic ping Tx/Rx testing of net_virtio pmd driver using standard Tx path, We saw TX is broken since anomaly code added by below patch once submitted
http://git.dpdk.org/dpdk/patch/?id=57f90f89458807bccc63425e4b72796870177977
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

Chenbo Xia Aug. 10, 2020, 4:10 a.m. UTC | #1
Hi Vipul,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Vipul Ashri
> Sent: Friday, August 7, 2020 8:58 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] Virtio TX: reverting a small change causing
> Virtio standard TX broken
> 
> Virtio Standard TX broken : Reverting a small change added few months back
> which has caused breakage in Virtio Standard TX path.
> 
> During basic ping Tx/Rx testing of net_virtio pmd driver using standard Tx
> path, We saw TX is broken since anomaly code added by below patch once
> submitted
> http://git.dpdk.org/dpdk/patch/?id=57f90f89458807bccc63425e4b7279687017797
> 7

First, your commit title and commit message have several problems:
1. Title should be: net/virtio: TITLE_OF_YOUR_COMMIT. As your patch is a
fix patch, your title maybe 'fix XXXX'.
2. Title and description too long, should be less or equal than around 75 chars
per line
3. Seems the link you attached is the bad commit you want to fix. Please use
this way to point it out: add 'Fixes: BAD_COMMIT_ID ("BAD_COMMIT_TITLE")' under
the commit msg.

For all above problems, please see previous git log for reference.

And for the patch content, what is the exact issue you met? I've been told that
the deleted lines were for some CI errors. Besides, better keep the '\' aligned.

Also, please cc to related maintainers in your v2 because otherwise it'll be hard
for them to see your patch.(use get-maintainer.sh to know them)

Thanks!
Chenbo

> ---
>  drivers/net/virtio/virtqueue.h | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtqueue.h
> b/drivers/net/virtio/virtqueue.h
> index 105a9c00c..81118d9fb 100644
> --- a/drivers/net/virtio/virtqueue.h
> +++ b/drivers/net/virtio/virtqueue.h
> @@ -607,10 +607,8 @@ virtqueue_notify(struct virtqueue *vq)
> 
>  /* avoid write operation when necessary, to lessen cache issues */
>  #define ASSIGN_UNLESS_EQUAL(var, val) do {	\
> -	typeof(var) var_ = (var);		\
> -	typeof(val) val_ = (val);		\
> -	if ((var_) != (val_))			\
> -		(var_) = (val_);		\
> +	if ((var) != (val))			\
> +		(var) = (val);		\
>  } while (0)
> 
>  #define virtqueue_clear_net_hdr(hdr) do {		\
> --
> 2.28.0.windows.1
  
Chenbo Xia Aug. 11, 2020, 1:39 a.m. UTC | #2
Hi Vipul,

> -----Original Message-----
> From: Vipul Ashri <vipul.ashri@oracle.com>
> Sent: Tuesday, August 11, 2020 4:00 AM
> To: dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; vipul.ashri@oracle.com
> Subject: [PATCH v2] net/virtio: fix 57f90f8("net/virtio: reuse packed ring
> functions")

The title is not right. As I told you,
please put 'Fixes: 57f90f894588 ("net/virtio: reuse packed ring functions")'
between the commit message and your 'Signed-off-by'. Note that the prefix
should be 'Fixes' and the commit id length is 12.

Could you refer to other commit with 'Fixes' to make it right?

> 
> tx packets are not going out and standard tx path is not working due to
> cleanup malfunctioning.

Could you tell me what problem you solved? You just describe the result but
not the root cause.

Thanks!
Chenbo

> 
> Signed-off-by: Vipul Ashri <vipul.ashri@oracle.com>
> ---
>  drivers/net/virtio/virtqueue.h | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtqueue.h
> b/drivers/net/virtio/virtqueue.h
> index 105a9c00c..20c95471e 100644
> --- a/drivers/net/virtio/virtqueue.h
> +++ b/drivers/net/virtio/virtqueue.h
> @@ -607,10 +607,8 @@ virtqueue_notify(struct virtqueue *vq)
> 
>  /* avoid write operation when necessary, to lessen cache issues */
>  #define ASSIGN_UNLESS_EQUAL(var, val) do {	\
> -	typeof(var) var_ = (var);		\
> -	typeof(val) val_ = (val);		\
> -	if ((var_) != (val_))			\
> -		(var_) = (val_);		\
> +	if ((var) != (val))			\
> +		(var) = (val);			\
>  } while (0)
> 
>  #define virtqueue_clear_net_hdr(hdr) do {		\
> --
> 2.28.0.windows.1
  
Chenbo Xia Aug. 14, 2020, 1:25 a.m. UTC | #3
> -----Original Message-----
> From: Vipul Ashri <vipul.ashri@oracle.com>
> Sent: Friday, August 14, 2020 12:22 AM
> To: dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; vipul.ashri@oracle.com;
> edwin.leung@oracle.com; stable@dpdk.org; Wang, Zhihong
> <zhihong.wang@intel.com>; maxime.coquelin@redhat.com
> Subject: [PATCH v3] net/virtio: fix wrong variable assignment in helper
> macro
> 
> Inside Macro ASSIGN_UNLESS_EQUAL(var, val), assignment to var is always
> failing as assignment done using var_ having local scope only.
> This leads to TX packets not going out and found broken due to cleanup
> malfunctioning. This patch fixes the wrong variable assignment.
> 
> Fixes: 57f90f894588 ("net/virtio: reuse packed ring functions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Vipul Ashri <vipul.ashri@oracle.com>
> ---
>  drivers/net/virtio/virtqueue.h | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtqueue.h
> b/drivers/net/virtio/virtqueue.h
> index 105a9c00c..20c95471e 100644
> --- a/drivers/net/virtio/virtqueue.h
> +++ b/drivers/net/virtio/virtqueue.h
> @@ -607,10 +607,8 @@ virtqueue_notify(struct virtqueue *vq)
> 
>  /* avoid write operation when necessary, to lessen cache issues */
>  #define ASSIGN_UNLESS_EQUAL(var, val) do {	\
> -	typeof(var) var_ = (var);		\
> -	typeof(val) val_ = (val);		\
> -	if ((var_) != (val_))			\
> -		(var_) = (val_);		\
> +	if ((var) != (val))			\
> +		(var) = (val);			\
>  } while (0)
> 
>  #define virtqueue_clear_net_hdr(hdr) do {		\
> --
> 2.28.0.windows.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
  
Vipul Ashri Aug. 14, 2020, 5:23 a.m. UTC | #4
Hi All

I tried twice uploading this same patch but it is still not listed under http://patches.dpdk.org/project/dpdk/list/.
Please let me know if I am missing something and required to do some additional steps to submit my patch.

Thanks to Xia  for reviewing this code!

Regards
Vipul

-----Original Message-----
From: Xia, Chenbo [mailto:chenbo.xia@intel.com] 
Sent: Friday, 14 August, 2020 6:56
To: Vipul Ashri <vipul.ashri@oracle.com>; dev@dpdk.org
Cc: Edwin Leung <edwin.leung@oracle.com>; stable@dpdk.org; Wang, Zhihong <zhihong.wang@intel.com>; maxime.coquelin@redhat.com
Subject: RE: [PATCH v3] net/virtio: fix wrong variable assignment in helper macro


> -----Original Message-----
> From: Vipul Ashri <vipul.ashri@oracle.com>
> Sent: Friday, August 14, 2020 12:22 AM
> To: dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; vipul.ashri@oracle.com; 
> edwin.leung@oracle.com; stable@dpdk.org; Wang, Zhihong 
> <zhihong.wang@intel.com>; maxime.coquelin@redhat.com
> Subject: [PATCH v3] net/virtio: fix wrong variable assignment in 
> helper macro
> 
> Inside Macro ASSIGN_UNLESS_EQUAL(var, val), assignment to var is 
> always failing as assignment done using var_ having local scope only.
> This leads to TX packets not going out and found broken due to cleanup 
> malfunctioning. This patch fixes the wrong variable assignment.
> 
> Fixes: 57f90f894588 ("net/virtio: reuse packed ring functions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Vipul Ashri <vipul.ashri@oracle.com>
> ---
>  drivers/net/virtio/virtqueue.h | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtqueue.h 
> b/drivers/net/virtio/virtqueue.h index 105a9c00c..20c95471e 100644
> --- a/drivers/net/virtio/virtqueue.h
> +++ b/drivers/net/virtio/virtqueue.h
> @@ -607,10 +607,8 @@ virtqueue_notify(struct virtqueue *vq)
> 
>  /* avoid write operation when necessary, to lessen cache issues */
>  #define ASSIGN_UNLESS_EQUAL(var, val) do {	\
> -	typeof(var) var_ = (var);		\
> -	typeof(val) val_ = (val);		\
> -	if ((var_) != (val_))			\
> -		(var_) = (val_);		\
> +	if ((var) != (val))			\
> +		(var) = (val);			\
>  } while (0)
> 
>  #define virtqueue_clear_net_hdr(hdr) do {		\
> --
> 2.28.0.windows.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
  
Ferruh Yigit Aug. 18, 2020, 6:45 p.m. UTC | #5
On 8/14/2020 6:23 AM, Vipul Ashri wrote:
> Hi All
> 
> I tried twice uploading this same patch but it is still not listed under http://patches.dpdk.org/project/dpdk/list/.
> Please let me know if I am missing something and required to do some additional steps to submit my patch.

Mail list is moderated, only subscribed members can post.
Your patches were hold in the administration queue because of that, I have
released them and cleaned up the patchwork (since there were double of some
versions) and only left one copy of v3, please check if that is the correct one:
https://patches.dpdk.org/project/dpdk/list/?submitter=1867

> 
> Thanks to Xia  for reviewing this code!
> 
> Regards
> Vipul
> 
> -----Original Message-----
> From: Xia, Chenbo [mailto:chenbo.xia@intel.com] 
> Sent: Friday, 14 August, 2020 6:56
> To: Vipul Ashri <vipul.ashri@oracle.com>; dev@dpdk.org
> Cc: Edwin Leung <edwin.leung@oracle.com>; stable@dpdk.org; Wang, Zhihong <zhihong.wang@intel.com>; maxime.coquelin@redhat.com
> Subject: RE: [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
> 
> 
>> -----Original Message-----
>> From: Vipul Ashri <vipul.ashri@oracle.com>
>> Sent: Friday, August 14, 2020 12:22 AM
>> To: dev@dpdk.org
>> Cc: Xia, Chenbo <chenbo.xia@intel.com>; vipul.ashri@oracle.com; 
>> edwin.leung@oracle.com; stable@dpdk.org; Wang, Zhihong 
>> <zhihong.wang@intel.com>; maxime.coquelin@redhat.com
>> Subject: [PATCH v3] net/virtio: fix wrong variable assignment in 
>> helper macro
>>
>> Inside Macro ASSIGN_UNLESS_EQUAL(var, val), assignment to var is 
>> always failing as assignment done using var_ having local scope only.
>> This leads to TX packets not going out and found broken due to cleanup 
>> malfunctioning. This patch fixes the wrong variable assignment.
>>
>> Fixes: 57f90f894588 ("net/virtio: reuse packed ring functions")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Vipul Ashri <vipul.ashri@oracle.com>
>> ---
>>  drivers/net/virtio/virtqueue.h | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/virtio/virtqueue.h 
>> b/drivers/net/virtio/virtqueue.h index 105a9c00c..20c95471e 100644
>> --- a/drivers/net/virtio/virtqueue.h
>> +++ b/drivers/net/virtio/virtqueue.h
>> @@ -607,10 +607,8 @@ virtqueue_notify(struct virtqueue *vq)
>>
>>  /* avoid write operation when necessary, to lessen cache issues */
>>  #define ASSIGN_UNLESS_EQUAL(var, val) do {	\
>> -	typeof(var) var_ = (var);		\
>> -	typeof(val) val_ = (val);		\
>> -	if ((var_) != (val_))			\
>> -		(var_) = (val_);		\
>> +	if ((var) != (val))			\
>> +		(var) = (val);			\
>>  } while (0)
>>
>>  #define virtqueue_clear_net_hdr(hdr) do {		\
>> --
>> 2.28.0.windows.1
> 
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
>
  
Vipul Ashri Aug. 18, 2020, 8:46 p.m. UTC | #6
Hi All

This patch needs to get reviewed by all available reviewers as link came visible now.

@Xia Chenbo, As you have already reviewed so here I request you to share your review vote again and Ack if possible.

@Ferruh, Below link is correct patch, I appreciate and thank you very much for your help.

Patch Link:
https://urldefense.com/v3/__https://patches.dpdk.org/project/dpdk/list/?submitter=1867__;!!GqivPVa7Brio!JuQy9aSMyTDxpgEERG6JThvjCeZ0vbjYktEIDtU-JSHQalUpEoAp3u4diGxyy98kmw$


Regards
Vipul

-----Original Message-----
From: Ferruh Yigit [mailto:ferruh.yigit@intel.com] 
Sent: Wednesday, 19 August, 2020 0:15
To: Vipul Ashri <vipul.ashri@oracle.com>; Xia, Chenbo <chenbo.xia@intel.com>; dev@dpdk.org; stable@dpdk.org; Wang, Zhihong <zhihong.wang@intel.com>; maxime.coquelin@redhat.com
Cc: Edwin Leung <edwin.leung@oracle.com>
Subject: Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

On 8/14/2020 6:23 AM, Vipul Ashri wrote:
> Hi All
> 
> I tried twice uploading this same patch but it is still not listed under https://urldefense.com/v3/__http://patches.dpdk.org/project/dpdk/list/__;!!GqivPVa7Brio!JuQy9aSMyTDxpgEERG6JThvjCeZ0vbjYktEIDtU-JSHQalUpEoAp3u4diGy8g7AhJA$ .
> Please let me know if I am missing something and required to do some additional steps to submit my patch.

Mail list is moderated, only subscribed members can post.
Your patches were hold in the administration queue because of that, I have released them and cleaned up the patchwork (since there were double of some
versions) and only left one copy of v3, please check if that is the correct one:
https://urldefense.com/v3/__https://patches.dpdk.org/project/dpdk/list/?submitter=1867__;!!GqivPVa7Brio!JuQy9aSMyTDxpgEERG6JThvjCeZ0vbjYktEIDtU-JSHQalUpEoAp3u4diGxyy98kmw$ 

> 
> Thanks to Xia  for reviewing this code!
> 
> Regards
> Vipul
> 
> -----Original Message-----
> From: Xia, Chenbo [mailto:chenbo.xia@intel.com]
> Sent: Friday, 14 August, 2020 6:56
> To: Vipul Ashri <vipul.ashri@oracle.com>; dev@dpdk.org
> Cc: Edwin Leung <edwin.leung@oracle.com>; stable@dpdk.org; Wang, 
> Zhihong <zhihong.wang@intel.com>; maxime.coquelin@redhat.com
> Subject: RE: [PATCH v3] net/virtio: fix wrong variable assignment in 
> helper macro
> 
> 
>> -----Original Message-----
>> From: Vipul Ashri <vipul.ashri@oracle.com>
>> Sent: Friday, August 14, 2020 12:22 AM
>> To: dev@dpdk.org
>> Cc: Xia, Chenbo <chenbo.xia@intel.com>; vipul.ashri@oracle.com; 
>> edwin.leung@oracle.com; stable@dpdk.org; Wang, Zhihong 
>> <zhihong.wang@intel.com>; maxime.coquelin@redhat.com
>> Subject: [PATCH v3] net/virtio: fix wrong variable assignment in 
>> helper macro
>>
>> Inside Macro ASSIGN_UNLESS_EQUAL(var, val), assignment to var is 
>> always failing as assignment done using var_ having local scope only.
>> This leads to TX packets not going out and found broken due to 
>> cleanup malfunctioning. This patch fixes the wrong variable assignment.
>>
>> Fixes: 57f90f894588 ("net/virtio: reuse packed ring functions")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Vipul Ashri <vipul.ashri@oracle.com>
>> ---
>>  drivers/net/virtio/virtqueue.h | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/virtio/virtqueue.h 
>> b/drivers/net/virtio/virtqueue.h index 105a9c00c..20c95471e 100644
>> --- a/drivers/net/virtio/virtqueue.h
>> +++ b/drivers/net/virtio/virtqueue.h
>> @@ -607,10 +607,8 @@ virtqueue_notify(struct virtqueue *vq)
>>
>>  /* avoid write operation when necessary, to lessen cache issues */
>>  #define ASSIGN_UNLESS_EQUAL(var, val) do {	\
>> -	typeof(var) var_ = (var);		\
>> -	typeof(val) val_ = (val);		\
>> -	if ((var_) != (val_))			\
>> -		(var_) = (val_);		\
>> +	if ((var) != (val))			\
>> +		(var) = (val);			\
>>  } while (0)
>>
>>  #define virtqueue_clear_net_hdr(hdr) do {		\
>> --
>> 2.28.0.windows.1
> 
> Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
>
  

Patch

diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 105a9c00c..81118d9fb 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -607,10 +607,8 @@  virtqueue_notify(struct virtqueue *vq)
 
 /* avoid write operation when necessary, to lessen cache issues */
 #define ASSIGN_UNLESS_EQUAL(var, val) do {	\
-	typeof(var) var_ = (var);		\
-	typeof(val) val_ = (val);		\
-	if ((var_) != (val_))			\
-		(var_) = (val_);		\
+	if ((var) != (val))			\
+		(var) = (val);		\
 } while (0)
 
 #define virtqueue_clear_net_hdr(hdr) do {		\