Skip to content

QRTR Multi-endpoint support

Mihai Moldovan linux-arm-msm lkml netdev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest11 patches 4 repliesIn review
  2. v411 patches 2 repliesSuperseded
  3. v311 patches 9 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v210 patches3 repliesSuperseded

v4 from the cover letter

- fixed issues found in previous review round:
o lock without unlock
o wrong return value
- Link to v3: https://msgid.link/[email protected]

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11net: qrtr: ns: validate msglen before ctrl_pkt usenet/qrtr/ns.c+3 -03 replies
2/11net: qrtr: allocate and track endpoint idsnet/qrtr/af_qrtr.c net/qrtr/qrtr.h+25 -00 replies
3/11net: qrtr: fit node ID + port number combination into unsigned longnet/qrtr/af_qrtr.c+65 -111 reply
4/11net: qrtr: support identical node idsnet/qrtr/af_qrtr.c+42 -150 replies
5/11net: qrtr: Report sender endpoint in aux datainclude/linux/socket.h include/uapi/linux/qrtr.h net/qrtr/af_qrtr.c+84 -00 replies
6/11net: qrtr: Report endpoint for locally generated messagesnet/qrtr/af_qrtr.c+20 -90 replies
7/11net: qrtr: Allow sendmsg to target an endpointnet/qrtr/af_qrtr.c net/qrtr/qrtr.h+68 -230 replies
8/11net: qrtr: allow socket endpoint bindinginclude/uapi/linux/qrtr.h net/qrtr/af_qrtr.c+41 -160 replies
9/11net: qrtr: Drop remote {NEW|DEL}_LOOKUP messagesnet/qrtr/af_qrtr.c+5 -00 replies
10/11net: qrtr: ns: support multiple endpointsnet/qrtr/af_qrtr.c net/qrtr/ns.c net/qrtr/qrtr.h+191 -1180 replies
11/11net: qrtr: mhi: Report endpoint id in sysfsnet/qrtr/mhi.c+14 -00 replies

Reviews trailers per patch

10 of 11 patches have a Reviewed-by or Acked-by.

PatchMarcel HoltmannAndy Gross
1/11R-b R-b
2/11R-b R-b
3/11
4/11R-b R-b
5/11R-b R-b
6/11R-b R-b
7/11R-b R-b
8/11R-b R-b
9/11R-b R-b
10/11R-b R-b
11/11R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 00/11] QRTR Multi-endpoint support

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.

v4:
- fixed issues found in previous review round:
o lock without unlock
o wrong return value
- Link to v3: https://msgid.link/[email protected]

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/[email protected]

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/[email protected]

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        | 405 ++++++++++++++++++++++++++++++++------
 net/qrtr/mhi.c            |  14 ++
 net/qrtr/ns.c             | 299 +++++++++++++++++-----------
 net/qrtr/qrtr.h           |   4 +
 6 files changed, 548 insertions(+), 182 deletions(-)
Signature · 1 line
2.50.0