DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: fix virtio_net_hdr not being cleared correctly
@ 2020-08-13  6:26 javin
  0 siblings, 0 replies; only message in thread
From: javin @ 2020-08-13  6:26 UTC (permalink / raw)
  To: dev; +Cc: yong.liu

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-13  6:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13  6:26 [dpdk-dev] [PATCH] net/virtio: fix virtio_net_hdr not being cleared correctly javin

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