diff mbox

[iproute2] netlink: extend buffers to 16K

Message ID 1413045793.9362.48.camel@edumazet-glaptop2.roam.corp.google.com
State Accepted, archived
Delegated to: stephen hemminger
Headers show

Commit Message

Eric Dumazet Oct. 11, 2014, 4:43 p.m. UTC
From: Eric Dumazet <edumazet@google.com>

Starting from linux-3.15 (commit 9063e21fb026, "netlink: autosize skb
lengths"), kernel is able to send up to 16K in netlink replies.

This change enables iproute2 commands to get bigger chunks,
without breaking compatibility with old kernels.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 lib/libnetlink.c |    4 ++--
 misc/ss.c        |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Joe Perches Oct. 11, 2014, 5 p.m. UTC | #1
On Sat, 2014-10-11 at 09:43 -0700, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> Starting from linux-3.15 (commit 9063e21fb026, "netlink: autosize skb
> lengths"), kernel is able to send up to 16K in netlink replies.
> 
> This change enables iproute2 commands to get bigger chunks,
> without breaking compatibility with old kernels.

Maybe a #define for the next time it's increased?


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Hemminger Oct. 30, 2014, 5:52 a.m. UTC | #2
On Sat, 11 Oct 2014 09:43:13 -0700
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> From: Eric Dumazet <edumazet@google.com>
> 
> Starting from linux-3.15 (commit 9063e21fb026, "netlink: autosize skb
> lengths"), kernel is able to send up to 16K in netlink replies.
> 
> This change enables iproute2 commands to get bigger chunks,
> without breaking compatibility with old kernels.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 9e2a795..8d504a9 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -420,7 +420,7 @@  int rtnl_listen(struct rtnl_handle *rtnl,
 		.msg_iov = &iov,
 		.msg_iovlen = 1,
 	};
-	char   buf[8192];
+	char   buf[16384];
 
 	memset(&nladdr, 0, sizeof(nladdr));
 	nladdr.nl_family = AF_NETLINK;
@@ -486,7 +486,7 @@  int rtnl_from_file(FILE *rtnl, rtnl_filter_t handler,
 {
 	int status;
 	struct sockaddr_nl nladdr;
-	char   buf[8192];
+	char   buf[16384];
 	struct nlmsghdr *h = (void*)buf;
 
 	memset(&nladdr, 0, sizeof(nladdr));
diff --git a/misc/ss.c b/misc/ss.c
index 2420b51..d185040 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -1864,7 +1864,7 @@  static int inet_show_netlink(struct filter *f, FILE *dump_fp, int protocol)
 	int fd, family;
 	struct sockaddr_nl nladdr;
 	struct msghdr msg;
-	char	buf[8192];
+	char	buf[16384];
 	struct iovec iov[3];
 
 	if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_INET_DIAG)) < 0)
@@ -1980,7 +1980,7 @@  done:
 static int tcp_show_netlink_file(struct filter *f)
 {
 	FILE	*fp;
-	char	buf[8192];
+	char	buf[16384];
 
 	if ((fp = fopen(getenv("TCPDIAG_FILE"), "r")) == NULL) {
 		perror("fopen($TCPDIAG_FILE)");
@@ -2497,7 +2497,7 @@  static int handle_netlink_request(struct filter *f, FILE *dump_fp,
 				  int (* show_one_sock)(struct nlmsghdr *nlh, struct filter *f))
 {
 	int fd;
-	char	buf[8192];
+	char	buf[16384];
 
 	if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_INET_DIAG)) < 0)
 		return -1;
@@ -2782,7 +2782,7 @@  static int packet_show_netlink(struct filter *f, FILE *dump_fp)
 		struct nlmsghdr nlh;
 		struct packet_diag_req r;
 	} req;
-	char	buf[8192];
+	char	buf[16384];
 
 	if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_INET_DIAG)) < 0)
 		return -1;