Blame SOURCES/0020-net-virtio-fix-calculation-of-device_event-ptr.patch

2c1bf6
From f2e20b51ac6432390ea545e2b6247419dfcaab40 Mon Sep 17 00:00:00 2001
2c1bf6
From: Jens Freimann <jfreimann@redhat.com>
2c1bf6
Date: Mon, 16 Sep 2019 17:26:16 +0200
2c1bf6
Subject: [PATCH] net/virtio: fix calculation of device_event ptr
2c1bf6
2c1bf6
Fix wrong pointer arithmetic. We only need to increment by 1 if we want
2c1bf6
to advance it by the size of the driver event area.
2c1bf6
2c1bf6
Signed-off-by: Jens Freimann <jfreimann@redhat.com>
2c1bf6
---
2c1bf6
 drivers/net/virtio/virtio_ring.h | 3 +--
2c1bf6
 1 file changed, 1 insertion(+), 2 deletions(-)
2c1bf6
2c1bf6
diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h
2c1bf6
index 1760823c6..fdc62194e 100644
2c1bf6
--- a/drivers/net/virtio/virtio_ring.h
2c1bf6
+++ b/drivers/net/virtio/virtio_ring.h
2c1bf6
@@ -165,8 +165,7 @@ vring_init_packed(struct vring_packed *vr, uint8_t *p, unsigned long align,
2c1bf6
 	vr->driver_event = (struct vring_packed_desc_event *)(p +
2c1bf6
 			vr->num * sizeof(struct vring_packed_desc));
2c1bf6
 	vr->device_event = (struct vring_packed_desc_event *)
2c1bf6
-		RTE_ALIGN_CEIL((uintptr_t)(vr->driver_event +
2c1bf6
-				sizeof(struct vring_packed_desc_event)), align);
2c1bf6
+		RTE_ALIGN_CEIL((uintptr_t)(vr->driver_event + 1), align);
2c1bf6
 }
2c1bf6
 
2c1bf6
 /*
2c1bf6
-- 
2c1bf6
2.21.0
2c1bf6