Skip to contentSkip to conversation

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

PATCH In review Vipul Ashri 6 participants 23 messages Aug 9, 2020 – Sep 18, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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=57f90f89458807bccc63425e4b72796870177977

---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -4
index 105a9c00c..81118d9fb 100644
@@ -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 {		\
Signature · 1 line
2.28.0.windows.1
#1 lore raw

Hi Vipul,

Quoted 7 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Vipul Ashri
Sent: Friday, August 7, 2020 8:58 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH] Virtio TX: reverting a small change causing Virtio standard TX broken

Quoted 8 lines

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

Quoted 24 lines
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -5
index 105a9c00c..81118d9fb 100644
@@ -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

#2 lore raw

PATCH 1/1 Virtio TX: reverting a small change causing Virtio standard TX broken

In reply to 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

---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -4
index 105a9c00c..81118d9fb 100644
@@ -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 {		\
Signature · 1 line
2.28.0.windows.1
#3 lore raw

PATCH v2 1/1 net/virtio: fix 57f90f8("net/virtio: reuse packed ring functions")

In reply to Vipul Ashri

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

---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -4
index 105a9c00c..20c95471e 100644
@@ -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 {		\
Signature · 1 line
2.28.0.windows.1
#4 lore raw

Re: [dpdk-dev] [PATCH v2] net/virtio: fix 57f90f8("net/virtio: reuse packed ring functions")

Hi Vipul,

Quoted 7 lines

-----Original Message-----
From: Vipul Ashri <[email protected]>
Sent: Tuesday, August 11, 2020 4:00 AM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>; [email protected]
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?

Quoted 3 lines

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

Quoted 26 lines
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -5
index 105a9c00c..20c95471e 100644
@@ -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

#5 lore raw

PATCH v2 1/1 Fixes: 57f90f894588("net/virtio: reuse packed ring functions")

In reply to Vipul Ashri

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.

---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -4
index 105a9c00c..20c95471e 100644
@@ -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 {		\
Signature · 1 line
2.28.0.windows.1
#6 lore raw

Re: [dpdk-dev] [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")

Hi Vipul,

Quoted 13 lines

-----Original Message-----
From: Vipul Ashri <[email protected]>
Sent: Wednesday, August 12, 2020 5:23 PM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>; [email protected]; [email protected]
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.

Quoted 5 lines

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.

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")
Quoted 24 lines
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -5
index 105a9c00c..20c95471e 100644
@@ -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

#7 lore raw

PATCH v2 1/1 Fixes: 57f90f894588("net/virtio: reuse packed ring functions")

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:[email protected]]
Sent: Wednesday, 12 August, 2020 17:31
To: Vipul Ashri <[email protected]>; [email protected]
Cc: Edwin Leung <[email protected]>
Subject: RE: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")

Hi Vipul,

Quoted 9 lines

-----Original Message-----
From: Vipul Ashri <[email protected]>
Sent: Wednesday, August 12, 2020 5:23 PM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>; [email protected]; [email protected]
Subject: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")

Quoted 8 lines

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.

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")
Quoted 23 lines
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/net/virtio/virtqueue.h index 105a9c00c..20c95471e 100644

drivers/net/virtio/virtqueue.h +2 -5
@@ -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

#8 lore raw

Re: [dpdk-dev] FW: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")

OK !

Quoted 71 lines · Vipul Ashri

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:[email protected]]
Sent: Wednesday, 12 August, 2020 17:31
To: Vipul Ashri <[email protected]>; [email protected]
Cc: Edwin Leung <[email protected]>
Subject: RE: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")

Hi Vipul,

Quoted 9 lines

-----Original Message-----
From: Vipul Ashri <[email protected]>
Sent: Wednesday, August 12, 2020 5:23 PM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>; [email protected]; [email protected]
Subject: [PATCH v2] Fixes: 57f90f894588("net/virtio: reuse packed ring functions")

Quoted 8 lines

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.

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")
Quoted 23 lines
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/net/virtio/virtqueue.h index 105a9c00c..20c95471e 100644

drivers/net/virtio/virtqueue.h +2 -5
@@ -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

#9 lore raw

PATCH v3 1/1 net/virtio: fix wrong variable assignment in helper macro

In reply to Vipul Ashri

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")
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -4
index 105a9c00c..20c95471e 100644
@@ -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 {		\
Signature · 1 line
2.28.0.windows.1
Reviewed-by on v3 1/1
#10 lore raw

Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

Quoted 41 lines

-----Original Message-----
From: Vipul Ashri <[email protected]>
Sent: Thursday, August 13, 2020 3:29 PM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>; [email protected]; [email protected]; [email protected]
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")
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -5
index 105a9c00c..20c95471e 100644
@@ -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 {		\
--
Quoted 1 line

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 on v3 1/1
#11 lore raw

Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

In reply to Vipul Ashri
Quoted 42 lines

-----Original Message-----
From: Vipul Ashri <[email protected]>
Sent: Thursday, August 13, 2020 3:29 PM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>; [email protected]; [email protected]; [email protected]
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")
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -5
index 105a9c00c..20c95471e 100644
@@ -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 {		\
--
Quoted 1 line

2.28.0.windows.1

#12 lore raw

PATCH v4 1/1 net/virtio: fix wrong variable assignment in helper macro

In reply to Vipul Ashri

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")
---
 drivers/net/virtio/virtqueue.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +5 -4
index 105a9c00c..7f8a3976f 100644
@@ -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 {		\
Signature · 1 line
2.28.0.windows.1
Acked-by on v4 1/1
#13 lore raw

Re: [dpdk-dev] [PATCH v4] net/virtio: fix wrong variable assignment in helper macro

Quoted 9 lines · Vipul Ashri

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")
#14 lore raw

PATCH v5 1/1 net/virtio: fix wrong variable assignment in helper macro

In reply to Vipul Ashri

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")
---
 drivers/net/virtio/virtqueue.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +4 -4
index 105a9c00c..6ed50648c 100644
@@ -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 {		\
Signature · 1 line
2.28.0.windows.1
Reviewed-by on v5 1/1
#15 lore raw

Re: [dpdk-dev] [PATCH v5] net/virtio: fix wrong variable assignment in helper macro

Quoted 23 lines · Vipul Ashri

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")
---
 drivers/net/virtio/virtqueue.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +0 -1
index 105a9c00c..6ed50648c 100644
@@ -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);		\

drivers/net/virtio/virtqueue.h virtqueue_notify(struct virtqueue *vq) · line 616

Quoted 10 lines
drivers/net/virtio/virtqueue.h +4 -3
-	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 {		\

Thanks,
Maxime

#16 lore raw

Re: [dpdk-dev] [PATCH v5] net/virtio: fix wrong variable assignment in helper macro

In reply to Vipul Ashri
Quoted 5 lines · Vipul Ashri

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.

Quoted 7 lines
Fixes 57f90f894588 ("net/virtio: reuse packed ring functions")
---
 drivers/net/virtio/virtqueue.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime

#17 lore raw

PATCH v2 1/1 net/virtio: fix wrong variable assignment in helper macro

In reply to Vipul Ashri

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")
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -4
index 105a9c00c..20c95471e 100644
@@ -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 {		\
Signature · 1 line
2.28.0.windows.1
#18 lore raw

PATCH v3 1/1 net/virtio: fix wrong variable assignment in helper macro

In reply to Vipul Ashri

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")
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -4
index 105a9c00c..20c95471e 100644
@@ -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 {		\
Signature · 1 line
2.28.0.windows.1
Reviewed-by on v3 1/1
#19 lore raw

Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

Quoted 43 lines

-----Original Message-----
From: Vipul Ashri <[email protected]>
Sent: Friday, August 14, 2020 12:22 AM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>; [email protected]; [email protected]; [email protected]; Wang, Zhihong <[email protected]>; [email protected]
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")
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/virtio/virtqueue.h +2 -5
index 105a9c00c..20c95471e 100644
@@ -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 {		\
--
Quoted 1 line

2.28.0.windows.1

author Reviewed-by Chenbo Xia
#20 lore raw

Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

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:[email protected]]
Sent: Friday, 14 August, 2020 6:56
To: Vipul Ashri <[email protected]>; [email protected]
Cc: Edwin Leung <[email protected]>; [email protected]; Wang, Zhihong <[email protected]>; [email protected]
Subject: RE: [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

Quoted 41 lines

-----Original Message-----
From: Vipul Ashri <[email protected]>
Sent: Friday, August 14, 2020 12:22 AM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>; [email protected]; [email protected]; [email protected]; Wang, Zhihong <[email protected]>; [email protected]
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")
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/net/virtio/virtqueue.h index 105a9c00c..20c95471e 100644

drivers/net/virtio/virtqueue.h +2 -5
@@ -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 {		\
--
Quoted 1 line

2.28.0.windows.1

#21 lore raw

Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

Quoted 4 lines · Vipul Ashri

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

Quoted 59 lines

Thanks to Xia for reviewing this code!

Regards
Vipul

-----Original Message-----
From: Xia, Chenbo [mailto:[email protected]]
Sent: Friday, 14 August, 2020 6:56
To: Vipul Ashri <[email protected]>; [email protected]
Cc: Edwin Leung <[email protected]>; [email protected]; Wang, Zhihong <[email protected]>; [email protected]
Subject: RE: [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

Quoted 41 lines

-----Original Message-----
From: Vipul Ashri <[email protected]>
Sent: Friday, August 14, 2020 12:22 AM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>; [email protected]; [email protected]; [email protected]; Wang, Zhihong <[email protected]>; [email protected]
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")
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/net/virtio/virtqueue.h index 105a9c00c..20c95471e 100644

drivers/net/virtio/virtqueue.h +2 -5
@@ -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 {		\
--
Quoted 1 line

2.28.0.windows.1

#22 lore raw

Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

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:[email protected]]
Sent: Wednesday, 19 August, 2020 0:15
To: Vipul Ashri <[email protected]>; Xia, Chenbo <[email protected]>; [email protected]; [email protected]; Wang, Zhihong <[email protected]>; [email protected]
Cc: Edwin Leung <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

Quoted 4 lines · Vipul Ashri

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$

Quoted 61 lines

Thanks to Xia for reviewing this code!

Regards
Vipul

-----Original Message-----
From: Xia, Chenbo [mailto:[email protected]]
Sent: Friday, 14 August, 2020 6:56
To: Vipul Ashri <[email protected]>; [email protected]
Cc: Edwin Leung <[email protected]>; [email protected]; Wang, Zhihong <[email protected]>; [email protected]
Subject: RE: [PATCH v3] net/virtio: fix wrong variable assignment in helper macro

Quoted 41 lines

-----Original Message-----
From: Vipul Ashri <[email protected]>
Sent: Friday, August 14, 2020 12:22 AM
To: [email protected]
Cc: Xia, Chenbo <[email protected]>; [email protected]; [email protected]; [email protected]; Wang, Zhihong <[email protected]>; [email protected]
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")
---
 drivers/net/virtio/virtqueue.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/net/virtio/virtqueue.h index 105a9c00c..20c95471e 100644

drivers/net/virtio/virtqueue.h +2 -5
@@ -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 {		\
--
Quoted 1 line

2.28.0.windows.1