From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Loic Poulain <loic.poulain@linaro.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, clew@codeaurora.org,
manivannan.sadhasivam@linaro.org
Subject: Re: [PATCH 2/2] net: qrtr: Allow non-immediate node routing
Date: Tue, 29 Sep 2020 09:41:44 -0500 [thread overview]
Message-ID: <20200929144144.GE71055@builder.lan> (raw)
In-Reply-To: <1601386397-21067-2-git-send-email-loic.poulain@linaro.org>
On Tue 29 Sep 08:33 CDT 2020, Loic Poulain wrote:
> In order to reach non-immediate remote node services that are
> accessed through an intermediate node, the route to the remote
> node needs to be saved.
>
> E.g for a [node1 <=> node2 <=> node3] network
> - node2 forwards node3 service to node1
> - node1 must save node2 as route for reaching node3
>
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Regards,
Bjorn
> ---
> net/qrtr/qrtr.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
> index e09154b..bd9bcea 100644
> --- a/net/qrtr/qrtr.c
> +++ b/net/qrtr/qrtr.c
> @@ -400,12 +400,13 @@ static void qrtr_node_assign(struct qrtr_node *node, unsigned int nid)
> {
> unsigned long flags;
>
> - if (node->nid != QRTR_EP_NID_AUTO || nid == QRTR_EP_NID_AUTO)
> + if (nid == QRTR_EP_NID_AUTO)
> return;
>
> spin_lock_irqsave(&qrtr_nodes_lock, flags);
> radix_tree_insert(&qrtr_nodes, nid, node);
> - node->nid = nid;
> + if (node->nid == QRTR_EP_NID_AUTO)
> + node->nid = nid;
> spin_unlock_irqrestore(&qrtr_nodes_lock, flags);
> }
>
> @@ -493,6 +494,12 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len)
>
> qrtr_node_assign(node, cb->src_node);
>
> + if (cb->type == QRTR_TYPE_NEW_SERVER) {
> + /* Remote node endpoint can bridge other distant nodes */
> + const struct qrtr_ctrl_pkt *pkt = data + hdrlen;
> + qrtr_node_assign(node, le32_to_cpu(pkt->server.node));
> + }
> +
> if (cb->type == QRTR_TYPE_RESUME_TX) {
> qrtr_tx_resume(node, skb);
> } else {
> --
> 2.7.4
>
next prev parent reply other threads:[~2020-09-29 14:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 13:33 [PATCH 1/2] net: qrtr: Allow forwarded services Loic Poulain
2020-09-29 13:33 ` [PATCH 2/2] net: qrtr: Allow non-immediate node routing Loic Poulain
2020-09-29 14:41 ` Bjorn Andersson [this message]
2020-09-29 15:55 ` Jakub Kicinski
2020-09-29 14:34 ` [PATCH 1/2] net: qrtr: Allow forwarded services Bjorn Andersson
2020-10-01 13:26 ` Manivannan Sadhasivam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200929144144.GE71055@builder.lan \
--to=bjorn.andersson@linaro.org \
--cc=clew@codeaurora.org \
--cc=davem@davemloft.net \
--cc=loic.poulain@linaro.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).