diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2016-11-25 10:31:50 -0800 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-01-10 23:13:33 +0100 |
commit | 1db9a161430d3975b4b3822b91b2a14c5b8193ba (patch) | |
tree | 9b178295e5bd619d7eaed378d8ffb022248a4c39 | |
parent | 4cfa939c693b20ca213f054c1dfe5583d966beb4 (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>
-rw-r--r-- | arch/arm/mach-imx/imx_rpmsg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/imx_rpmsg.c b/arch/arm/mach-imx/imx_rpmsg.c index 440d0437de75..978aeee4033d 100644 --- a/arch/arm/mach-imx/imx_rpmsg.c +++ b/arch/arm/mach-imx/imx_rpmsg.c @@ -44,9 +44,8 @@ struct imx_rpmsg_vproc { * 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. @@ -56,7 +55,7 @@ struct imx_rpmsg_vproc { #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_rpdev(vd) container_of(vd, struct imx_rpmsg_vproc, vdev) @@ -156,7 +155,7 @@ static struct virtqueue *rp_find_vq(struct virtio_device *vdev, pr_debug("vring%d: phys 0x%x, virt 0x%x\n", index, rpdev->vring[index], (unsigned int) 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) { |