public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Per socket value for max datagram queue length
@ 2014-01-22 15:11 Dan Ballard
  2014-01-22 15:20 ` Hannes Frederic Sowa
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dan Ballard @ 2014-01-22 15:11 UTC (permalink / raw)
  To: Lennart Poettering, kay.sievers, Arnd Bergmann, David S. Miller,
	Eric Dumazet, Eliezer Tamir, Neil Horman, Li Zefan, linux-arch,
	linux-kernel, netdev

Provides a new option for setsockopt SO_MAX_DGRAM_QLEN that sets and
gets a socket specific max datagram queue length. Currently each socket
has one but it's only ever initialized from
/proc/sys/net/unix/max_dgram_qlen and then never adjustable later. Now
each socket can have it individually tweaked during it's life.

Signed-off-by: Dan Ballard <dan@mindstab.net>
---
  include/uapi/asm-generic/socket.h |    2 ++
  net/core/sock.c                   |    7 +++++++
  2 files changed, 9 insertions(+)

diff --git a/include/uapi/asm-generic/socket.h 
b/include/uapi/asm-generic/socket.h
index 38f14d0..f8c3e6b 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -80,4 +80,6 @@

  #define SO_MAX_PACING_RATE     47

+#define SO_MAX_DGRAM_QLEN      48
+
  #endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/net/core/sock.c b/net/core/sock.c
index 5393b4b..1ff69d1 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -915,6 +915,10 @@ set_rcvbuf:
                                          sk->sk_max_pacing_rate);
                 break;

+       case SO_MAX_DGRAM_QLEN:
+               sk->sk_max_ack_backlog = val;
+               break;
+
         default:
                 ret = -ENOPROTOOPT;
                 break;
@@ -1182,6 +1186,9 @@ int sock_getsockopt(struct socket *sock, int 
level, int optname,
                 v.val = sk->sk_max_pacing_rate;
                 break;

+       case SO_MAX_DGRAM_QLEN:
+               v.val = sk->sk_max_ack_backlog;
+               break;
         default:
                 return -ENOPROTOOPT;
         }
-- 
1.7.10.4

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

end of thread, other threads:[~2014-01-22 15:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-22 15:11 [PATCH 1/1] Per socket value for max datagram queue length Dan Ballard
2014-01-22 15:20 ` Hannes Frederic Sowa
2014-01-22 15:32   ` Hannes Frederic Sowa
2014-01-22 15:30 ` Eric Dumazet
2014-01-22 15:32 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox