Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1660230 > unrolled thread

[RESEND PATCH 0/4] Missing QRTR features

Started byBjorn Andersson <bjorn.andersson@linaro.org>
First post2017-06-07 23:10 +0200
Last post2017-06-08 17:40 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [RESEND PATCH 0/4] Missing QRTR features Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-06-07 23:10 +0200
    [RESEND PATCH 4/4] net: qrtr: Inform open sockets about new controller Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-06-07 23:10 +0200
    Re: [RESEND PATCH 0/4] Missing QRTR features David Miller <davem@davemloft.net> - 2017-06-08 17:40 +0200

#1660230 — [RESEND PATCH 0/4] Missing QRTR features

FromBjorn Andersson <bjorn.andersson@linaro.org>
Date2017-06-07 23:10 +0200
Subject[RESEND PATCH 0/4] Missing QRTR features
Message-ID<tPQnf-3rp-15@gated-at.bofh.it>
The QMUX specification covers packet routing as well as service life cycle and
discovery. The current implementation of qrtr supports the prior part, but in
order to fully implement service management on-top a few more parts are needed.

The first patch in the series serves the purpose of reducing duplication in
patch two and three.

The second and third patch adds two qrtr-level notifications required by the
specification, in order to notify local and remote service controllers about
dying clients.

The last patch serves the purpose of notifying local clients about the presence
of a local service register, allowing them to register services as well as
querying for remote registered services.

Bjorn Andersson (4):
  net: qrtr: Refactor packet allocation
  net: qrtr: Inject BYE on remote termination
  net: qrtr: Broadcast DEL_CLIENT message when endpoint is closed
  net: qrtr: Inform open sockets about new controller

 net/qrtr/qrtr.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 98 insertions(+), 6 deletions(-)

-- 
2.12.0

[toc] | [next] | [standalone]


#1660232 — [RESEND PATCH 4/4] net: qrtr: Inform open sockets about new controller

FromBjorn Andersson <bjorn.andersson@linaro.org>
Date2017-06-07 23:10 +0200
Subject[RESEND PATCH 4/4] net: qrtr: Inform open sockets about new controller
Message-ID<tPQng-3rp-45@gated-at.bofh.it>
In reply to#1660230
As the higher level communication only deals with "services" the
a service directory is required to keep track of local and remote
services. In order for qrtr clients to be informed about when the
service directory implementation is available some event needs to be
passed to them.

Rather than introducing support for broadcasting such a message in-band
to all open local sockets we flag each socket with ENETRESET, as there
are no other expected operations that would benefit from having support
from locally broadcasting messages.

Cc: Courtney Cavin <ccavin@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 net/qrtr/qrtr.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index d7516098b5aa..c7a5d861906b 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -530,6 +530,26 @@ static int qrtr_port_assign(struct qrtr_sock *ipc, int *port)
 	return 0;
 }
 
+/* Reset all non-control ports */
+static void qrtr_reset_ports(void)
+{
+	struct qrtr_sock *ipc;
+	int id;
+
+	mutex_lock(&qrtr_port_lock);
+	idr_for_each_entry(&qrtr_ports, ipc, id) {
+		/* Don't reset control port */
+		if (id == 0)
+			continue;
+
+		sock_hold(&ipc->sk);
+		ipc->sk.sk_err = ENETRESET;
+		wake_up_interruptible(sk_sleep(&ipc->sk));
+		sock_put(&ipc->sk);
+	}
+	mutex_unlock(&qrtr_port_lock);
+}
+
 /* Bind socket to address.
  *
  * Socket should be locked upon call.
@@ -558,6 +578,10 @@ static int __qrtr_bind(struct socket *sock,
 
 	sock_reset_flag(sk, SOCK_ZAPPED);
 
+	/* Notify all open ports about the new controller */
+	if (port == QRTR_PORT_CTRL)
+		qrtr_reset_ports();
+
 	return 0;
 }
 
-- 
2.12.0

[toc] | [prev] | [next] | [standalone]


#1661404

FromDavid Miller <davem@davemloft.net>
Date2017-06-08 17:40 +0200
Message-ID<tQ7Ht-63v-43@gated-at.bofh.it>
In reply to#1660230
From: Bjorn Andersson <bjorn.andersson@linaro.org>
Date: Wed,  7 Jun 2017 14:07:35 -0700

> The QMUX specification covers packet routing as well as service life cycle and
> discovery. The current implementation of qrtr supports the prior part, but in
> order to fully implement service management on-top a few more parts are needed.
> 
> The first patch in the series serves the purpose of reducing duplication in
> patch two and three.
> 
> The second and third patch adds two qrtr-level notifications required by the
> specification, in order to notify local and remote service controllers about
> dying clients.
> 
> The last patch serves the purpose of notifying local clients about the presence
> of a local service register, allowing them to register services as well as
> querying for remote registered services.

Looks good, series applied to net-next, thank you.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web