diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2016-11-25 10:31:50 -0800 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-12-21 14:27:35 +0100 |
commit | 1a5fbf6a6fac544afd63634aa547247463b9c7f8 (patch) | |
tree | 472eb9eef947b37414990986f9e9bc49f75f5116 /drivers | |
parent | dad793183c8b1654ee81c2a041d0cbd3e6f54422 (diff) |
ARM: imx: define buffer count per VirtIO queue
Let RPMSG_NUM_BUFS to be the number of buffers per VirtIO queue,
so that each queue (TX/RX) has 256 buffers. The change does not
affect the number of buffers. But specifing per VirtIO queue
aligns better with the way buffer sizes are specified on the
FreeRTOS side (in platform_info.c).
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
(cherry picked from commit 1db9a161430d3975b4b3822b91b2a14c5b8193ba)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rpmsg/imx_rpmsg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/rpmsg/imx_rpmsg.c b/drivers/rpmsg/imx_rpmsg.c index d63e353b5c60..09cd3cb2f510 100644 --- a/drivers/rpmsg/imx_rpmsg.c +++ b/drivers/rpmsg/imx_rpmsg.c @@ -80,9 +80,8 @@ static struct delayed_work rpmsg_work; * 3 pages for every vring (the size of the vring depends on the number of * buffers it supports). */ -#define RPMSG_NUM_BUFS (512) +#define RPMSG_NUM_BUFS (256) #define RPMSG_BUF_SIZE (512) -#define RPMSG_BUFS_SPACE (RPMSG_NUM_BUFS * RPMSG_BUF_SIZE) /* * The alignment between the consumer and producer parts of the vring. @@ -92,7 +91,7 @@ static struct delayed_work rpmsg_work; #define RPMSG_VRING_ALIGN (4096) /* With 256 buffers, our vring will occupy 3 pages */ -#define RPMSG_RING_SIZE ((DIV_ROUND_UP(vring_size(RPMSG_NUM_BUFS / 2, \ +#define RPMSG_RING_SIZE ((DIV_ROUND_UP(vring_size(RPMSG_NUM_BUFS, \ RPMSG_VRING_ALIGN), PAGE_SIZE)) * PAGE_SIZE) #define to_imx_virdev(vd) container_of(vd, struct imx_virdev, vdev) @@ -219,7 +218,7 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev, pr_debug("vring%d: phys 0x%x, virt 0x%p\n", index, virdev->vring[index], rpvq->addr); - vq = vring_new_virtqueue(index, RPMSG_NUM_BUFS / 2, RPMSG_VRING_ALIGN, + vq = vring_new_virtqueue(index, RPMSG_NUM_BUFS, RPMSG_VRING_ALIGN, vdev, true, rpvq->addr, imx_rpmsg_notify, callback, name); if (!vq) { |