* Re: [dpdk-stable] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
[not found] ` <20200813072837.1468-1-vipul.ashri@oracle.com>
@ 2020-08-13 7:35 ` Xia, Chenbo
2020-08-19 1:25 ` Xia, Chenbo
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ 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] 7+ messages in thread
* Re: [dpdk-stable] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro
[not found] ` <20200813072837.1468-1-vipul.ashri@oracle.com>
2020-08-13 7:35 ` [dpdk-stable] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro Xia, Chenbo
@ 2020-08-19 1:25 ` Xia, Chenbo
2020-09-16 5:57 ` [dpdk-stable] [PATCH v4] " Vipul Ashri
2020-09-18 9:55 ` [dpdk-stable] [PATCH v5] " Vipul Ashri
3 siblings, 0 replies; 7+ 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] 7+ messages in thread
* [dpdk-stable] [PATCH v4] net/virtio: fix wrong variable assignment in helper macro
[not found] ` <20200813072837.1468-1-vipul.ashri@oracle.com>
2020-08-13 7:35 ` [dpdk-stable] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro Xia, Chenbo
2020-08-19 1:25 ` Xia, Chenbo
@ 2020-09-16 5:57 ` Vipul Ashri
2020-09-17 15:54 ` [dpdk-stable] [dpdk-dev] " Andrew Rybchenko
2020-09-18 9:55 ` [dpdk-stable] [PATCH v5] " Vipul Ashri
3 siblings, 1 reply; 7+ 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] 7+ messages in thread
* Re: [dpdk-stable] [dpdk-dev] [PATCH v4] net/virtio: fix wrong variable assignment in helper macro
2020-09-16 5:57 ` [dpdk-stable] [PATCH v4] " Vipul Ashri
@ 2020-09-17 15:54 ` Andrew Rybchenko
0 siblings, 0 replies; 7+ 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] 7+ messages in thread
* [dpdk-stable] [PATCH v5] net/virtio: fix wrong variable assignment in helper macro
[not found] ` <20200813072837.1468-1-vipul.ashri@oracle.com>
` (2 preceding siblings ...)
2020-09-16 5:57 ` [dpdk-stable] [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; 7+ 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] 7+ messages in thread
* Re: [dpdk-stable] [PATCH v5] net/virtio: fix wrong variable assignment in helper macro
2020-09-18 9:55 ` [dpdk-stable] [PATCH v5] " Vipul Ashri
@ 2020-09-18 12:22 ` Maxime Coquelin
2020-09-18 12:30 ` Maxime Coquelin
1 sibling, 0 replies; 7+ 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] 7+ messages in thread
* Re: [dpdk-stable] [PATCH v5] net/virtio: fix wrong variable assignment in helper macro
2020-09-18 9:55 ` [dpdk-stable] [PATCH v5] " Vipul Ashri
2020-09-18 12:22 ` Maxime Coquelin
@ 2020-09-18 12:30 ` Maxime Coquelin
1 sibling, 0 replies; 7+ 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] 7+ messages in thread
end of thread, other threads:[~2020-09-18 12:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20200812092306.1345-1-vipul.ashri@oracle.com>
[not found] ` <20200813072837.1468-1-vipul.ashri@oracle.com>
2020-08-13 7:35 ` [dpdk-stable] [PATCH v3] net/virtio: fix wrong variable assignment in helper macro Xia, Chenbo
2020-08-19 1:25 ` Xia, Chenbo
2020-09-16 5:57 ` [dpdk-stable] [PATCH v4] " Vipul Ashri
2020-09-17 15:54 ` [dpdk-stable] [dpdk-dev] " Andrew Rybchenko
2020-09-18 9:55 ` [dpdk-stable] [PATCH v5] " Vipul Ashri
2020-09-18 12:22 ` Maxime Coquelin
2020-09-18 12:30 ` Maxime Coquelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).