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