DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] Virtio TX: reverting a small change causing Virtio standard TX broken
@ 2020-08-07 12:57 Vipul Ashri
  2020-08-09 13:28 ` Vipul Ashri
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Vipul Ashri @ 2020-08-07 12:57 UTC (permalink / raw)
  To: dev

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(-)

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH] Virtio TX: reverting a small change causing Virtio standard TX broken
  2020-08-07 12:57 [dpdk-dev] [PATCH] Virtio TX: reverting a small change causing Virtio standard TX broken Vipul Ashri
@ 2020-08-09 13:28 ` Vipul Ashri
  2020-08-10  4:10 ` Xia, Chenbo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Vipul Ashri @ 2020-08-09 13:28 UTC (permalink / raw)
  To: dev; +Cc: vipul.ashri

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

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..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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH] Virtio TX: reverting a small change causing Virtio standard TX broken
  2020-08-07 12:57 [dpdk-dev] [PATCH] Virtio TX: reverting a small change causing Virtio standard TX broken Vipul Ashri
  2020-08-09 13:28 ` Vipul Ashri
@ 2020-08-10  4:10 ` Xia, Chenbo
  2020-08-10 19:59 ` [dpdk-dev] [PATCH v2] net/virtio: fix 57f90f8("net/virtio: reuse packed ring functions") Vipul Ashri
  2020-08-13 16:22 ` [dpdk-dev] [PATCH v3] " Vipul Ashri
  3 siblings, 0 replies; 23+ messages in thread
From: Xia, Chenbo @ 2020-08-10  4:10 UTC (permalink / raw)
  To: Vipul Ashri, dev

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v2] net/virtio: fix 57f90f8("net/virtio: reuse packed ring functions")
  2020-08-07 12:57 [dpdk-dev] [PATCH] Virtio TX: reverting a small change causing Virtio standard TX broken Vipul Ashri
  2020-08-09 13:28 ` Vipul Ashri
  2020-08-10  4:10 ` Xia, Chenbo
@ 2020-08-10 19:59 ` Vipul Ashri
  2020-08-11  1:39   ` Xia, Chenbo
  2020-08-12  9:23   ` [dpdk-dev] [PATCH v2] Fixes: 57f90f894588("net/virtio: " Vipul Ashri
  2020-08-13 16:22 ` [dpdk-dev] [PATCH v3] " Vipul Ashri
  3 siblings, 2 replies; 23+ messages in thread
From: Vipul Ashri @ 2020-08-10 19:59 UTC (permalink / raw)
  To: dev; +Cc: chenbo.xia, vipul.ashri

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

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/virtio: fix 57f90f8("net/virtio: reuse packed ring functions")
  2020-08-10 19:59 ` [dpdk-dev] [PATCH v2] net/virtio: fix 57f90f8("net/virtio: reuse packed ring functions") Vipul Ashri
@ 2020-08-11  1:39   ` Xia, Chenbo
  2020-08-12  9:23   ` [dpdk-dev] [PATCH v2] Fixes: 57f90f894588("net/virtio: " Vipul Ashri
  1 sibling, 0 replies; 23+ messages in thread
From: Xia, Chenbo @ 2020-08-11  1:39 UTC (permalink / raw)
  To: Vipul Ashri, dev

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")
  2020-08-10 19:59 ` [dpdk-dev] [PATCH v2] net/virtio: fix 57f90f8("net/virtio: reuse packed ring functions") Vipul Ashri
  2020-08-11  1:39   ` Xia, Chenbo
@ 2020-08-12  9:23   ` " Vipul Ashri
  2020-08-12 12:00     ` Xia, Chenbo
                       ` (2 more replies)
  1 sibling, 3 replies; 23+ messages in thread
From: Vipul Ashri @ 2020-08-12  9:23 UTC (permalink / raw)
  To: dev; +Cc: chenbo.xia, vipul.ashri, edwin.leung

Problem - Standard Tx packets are not going out and found broken
 due to cleanup malfunctioning whereever below mentioned macro is
 used.

RootCause - Here inside Macro 'ASSIGN_UNLESS_EQUAL(var, val)'
 assignment to 'var' argument passed is always failing as assignment
 done using 'var_' having local scope only.

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")
  2020-08-12  9:23   ` [dpdk-dev] [PATCH v2] Fixes: 57f90f894588("net/virtio: " Vipul Ashri
@ 2020-08-12 12:00     ` Xia, Chenbo
  2020-08-13  7:23       ` [dpdk-dev] FW: " Vipul Ashri
  2020-08-13  7:25     ` [dpdk-dev] [PATCH v2] net/virtio: fix wrong variable assignment in helper macro Vipul Ashri
  2020-08-13  7:28     ` [dpdk-dev] [PATCH v3] " Vipul Ashri
  2 siblings, 1 reply; 23+ messages in thread
From: Xia, Chenbo @ 2020-08-12 12:00 UTC (permalink / raw)
  To: Vipul Ashri, dev; +Cc: edwin.leung

Hi Vipul,

> -----Original Message-----
> From: Vipul Ashri <vipul.ashri@oracle.com>
> Sent: Wednesday, August 12, 2020 5:23 PM
> To: dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; vipul.ashri@oracle.com;
> edwin.leung@oracle.com
> Subject: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring
> functions")
> 
> Problem - Standard Tx packets are not going out and found broken
>  due to cleanup malfunctioning whereever below mentioned macro is
>  used.
> 
> RootCause - Here inside Macro 'ASSIGN_UNLESS_EQUAL(var, val)'
>  assignment to 'var' argument passed is always failing as assignment
>  done using 'var_' having local scope only.
> 
> Signed-off-by: Vipul Ashri <vipul.ashri@oracle.com>

I understand now. Your patch makes sense. But your commit title/msg is still
wrong. An example commit message should be (you could use this):

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] FW: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")
  2020-08-12 12:00     ` Xia, Chenbo
@ 2020-08-13  7:23       ` " Vipul Ashri
  2020-08-13  7:27         ` chupenghong
  0 siblings, 1 reply; 23+ messages in thread
From: Vipul Ashri @ 2020-08-13  7:23 UTC (permalink / raw)
  To: javin158; +Cc: yong.liu, chenbo.xia, dev

Hi Javin

FYI
http://patches.dpdk.org/patch/75476/
The mentioned fix you are trying to submit is already addressed and in review with Xia chenbo since 10th august.
Hope you can discard your patch as I have already sent the patch to dpdk community.

Regards
Vipul

-----Original Message-----
From: Xia, Chenbo [mailto:chenbo.xia@intel.com] 
Sent: Wednesday, 12 August, 2020 17:31
To: Vipul Ashri <vipul.ashri@oracle.com>; dev@dpdk.org
Cc: Edwin Leung <edwin.leung@oracle.com>
Subject: RE: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")

Hi Vipul,

> -----Original Message-----
> From: Vipul Ashri <vipul.ashri@oracle.com>
> Sent: Wednesday, August 12, 2020 5:23 PM
> To: dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; vipul.ashri@oracle.com; 
> edwin.leung@oracle.com
> Subject: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring
> functions")
> 
> Problem - Standard Tx packets are not going out and found broken  due 
> to cleanup malfunctioning whereever below mentioned macro is  used.
> 
> RootCause - Here inside Macro 'ASSIGN_UNLESS_EQUAL(var, val)'
>  assignment to 'var' argument passed is always failing as assignment  
> done using 'var_' having local scope only.
> 
> Signed-off-by: Vipul Ashri <vipul.ashri@oracle.com>

I understand now. Your patch makes sense. But your commit title/msg is still wrong. An example commit message should be (you could use this):

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v2] net/virtio: fix wrong variable assignment in helper macro
  2020-08-12  9:23   ` [dpdk-dev] [PATCH v2] Fixes: 57f90f894588("net/virtio: " Vipul Ashri
  2020-08-12 12:00     ` Xia, Chenbo
@ 2020-08-13  7:25     ` Vipul Ashri
  2020-08-13  7:28     ` [dpdk-dev] [PATCH v3] " Vipul Ashri
  2 siblings, 0 replies; 23+ messages in thread
From: Vipul Ashri @ 2020-08-13  7:25 UTC (permalink / raw)
  To: dev; +Cc: chenbo.xia, vipul.ashri, edwin.leung, stable

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] FW: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")
  2020-08-13  7:23       ` [dpdk-dev] FW: " Vipul Ashri
@ 2020-08-13  7:27         ` chupenghong
  0 siblings, 0 replies; 23+ messages in thread
From: chupenghong @ 2020-08-13  7:27 UTC (permalink / raw)
  To: Vipul Ashri; +Cc: yong.liu, chenbo.xia, dev

OK !









At 2020-08-13 15:23:01, "Vipul Ashri" <vipul.ashri@oracle.com> wrote:
>Hi Javin
>
>FYI
>http://patches.dpdk.org/patch/75476/
>The mentioned fix you are trying to submit is already addressed and in review with Xia chenbo since 10th august.
>Hope you can discard your patch as I have already sent the patch to dpdk community.
>
>Regards
>Vipul
>
>-----Original Message-----
>From: Xia, Chenbo [mailto:chenbo.xia@intel.com] 
>Sent: Wednesday, 12 August, 2020 17:31
>To: Vipul Ashri <vipul.ashri@oracle.com>; dev@dpdk.org
>Cc: Edwin Leung <edwin.leung@oracle.com>
>Subject: RE: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")
>
>Hi Vipul,
>
>> -----Original Message-----
>> From: Vipul Ashri <vipul.ashri@oracle.com>
>> Sent: Wednesday, August 12, 2020 5:23 PM
>> To: dev@dpdk.org
>> Cc: Xia, Chenbo <chenbo.xia@intel.com>; vipul.ashri@oracle.com; 
>> edwin.leung@oracle.com
>> Subject: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring
>> functions")
>> 
>> Problem - Standard Tx packets are not going out and found broken  due 
>> to cleanup malfunctioning whereever below mentioned macro is  used.
>> 
>> RootCause - Here inside Macro 'ASSIGN_UNLESS_EQUAL(var, val)'
>>  assignment to 'var' argument passed is always failing as assignment  
>> done using 'var_' having local scope only.
>> 
>> Signed-off-by: Vipul Ashri <vipul.ashri@oracle.com>
>
>I understand now. Your patch makes sense. But your commit title/msg is still wrong. An example commit message should be (you could use this):
>
>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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
  2020-08-12  9:23   ` [dpdk-dev] [PATCH v2] Fixes: 57f90f894588("net/virtio: " Vipul Ashri
  2020-08-12 12:00     ` Xia, Chenbo
  2020-08-13  7:25     ` [dpdk-dev] [PATCH v2] net/virtio: fix wrong variable assignment in helper macro Vipul Ashri
@ 2020-08-13  7:28     ` " Vipul Ashri
  2020-08-13  7:35       ` Xia, Chenbo
                         ` (3 more replies)
  2 siblings, 4 replies; 23+ messages in thread
From: Vipul Ashri @ 2020-08-13  7:28 UTC (permalink / raw)
  To: dev; +Cc: chenbo.xia, vipul.ashri, edwin.leung, stable

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
  2020-08-13  7:28     ` [dpdk-dev] [PATCH v3] " Vipul Ashri
@ 2020-08-13  7:35       ` Xia, Chenbo
  2020-08-19  1:25       ` Xia, Chenbo
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Xia, Chenbo @ 2020-08-13  7:35 UTC (permalink / raw)
  To: Vipul Ashri, dev; +Cc: edwin.leung, stable, Wang, Zhihong, maxime.coquelin

> -----Original Message-----
> From: Vipul Ashri <vipul.ashri@oracle.com>
> Sent: Thursday, August 13, 2020 3:29 PM
> To: dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; vipul.ashri@oracle.com;
> edwin.leung@oracle.com; stable@dpdk.org
> 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

Thanks for the fix!

But please remember to cc all maintainers next time you send a patch.
I add them this time.

For this patch:

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>




^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
  2020-08-07 12:57 [dpdk-dev] [PATCH] Virtio TX: reverting a small change causing Virtio standard TX broken Vipul Ashri
                   ` (2 preceding siblings ...)
  2020-08-10 19:59 ` [dpdk-dev] [PATCH v2] net/virtio: fix 57f90f8("net/virtio: reuse packed ring functions") Vipul Ashri
@ 2020-08-13 16:22 ` " Vipul Ashri
  2020-08-14  1:25   ` Xia, Chenbo
  3 siblings, 1 reply; 23+ messages in thread
From: Vipul Ashri @ 2020-08-13 16:22 UTC (permalink / raw)
  To: dev
  Cc: chenbo.xia, vipul.ashri, edwin.leung, stable, zhihong.wang,
	maxime.coquelin

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
  2020-08-13 16:22 ` [dpdk-dev] [PATCH v3] " Vipul Ashri
@ 2020-08-14  1:25   ` Xia, Chenbo
  2020-08-14  5:23     ` Vipul Ashri
  0 siblings, 1 reply; 23+ messages in thread
From: Xia, Chenbo @ 2020-08-14  1:25 UTC (permalink / raw)
  To: Vipul Ashri, dev; +Cc: edwin.leung, stable, Wang, Zhihong, maxime.coquelin


> -----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>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
  2020-08-14  1:25   ` Xia, Chenbo
@ 2020-08-14  5:23     ` Vipul Ashri
  2020-08-18 18:45       ` Ferruh Yigit
  0 siblings, 1 reply; 23+ messages in thread
From: Vipul Ashri @ 2020-08-14  5:23 UTC (permalink / raw)
  To: Xia, Chenbo, dev, stable, Wang, Zhihong, maxime.coquelin; +Cc: Edwin Leung

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>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
  2020-08-14  5:23     ` Vipul Ashri
@ 2020-08-18 18:45       ` Ferruh Yigit
  2020-08-18 20:46         ` Vipul Ashri
  0 siblings, 1 reply; 23+ messages in thread
From: Ferruh Yigit @ 2020-08-18 18:45 UTC (permalink / raw)
  To: Vipul Ashri, Xia, Chenbo, dev, stable, Wang, Zhihong, maxime.coquelin
  Cc: Edwin Leung

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>
> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
  2020-08-18 18:45       ` Ferruh Yigit
@ 2020-08-18 20:46         ` Vipul Ashri
  0 siblings, 0 replies; 23+ messages in thread
From: Vipul Ashri @ 2020-08-18 20:46 UTC (permalink / raw)
  To: Ferruh Yigit, Xia, Chenbo, dev, stable, Wang, Zhihong, maxime.coquelin

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>
> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
  2020-08-13  7:28     ` [dpdk-dev] [PATCH v3] " Vipul Ashri
  2020-08-13  7:35       ` Xia, Chenbo
@ 2020-08-19  1:25       ` Xia, Chenbo
  2020-09-16  5:57       ` [dpdk-dev] [PATCH v4] " Vipul Ashri
  2020-09-18  9:55       ` [dpdk-dev] [PATCH v5] " Vipul Ashri
  3 siblings, 0 replies; 23+ messages in thread
From: Xia, Chenbo @ 2020-08-19  1:25 UTC (permalink / raw)
  To: Vipul Ashri, dev; +Cc: edwin.leung, stable, Maxime Coquelin, Wang, Zhihong


> -----Original Message-----
> From: Vipul Ashri <vipul.ashri@oracle.com>
> Sent: Thursday, August 13, 2020 3:29 PM
> To: dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; vipul.ashri@oracle.com;
> edwin.leung@oracle.com; stable@dpdk.org
> 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>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v4] net/virtio: fix wrong variable assignment in helper macro
  2020-08-13  7:28     ` [dpdk-dev] [PATCH v3] " Vipul Ashri
  2020-08-13  7:35       ` Xia, Chenbo
  2020-08-19  1:25       ` Xia, Chenbo
@ 2020-09-16  5:57       ` " Vipul Ashri
  2020-09-17 15:54         ` Andrew Rybchenko
  2020-09-18  9:55       ` [dpdk-dev] [PATCH v5] " Vipul Ashri
  3 siblings, 1 reply; 23+ messages in thread
From: Vipul Ashri @ 2020-09-16  5:57 UTC (permalink / raw)
  To: dev
  Cc: chenbo.xia, vipul.ashri, zhihong.wang, maxime.coquelin,
	arybchenko, makarov, stable

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 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 105a9c00c..7f8a3976f 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -607,10 +607,11 @@ 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_);		\
+	typeof(var) *const var_ = &(var);	\
+	typeof(val)  const val_ = (val);	\
+	if (*var_ != val_)			\
+		*var_ = val_;			\
+
 } while (0)
 
 #define virtqueue_clear_net_hdr(hdr) do {		\
-- 
2.28.0.windows.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v4] net/virtio: fix wrong variable assignment in helper macro
  2020-09-16  5:57       ` [dpdk-dev] [PATCH v4] " Vipul Ashri
@ 2020-09-17 15:54         ` Andrew Rybchenko
  0 siblings, 0 replies; 23+ messages in thread
From: Andrew Rybchenko @ 2020-09-17 15:54 UTC (permalink / raw)
  To: Vipul Ashri, dev
  Cc: chenbo.xia, zhihong.wang, maxime.coquelin, makarov, stable

On 9/16/20 8:57 AM, Vipul Ashri wrote:
> 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>

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dpdk-dev] [PATCH v5] net/virtio: fix wrong variable assignment in helper macro
  2020-08-13  7:28     ` [dpdk-dev] [PATCH v3] " Vipul Ashri
                         ` (2 preceding siblings ...)
  2020-09-16  5:57       ` [dpdk-dev] [PATCH v4] " Vipul Ashri
@ 2020-09-18  9:55       ` " Vipul Ashri
  2020-09-18 12:22         ` Maxime Coquelin
  2020-09-18 12:30         ` Maxime Coquelin
  3 siblings, 2 replies; 23+ messages in thread
From: Vipul Ashri @ 2020-09-18  9:55 UTC (permalink / raw)
  To: dev
  Cc: chenbo.xia, vipul.ashri, zhihong.wang, maxime.coquelin,
	arybchenko, makarov, stable

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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 105a9c00c..6ed50648c 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -607,10 +607,10 @@ 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_);		\
+	typeof(var) *const var_ = &(var);	\
+	typeof(val)  const val_ = (val);	\
+	if (*var_ != val_)			\
+		*var_ = val_;			\
 } while (0)
 
 #define virtqueue_clear_net_hdr(hdr) do {		\
