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