DPDK patches and discussions
 help / color / mirror / Atom feed
From: javin <javin158@163.com>
To: dev@dpdk.org
Cc: yong.liu@intel.com
Subject: [dpdk-dev] [PATCH] net/virtio: fix virtio_net_hdr not being cleared correctly
Date: Thu, 13 Aug 2020 14:26:15 +0800	[thread overview]
Message-ID: <20200813062615.1759-1-javin158@163.com> (raw)

The macro ASSIGN_UNLESS_EQUAL doesn't assign value to the
variable, so the virtio_net_hdr may not be cleared correctly and the
tx packet may be droped due to wrong virtio_net_hdr.

Fixes: 57f90f894588 ("net/virtio: reuse packed ring functions")
Cc: yong.liu@intel.com
Signed-off-by: javin <javin158@163.com>
---
 drivers/net/virtio/virtqueue.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 105a9c00c..e94d78ae5 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -610,7 +610,7 @@ virtqueue_notify(struct virtqueue *vq)
 	typeof(var) var_ = (var);		\
 	typeof(val) val_ = (val);		\
 	if ((var_) != (val_))			\
-		(var_) = (val_);		\
+		(var) = (val_);		\
 } while (0)
 
 #define virtqueue_clear_net_hdr(hdr) do {		\
-- 
2.17.1


                 reply	other threads:[~2020-08-13  6:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200813062615.1759-1-javin158@163.com \
    --to=javin158@163.com \
    --cc=dev@dpdk.org \
    --cc=yong.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).