-- 
2.28.0.windows.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v5] net/virtio: fix wrong variable assignment in helper macro
  2020-09-18  9:55       ` [dpdk-dev] [PATCH v5] " Vipul Ashri
@ 2020-09-18 12:22         ` Maxime Coquelin
  2020-09-18 12:30         ` Maxime Coquelin
  1 sibling, 0 replies; 23+ messages in thread
From: Maxime Coquelin @ 2020-09-18 12:22 UTC (permalink / raw)
  To: Vipul Ashri, dev; +Cc: chenbo.xia, zhihong.wang, arybchenko, makarov, stable



On 9/18/20 11:55 AM, Vipul Ashri wrote:
> 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 | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
> index 105a9c00c..6ed50648c 100644
> --- a/drivers/net/virtio/virtqueue.h
> +++ b/drivers/net/virtio/virtqueue.h
> @@ -607,10 +607,10 @@ 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_);		\
> +	typeof(var) *const var_ = &(var);	\
> +	typeof(val)  const val_ = (val);	\
> +	if (*var_ != val_)			\
> +		*var_ = val_;			\
>  } while (0)
>  
>  #define virtqueue_clear_net_hdr(hdr) do {		\
> 

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

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dpdk-dev] [PATCH v5] net/virtio: fix wrong variable assignment in helper macro
  2020-09-18  9:55       ` [dpdk-dev] [PATCH v5] " Vipul Ashri
  2020-09-18 12:22         ` Maxime Coquelin
@ 2020-09-18 12:30         ` Maxime Coquelin
  1 sibling, 0 replies; 23+ messages in thread
