Skip to content

Commit f1b61ca

Browse files
committed
virtio_buffer: RPMSG_VRING_TOTAL_PAYLOAD_SIZE + 1 will be enough
1 parent a7ac9c8 commit f1b61ca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cores/arduino/stm32/OpenAMP/virtio_buffer.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ extern "C" {
3232

3333
/**
3434
* @brief Size of virtio ring buffer
35-
* @note See virtio_config.h for the size decision.
35+
* @note See virtio_config.h for the size decision. (7937 bytes by default)
3636
* The multiplier should be at least 1. As a result, the minimum
3737
* required size of the initial virtio_buffer_write_available()
3838
* must be RPMSG_VRING_TOTAL_PAYLOAD_SIZE.
3939
* @note If VIRTIO_BUFFER_SIZE is still too big, RPMSG_VRING_TOTAL_PAYLOAD_SIZE
4040
* can be reduced by reducing the number of VRING_NUM_BUFFS in
4141
* virtio_config.h.
4242
*/
43-
#define VIRTIO_BUFFER_SIZE (RPMSG_VRING_TOTAL_PAYLOAD_SIZE * 2 + 1)
43+
#ifndef VIRTIO_BUFFER_SIZE
44+
#define VIRTIO_BUFFER_SIZE (RPMSG_VRING_TOTAL_PAYLOAD_SIZE * 1 + 1)
45+
#endif
4446

4547
typedef struct {
4648
uint8_t buffer[VIRTIO_BUFFER_SIZE];

0 commit comments

Comments
 (0)