Re: [PATCH v7 02/15] net: qrtr: allocate and track endpoint ids

From: Manivannan Sadhasivam

Date: Wed Sep 16 2026 - 02:50:54 EST


On Tue, Sep 15, 2026 at 08:41:54AM +0300, Juha-Matti Tilli wrote:
> From: Denis Kenzior <denkenz@xxxxxxxxx>
>
> Currently, QRTR endpoints are tracked solely by their pointer value,
> which is sufficient as they are not exposed to user space and it is
> assumed that each endpoint has a unique set of node identifiers
> associated with it. However, this assumption does not hold when
> multiple devices of the same type are connected to the system. For
> example, multiple PCIe based 5G modems. Such a setup results in
> multiple endpoints with confliciting node identifiers.
>
> To enable support for such scenarios, introduce the ability to track
> and assign unique identifiers to QRTR endpoints. These identifiers
> can then be exposed to user space, allowing for userspace clients to
> identify which endpoint sent a given message, or to direct a message
> to a specific endpoint.
>
> A simple allocation strategy is used based on xa_alloc_cyclic. Remote
> endpoint ids start at 'qrtr_local_nid' + 1. Since qrtr_local_nid is
> currently always set to 1 and never changed, node identifiers start at
> '1' for the local endpoint and 2..INT_MAX for remote endpoints.
>
> Signed-off-by: Denis Kenzior <denkenz@xxxxxxxxx>
> Reviewed-by: Marcel Holtmann <marcel@xxxxxxxxxxxx>
> Reviewed-by: Andy Gross <agross@xxxxxxxxxx>
> Signed-off-by: Mihai Moldovan <ionic@xxxxxxxx>
> Signed-off-by: Juha-Matti Tilli <juha-matti.tilli@xxxxxx>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>

- Mani

--
மணிவண்ணன் சதாசிவம்