From: Maxime Coquelin @ 2020-09-18 12:30 UTC (permalink / raw)
  To: Vipul Ashri, dev; +Cc: chenbo.xia, zhihong.wang, arybchenko, makarov, stable



On 9/18/20 11:55 AM, Vipul Ashri wrote:
> 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 | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, back to index

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07 12:57 [dpdk-dev] [PATCH] Virtio TX: reverting a small change causing Virtio standard TX broken Vipul Ashri
2020-08-09 13:28 ` Vipul Ashri
2020-08-10  4:10 ` Xia, Chenbo
2020-08-10 19:59 ` [dpdk-dev] [PATCH v2] net/virtio: fix 57f90f8("net/virtio: reuse packed ring functions") Vipul Ashri
2020-08-11  1:39   ` Xia, Chenbo
2020-08-12  9:23   ` [dpdk-dev] [PATCH v2] Fixes: 57f90f894588("net/virtio: " Vipul Ashri
2020-08-12 12:00     ` Xia, Chenbo
2020-08-13  7:23       ` [dpdk-dev] FW: " Vipul Ashri
2020-08-13  7:27         ` chupenghong
2020-08-13  7:25     ` [dpdk-dev] [PATCH v2] net/virtio: fix wrong variable assignment in helper macro Vipul Ashri
2020-08-13  7:28     ` [dpdk-dev] [PATCH v3] " Vipul Ashri
2020-08-13  7:35       ` Xia, Chenbo
2020-08-19  1:25       ` Xia, Chenbo
2020-09-16  5:57       ` [dpdk-dev] [PATCH v4] " Vipul Ashri
2020-09-17 15:54         ` Andrew Rybchenko
2020-09-18  9:55       ` [dpdk-dev] [PATCH v5] " Vipul Ashri
2020-09-18 12:22         ` Maxime Coquelin
2020-09-18 12:30         ` Maxime Coquelin
2020-08-13 16:22 ` [dpdk-dev] [PATCH v3] " Vipul Ashri
2020-08-14  1:25   ` Xia, Chenbo
2020-08-14  5:23     ` Vipul Ashri
2020-08-18 18:45       ` Ferruh Yigit
2020-08-18 20:46         ` Vipul Ashri

DPDK patches and discussions

Archives are clonable:
	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox