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