Current design uses fixed (512 bytes) rpmsg buffer size in both rx and
tx directions. This design is not suitable if the payload is larger than
512 bytes or the payload is very small and doesn't need that much
memory. Instead introduce new virtio feature to retrieve rpmsg tx buf
size and rx buf size from the virtio config space in the resource table.
Changes in v4:
- Introduce new patch to modify rpmsg.rst documentation
- check version is always 1.
- check size field is same as size of struct virtio_rpmsg_config
- introduce alignment field
- check alignment field is power of 2
- check tx and rx buf size is aligned with alignment passed in the
structure
- check msg size is < MTU size
Changes in v3:
- new patch [1/4] that renames variables with clear names.
- %s/rbufs/rx_bufs/
- %s/sbufs/tx_bufs/
- %s/last_sbuf/last_tx_buf/
- add num_rx_buf and num_tx_buf in the documentation
- change version field from u16 to u8
- introduce size field in the rpmsg_virtio_config structure
- check version field is set to any non-zero value.
- check size field is not 0.
- Remove field for private config, as not needed for now.
- add documentation of rpmsg_virtio_config structure
- Check for error when retrieving MTU size in the sample driver
- %s/mtu/MTU/
Changes in v2:
- Change author
- fix commit message with better explanation
- %s/sbuf/tx_buf
- %s/rbuf/rx_buf
- %s/num_rbuf/num_rx_buf/
- %s/num_sbuf/num_tx_buf/
- %s/sbuf_size/tx_buf_size/
- %s/rbuf_size/rx_buf_size/
- fix typo
- do not use ALIGN on buf size, rely on allocator
- make err msg more explicit, %s/vdev config:/bad vdev config/
- fix license and add AMD copyrights in the header virtio_rpmsg.h
- Assign bit 1 to VIRTIO_RPMSG_F_BUFSZ feature
- use __virtio32 over __u32
- add version field to virtio rpmsg config structure
- Introduce new patch to print rpmsg mtu size in the sample rpmsg driver
- move linux/virtio_rpmsg.h to linux/rpmsg/virtio_rpmsg.h
Tanmay Shah (5):
rpmsg: virtio_rpmsg_bus: rename rbufs and sbufs
rpmsg: virtio_rpmsg_bus: allow different size of tx and rx bufs
rpmsg: virtio_rpmsg_bus: get buffer size from config space
docs: rpmsg: add virtio config space details
samples: rpmsg: add MTU size info
Documentation/staging/rpmsg.rst | 19 +++
drivers/rpmsg/virtio_rpmsg_bus.c | 185 +++++++++++++++++++++-------
include/linux/rpmsg/virtio_rpmsg.h | 50 ++++++++
samples/rpmsg/rpmsg_client_sample.c | 20 ++-
4 files changed, 226 insertions(+), 48 deletions(-)
create mode 100644 include/linux/rpmsg/virtio_rpmsg.h
base-commit: 85842b61f64cac93d28e129d35193e329d463fd1
--
2.34.1