Skip to content

Commit

Permalink
risc-v/mpfs: enhance rpmsg throughput
Browse files Browse the repository at this point in the history
RPMSG is associated with the use of HPWORK / LPWORK queues.
After sending a message to the remote end (Linux), the system
waits for an ack before proceeding. Unfortunately this may
take sometimes more time than one would expect. Ack waiting is
also unnecessary: nothing is done with that information. Even
worse, the net_lock() is also held during the blocked time so
it blocks other network stacks that are unrelated to this.

Also reorganize the mpfs_opensbi_*.S so that the trap
handler is easily relocated in the linker .ld file without
the need to relocate the utils.S. This makes it easier to
separate the files into own segments. The trap file should be
located in the zero device.

Moreover, provide support for simultaneous ACK and message
present handling capabilities in both directions. There are
times when both bits are set but only other is being handled.

In the end, the maximum throughput of the RPMSG bus increases
easily 10-20% or even more.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
  • Loading branch information
eenurkka committed Sep 6, 2023
1 parent 7e3b843 commit a248c12
Show file tree
Hide file tree
Showing 6 changed files with 497 additions and 312 deletions.
1 change: 1 addition & 0 deletions arch/risc-v/src/mpfs/Make.defs
Expand Up @@ -84,6 +84,7 @@ endif

ifeq (${CONFIG_MPFS_OPENSBI},y)
CHIP_ASRCS += mpfs_opensbi_utils.S
CHIP_ASRCS += mpfs_opensbi_trap.S
CHIP_CSRCS += mpfs_opensbi.c
endif

Expand Down
4 changes: 2 additions & 2 deletions arch/risc-v/src/mpfs/hardware/mpfs_ihc.h
Expand Up @@ -27,8 +27,8 @@

enum mpfs_irq_type_e
{
MP_IRQ = 0x0,
ACK_IRQ = 0x1,
MP_IRQ = 0x1,
ACK_IRQ = 0x2,
};

#define IHC_MAX_MESSAGE_SIZE 2
Expand Down

0 comments on commit a248c12

Please sign in to comment.