Netdev List
 help / color / mirror / Atom feed
* Re: e1000 full-duplex TCP performance well below wire speed
From: Bruce Allen @ 2008-01-31 19:48 UTC (permalink / raw)
  To: Kok, Auke
  Cc: Brandeburg, Jesse, netdev, Carsten Aulbert, Henning Fehrmann,
	Bruce Allen
In-Reply-To: <47A22241.70600@intel.com>

Hi Auke,

>> Based on the discussion in this thread, I am inclined to believe that
>> lack of PCI-e bus bandwidth is NOT the issue.  The theory is that the
>> extra packet handling associated with TCP acknowledgements are pushing
>> the PCI-e x1 bus past its limits.  However the evidence seems to show
>> otherwise:
>>
>> (1) Bill Fink has reported the same problem on a NIC with a 133 MHz
>> 64-bit PCI connection.  That connection can transfer data at 8Gb/s.
>
> That was even a PCI-X connection, which is known to have extremely good latency
> numbers, IIRC better than PCI-e? (?) which could account for a lot of the
> latency-induced lower performance...
>
> also, 82573's are _not_ a serverpart and were not designed for this 
> usage. 82546's are and that really does make a difference.

I'm confused.  It DOESN'T make a difference! Using 'server grade' 82546's 
on a PCI-X bus, Bill Fink reports the SAME loss of throughput with TCP 
full duplex that we see on a 'consumer grade' 82573 attached to a PCI-e x1 
bus.

Just like us, when Bill goes from TCP to UDP, he gets wire speed back.

Cheers,
 	Bruce

^ permalink raw reply

* [PATCH] Add addrlabel subsystem.
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-01-31 19:56 UTC (permalink / raw)
  To: shemminger; +Cc: yoshfuji, netdev

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
 include/linux/if_addrlabel.h |   32 +++++
 ip/Makefile                  |    2 +-
 ip/ip.c                      |    5 +-
 ip/ip_common.h               |    4 +
 ip/ipaddrlabel.c             |  260 ++++++++++++++++++++++++++++++++++++++++++
 ip/ipmonitor.c               |    4 +
 6 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h
new file mode 100644
index 0000000..9fe79c9
--- /dev/null
+++ b/include/linux/if_addrlabel.h
@@ -0,0 +1,32 @@
+/*
+ * if_addrlabel.h - netlink interface for address labels
+ *
+ * Copyright (C)2007 USAGI/WIDE Project,  All Rights Reserved.
+ *
+ * Authors:
+ *	YOSHIFUJI Hideaki @ USAGI/WIDE <yoshfuji@linux-ipv6.org>
+ */
+
+#ifndef __LINUX_IF_ADDRLABEL_H
+#define __LINUX_IF_ADDRLABEL_H
+
+struct ifaddrlblmsg
+{
+	__u8		ifal_family;		/* Address family */
+	__u8		__ifal_reserved;	/* Reserved */
+	__u8		ifal_prefixlen;		/* Prefix length */
+	__u8		ifal_flags;		/* Flags */
+	__u32		ifal_index;		/* Link index */
+	__u32		ifal_seq;		/* sequence number */
+};
+
+enum
+{
+	IFAL_ADDRESS = 1,
+	IFAL_LABEL = 2,
+	__IFAL_MAX
+};
+
+#define IFAL_MAX	(__IFAL_MAX - 1)
+
+#endif
diff --git a/ip/Makefile b/ip/Makefile
index b427d58..d908817 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -1,4 +1,4 @@
-IPOBJ=ip.o ipaddress.o iproute.o iprule.o \
+IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o \
     rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
     ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o \
     ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \
diff --git a/ip/ip.c b/ip/ip.c
index aeb8c68..c4c773f 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -46,8 +46,8 @@ static void usage(void)
 	fprintf(stderr,
 "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
 "       ip [ -force ] [-batch filename\n"
-"where  OBJECT := { link | addr | route | rule | neigh | ntable | tunnel |\n"
-"                   maddr | mroute | monitor | xfrm }\n"
+"where  OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable |\n"
+"                   tunnel | maddr | mroute | monitor | xfrm }\n"
 "       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
 "                    -f[amily] { inet | inet6 | ipx | dnet | link } |\n"
 "                    -o[neline] | -t[imestamp] }\n");
