This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 91d7bf86c335fd1fb39e3c5f1bcef7f637cd07d6
Author: yintao <[email protected]>
AuthorDate: Mon Mar 9 11:41:44 2026 +0800

    net/rpmsg: add CONFIG_NET_RPMSG_EPT_PRIORITY
    
    Every rpmsg socket endpoint is created with RPMSG_PRIO_DEFAULT, and the
    only way to change it is SO_PRIORITY on each socket.  Add a Kconfig
    option for the default, so that a board can raise or lower the priority
    of all rpmsg sockets without touching every user.
    
    The range stops below RPMSG_PRIO_RT, which SO_PRIORITY rejects as well.
    
    Signed-off-by: yintao <[email protected]>
    Signed-off-by: Bowen Wang <[email protected]>
---
 net/rpmsg/Kconfig        | 10 ++++++++++
 net/rpmsg/rpmsg_sockif.c |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/net/rpmsg/Kconfig b/net/rpmsg/Kconfig
index 4740c22f52b..5860215237b 100644
--- a/net/rpmsg/Kconfig
+++ b/net/rpmsg/Kconfig
@@ -48,6 +48,16 @@ config NET_RPMSG_NPOLLWAITERS
        ---help---
                Socket RPMSG number of poll waiters
 
+config NET_RPMSG_EPT_PRIORITY
+       int "RPMSG socket endpoint priority"
+       default 127
+       range 0 254
+       ---help---
+               Default priority of the rpmsg endpoint of every rpmsg socket.
+               SO_PRIORITY overrides it per socket.  255 (RPMSG_PRIO_RT) is
+               reserved and runs the endpoint callback in interrupt context,
+               which the socket code does not support.
+
 endif # NET_RPMSG
 
 endmenu # Rpmsg Domain Sockets
diff --git a/net/rpmsg/rpmsg_sockif.c b/net/rpmsg/rpmsg_sockif.c
index d6a8c283a9c..88be1bdc870 100644
--- a/net/rpmsg/rpmsg_sockif.c
+++ b/net/rpmsg/rpmsg_sockif.c
@@ -298,7 +298,7 @@ static FAR struct rpmsg_socket_conn_s 
*rpmsg_socket_alloc(void)
 
   conn->recvsize = CONFIG_NET_RPMSG_RXBUF_SIZE;
   conn->crefs = 1;
-  conn->priority = RPMSG_PRIO_DEFAULT;
+  conn->priority = CONFIG_NET_RPMSG_EPT_PRIORITY;
   return conn;
 }
 

Reply via email to