netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next af_unix v1 0/1] Allow delivery of SIGURG on AF_UNIX streams socket
@ 2020-11-15  2:58 rao.shoaib
  2020-11-15  2:58 ` [RFC net-next af_unix v1 1/1] af_unix: " rao.shoaib
  2020-11-18 16:34 ` [RFC net-next af_unix v1 0/1] " Jakub Kicinski
  0 siblings, 2 replies; 4+ messages in thread
From: rao.shoaib @ 2020-11-15  2:58 UTC (permalink / raw)
  To: netdev, kuba; +Cc: Rao Shoaib

From: Rao Shoaib <rao.shoaib@oracle.com>

The use of AF_UNIX sockets is on the rise. We have a case where thousands
of processes connect locally to a database and issue queries that are
serviced by a pool of threads. Communication is done over AF_UNIX
sockets. Currently, there is no way for the submitter to signal the
servicing thread about an urgent condition such as abandoning
the query. This patch addresses that requirement by adding support for
MSG_OOB flag for AF_UNIX sockets. On receipt of such a flag,
the kernel sends a SIGURG to the peer.

Rao Shoaib (1):
  af_unix: Allow delivery of SIGURG on AF_UNIX streams socket

 net/unix/af_unix.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
1.8.3.1


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

* [RFC net-next af_unix v1 1/1] af_unix: Allow delivery of SIGURG on AF_UNIX streams socket
  2020-11-15  2:58 [RFC net-next af_unix v1 0/1] Allow delivery of SIGURG on AF_UNIX streams socket rao.shoaib
@ 2020-11-15  2:58 ` rao.shoaib
  2020-11-18 16:34 ` [RFC net-next af_unix v1 0/1] " Jakub Kicinski
  1 sibling, 0 replies; 4+ messages in thread
From: rao.shoaib @ 2020-11-15  2:58 UTC (permalink / raw)
  To: netdev, kuba; +Cc: Rao Shoaib

From: Rao Shoaib <rao.shoaib@oracle.com>

For AF_UNIX stream socket send SIGURG to the peer if
the msg has MSG_OOB flag set.

Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com>
---
 net/unix/af_unix.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 92784e5..4f01d74 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1840,8 +1840,6 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
 		return err;
 
 	err = -EOPNOTSUPP;
-	if (msg->msg_flags&MSG_OOB)
-		goto out_err;
 
 	if (msg->msg_namelen) {
 		err = sk->sk_state == TCP_ESTABLISHED ? -EISCONN : -EOPNOTSUPP;
@@ -1906,6 +1904,9 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
 		sent += size;
 	}
 
+	if (msg->msg_flags & MSG_OOB)
+		sk_send_sigurg(other);
+
 	scm_destroy(&scm);
 
 	return sent;
-- 
1.8.3.1


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

* Re: [RFC net-next af_unix v1 0/1] Allow delivery of SIGURG on AF_UNIX streams socket
  2020-11-15  2:58 [RFC net-next af_unix v1 0/1] Allow delivery of SIGURG on AF_UNIX streams socket rao.shoaib
  2020-11-15  2:58 ` [RFC net-next af_unix v1 1/1] af_unix: " rao.shoaib
@ 2020-11-18 16:34 ` Jakub Kicinski
  1 sibling, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2020-11-18 16:34 UTC (permalink / raw)
  To: rao.shoaib; +Cc: netdev

On Sat, 14 Nov 2020 18:58:04 -0800 rao.shoaib@oracle.com wrote:
> From: Rao Shoaib <rao.shoaib@oracle.com>
> 
> The use of AF_UNIX sockets is on the rise. We have a case where thousands
> of processes connect locally to a database and issue queries that are
> serviced by a pool of threads. Communication is done over AF_UNIX
> sockets. Currently, there is no way for the submitter to signal the
> servicing thread about an urgent condition such as abandoning
> the query. This patch addresses that requirement by adding support for
> MSG_OOB flag for AF_UNIX sockets. On receipt of such a flag,
> the kernel sends a SIGURG to the peer.

You need to widen the CC list on this, I doubt anyone paid much
attention.

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

* [RFC net-next af_unix v1 0/1] Allow delivery of SIGURG on AF_UNIX streams socket
@ 2020-10-08 20:03 rao.shoaib
  0 siblings, 0 replies; 4+ messages in thread
From: rao.shoaib @ 2020-10-08 20:03 UTC (permalink / raw)
  To: netdev; +Cc: Rao Shoaib

From: Rao Shoaib <rao.shoaib@oracle.com>

The use of AF_UNIX sockets is on the rise. We have a case where thousands
of processes connect locally to a database and issue queries that are
serviced by a pool of threads. Communication is done over AF_UNIX
sockets. Currently, there is no way for the submitter to signal the
servicing thread about an urgent condition such as abandoning
the query. This patch addresses that requirement by adding support for
MSG_OOB flag for AF_UNIX sockets. On receipt of such a flag,
the kernel sends a SIGURG to the peer.

Rao Shoaib (1):
  af_unix: Allow delivery of SIGURG on AF_UNIX streams socket

 net/unix/af_unix.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
1.8.3.1


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

end of thread, other threads:[~2020-11-18 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15  2:58 [RFC net-next af_unix v1 0/1] Allow delivery of SIGURG on AF_UNIX streams socket rao.shoaib
2020-11-15  2:58 ` [RFC net-next af_unix v1 1/1] af_unix: " rao.shoaib
2020-11-18 16:34 ` [RFC net-next af_unix v1 0/1] " Jakub Kicinski
  -- strict thread matches above, loose matches on Subject: below --
2020-10-08 20:03 rao.shoaib

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).