diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2016-11-25 10:31:50 -0800 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2018-12-24 01:27:28 +0100 |
commit | 5f5013d1a655d4325fe2a4ee57204c830dbe8e67 (patch) | |
tree | 61f47ca5c2f71d27395fb24c587f47b0938ea206 /drivers/rpmsg | |
parent | 6a04382fcf685219d4c3193d90672b610be4a3d3 (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/rpmsg')
-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 d4ee27085fe1..6a35069bbb8b 100644 --- a/drivers/rpmsg/imx_rpmsg.c +++ b/drivers/rpmsg/imx_rpmsg.c @@ -75,9 +75,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. @@ -87,7 +86,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_virdev(vd) container_of(vd, struct imx_virdev, vdev) @@ -209,7 +208,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) { |