Skip to content

Commit a7ac9c8

Browse files
committed
virtio_buffer: Increase buffer by 1 to meet the minimum requirement
1 parent 0cdff8a commit a7ac9c8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

cores/arduino/stm32/OpenAMP/virtio_buffer.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ extern "C" {
3131
#endif
3232

3333
/**
34-
* See virtio_config.h for the size decision.
35-
* The multiplier should be at least 1.
36-
* If VIRTIO_BUFFER_SIZE is still too big, RPMSG_VRING_TOTAL_PAYLOAD_SIZE
37-
* can be reduced by reducing the number of VRING_NUM_BUFFS in virtio_config.h.
34+
* @brief Size of virtio ring buffer
35+
* @note See virtio_config.h for the size decision.
36+
* The multiplier should be at least 1. As a result, the minimum
37+
* required size of the initial virtio_buffer_write_available()
38+
* must be RPMSG_VRING_TOTAL_PAYLOAD_SIZE.
39+
* @note If VIRTIO_BUFFER_SIZE is still too big, RPMSG_VRING_TOTAL_PAYLOAD_SIZE
40+
* can be reduced by reducing the number of VRING_NUM_BUFFS in
41+
* virtio_config.h.
3842
*/
39-
#define VIRTIO_BUFFER_SIZE (RPMSG_VRING_TOTAL_PAYLOAD_SIZE * 2)
43+
#define VIRTIO_BUFFER_SIZE (RPMSG_VRING_TOTAL_PAYLOAD_SIZE * 2 + 1)
4044

4145
typedef struct {
4246
uint8_t buffer[VIRTIO_BUFFER_SIZE];

0 commit comments

Comments
 (0)