@@ -64,6 +64,7 @@ static const struct cmd {
 	int (*func)(int argc, char **argv);
 } cmds[] = {
 	{ "address", 	do_ipaddr },
+	{ "addrlabel",	do_ipaddrlabel },
 	{ "maddress",	do_multiaddr },
 	{ "route",	do_iproute },
 	{ "rule",	do_iprule },
diff --git a/ip/ip_common.h b/ip/ip_common.h
index 39f2507..1bbd50d 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -4,6 +4,9 @@ extern int print_linkinfo(const struct sockaddr_nl *who,
 extern int print_addrinfo(const struct sockaddr_nl *who,
 			  struct nlmsghdr *n,
 			  void *arg);
+extern int print_addrlabelinfo(const struct sockaddr_nl *who,
+			       struct nlmsghdr *n,
+			       void *arg);
 extern int print_neigh(const struct sockaddr_nl *who,
 		       struct nlmsghdr *n, void *arg);
 extern int print_ntable(const struct sockaddr_nl *who,
@@ -23,6 +26,7 @@ extern int print_prefix(const struct sockaddr_nl *who,
 extern int print_rule(const struct sockaddr_nl *who,
 		      struct nlmsghdr *n, void *arg);
 extern int do_ipaddr(int argc, char **argv);
+extern int do_ipaddrlabel(int argc, char **argv);
 extern int do_iproute(int argc, char **argv);
 extern int do_iprule(int argc, char **argv);
 extern int do_ipneigh(int argc, char **argv);
diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
new file mode 100644
index 0000000..1c873e9
--- /dev/null
+++ b/ip/ipaddrlabel.c
@@ -0,0 +1,260 @@
+/*
+ * ipaddrlabel.c	"ip addrlabel"
+ *
+ * Copyright (C)2007 USAGI/WIDE Project
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *
+ * Based on iprule.c.
+ *
+ * Authors:	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <arpa/inet.h>
+#include <string.h>
+#include <linux/types.h>
+#include <linux/if_addrlabel.h>
+
+#include "rt_names.h"
+#include "utils.h"
+#include "ip_common.h"
+
+#define IFAL_RTA(r)	((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrlblmsg))))
+#define IFAL_PAYLOAD(n)	NLMSG_PAYLOAD(n,sizeof(struct ifaddrlblmsg))
+
+extern struct rtnl_handle rth;
+
+static void usage(void) __attribute__((noreturn));
+
+static void usage(void)
+{
+	fprintf(stderr, "Usage: ip addrlabel [ list | add | del | flush ] prefix PREFIX [ dev DEV ] [ label LABEL ]\n");
+	exit(-1);
+}
+
+int print_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+{
+	FILE *fp = (FILE*)arg;
+	struct ifaddrlblmsg *ifal = NLMSG_DATA(n);
+	int len = n->nlmsg_len;
+	int host_len = -1;
+	struct rtattr *tb[IFAL_MAX+1];
+	char abuf[256];
+
+	if (n->nlmsg_type != RTM_NEWADDRLABEL && n->nlmsg_type != RTM_DELADDRLABEL)
+		return 0;
+
+	len -= NLMSG_LENGTH(sizeof(*ifal));
+	if (len < 0)
+		return -1;
+
+	parse_rtattr(tb, IFAL_MAX, IFAL_RTA(ifal), len);
+
+	if (ifal->ifal_family == AF_INET)
+		host_len = 32;
+	else if (ifal->ifal_family == AF_INET6)
+		host_len = 128;
+
+	if (n->nlmsg_type == RTM_DELADDRLABEL)
+		fprintf(fp, "Deleted ");
+
+	if (tb[IFAL_ADDRESS]) {
+		fprintf(fp, "prefix %s/%u ",
+			format_host(ifal->ifal_family,
+				    RTA_PAYLOAD(tb[IFAL_ADDRESS]),
+				    RTA_DATA(tb[IFAL_ADDRESS]),
+				    abuf, sizeof(abuf)),
+			ifal->ifal_prefixlen);
+	}
+
+	if (ifal->ifal_index)
+		fprintf(fp, "dev %s ", ll_index_to_name(ifal->ifal_index));
+
+	if (tb[IFAL_LABEL] && RTA_PAYLOAD(tb[IFAL_LABEL]) == sizeof(int32_t)) {
+		int32_t label;
+		memcpy(&label, RTA_DATA(tb[IFAL_LABEL]), sizeof(label));
+		fprintf(fp, "label %d ", label);
+	}
+
+	fprintf(fp, "\n");
+	fflush(fp);
+	return 0;
+}
+
+static int ipaddrlabel_list(int argc, char **argv)
+{
+	int af = preferred_family;
+
+	if (af == AF_UNSPEC)
+		af = AF_INET6;
+
+	if (argc > 0) {
+		fprintf(stderr, "\"ip addrlabel show\" does not take any arguments.\n");
+		return -1;
+	}
+
+	if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
+		perror("Cannot send dump request");
+		return 1;
+	}
+
+	if (rtnl_dump_filter(&rth, print_addrlabel, stdout, NULL, NULL) < 0) {
+		fprintf(stderr, "Dump terminated\n");
+		return 1;
+	}
+
+	return 0;
+}
+
+
+static int ipaddrlabel_modify(int cmd, int argc, char **argv)
+{
+	struct {
+		struct nlmsghdr 	n;
+		struct ifaddrlblmsg	ifal;
+		char   			buf[1024];
+	} req;
+
+	inet_prefix prefix;
+	uint32_t label = 0xffffffffUL;
+
+	memset(&req, 0, sizeof(req));
+	memset(&prefix, 0, sizeof(prefix));
+
+	req.n.nlmsg_type = cmd;
+	req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrlblmsg));
+	req.n.nlmsg_flags = NLM_F_REQUEST;
+	req.ifal.ifal_family = preferred_family;
+	req.ifal.ifal_prefixlen = 0;
+	req.ifal.ifal_index = 0;
+
+	if (cmd == RTM_NEWADDRLABEL) {
+		req.n.nlmsg_flags |= NLM_F_CREATE|NLM_F_EXCL;
+	}
+
+	while (argc > 0) {
+		if (strcmp(*argv, "prefix") == 0) {
+			NEXT_ARG();
+			get_prefix(&prefix, *argv, preferred_family);
+		} else if (strcmp(*argv, "dev") == 0) {
+			NEXT_ARG();
+			if ((req.ifal.ifal_index = ll_name_to_index(*argv)) == 0)
+				invarg("dev is invalid\n", *argv);
+		} else if (strcmp(*argv, "label") == 0) {
+			NEXT_ARG();
+			if (get_u32(&label, *argv, 0) || label == 0xffffffffUL)
+				invarg("label is invalid\n", *argv);
+		}
+		argc--;
+		argv++;
+	}
+
+	addattr32(&req.n, sizeof(req), IFAL_LABEL, label);
+	addattr_l(&req.n, sizeof(req), IFAL_ADDRESS, &prefix.data, prefix.bytelen);
+
+	if (req.ifal.ifal_family == AF_UNSPEC)
+		req.ifal.ifal_family = AF_INET6;
+
+	if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+		return 2;
+
+	return 0;
+}
+
+
+static int flush_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+{
+	struct rtnl_handle rth2;
+	struct rtmsg *r = NLMSG_DATA(n);
+	int len = n->nlmsg_len;
+	struct rtattr * tb[IFAL_MAX+1];
+
+	len -= NLMSG_LENGTH(sizeof(*r));
+	if (len < 0)
+		return -1;
+
+	parse_rtattr(tb, IFAL_MAX, RTM_RTA(r), len);
+
+	if (tb[IFAL_ADDRESS]) {
+		n->nlmsg_type = RTM_DELADDRLABEL;
+		n->nlmsg_flags = NLM_F_REQUEST;
+
+		if (rtnl_open(&rth2, 0) < 0)
+			return -1;
+
+		if (rtnl_talk(&rth2, n, 0, 0, NULL, NULL, NULL) < 0)
+			return -2;
+
+		rtnl_close(&rth2);
+	}
+
+	return 0;
+}
+
+static int ipaddrlabel_flush(int argc, char **argv)
+{
+	int af = preferred_family;
+
+	if (af == AF_UNSPEC)
+		af = AF_INET6;
+
+	if (argc > 0) {
+		fprintf(stderr, "\"ip addrlabel flush\" does not allow extra arguments\n");
+		return -1;
+	}
+
+	if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
+		perror("Cannot send dump request");
+		return 1;
+	}
+
+	if (rtnl_dump_filter(&rth, flush_addrlabel, NULL, NULL, NULL) < 0) {
+		fprintf(stderr, "Flush terminated\n");
+		return 1;
+	}
+
+	return 0;
+}
+
+int do_ipaddrlabel(int argc, char **argv)
+{
+	if (argc < 1) {
+		return ipaddrlabel_list(0, NULL);
+	} else if (matches(argv[0], "list") == 0 ||
+		   matches(argv[0], "show") == 0) {
+		return ipaddrlabel_list(argc-1, argv+1);
+	} else if (matches(argv[0], "add") == 0) {
+		return ipaddrlabel_modify(RTM_NEWADDRLABEL, argc-1, argv+1);
+	} else if (matches(argv[0], "delete") == 0) {
+		return ipaddrlabel_modify(RTM_DELADDRLABEL, argc-1, argv+1);
+	} else if (matches(argv[0], "flush") == 0) {
+		return ipaddrlabel_flush(argc-1, argv+1);
+	} else if (matches(argv[0], "help") == 0)
+		usage();
+
+	fprintf(stderr, "Command \"%s\" is unknown, try \"ip addrlabel help\".\n", *argv);
+	exit(-1);
+}
+
diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index f1a1f27..df0fd91 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -54,6 +54,10 @@ int accept_msg(const struct sockaddr_nl *who,
 		print_addrinfo(who, n, arg);
 		return 0;
 	}
+	if (n->nlmsg_type == RTM_NEWADDRLABEL || n->nlmsg_type == RTM_DELADDRLABEL) {
+		print_addrlabel(who, n, arg);
+		return 0;
+	}
 	if (n->nlmsg_type == RTM_NEWNEIGH || n->nlmsg_type == RTM_DELNEIGH) {
 		print_neigh(who, n, arg);
 		return 0;
-- 
1.4.4.4


^ permalink raw reply related

* [PATCH] IPROUTE2: Add addrlabel subsystem.
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-01-31 19:57 UTC (permalink / raw)
  To: shemminger; +Cc: yoshfuji, netdev

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
 include/linux/if_addrlabel.h |   32 +++++
 ip/Makefile                  |    2 +-
 ip/ip.c                      |    5 +-
 ip/ip_common.h               |    4 +
 ip/ipaddrlabel.c             |  260 ++++++++++++++++++++++++++++++++++++++++++
 ip/ipmonitor.c               |    4 +
 6 files changed, 304 insertions(+), 3 deletions(-)

diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h
new file mode 100644
index 0000000..9fe79c9
--- /dev/null
+++ b/include/linux/if_addrlabel.h
@@ -0,0 +1,32 @@
+/*
+ * if_addrlabel.h - netlink interface for address labels
+ *
+ * Copyright (C)2007 USAGI/WIDE Project,  All Rights Reserved.
+ *
+ * Authors:
+ *	YOSHIFUJI Hideaki @ USAGI/WIDE <yoshfuji@linux-ipv6.org>
+ */
+
+#ifndef __LINUX_IF_ADDRLABEL_H
+#define __LINUX_IF_ADDRLABEL_H
+
+struct ifaddrlblmsg
+{
+	__u8		ifal_family;		/* Address family */
+	__u8		__ifal_reserved;	/* Reserved */
+	__u8		ifal_prefixlen;		/* Prefix length */
+	__u8		ifal_flags;		/* Flags */
+	__u32		ifal_index;		/* Link index */
+	__u32		ifal_seq;		/* sequence number */
+};
+
+enum
+{
+	IFAL_ADDRESS = 1,
+	IFAL_LABEL = 2,
+	__IFAL_MAX
+};
+
+#define IFAL_MAX	(__IFAL_MAX - 1)
+
+#endif
diff --git a/ip/Makefile b/ip/Makefile
index b427d58..d908817 100644
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -1,4 +1,4 @@
-IPOBJ=ip.o ipaddress.o iproute.o iprule.o \
+IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o \
     rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
     ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o \
     ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \
diff --git a/ip/ip.c b/ip/ip.c
index aeb8c68..c4c773f 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -46,8 +46,8 @@ static void usage(void)
 	fprintf(stderr,
 "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
 "       ip [ -force ] [-batch filename\n"
-"where  OBJECT := { link | addr | route | rule | neigh | ntable | tunnel |\n"
-"                   maddr | mroute | monitor | xfrm }\n"
+"where  OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable |\n"
+"                   tunnel | maddr | mroute | monitor | xfrm }\n"
 "       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
 "                    -f[amily] { inet | inet6 | ipx | dnet | link } |\n"
 "                    -o[neline] | -t[imestamp] }\n");
@@ -64,6 +64,7 @@ static const struct cmd {
 	int (*func)(int argc, char **argv);
 } cmds[] = {
 	{ "address", 	do_ipaddr },
+	{ "addrlabel",	do_ipaddrlabel },
 	{ "maddress",	do_multiaddr },
 	{ "route",	do_iproute },
 	{ "rule",	do_iprule },
diff --git a/ip/ip_common.h b/ip/ip_common.h
index 39f2507..1bbd50d 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -4,6 +4,9 @@ extern int print_linkinfo(const struct sockaddr_nl *who,
 extern int print_addrinfo(const struct sockaddr_nl *who,
 			  struct nlmsghdr *n,
 			  void *arg);
+extern int print_addrlabelinfo(const struct sockaddr_nl *who,
+			       struct nlmsghdr *n,
+			       void *arg);
 extern int print_neigh(const struct sockaddr_nl *who,
 		       struct nlmsghdr *n, void *arg);
 extern int print_ntable(const struct sockaddr_nl *who,
@@ -23,6 +26,7 @@ extern int print_prefix(const struct sockaddr_nl *who,
 extern int print_rule(const struct sockaddr_nl *who,
 		      struct nlmsghdr *n, void *arg);
 extern int do_ipaddr(int argc, char **argv);
+extern int do_ipaddrlabel(int argc, char **argv);
 extern int do_iproute(int argc, char **argv);
 extern int do_iprule(int argc, char **argv);
 extern int do_ipneigh(int argc, char **argv);
diff --git a/ip/ipaddrlabel.c b/ip/ipaddrlabel.c
new file mode 100644
index 0000000..1c873e9
--- /dev/null
+++ b/ip/ipaddrlabel.c
@@ -0,0 +1,260 @@
+/*
+ * ipaddrlabel.c	"ip addrlabel"
+ *
+ * Copyright (C)2007 USAGI/WIDE Project
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ *
+ * Based on iprule.c.
+ *
+ * Authors:	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <arpa/inet.h>
+#include <string.h>
+#include <linux/types.h>
+#include <linux/if_addrlabel.h>
+
+#include "rt_names.h"
+#include "utils.h"
+#include "ip_common.h"
+
+#define IFAL_RTA(r)	((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrlblmsg))))
+#define IFAL_PAYLOAD(n)	NLMSG_PAYLOAD(n,sizeof(struct ifaddrlblmsg))
+
+extern struct rtnl_handle rth;
+
+static void usage(void) __attribute__((noreturn));
+
+static void usage(void)
+{
+	fprintf(stderr, "Usage: ip addrlabel [ list | add | del | flush ] prefix PREFIX [ dev DEV ] [ label LABEL ]\n");
+	exit(-1);
+}
+
+int print_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+{
+	FILE *fp = (FILE*)arg;
+	struct ifaddrlblmsg *ifal = NLMSG_DATA(n);
+	int len = n->nlmsg_len;
+	int host_len = -1;
+	struct rtattr *tb[IFAL_MAX+1];
+	char abuf[256];
+
+	if (n->nlmsg_type != RTM_NEWADDRLABEL && n->nlmsg_type != RTM_DELADDRLABEL)
+		return 0;
+
+	len -= NLMSG_LENGTH(sizeof(*ifal));
+	if (len < 0)
+		return -1;
+
+	parse_rtattr(tb, IFAL_MAX, IFAL_RTA(ifal), len);
+
+	if (ifal->ifal_family == AF_INET)
+		host_len = 32;
+	else if (ifal->ifal_family == AF_INET6)
+		host_len = 128;
+
+	if (n->nlmsg_type == RTM_DELADDRLABEL)
+		fprintf(fp, "Deleted ");
+
+	if (tb[IFAL_ADDRESS]) {
+		fprintf(fp, "prefix %s/%u ",
+			format_host(ifal->ifal_family,
+				    RTA_PAYLOAD(tb[IFAL_ADDRESS]),
+				    RTA_DATA(tb[IFAL_ADDRESS]),
+				    abuf, sizeof(abuf)),
+			ifal->ifal_prefixlen);
+	}
+
+	if (ifal->ifal_index)
+		fprintf(fp, "dev %s ", ll_index_to_name(ifal->ifal_index));
+
+	if (tb[IFAL_LABEL] && RTA_PAYLOAD(tb[IFAL_LABEL]) == sizeof(int32_t)) {
+		int32_t label;
+		memcpy(&label, RTA_DATA(tb[IFAL_LABEL]), sizeof(label));
+		fprintf(fp, "label %d ", label);
+	}
+
+	fprintf(fp, "\n");
+	fflush(fp);
+	return 0;
+}
+
+static int ipaddrlabel_list(int argc, char **argv)
+{
+	int af = preferred_family;
+
+	if (af == AF_UNSPEC)
+		af = AF_INET6;
+
+	if (argc > 0) {
+		fprintf(stderr, "\"ip addrlabel show\" does not take any arguments.\n");
+		return -1;
+	}
+
+	if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
+		perror("Cannot send dump request");
+		return 1;
+	}
+
+	if (rtnl_dump_filter(&rth, print_addrlabel, stdout, NULL, NULL) < 0) {
+		fprintf(stderr, "Dump terminated\n");
+		return 1;
+	}
+
+	return 0;
+}
+
+
+static int ipaddrlabel_modify(int cmd, int argc, char **argv)
+{
+	struct {
+		struct nlmsghdr 	n;
+		struct ifaddrlblmsg	ifal;
+		char   			buf[1024];
+	} req;
+
+	inet_prefix prefix;
+	uint32_t label = 0xffffffffUL;
+
+	memset(&req, 0, sizeof(req));
+	memset(&prefix, 0, sizeof(prefix));
+
+	req.n.nlmsg_type = cmd;
+	req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrlblmsg));
+	req.n.nlmsg_flags = NLM_F_REQUEST;
+	req.ifal.ifal_family = preferred_family;
+	req.ifal.ifal_prefixlen = 0;
+	req.ifal.ifal_index = 0;
+
+	if (cmd == RTM_NEWADDRLABEL) {
+		req.n.nlmsg_flags |= NLM_F_CREATE|NLM_F_EXCL;
+	}
+
+	while (argc > 0) {
+		if (strcmp(*argv, "prefix") == 0) {
+			NEXT_ARG();
+			get_prefix(&prefix, *argv, preferred_family);
+		} else if (strcmp(*argv, "dev") == 0) {
+			NEXT_ARG();
+			if ((req.ifal.ifal_index = ll_name_to_index(*argv)) == 0)
+				invarg("dev is invalid\n", *argv);
+		} else if (strcmp(*argv, "label") == 0) {
+			NEXT_ARG();
+			if (get_u32(&label, *argv, 0) || label == 0xffffffffUL)
+				invarg("label is invalid\n", *argv);
+		}
+		argc--;
+		argv++;
+	}
+
+	addattr32(&req.n, sizeof(req), IFAL_LABEL, label);
+	addattr_l(&req.n, sizeof(req), IFAL_ADDRESS, &prefix.data, prefix.bytelen);
+
+	if (req.ifal.ifal_family == AF_UNSPEC)
+		req.ifal.ifal_family = AF_INET6;
+
+	if (rtnl_talk(&rth, &req.n, 0, 0, NULL, NULL, NULL) < 0)
+		return 2;
+
+	return 0;
+}
+
+
+static int flush_addrlabel(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+{
+	struct rtnl_handle rth2;
+	struct rtmsg *r = NLMSG_DATA(n);
+	int len = n->nlmsg_len;
+	struct rtattr * tb[IFAL_MAX+1];
+
+	len -= NLMSG_LENGTH(sizeof(*r));
+	if (len < 0)
+		return -1;
+
+	parse_rtattr(tb, IFAL_MAX, RTM_RTA(r), len);
+
+	if (tb[IFAL_ADDRESS]) {
+		n->nlmsg_type = RTM_DELADDRLABEL;
+		n->nlmsg_flags = NLM_F_REQUEST;
+
+		if (rtnl_open(&rth2, 0) < 0)
+			return -1;
+
+		if (rtnl_talk(&rth2, n, 0, 0, NULL, NULL, NULL) < 0)
+			return -2;
+
+		rtnl_close(&rth2);
+	}
+
+	return 0;
+}
+
+static int ipaddrlabel_flush(int argc, char **argv)
+{
+	int af = preferred_family;
+
+	if (af == AF_UNSPEC)
+		af = AF_INET6;
+
+	if (argc > 0) {
+		fprintf(stderr, "\"ip addrlabel flush\" does not allow extra arguments\n");
+		return -1;
+	}
+
+	if (rtnl_wilddump_request(&rth, af, RTM_GETADDRLABEL) < 0) {
+		perror("Cannot send dump request");
+		return 1;
+	}
+
+	if (rtnl_dump_filter(&rth, flush_addrlabel, NULL, NULL, NULL) < 0) {
+		fprintf(stderr, "Flush terminated\n");
+		return 1;
+	}
+
+	return 0;
+}
+
+int do_ipaddrlabel(int argc, char **argv)
+{
+	if (argc < 1) {
+		return ipaddrlabel_list(0, NULL);
+	} else if (matches(argv[0], "list") == 0 ||
+		   matches(argv[0], "show") == 0) {
+		return ipaddrlabel_list(argc-1, argv+1);
+	} else if (matches(argv[0], "add") == 0) {
+		return ipaddrlabel_modify(RTM_NEWADDRLABEL, argc-1, argv+1);
+	} else if (matches(argv[0], "delete") == 0) {
+		return ipaddrlabel_modify(RTM_DELADDRLABEL, argc-1, argv+1);
+	} else if (matches(argv[0], "flush") == 0) {
+		return ipaddrlabel_flush(argc-1, argv+1);
+	} else if (matches(argv[0], "help") == 0)
+		usage();
+
+	fprintf(stderr, "Command \"%s\" is unknown, try \"ip addrlabel help\".\n", *argv);
+	exit(-1);
+}
+
diff --git a/ip/ipmonitor.c b/ip/ipmonitor.c
index f1a1f27..df0fd91 100644
--- a/ip/ipmonitor.c
+++ b/ip/ipmonitor.c
@@ -54,6 +54,10 @@ int accept_msg(const struct sockaddr_nl *who,
 		print_addrinfo(who, n, arg);
 		return 0;
 	}
+	if (n->nlmsg_type == RTM_NEWADDRLABEL || n->nlmsg_type == RTM_DELADDRLABEL) {
+		print_addrlabel(who, n, arg);
+		return 0;
+	}
 	if (n->nlmsg_type == RTM_NEWNEIGH || n->nlmsg_type == RTM_DELNEIGH) {
 		print_neigh(who, n, arg);
 		return 0;
-- 
1.4.4.4


^ permalink raw reply related

* Re: [PATCH 6/6] [TCP]: Reorganize struct tcp_sock to save 16 bytes on 64-bit arch
From: Eric Dumazet @ 2008-01-31 19:57 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: David S. Miller, netdev, dccp
In-Reply-To: <1201804304-28777-7-git-send-email-acme@redhat.com>

Arnaldo Carvalho de Melo a écrit :
> /home/acme/git/net-2.6/net/ipv6/tcp_ipv6.c:
>   struct tcp_sock  |  -16
>   struct tcp6_sock |  -16
>  2 structs changed
> 
> Now it is at:
> 
> /* size: 1552, cachelines: 25 */
> /* paddings: 2, sum paddings: 8 */
> /* last cacheline: 16 bytes */
> 
> As soon as we stop using skb_queue_list we'll get it down to 24 cachelines.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  include/linux/tcp.h |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
> index 08027f1..f48644d 100644
> --- a/include/linux/tcp.h
> +++ b/include/linux/tcp.h
> @@ -304,7 +304,6 @@ struct tcp_sock {
>  	u32	rtt_seq;	/* sequence number to update rttvar	*/
>  
>  	u32	packets_out;	/* Packets which are "in flight"	*/
> -	u32	retrans_out;	/* Retransmitted packets out		*/
>  /*
>   *      Options received (usually on last packet, some only on SYN packets).
>   */
> @@ -332,6 +331,8 @@ struct tcp_sock {
>  
>  	struct tcp_sack_block recv_sack_cache[4];
>  
> +	u32	retrans_out;	/* Retransmitted packets out		*/
> +

Hum... retrans_out should sit close to packets_out (or lost_out/sacked_out 
???), please.

'struct tcp_sock' is very large on 64 bits, so I would prefer to make sure 
most paths dont need to touch all 24 cache lines (or 25 cache lines).


^ permalink raw reply

* Re: [PATCH] Add addrlabel subsystem.
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-01-31 19:59 UTC (permalink / raw)
  To: shemminger; +Cc: yoshfuji, netdev
In-Reply-To: <20080201.065610.16428092.yoshfuji@linux-ipv6.org>

In article <20080201.065610.16428092.yoshfuji@linux-ipv6.org> (at Fri, 01 Feb 2008 06:56:10 +1100 (EST)), YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org> says:

> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> ---
>  include/linux/if_addrlabel.h |   32 +++++
>  ip/Makefile                  |    2 +-
>  ip/ip.c                      |    5 +-
>  ip/ip_common.h               |    4 +
>  ip/ipaddrlabel.c             |  260 ++++++++++++++++++++++++++++++++++++++++++
>  ip/ipmonitor.c               |    4 +
>  6 files changed, 304 insertions(+), 3 deletions(-)

Sorry, "iproute2" was missing in the subject...resent.

--yoshfuji

^ permalink raw reply

* Re: [PATCH 6/6] [TCP]: Reorganize struct tcp_sock to save 16 bytes on 64-bit arch
From: Arnaldo Carvalho de Melo @ 2008-01-31 20:17 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Arnaldo Carvalho de Melo, David S. Miller, netdev, dccp
In-Reply-To: <47A22841.6090508@cosmosbay.com>

Em Thu, Jan 31, 2008 at 08:57:53PM +0100, Eric Dumazet escreveu:
> Arnaldo Carvalho de Melo a écrit :
>> /home/acme/git/net-2.6/net/ipv6/tcp_ipv6.c:
>>   struct tcp_sock  |  -16
>>   struct tcp6_sock |  -16
>>  2 structs changed
>>
>> Now it is at:
>>
>> /* size: 1552, cachelines: 25 */
>> /* paddings: 2, sum paddings: 8 */
>> /* last cacheline: 16 bytes */
>>
>> As soon as we stop using skb_queue_list we'll get it down to 24 cachelines.
>>
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>> ---
>>  include/linux/tcp.h |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
>> index 08027f1..f48644d 100644
>> --- a/include/linux/tcp.h
>> +++ b/include/linux/tcp.h
>> @@ -304,7 +304,6 @@ struct tcp_sock {
>>  	u32	rtt_seq;	/* sequence number to update rttvar	*/
>>   	u32	packets_out;	/* Packets which are "in flight"	*/
>> -	u32	retrans_out;	/* Retransmitted packets out		*/
>>  /*
>>   *      Options received (usually on last packet, some only on SYN packets).
>>   */
>> @@ -332,6 +331,8 @@ struct tcp_sock {
>>   	struct tcp_sack_block recv_sack_cache[4];
>>  +	u32	retrans_out;	/* Retransmitted packets out		*/
>> +
>
> Hum... retrans_out should sit close to packets_out (or lost_out/sacked_out 
> ???), please.
>
> 'struct tcp_sock' is very large on 64 bits, so I would prefer to make sure 
> most paths dont need to touch all 24 cache lines (or 25 cache lines).

That is perfectly fine, I'll replace my patch with another, that states
this beyond doubt.

- Arnaldo

^ permalink raw reply

* Re: [PATCH] Disable TSO for non standard qdiscs
From: Jarek Poplawski @ 2008-01-31 20:33 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Waskiewicz Jr, Peter P, Patrick McHardy, Stephen Hemminger,
	netdev
In-Reply-To: <20080131193406.GH4671@one.firstfloor.org>

Andi Kleen wrote, On 01/31/2008 08:34 PM:

>> TSO by nature is bursty.  But disabling TSO without the option of having
>> it on or off to me seems to aggressive.  If someone is using a qdisc
>> that TSO is interfering with the effectiveness of the traffic shaping,
>> then they should turn off TSO via ethtool on the target device.  Some
> 
> The philosophical problem I have with this suggestion is that I expect
> that the large majority of users will be more happy with disabled TSO
> if they use non standard qdiscs and defaults that do not fit 
> the majority use case are bad.


If you mean the large majority of the large minority of users, who use
non standard qdiscs - I agree - this is really the philosophical problem!

 
> Basically you're suggesting that nearly everyone using tc should learn about
> another obscure command.

...So, it sounds like tc is used by nearly everyone now...

It seems my distro really isn't up to date:

"Package: iproute
 ...
 Description: Professional tools to control the networking in Linux kernels
 This is `iproute', the professional set of tools to control the
 networking behavior in kernels 2.2.x and later."

And ethtool doesn't have to be learnt at all: "most friendly distros"
could use this in config or add some graphical wrapper.

Regards,
Jarek P.

^ permalink raw reply

* Re: [PATCH 6/6] [TCP]: Reorganize struct tcp_sock to save 16 bytes on 64-bit arch
From: Arnaldo Carvalho de Melo @ 2008-01-31 20:33 UTC (permalink / raw)
  To: Eric Dumazet, David S. Miller, netdev, dccp
In-Reply-To: <20080131201720.GE11940@ghostprotocols.net>

Em Thu, Jan 31, 2008 at 06:17:20PM -0200, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Jan 31, 2008 at 08:57:53PM +0100, Eric Dumazet escreveu:
> > Hum... retrans_out should sit close to packets_out (or lost_out/sacked_out 
> > ???), please.
> >
> > 'struct tcp_sock' is very large on 64 bits, so I would prefer to make sure 
> > most paths dont need to touch all 24 cache lines (or 25 cache lines).
> 
> That is perfectly fine, I'll replace my patch with another, that states
> this beyond doubt.

David, I just removed this patch from my net-2.6 tree, if you are ok
with the others, please pull.

- Arnaldo

^ permalink raw reply

* Null pointer dereference in bonding driver, kernel 2.6.24
From: Chuck Ebbert @ 2008-01-31 22:36 UTC (permalink / raw)
  To: Jay Vosburgh; +Cc: Netdev

In bond_main.c:

int bond_create(char *name, struct bond_params *params, struct bonding **newbond)
{
...
        /* Check to see if the bond already exists. */
        list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
                if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
                        printk(KERN_ERR DRV_NAME
                               ": cannot add bond %s; it already exists\n",


If 'name' is null we get a null dereference in strnicmp()

The code was added in 2.6.24.

Signed-off-by: Chuck Ebbert <cebbert@redhat.com>

---
(not even compile tested)

 drivers/net/bonding/bond_main.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

--- linux-2.6.24.noarch.orig/drivers/net/bonding/bond_main.c
+++ linux-2.6.24.noarch/drivers/net/bonding/bond_main.c
@@ -4882,15 +4882,17 @@ int bond_create(char *name, struct bond_
 	rtnl_lock();
 	down_write(&bonding_rwsem);
 
-	/* Check to see if the bond already exists. */
-	list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
-		if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
-			printk(KERN_ERR DRV_NAME
-			       ": cannot add bond %s; it already exists\n",
-			       name);
-			res = -EPERM;
-			goto out_rtnl;
-		}
+	if (name) {
+		/* Check to see if the bond already exists. */
+		list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
+			if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
+				printk(KERN_ERR DRV_NAME
+				       ": cannot add bond %s; it already exists\n",
+				       name);
+				res = -EPERM;
+				goto out_rtnl;
+			}
+	}
 
 	bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
 				ether_setup);

^ permalink raw reply

* Re: Null pointer dereference in bonding driver, kernel 2.6.24
From: Jay Vosburgh @ 2008-01-31 22:55 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: Netdev
In-Reply-To: <47A24D65.2000001@redhat.com>

Chuck Ebbert <cebbert@redhat.com> wrote:

>In bond_main.c:
>
>int bond_create(char *name, struct bond_params *params, struct bonding **newbond)
>{
>...
>        /* Check to see if the bond already exists. */
>        list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
>                if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
>                        printk(KERN_ERR DRV_NAME
>                               ": cannot add bond %s; it already exists\n",
>
>
>If 'name' is null we get a null dereference in strnicmp()
>
>The code was added in 2.6.24.

	This is already fixed in netdev-2.6#upstream.

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com

^ permalink raw reply

* [PATCH] e1000e: tweak irq allocation messages
From: Andy Gospodarek @ 2008-01-31 22:56 UTC (permalink / raw)
  To: netdev; +Cc: auke-jan.h.kok


There's too much noise on systems that don't support MSI.  Let's get rid
of the unneeded message and make the real error message more specific.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---

 netdev.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 0a2cb79..0c8cd1c 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -945,11 +945,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
 	int irq_flags = IRQF_SHARED;
 	int err;
 
-	err = pci_enable_msi(adapter->pdev);
-	if (err) {
-		ndev_warn(netdev,
-		 "Unable to allocate MSI interrupt Error: %d\n", err);
-	} else {
+	if (!pci_enable_msi(adapter->pdev)) {
 		adapter->flags |= FLAG_MSI_ENABLED;
 		handler = e1000_intr_msi;
 		irq_flags = 0;
@@ -958,10 +954,12 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
 	err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
 			  netdev);
 	if (err) {
+		ndev_err(netdev,
+		       "Unable to allocate %s interrupt (return: %d)\n",
+			adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx"
+			err);
 		if (adapter->flags & FLAG_MSI_ENABLED)
 			pci_disable_msi(adapter->pdev);
-		ndev_err(netdev,
-		       "Unable to allocate interrupt Error: %d\n", err);
 	}
 
 	return err;

^ permalink raw reply related

* Re: [PATCH] Disable TSO for non standard qdiscs
From: Jarek Poplawski @ 2008-01-31 23:04 UTC (permalink / raw)
  Cc: Andi Kleen, Waskiewicz Jr, Peter P, Patrick McHardy,
	Stephen Hemminger, netdev
In-Reply-To: <47A230A8.7080100@gmail.com>

Jarek Poplawski wrote, On 01/31/2008 09:33 PM:

> Andi Kleen wrote, On 01/31/2008 08:34 PM

 ...

>> Basically you're suggesting that nearly everyone using tc should learn about
>> another obscure command

 
...On the other hand, with this DSL argument from the sub-thread you
could be quite right: if this "everyone" wants to use one NIC for
both high speed local network and such a DSL, then learning ethtool
could be not enough...

Jarek P.


^ permalink raw reply

* Re: [PATCH] e1000e: tweak irq allocation messages
From: Andy Gospodarek @ 2008-01-31 23:06 UTC (permalink / raw)
  To: netdev, auke-jan.h.kok
In-Reply-To: <20080131225639.GB856@gospo.usersys.redhat.com>

On Thu, Jan 31, 2008 at 05:56:39PM -0500, Andy Gospodarek wrote:
> 
> There's too much noise on systems that don't support MSI.  Let's get rid
> of the unneeded message and make the real error message more specific.
> 
> Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
> ---
> 
>  netdev.c |   12 +++++-------
>  1 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
> index 0a2cb79..0c8cd1c 100644
> --- a/drivers/net/e1000e/netdev.c
> +++ b/drivers/net/e1000e/netdev.c
> @@ -945,11 +945,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
>  	int irq_flags = IRQF_SHARED;
>  	int err;
>  
> -	err = pci_enable_msi(adapter->pdev);
> -	if (err) {
> -		ndev_warn(netdev,
> -		 "Unable to allocate MSI interrupt Error: %d\n", err);
> -	} else {
> +	if (!pci_enable_msi(adapter->pdev)) {
>  		adapter->flags |= FLAG_MSI_ENABLED;
>  		handler = e1000_intr_msi;
>  		irq_flags = 0;
> @@ -958,10 +954,12 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
>  	err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
>  			  netdev);
>  	if (err) {
> +		ndev_err(netdev,
> +		       "Unable to allocate %s interrupt (return: %d)\n",
> +			adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx"
> +			err);
>  		if (adapter->flags & FLAG_MSI_ENABLED)
>  			pci_disable_msi(adapter->pdev);
> -		ndev_err(netdev,
> -		       "Unable to allocate interrupt Error: %d\n", err);
>  	}
>  
>  	return err;


(Reposted with the version I intended -- added ',' so it compiles!)

There's too much noise on systems that don't support MSI.  Let's get rid
of a few and make the real error message more specific.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---

 netdev.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 0a2cb79..0c8cd1c 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -945,11 +945,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
 	int irq_flags = IRQF_SHARED;
 	int err;
 
-	err = pci_enable_msi(adapter->pdev);
-	if (err) {
-		ndev_warn(netdev,
-		 "Unable to allocate MSI interrupt Error: %d\n", err);
-	} else {
+	if (!pci_enable_msi(adapter->pdev)) {
 		adapter->flags |= FLAG_MSI_ENABLED;
 		handler = e1000_intr_msi;
 		irq_flags = 0;
@@ -958,10 +954,12 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
 	err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
 			  netdev);
 	if (err) {
+		ndev_err(netdev,
+		       "Unable to allocate %s interrupt (return: %d)\n",
+			adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx",
+			err);
 		if (adapter->flags & FLAG_MSI_ENABLED)
 			pci_disable_msi(adapter->pdev);
-		ndev_err(netdev,
-		       "Unable to allocate interrupt Error: %d\n", err);
 	}
 
 	return err;

^ permalink raw reply related

* Re: [PATCH] Disable TSO for non standard qdiscs
From: Arnaldo Carvalho de Melo @ 2008-01-31 23:10 UTC (permalink / raw)
  To: Waskiewicz Jr, Peter P
  Cc: Andi Kleen, Patrick McHardy, Stephen Hemminger, netdev
In-Reply-To: <D5C1322C3E673F459512FB59E0DDC32904700F27@orsmsx414.amr.corp.intel.com>

Em Thu, Jan 31, 2008 at 11:39:55AM -0800, Waskiewicz Jr, Peter P escreveu:
> > The philosophical problem I have with this suggestion is that 
> > I expect that the large majority of users will be more happy 
> > with disabled TSO if they use non standard qdiscs and 
> > defaults that do not fit the majority use case are bad.
> > 
> > Basically you're suggesting that nearly everyone using tc 
> > should learn about another obscure command.
> 
> If someone is using tc to load and configure a qdisc, I'd really hope
> knowing or learning ethtool wouldn't be a stretch for them...  And I'm
> not arguing the majority of people will want this or not, but taking
> away the ability to use TSO at the kernel level here without allowing a
> tuneable is making that decision for them, which is wrong IMO.

Well, it could be just that when using such qdiscs TSO would be
disabled, but the user could override this by using ethtool after
loading the qdiscs.

- Arnaldo

^ permalink raw reply

* RE: [PATCH] Disable TSO for non standard qdiscs
From: Waskiewicz Jr, Peter P @ 2008-01-31 23:42 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Andi Kleen, Patrick McHardy, Stephen Hemminger, netdev
In-Reply-To: <20080131231045.GA5543@ghostprotocols.net>

> Well, it could be just that when using such qdiscs TSO would be
> disabled, but the user could override this by using ethtool after
> loading the qdiscs.

I still disagree with this.  The qdisc should not cause anything to happen to feature flags on the device. It's the scheduling layer and really shouldn't care about what features the device supports or not.  If someone has an issue with a feature hurting performance or causing odd behavior when using a qdisc, then they should disable the feature on the device using the appropriate tools provided.  If it's the qdisc causing issues, then either the qdisc needs to be fixed, or it should be documented what features are recommended to be on and off with the qdisc.  I don't agree that the scheduling layer should affect features on an underlying device.

Cheers,

-PJ Waskiewicz

^ permalink raw reply

* Re: [PATCH] e1000e: tweak irq allocation messages
From: Kok, Auke @ 2008-01-31 23:54 UTC (permalink / raw)
  To: Andy Gospodarek; +Cc: netdev, auke-jan.h.kok
In-Reply-To: <20080131230620.GC856@gospo.usersys.redhat.com>

Andy Gospodarek wrote:
> (Reposted with the version I intended -- added ',' so it compiles!)
> 
> There's too much noise on systems that don't support MSI.  Let's get rid
> of a few and make the real error message more specific.
> 
> Signed-off-by: Andy Gospodarek <andy@greyhouse.net>

thanks Andy, I'll post this to Jeff,

Auke



> ---
> 
>  netdev.c |   12 +++++-------
>  1 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
> index 0a2cb79..0c8cd1c 100644
> --- a/drivers/net/e1000e/netdev.c
> +++ b/drivers/net/e1000e/netdev.c
> @@ -945,11 +945,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
>  	int irq_flags = IRQF_SHARED;
>  	int err;
>  
> -	err = pci_enable_msi(adapter->pdev);
> -	if (err) {
> -		ndev_warn(netdev,
> -		 "Unable to allocate MSI interrupt Error: %d\n", err);
> -	} else {
> +	if (!pci_enable_msi(adapter->pdev)) {
>  		adapter->flags |= FLAG_MSI_ENABLED;
>  		handler = e1000_intr_msi;
>  		irq_flags = 0;
> @@ -958,10 +954,12 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
>  	err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
>  			  netdev);
>  	if (err) {
> +		ndev_err(netdev,
> +		       "Unable to allocate %s interrupt (return: %d)\n",
> +			adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx",
> +			err);
>  		if (adapter->flags & FLAG_MSI_ENABLED)
>  			pci_disable_msi(adapter->pdev);
> -		ndev_err(netdev,
> -		       "Unable to allocate interrupt Error: %d\n", err);
>  	}
>  
>  	return err;
> --
> 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


^ permalink raw reply

* Re: [PATCH] ipv6: update MSS even if MTU is unchanged
From: David Miller @ 2008-02-01  0:37 UTC (permalink / raw)
  To: jim; +Cc: netdev
In-Reply-To: <20080121220248.GA25284@jim.sh>

From: Jim Paris <jim@jtan.com>
Date: Mon, 21 Jan 2008 17:02:48 -0500

> This is needed because in ndisc.c, we have:
> 
>   static void ndisc_router_discovery(struct sk_buff *skb)
>   {
>   // ...
>   	if (ndopts.nd_opts_mtu) {
>   // ...
>   			if (rt)
>   				rt->u.dst.metrics[RTAX_MTU-1] = mtu;
> 
>   			rt6_mtu_change(skb->dev, mtu);
>   // ...
>   }
> 
> Since the mtu is set directly here, rt6_mtu_change_route thinks that
> it is unchanged, and so it fails to update the MSS accordingly.  This
> patch lets rt6_mtu_change_route still update MSS if old_mtu == new_mtu.
> 
> Signed-off-by: Jim Paris <jim@jtan.com>

This seems ok, patch applied, thanks.

^ permalink raw reply

* Re: [PATCH net-2.6.25] [PKTGEN] Remove an unused definition in pktgen.c.
From: David Miller @ 2008-02-01  0:43 UTC (permalink / raw)
  To: ramirose; +Cc: netdev
In-Reply-To: <eb3ff54b0801230638j4e0ece76sf0a2592477050fee@mail.gmail.com>

From: "Rami Rosen" <ramirose@gmail.com>
Date: Wed, 23 Jan 2008 16:38:09 +0200

> Hi,
> - Remove an unused definition (LAT_BUCKETS_MAX) in net/core/pktgen.c.
> - Remove the corresponding comment.
> - The LAT_BUCKETS_MAX seems to have to do with a patch from a long
> time ago which was not applied (Ben Greear), which dealt with latency
> counters.
> 
> See, for example : http://oss.sgi.com/archives/netdev/2002-09/msg00184.html
> 
> Signed-off-by: Rami Rosen <ramirose@gmail.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] fib_trie: rescan if key is lost during dump
From: David Miller @ 2008-02-01  0:45 UTC (permalink / raw)
  To: shemminger; +Cc: kaber, netdev
In-Reply-To: <20080124135112.32b5c1c7@deepthought>

From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Thu, 24 Jan 2008 13:51:12 -0800

> Normally during a dump the key of the last dumped entry is used for
> continuation, but since lock is dropped it might be lost. In that case
> fallback to the old counter based N^2 behaviour.  This means the dump will end up
> skipping some routes which matches what FIB_HASH does.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] TCP:Fix a bug in strategy_allowed_congestion_control
From: David Miller @ 2008-02-01  0:47 UTC (permalink / raw)
  To: shanwei; +Cc: shemminger, netdev, sjansen
In-Reply-To: <479D386F.5030805@cn.fujitsu.com>

From: shanwei <shanwei@cn.fujitsu.com>
Date: Mon, 28 Jan 2008 10:05:35 +0800

> Stephen Hemminger 写道:
> > On Fri, 25 Jan 2008 15:10:13 +0800
> > shanwei <shanwei@cn.fujitsu.com> wrote:
> > 
> >> hi all:
> >>
> >> In strategy_allowed_congestion_control of the 2.6.24 kernel, 
> >> when sysctl_string return 1 on success,it should call 
> >> tcp_set_allowed_congestion_control to set the allowed congestion
> >> control.But, it don't.
> >> the sysctl_string return 1 on success, otherwise return negative,
> >> never return 0.The patch fix the problem.
> >>
> >> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> >>
> >> diff -Nuarp linux-2.6.24/net/ipv4/sysctl_net_ipv4.c linux-2.6.24-new/net/ipv4/sysctl_net_ipv4.c
> >> --- linux-2.6.24/net/ipv4/sysctl_net_ipv4.c	2008-01-25 06:58:37.000000000 +0800
> >> +++ linux-2.6.24-new/net/ipv4/sysctl_net_ipv4.c	2008-01-25 12:23:20.000000000 +0800
> >> @@ -248,7 +248,7 @@ static int strategy_allowed_congestion_c
> >>  
> >>  	tcp_get_available_congestion_control(tbl.data, tbl.maxlen);
> >>  	ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen);
> >> -	if (ret == 0 && newval && newlen)
> >> +	if (ret == 1 && newval && newlen)
> >>  		ret = tcp_set_allowed_congestion_control(tbl.data);
> >>  	kfree(tbl.data);
> >>
> >>
> > 
> > Acked-by: Stephen Hemminger <shemminger@vyatta.com>
> > 
> > This parallels previous fix by Sam Jansen.
> > 
> > 
> >From the link:http://marc.info/?l=linux-netdev&m=119551836927062&w=2,
> he only fix the sysctl_tcp_congestion_control function.
> In the latest kernel, the sysctl_string problem is present.
> Can this patch be applied?

Done.

^ permalink raw reply

* Re: [VLAN]: set_rx_mode support for unicast address list
From: David Miller @ 2008-02-01  0:54 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <479F41BF.6050004@trash.net>


Applied.

^ permalink raw reply

* Re: [PATCH net-2.6.25] [MACVLAN] Setting macvlan_handle_frame_hook to NULL when rtnl_link_register() fails.
From: David Miller @ 2008-02-01  0:56 UTC (permalink / raw)
  To: kaber; +Cc: ramirose, netdev
In-Reply-To: <479F43E8.4010107@trash.net>

From: Patrick McHardy <kaber@trash.net>
Date: Tue, 29 Jan 2008 16:19:04 +0100

> Rami Rosen wrote:
> > Hi,
> >   In drivers/net/macvlan.c, when rtnl_link_register() fails
> > in macvlan_init_module(), there is no point to set it (second time in this
> > method) to macvlan_handle_frame; macvlan_init_module() will return a negative
> > number, so instead this patch sets macvlan_handle_frame_hook to NULL.
> 
> 
> Indeed, that seems to be a stupid cut-and-paste error. Thanks for
> catching this.
> 
> Dave, please apply.

Done.

^ permalink raw reply

* Re: [NET_SCHED]: sch_ingress: remove netfilter support
From: David Miller @ 2008-02-01  0:57 UTC (permalink / raw)
  To: kaber; +Cc: hadi, netdev
In-Reply-To: <479F460B.2060104@trash.net>

From: Patrick McHardy <kaber@trash.net>
Date: Tue, 29 Jan 2008 16:28:11 +0100

>     [NET_SCHED]: sch_ingress: remove netfilter support
>     
>     Since the old policer code is gone, TC actions are needed for policing.
>     The ingress qdisc can get packets directly from netif_receive_skb()
>     in case TC actions are enabled or through netfilter otherwise, but
>     since without TC actions there is no policer the only thing it actually
>     does is count packets.
>     
>     Remove the netfilter support and always require TC actions.
>     
>     Signed-off-by: Patrick McHardy <kaber@trash.net>

Applied.

^ permalink raw reply

* Re: [PATCH] pktgen: pktgen should not print info that it is spinning
From: David Miller @ 2008-02-01  1:00 UTC (permalink / raw)
  To: jesse.brandeburg; +Cc: netdev, auke-jan.h.kok, Robert.Olsson
In-Reply-To: <20080128211635.5907.81831.stgit@jbrandeb-ich9b.jf.intel.com>

From: Jesse Brandeburg <jesse.brandeburg@intel.com>
Date: Mon, 28 Jan 2008 13:16:35 -0800

> when using pktgen to send delay packets the module prints repeatedly to the
> kernel log:
> sleeping for X
> sleeping for X
> ...
> 
> This is probably just a debugging item left in and should not be enabled for
> regular use of the module.
> 
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>

Applied, thanks.

^ permalink raw reply

* Re: [1/2] POHMELFS - network filesystem with local coherent cache.
From: Jan Engelhardt @ 2008-02-01  1:04 UTC (permalink / raw)
  To: Evgeniy Polyakov; +Cc: linux-kernel, netdev, linux-fsdevel
In-Reply-To: <11972872493911@2ka.mipt.ru>


On Jan 31 2008 22:17, Evgeniy Polyakov wrote:
>
>POHMELFS stands for Parallel Optimized Host Message Exchange
>Layered File System. It allows to mount remote servers to local
>directory via network. This filesystem supports local caching
>and writeback flushing.
>POHMELFS is a brick in a future distributed filesystem.

A brick is usually something that is in the way -
Or you also say "the user has bricked his machine"
when it's quite unusable :)
Hope you did not mean /that/.

>This set includes two patches:
> * network filesystem with write-through cache (slow, but works with
> 	remote userspace server)
> * hack to show how local cache works and how faster it is compared
> 	to async NFS (see below). hack disables writeback flush and
>	performs local allocation of the objects only.
>
>Now, some vaporware aka food for thoughts and your brains.
>
>A small benchmark of the local cached mode (above hack):
>
>$ time tar -xf /home/zbr/threading.tar
>
>	POHMELFS	NFS v3 (async)
>real    0m0.043s	0m1.679s
>
>Which is damn 40 times!

Needs a bigger data set to compare. But what is much more
important: does it use a single port for networing, or some
firewall-unfriendly-by-default multiple dynamic-port-allocation
like NFS?

>Next task is to think about how to generically solve the problem with
>syncing local changes with remote server, when remote server maintains inodes with
>completely different numbers.
>This, among others, will allow offline work with automatic syncing after reconnect.

What will happen when both nodes change an inode in disconnected state?
Which inode wins out?

>This is not intended for inclusion, CRFS by Zach Brown is a bit ahead of POHMELFS,
>but it is not generic enough (because of above problem), works only with BTRFS,
>and was closed by Oracle so far :)

btrfs is all we need :p


Where's the parallelism that is advertised by the "POH" in pohmelfs?

^ permalink raw reply


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