linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/11] QRTR Multi-endpoint support
@ 2025-07-23 23:23 Mihai Moldovan
  2025-07-23 23:23 ` [PATCH v3 01/11] net: qrtr: ns: validate msglen before ctrl_pkt use Mihai Moldovan
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Mihai Moldovan @ 2025-07-23 23:23 UTC (permalink / raw)
  To: linux-arm-msm, Manivannan Sadhasivam
  Cc: Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
	David S . Miller, Jakub Kicinski, Simon Horman, linux-kernel,
	netdev

I am incredibly thankful for Denis's work on this. To get this back on
track and to eventually get it merged, with his permission, I'm
resubmitting his patch set with issues in the previous review rounds
resolved. This feature is a prerequisite for my work on ath1{1,2}k to
allow using multiple devices in one computer.

The original description follows:

The current implementation of QRTR assumes that each entity on the QRTR
IPC bus is uniquely identifiable by its node/port combination, with
node/port combinations being used to route messages between entities.

However, this assumption of uniqueness is problematic in scenarios
where multiple devices with the same node/port combinations are
connected to the system.  A practical example is a typical consumer PC
with multiple PCIe-based devices, such as WiFi cards or 5G modems, where
each device could potentially have the same node identifier set.  In
such cases, the current QRTR protocol implementation does not provide a
mechanism to differentiate between these devices, making it impossible
to support communication with multiple identical devices.

This patch series addresses this limitation by introducing support for
a concept of an 'endpoint.' Multiple devices with conflicting node/port
combinations can be supported by assigning a unique endpoint identifier
to each one.  Such endpoint identifiers can then be used to distinguish
between devices while sending and receiving messages over QRTR sockets.

The patch series maintains backward compatibility with existing clients:
the endpoint concept is added using auxiliary data that can be added to
recvmsg and sendmsg system calls.  The QRTR socket interface is extended
as follows:

- Adds QRTR_ENDPOINT auxiliary data element that reports which endpoint
  generated a particular message.  This auxiliary data is only reported
  if the socket was explicitly opted in using setsockopt, enabling the
  QRTR_REPORT_ENDPOINT socket option.  SOL_QRTR socket level was added
  to facilitate this.  This requires QRTR clients to be updated to use
  recvmsg instead of the more typical recvfrom() or recv() use.

- Similarly, QRTR_ENDPOINT auxiliary data element can be included in
  sendmsg() requests.  This will allow clients to route QRTR messages
  to the desired endpoint, even in cases of node/port conflict between
  multiple endpoints.

- Finally, QRTR_BIND_ENDPOINT socket option is introduced.  This allows
  clients to bind to a particular endpoint (such as a 5G PCIe modem) if
  they're only interested in receiving or sending messages to this
  device.

v3:
  - rebased against current master
  - fix checkpatch.pl warnings
  - fix overflow issues with unsigned long radix tree keys by using the
    upper half of the storage space for one element and the lower half
    of storage for the other element, making sure that the elements fit
    into their respective storage space
  - Link to v2: https://msgid.link/cover.1752947108.git.ionic@ionic.de

v2:
  - rebased against current master
  - fixed most issues found in first review round (see individual
    commits), minus the 32-bit long
    unsafe use
  - Link to v1: https://msgid.link/20241018181842.1368394-1-denkenz@gmail.com

Denis Kenzior (10):
  net: qrtr: ns: validate msglen before ctrl_pkt use
  net: qrtr: allocate and track endpoint ids
  net: qrtr: support identical node ids
  net: qrtr: Report sender endpoint in aux data
  net: qrtr: Report endpoint for locally generated messages
  net: qrtr: Allow sendmsg to target an endpoint
  net: qrtr: allow socket endpoint binding
  net: qrtr: Drop remote {NEW|DEL}_LOOKUP messages
  net: qrtr: ns: support multiple endpoints
  net: qrtr: mhi: Report endpoint id in sysfs

Mihai Moldovan (1):
  net: qrtr: fit node ID + port number combination into unsigned long

 include/linux/socket.h    |   1 +
 include/uapi/linux/qrtr.h |   7 +
 net/qrtr/af_qrtr.c        | 400 ++++++++++++++++++++++++++++++++------
 net/qrtr/mhi.c            |  14 ++
 net/qrtr/ns.c             | 299 +++++++++++++++++-----------
 net/qrtr/qrtr.h           |   4 +
 6 files changed, 544 insertions(+), 181 deletions(-)

-- 
2.50.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2025-08-04 10:19 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23 23:23 [PATCH v3 00/11] QRTR Multi-endpoint support Mihai Moldovan
2025-07-23 23:23 ` [PATCH v3 01/11] net: qrtr: ns: validate msglen before ctrl_pkt use Mihai Moldovan
2025-07-23 23:23 ` [PATCH v3 02/11] net: qrtr: allocate and track endpoint ids Mihai Moldovan
2025-07-23 23:24 ` [PATCH v3 03/11] net: qrtr: fit node ID + port number combination into unsigned long Mihai Moldovan
2025-07-23 23:24 ` [PATCH v3 04/11] net: qrtr: support identical node ids Mihai Moldovan
2025-07-24 13:05   ` Jakub Kicinski
2025-07-24 13:08   ` Simon Horman
2025-07-27 13:09     ` Mihai Moldovan
2025-07-27 14:40       ` Simon Horman
2025-07-27 17:33         ` Mihai Moldovan
2025-07-28 10:51           ` Simon Horman
2025-08-01 17:25         ` Dan Carpenter
2025-08-04  9:55           ` Simon Horman
2025-08-04 10:19             ` Dan Carpenter
2025-07-23 23:24 ` [PATCH v3 05/11] net: qrtr: Report sender endpoint in aux data Mihai Moldovan
2025-07-23 23:24 ` [PATCH v3 06/11] net: qrtr: Report endpoint for locally generated messages Mihai Moldovan
2025-07-23 23:24 ` [PATCH v3 07/11] net: qrtr: Allow sendmsg to target an endpoint Mihai Moldovan
2025-07-23 23:24 ` [PATCH v3 08/11] net: qrtr: allow socket endpoint binding Mihai Moldovan
2025-07-23 23:24 ` [PATCH v3 09/11] net: qrtr: Drop remote {NEW|DEL}_LOOKUP messages Mihai Moldovan
2025-07-23 23:24 ` [PATCH v3 10/11] net: qrtr: ns: support multiple endpoints Mihai Moldovan
2025-07-23 23:24 ` [PATCH v3 11/11] net: qrtr: mhi: Report endpoint id in sysfs Mihai Moldovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).