Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 09/16] virtio-net: drop config_mutex
From: Sergei Shtylyov @ 2014-10-06 11:46 UTC (permalink / raw)
  To: Michael S. Tsirkin, linux-kernel; +Cc: netdev, virtualization
In-Reply-To: <1412525038-15871-10-git-send-email-mst@redhat.com>

Hello.

On 10/5/2014 8:07 PM, Michael S. Tsirkin wrote:

> config_mutex served two purposes: prevent multiple concurrent config
> change handlers, and synchronize access to config_enable flag.

> Since commit dbf2576e37da0fcc7aacbfbb9fd5d3de7888a3c1
>      workqueue: make all workqueues non-reentrant
> all workqueues are non-reentrant, and config_enable
> is now gone.

> Get rid of the unnecessary lock.

> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>   drivers/net/virtio_net.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)

> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index fa17afa..d80fef4 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
[...]
> @@ -1430,7 +1426,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
>   		netif_tx_stop_all_queues(vi->dev);
>   	}
>   done:
> -	mutex_unlock(&vi->config_lock);
> +	return;

    There's no need for this *return*.

>   }
>
>   static void virtnet_config_changed(struct virtio_device *vdev)

WBR, Sergei

^ permalink raw reply

* [iproute2 1/1] RFC: obsolete direct invocation of police
From: Jamal Hadi Salim @ 2014-10-06 11:46 UTC (permalink / raw)
  To: stephen; +Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim

From: Jamal Hadi Salim <jhs@mojatatu.com>

I realize this may be controversial. I dont think people are still using
the 1990s syntax anymore. This is one way to test it.
We want to eventually phase out the kernel hacks for backward compat.

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
 tc/f_basic.c   |    9 +++------
 tc/f_bpf.c     |    9 +++------
 tc/f_cgroup.c  |    9 +++------
 tc/f_flow.c    |    9 +++------
 tc/f_fw.c      |    9 +++------
 tc/f_route.c   |    9 +++------
 tc/f_rsvp.c    |    9 +++------
 tc/f_tcindex.c |    9 +++------
 tc/f_u32.c     |   10 +++-------
 9 files changed, 27 insertions(+), 55 deletions(-)

diff --git a/tc/f_basic.c b/tc/f_basic.c
index 1c33ca3..6137f83 100644
--- a/tc/f_basic.c
+++ b/tc/f_basic.c
@@ -86,12 +86,9 @@ static int basic_parse_opt(struct filter_util *qu, char *handle,
 			continue;
 
 		} else if (matches(*argv, "police") == 0) {
-			NEXT_ARG();
-			if (parse_police(&argc, &argv, TCA_BASIC_POLICE, n)) {
-				fprintf(stderr, "Illegal \"police\"\n");
-				return -1;
-			}
-			continue;
+			fprintf(stderr, "Obsolete \"police\"\n");
+			fprintf(stderr, "use \"action police ...\"\n");
+			return -1;
 		} else if (strcmp(*argv, "help") == 0) {
 			explain();
 			return -1;
diff --git a/tc/f_bpf.c b/tc/f_bpf.c
index 48635a7..4d86f38 100644
--- a/tc/f_bpf.c
+++ b/tc/f_bpf.c
@@ -227,12 +227,9 @@ static int bpf_parse_opt(struct filter_util *qu, char *handle,
 			}
 			continue;
 		} else if (matches(*argv, "police") == 0) {
-			NEXT_ARG();
-			if (parse_police(&argc, &argv, TCA_BPF_POLICE, n)) {
-				fprintf(stderr, "Illegal \"police\"\n");
-				return -1;
-			}
-			continue;
+			fprintf(stderr, "Obsolete \"police\"\n");
+			fprintf(stderr, "use \"action police ...\"\n");
+			return -1;
 		} else if (strcmp(*argv, "help") == 0) {
 			explain();
 			return -1;
diff --git a/tc/f_cgroup.c b/tc/f_cgroup.c
index 53f7406..092050c 100644
--- a/tc/f_cgroup.c
+++ b/tc/f_cgroup.c
@@ -60,12 +60,9 @@ static int cgroup_parse_opt(struct filter_util *qu, char *handle,
 			continue;
 
 		} else if (matches(*argv, "police") == 0) {
-			NEXT_ARG();
-			if (parse_police(&argc, &argv, TCA_CGROUP_POLICE, n)) {
-				fprintf(stderr, "Illegal \"police\"\n");
-				return -1;
-			}
-			continue;
+			fprintf(stderr, "Obsolete \"police\"\n");
+			fprintf(stderr, "use \"action police ...\"\n");
+			return -1;
 		} else if (strcmp(*argv, "help") == 0) {
 			explain();
 			return -1;
diff --git a/tc/f_flow.c b/tc/f_flow.c
index b454a65..d021f6f 100644
--- a/tc/f_flow.c
+++ b/tc/f_flow.c
@@ -220,12 +220,9 @@ static int flow_parse_opt(struct filter_util *fu, char *handle,
 			}
 			addattr32(n, 4096, TCA_FLOW_PERTURB, tmp);
 		} else if (matches(*argv, "police") == 0) {
-			NEXT_ARG();
-			if (parse_police(&argc, &argv, TCA_FLOW_POLICE, n)) {
-				fprintf(stderr, "Illegal \"police\"\n");
-				return -1;
-			}
-			continue;
+			fprintf(stderr, "Obsolete \"police\"\n");
+			fprintf(stderr, "use \"action police ...\"\n");
+			return -1;
 		} else if (matches(*argv, "action") == 0) {
 			NEXT_ARG();
 			if (parse_action(&argc, &argv, TCA_FLOW_ACT, n)) {
diff --git a/tc/f_fw.c b/tc/f_fw.c
index 165f489..4b15cce1 100644
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -78,12 +78,9 @@ static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **a
 			}
 			addattr_l(n, 4096, TCA_FW_CLASSID, &handle, 4);
 		} else if (matches(*argv, "police") == 0) {
-			NEXT_ARG();
-			if (parse_police(&argc, &argv, TCA_FW_POLICE, n)) {
-				fprintf(stderr, "Illegal \"police\"\n");
-				return -1;
-			}
-			continue;
+			fprintf(stderr, "Obsolete \"police\"\n");
+			fprintf(stderr, "use \"action police ...\"\n");
+			return -1;
 		} else if (matches(*argv, "action") == 0) {
 			NEXT_ARG();
 			if (parse_action(&argc, &argv, TCA_FW_ACT, n)) {
diff --git a/tc/f_route.c b/tc/f_route.c
index 23c4ecc..7603c0e 100644
--- a/tc/f_route.c
+++ b/tc/f_route.c
@@ -99,12 +99,9 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
 			}
 			addattr_l(n, 4096, TCA_ROUTE4_CLASSID, &handle, 4);
 		} else if (matches(*argv, "police") == 0) {
-			NEXT_ARG();
-			if (parse_police(&argc, &argv, TCA_ROUTE4_POLICE, n)) {
-				fprintf(stderr, "Illegal \"police\"\n");
-				return -1;
-			}
-			continue;
+			fprintf(stderr, "Obsolete \"police\"\n");
+			fprintf(stderr, "use \"action police ...\"\n");
+			return -1;
 		} else if (matches(*argv, "action") == 0) {
 			NEXT_ARG();
 			if (parse_action(&argc, &argv, TCA_ROUTE4_ACT, n)) {
diff --git a/tc/f_rsvp.c b/tc/f_rsvp.c
index cb7b8fb..b1af8fb 100644
--- a/tc/f_rsvp.c
+++ b/tc/f_rsvp.c
@@ -269,12 +269,9 @@ static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc, char *
 			}
 			continue;
 		} else if (matches(*argv, "police") == 0) {
-			NEXT_ARG();
-			if (parse_police(&argc, &argv, TCA_RSVP_POLICE, n)) {
-				fprintf(stderr, "Illegal \"police\"\n");
-				return -1;
-			}
-			continue;
+			fprintf(stderr, "Obsolete \"police\"\n");
+			fprintf(stderr, "use \"action police ...\"\n");
+			return -1;
 		} else if (strcmp(*argv, "help") == 0) {
 			explain();
 			return -1;
diff --git a/tc/f_tcindex.c b/tc/f_tcindex.c
index b1847c8..e7a08d9 100644
--- a/tc/f_tcindex.c
+++ b/tc/f_tcindex.c
@@ -99,12 +99,9 @@ static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
 			addattr_l(n, 4096, TCA_TCINDEX_CLASSID, &handle, 4);
 		}
 		else if (!strcmp(*argv,"police")) {
-			NEXT_ARG();
-			if (parse_police(&argc, &argv, TCA_TCINDEX_POLICE, n)) {
-				fprintf(stderr, "Illegal \"police\"\n");
-				return -1;
-			}
-			continue;
+			fprintf(stderr, "Obsolete \"police\"\n");
+			fprintf(stderr, "use \"action police ...\"\n");
+			return -1;
 		}
 		else if (!strcmp(*argv,"action")) {
 			NEXT_ARG();
diff --git a/tc/f_u32.c b/tc/f_u32.c
index 80a5097..a7b3da6 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -1131,13 +1131,9 @@ static int u32_parse_opt(struct filter_util *qu, char *handle,
 			continue;
 
 		} else if (matches(*argv, "police") == 0) {
-			NEXT_ARG();
-			if (parse_police(&argc, &argv, TCA_U32_POLICE, n)) {
-				fprintf(stderr, "Illegal \"police\"\n");
-				return -1;
-			}
-			terminal_ok++;
-			continue;
+			fprintf(stderr, "Obsolete \"police\"\n");
+			fprintf(stderr, "use \"action police ...\"\n");
+			return -1;
 		} else if (strcmp(*argv, "help") == 0) {
 			explain();
 			return -1;
-- 
1.7.9.5

^ permalink raw reply related

* [iproute2 1/1] discourage use of direct policer interface
From: Jamal Hadi Salim @ 2014-10-06 11:41 UTC (permalink / raw)
  To: stephen
  Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim,
	Jamal Hadi Salim

From: Jamal Hadi Salim <hadi@mojatatu.com>

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
 tc/f_basic.c  |    3 ++-
 tc/f_bpf.c    |    5 +++--
 tc/f_cgroup.c |    4 ++--
 tc/f_flow.c   |    2 +-
 tc/f_fw.c     |    4 ++--
 tc/f_rsvp.c   |    4 ++--
 tc/f_u32.c    |    2 +-
 7 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/tc/f_basic.c b/tc/f_basic.c
index 67d26ec..1c33ca3 100644
--- a/tc/f_basic.c
+++ b/tc/f_basic.c
@@ -27,11 +27,12 @@
 
 static void explain(void)
 {
-	fprintf(stderr, "Usage: ... basic [ match EMATCH_TREE ] [ police POLICE_SPEC ]\n");
+	fprintf(stderr, "Usage: ... basic [ match EMATCH_TREE ] \n");
 	fprintf(stderr, "                 [ action ACTION_SPEC ] [ classid CLASSID ]\n");
 	fprintf(stderr, "\n");
 	fprintf(stderr, "Where: SELECTOR := SAMPLE SAMPLE ...\n");
 	fprintf(stderr, "       FILTERID := X:Y:Z\n");
+	fprintf(stderr, "       ACTION_SPEC := ... look at individual actions\n");
 	fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
 }
 
diff --git a/tc/f_bpf.c b/tc/f_bpf.c
index 8f1593c..48635a7 100644
--- a/tc/f_bpf.c
+++ b/tc/f_bpf.c
@@ -34,13 +34,14 @@ static void explain(void)
 	fprintf(stderr, " [inline]:     run bytecode BPF_BYTECODE\n");
 	fprintf(stderr, " [from file]:  run bytecode-file FILE\n");
 	fprintf(stderr, "\n");
-	fprintf(stderr, "               [ police POLICE_SPEC ] [ action ACTION_SPEC ]\n");
+	fprintf(stderr, "               [ action ACTION_SPEC ]\n");
 	fprintf(stderr, "               [ classid CLASSID ]\n");
 	fprintf(stderr, "\n");
 	fprintf(stderr, "Where BPF_BYTECODE := \'s,c t f k,c t f k,c t f k,...\'\n");
 	fprintf(stderr, "      c,t,f,k and s are decimals; s denotes number of 4-tuples\n");
 	fprintf(stderr, "Where FILE points to a file containing the BPF_BYTECODE string\n");
-	fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
+	fprintf(stderr, "\nACTION_SPEC := ... look at individual actions\n");
+	fprintf(stderr, "NOTE: CLASSID is parsed as hexadecimal input.\n");
 }
 
 static int bpf_parse_string(char *arg, bool from_file, __u16 *bpf_len,
diff --git a/tc/f_cgroup.c b/tc/f_cgroup.c
index 4a4026e..53f7406 100644
--- a/tc/f_cgroup.c
+++ b/tc/f_cgroup.c
@@ -18,8 +18,8 @@
 
 static void explain(void)
 {
-	fprintf(stderr, "Usage: ... cgroup [ match EMATCH_TREE ] [ police POLICE_SPEC ]\n");
-	fprintf(stderr, "                 [ action ACTION_SPEC ]\n");
+	fprintf(stderr, "Usage: ... cgroup [ match EMATCH_TREE ]\n");
+	fprintf(stderr, "                  [ action ACTION_SPEC ]\n");
 }
 
 static int cgroup_parse_opt(struct filter_util *qu, char *handle,
diff --git a/tc/f_flow.c b/tc/f_flow.c
index 7d4bb7a..b454a65 100644
--- a/tc/f_flow.c
+++ b/tc/f_flow.c
@@ -27,7 +27,7 @@ static void explain(void)
 " [hashing mode]: hash keys KEY-LIST ... [ perturb SECS ]\n"
 "\n"
 "                 [ divisor NUM ] [ baseclass ID ] [ match EMATCH_TREE ]\n"
-"                 [ police POLICE_SPEC ] [ action ACTION_SPEC ]\n"
+"                 [ action ACTION_SPEC ]\n"
 "\n"
 "KEY-LIST := [ KEY-LIST , ] KEY\n"
 "KEY      := [ src | dst | proto | proto-src | proto-dst | iif | priority | \n"
diff --git a/tc/f_fw.c b/tc/f_fw.c
index 161e2f7..165f489 100644
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -25,8 +25,8 @@
 
 static void explain(void)
 {
-	fprintf(stderr, "Usage: ... fw [ classid CLASSID ] [ police POLICE_SPEC ]\n");
-	fprintf(stderr, "       POLICE_SPEC := ... look at TBF\n");
+	fprintf(stderr, "Usage: ... fw [ classid CLASSID ] [ action ACTION_SPEC ]\n");
+	fprintf(stderr, "       ACTION_SPEC := ... look at individual actions\n");
 	fprintf(stderr, "       CLASSID := X:Y\n");
 	fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
 }
diff --git a/tc/f_rsvp.c b/tc/f_rsvp.c
index 14f24b1..cb7b8fb 100644
--- a/tc/f_rsvp.c
+++ b/tc/f_rsvp.c
@@ -28,11 +28,11 @@ static void explain(void)
 {
 	fprintf(stderr, "Usage: ... rsvp ipproto PROTOCOL session DST[/PORT | GPI ]\n");
 	fprintf(stderr, "                [ sender SRC[/PORT | GPI ]\n");
-	fprintf(stderr, "                [ classid CLASSID ] [ police POLICE_SPEC ]\n");
+	fprintf(stderr, "                [ classid CLASSID ] [ action ACTION_SPEC ]\n");
 	fprintf(stderr, "                [ tunnelid ID ] [ tunnel ID skip NUMBER ]\n");
 	fprintf(stderr, "Where: GPI := { flowlabel NUMBER | spi/ah SPI | spi/esp SPI |\n");
 	fprintf(stderr, "                u{8|16|32} NUMBER mask MASK at OFFSET}\n");
-	fprintf(stderr, "       POLICE_SPEC := ... look at TBF\n");
+	fprintf(stderr, "       ACTION_SPEC := ... look at individual actions\n");
 	fprintf(stderr, "       FILTERID := X:Y\n");
 	fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
 }
diff --git a/tc/f_u32.c b/tc/f_u32.c
index f2a862d..80a5097 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -32,7 +32,7 @@ static void explain(void)
 {
 	fprintf(stderr, "Usage: ... u32 [ match SELECTOR ... ] [ link HTID ]"
 		" [ classid CLASSID ]\n");
-	fprintf(stderr, "               [ police POLICE_SPEC ]"
+	fprintf(stderr, "               [ action ACTION_SPEC ]"
 		" [ offset OFFSET_SPEC ]\n");
 	fprintf(stderr, "               [ ht HTID ] [ hashkey HASHKEY_SPEC ]\n");
 	fprintf(stderr, "               [ sample SAMPLE ]\n");
-- 
1.7.9.5

^ permalink raw reply related

* [iproute2 2/2] route classifier support for multiple actions
From: Jamal Hadi Salim @ 2014-10-06 11:30 UTC (permalink / raw)
  To: stephen; +Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim
In-Reply-To: <1412595017-6346-1-git-send-email-jhs@emojatatu.com>

From: Jamal Hadi Salim <jhs@mojatatu.com>

route can now use the action syntax

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
 tc/f_route.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tc/f_route.c b/tc/f_route.c
index 649e0ec..23c4ecc 100644
--- a/tc/f_route.c
+++ b/tc/f_route.c
@@ -28,8 +28,8 @@
 static void explain(void)
 {
 	fprintf(stderr, "Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n");
-	fprintf(stderr, "                [ flowid CLASSID ] [ police POLICE_SPEC ]\n");
-	fprintf(stderr, "       POLICE_SPEC := ... look at TBF\n");
+	fprintf(stderr, "                [ flowid CLASSID ] [ action ACTION_SPEC ]]\n");
+	fprintf(stderr, "       ACTION_SPEC := ... look at individual actions\n");
 	fprintf(stderr, "       CLASSID := X:Y\n");
 	fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
 }
@@ -105,6 +105,13 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
 				return -1;
 			}
 			continue;
+		} else if (matches(*argv, "action") == 0) {
+			NEXT_ARG();
+			if (parse_action(&argc, &argv, TCA_ROUTE4_ACT, n)) {
+				fprintf(stderr, "Illegal \"action\"\n");
+				return -1;
+			}
+			continue;
 		} else if (matches(*argv, "order") == 0) {
 			NEXT_ARG();
 			if (get_u32(&order, *argv, 0)) {
@@ -158,6 +165,8 @@ static int route_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt,
 		fprintf(f, "fromif %s", ll_index_to_name(*(int*)RTA_DATA(tb[TCA_ROUTE4_IIF])));
 	if (tb[TCA_ROUTE4_POLICE])
 		tc_print_police(f, tb[TCA_ROUTE4_POLICE]);
+	if (tb[TCA_ROUTE4_ACT])
+		tc_print_action(f, tb[TCA_ROUTE4_ACT]);
 	return 0;
 }
 
-- 
1.7.9.5

^ permalink raw reply related

* [iproute2 1/2] tcindex classifier support for multiple actions
From: Jamal Hadi Salim @ 2014-10-06 11:30 UTC (permalink / raw)
  To: stephen; +Cc: netdev, xiyou.wangcong, john.r.fastabend, Jamal Hadi Salim

From: Jamal Hadi Salim <jhs@mojatatu.com>

tcindex can now use the action syntax

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
 tc/f_tcindex.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tc/f_tcindex.c b/tc/f_tcindex.c
index 590c0a6..b1847c8 100644
--- a/tc/f_tcindex.c
+++ b/tc/f_tcindex.c
@@ -21,7 +21,7 @@ static void explain(void)
 	    " [ shift SHIFT ]\n");
 	fprintf(stderr,"                    [ pass_on | fall_through ]\n");
 	fprintf(stderr,"                    [ classid CLASSID ] "
-	    "[ police POLICE_SPEC ]\n");
+	    "[ action ACTION_SPEC ]\n");
 }
 
 static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
@@ -106,6 +106,14 @@ static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
 			}
 			continue;
 		}
+		else if (!strcmp(*argv,"action")) {
+			NEXT_ARG();
+			if (parse_police(&argc, &argv, TCA_TCINDEX_ACT, n)) {
+				fprintf(stderr, "Illegal \"action\"\n");
+				return -1;
+			}
+			continue;
+		}
 		else {
 			explain();
 			return -1;
@@ -171,6 +179,10 @@ static int tcindex_print_opt(struct filter_util *qu, FILE *f,
 		fprintf(f, "\n");
 		tc_print_police(f, tb[TCA_TCINDEX_POLICE]);
 	}
+	if (tb[TCA_TCINDEX_ACT]) {
+		fprintf(f, "\n");
+		tc_print_police(f, tb[TCA_TCINDEX_ACT]);
+	}
 	return 0;
 }
 
-- 
1.7.9.5

^ permalink raw reply related

* Re: netlink NETLINK_ROUTE failure & Can the kernel really handle IPv6 properly
From: Ulf Samuelsson @ 2014-10-06 11:25 UTC (permalink / raw)
  To: David Miller; +Cc: dcbw, netdev, hannes, netdev
In-Reply-To: <20141003.114949.826855678619123407.davem@davemloft.net>

On 10/03/2014 08:49 PM, David Miller wrote:
> From: Ulf Samuelsson <ulf.samuelsson@ericsson.com>
> Date: Fri, 3 Oct 2014 09:59:39 +0200
>
>> The kernel module is a control module which collects information
>> both from the kernel and from H/W, and talks to a userspace interface
>> manager.
>>
>> There is a proprietary management application which is used to
>> configure the stack.
>> This talks to the interface manager to handle different operations for
>> IPv6.
>>
>> The kernel module needs to know when interfaces are ready to use,
>> I.E: know when it exits "tentative" mode to do its job properly,
>> so the kernel module has to listen for RTM_NEWADDR.
>>
>> In a simpler system, your approach would be OK.
> Sorry, we're not going to help you with a proprietary driver
> of this kind.
>
> They should really just follow our upstream efforts to design
> a usable kernel framework for bridge and routing hardware offloads.

Whether to use a kernel framework or not is not my decision,
and I don't even work with that code.

What should interest the community is that a lot of stuff is probably
not working properly, when IPv6 link-local addresses are used.

Listening for NETDEV_UP, which is used in many places in the kernel, 
seems incorrect,
since connection to the link-local address will fail until the 
link-local address is verified.
It is not immediately obvious, since after 1-2 seconds the problem 
disappears.

For that, listening to the RTM_NEWADDR seems mandatory, so
any framework would benefit from a solution as well.


Best Regards,
Ulf Samuelsson

'

^ permalink raw reply

* Re: [Patch net-next] net_sched: refactor out tcf_exts
From: Jamal Hadi Salim @ 2014-10-06 11:20 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: John Fastabend, David S. Miller
In-Reply-To: <1412376709-25564-1-git-send-email-xiyou.wangcong@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]

Sorry for being annoying.
Cong - here's a simple test that will test for both .police and .action
for one classifier. If you have time please run it when updating your
patch.

cheers,
jamal



[-- Attachment #2: rsvp-test1 --]
[-- Type: text/plain, Size: 1808 bytes --]

export TC=/path/to/updatedtc

sudo $TC qdisc del dev eth0 root handle 1:0 prio 
sudo $TC qdisc add dev eth0 root handle 1:0 prio 

sudo $TC filter add dev eth0 pref 10 proto ip parent 1:0 rsvp session 10.0.0.1 ipproto icmp classid 1:1  police rate 1kbit burst 90k conform-exceed drop/ok

#display stats
$TC -s filter show dev eth0 parent 1:0
filter protocol ip pref 10 rsvp 
filter protocol ip pref 10 rsvp fh 0x0001100a flowid 1:1 session 10.0.0.1 ipproto icmp 
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) 


sudo ping -f 10.0.0.1 -c 10000

#display stats again..
$TC -s filter show dev eth0 parent 1:0

#
#
#lets redo with action semantics (two actions in the graph)
sudo $TC qdisc del dev eth0 root handle 1:0 prio
sudo $TC qdisc add dev eth0 root handle 1:0 prio

sudo $TC filter add dev eth0 pref 10 proto ip parent 1:0 \
rsvp session 10.0.0.1 ipproto icmp \
classid 1:1  \
action police rate 1kbit burst 90k pipe \
action ok

sudo ping -f 10.0.0.1 -c 1000
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
 
--- 10.0.0.1 ping statistics ---
1000 packets transmitted, 1000 received, 0% packet loss, time 377ms
rtt min/avg/max/mdev = 0.282/0.332/0.933/0.042 ms, ipg/ewma 0.378/0.333 ms

#display stats
$TC -s filter show dev eth0 parent 1:0
filter protocol ip pref 10 rsvp 
filter protocol ip pref 10 rsvp fh 0x0001100a flowid 1:1 session 10.0.0.1 ipproto icmp 
	action order 1:  police 0x5 rate 1Kbit burst 23440b mtu 2Kb action pipe overhead 0b 
ref 1 bind 1
	Action statistics:
	Sent 98000 bytes 1000 pkt (dropped 0, overlimits 761 requeues 0) 
	backlog 0b 0p requeues 0 

	action order 2: gact action pass
	 random type none pass val 0
	 index 2 ref 1 bind 1 installed 60 sec used 3 sec
 	Action statistics:
	Sent 74578 bytes 761 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0 


^ permalink raw reply

* RE: [PATCH] sctp: handle association restarts when the socket is closed.
From: David Laight @ 2014-10-06 11:09 UTC (permalink / raw)
  To: 'David Miller', vyasevich@gmail.com; +Cc: netdev@vger.kernel.org
In-Reply-To: <20141006.002229.1370132762577292096.davem@davemloft.net>

From: David Miller
> From: Vladislav Yasevich <vyasevich@gmail.com>
> Date: Fri,  3 Oct 2014 18:16:20 -0400
> 
> > From: Vlad Yasevich <vyasevich@gmail.com>
> >
> > Currently association restarts do not take into consideration the
> > state of the socket.  When a restart happens, the current assocation
> > simply transitions into established state.  This creates a condition
> > where a remote system, through a the restart procedure, may create a
> > local association that is no way reachable by user.  The conditions
> > to trigger this are as follows:
> >   1) Remote does not acknoledge some data causing data to remain
> >      outstanding.
> >   2) Local application calls close() on the socket.  Since data
> >      is still outstanding, the association is placed in SHUTDOWN_PENDING
> >      state.  However, the socket is closed.
> >   3) The remote tries to create a new association, triggering a restart
> >      on the local system.  The association moves from SHUTDOWN_PENDING
> >      to ESTABLISHED.  At this point, it is no longer reachable by
> >      any socket on the local system.
> >
> > This patch addresses the above situation by moving the newly ESTABLISHED
> > association into SHUTDOWN-SENT state and bundling a SHUTDOWN after
> > the COOKIE-ACK chunk.  This way, the restarted associate immidiately
> > enters the shutdown procedure and forces the termination of the
> > unreachable association.
> >
> > Reported-by: David Laight <David.Laight@aculab.com>
> > Signed-off-by: Vlad Yasevich <vyasevich@gmail.com>
> 
> Applied, thanks.
> 
> Candidate for -stable?

Maybe, but while I raised the problem and tested the fix, I added
a workaround to our M3UA code to ABORT sctp connections.
I'll predicate it on a kernel version when I know which one it is in,
but I'm not going to check backports to old distributions.
(I'm tempted to disable sctp on 2.6.18 kernels...)

So I'm not worried -stable.

Other sctp users may be more worried.

	David

^ permalink raw reply

* Re: [Patch net-next] net_sched: refactor out tcf_exts
From: Jamal Hadi Salim @ 2014-10-06 11:09 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: John Fastabend, David S. Miller
In-Reply-To: <1412376709-25564-1-git-send-email-xiyou.wangcong@gmail.com>

On 10/03/14 18:51, Cong Wang wrote:
> As Jamal pointed it out, tcf_exts is really unnecessary,
> we can definitely refactor it out without losing any functionality.
> This could also remove an indirect layer which makes the code
> much easier to read.
>
> This patch:
>
> 1) moves exts->action and exts->police into tp->ops, since they
> are statically assigned
>
> 2) moves exts->actions list head out
>
> 3) removes exts->type, act->type does the same thing
>
> 4) renames tcf_exts_*() functions to tcf_act_*()
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: John Fastabend <john.r.fastabend@intel.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Thanks for doing the work Cong.
I noticed John points to an issue in his testing; but
please add my:
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

I will start sending incremental patches to iproute2 to slowly get
rid of direct police interfacing which will allow us to get rid of
.police dereference altogether.
It was a mistake not to do it years ago.
One way to accelerate it right now is to log a "deprecated"
message everytime someone uses TCA_XXX_POLICE attributes.

cheers,
jamal

^ permalink raw reply

* [PATCH net-next] icmp6: Add new icmpv6 type for RPL control message
From: Simon Vincent @ 2014-10-06 10:37 UTC (permalink / raw)
  To: netdev; +Cc: Simon Vincent

IANA has defined a type value of 155 for RPL control messages.
We do nothing if we recieve one of these messages. This patch is to
avoid getting lots of icmpv6 unknown type messages when using RPL.

Signed-off-by: Simon Vincent <simon.vincent@xsilon.com>
---
 include/uapi/linux/icmpv6.h | 2 ++
 net/ipv6/icmp.c             | 1 +
 2 files changed, 3 insertions(+)

diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h
index 590beda..0d493c1 100644
--- a/include/uapi/linux/icmpv6.h
+++ b/include/uapi/linux/icmpv6.h
@@ -107,6 +107,8 @@ struct icmp6hdr {
 #define ICMPV6_MOBILE_PREFIX_SOL	146
 #define ICMPV6_MOBILE_PREFIX_ADV	147
 
+#define ICMPV6_RPL_CONTROL		155
+
 /*
  *	Codes for Destination Unreachable
  */
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 141e1f3..525ad3c 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -774,6 +774,7 @@ static int icmpv6_rcv(struct sk_buff *skb)
 	case ICMPV6_DHAAD_REPLY:
 	case ICMPV6_MOBILE_PREFIX_SOL:
 	case ICMPV6_MOBILE_PREFIX_ADV:
+	case ICMPV6_RPL_CONTROL:
 		break;
 
 	default:
-- 
1.9.1

^ permalink raw reply related

* RE: [PATCH net-next] net: introduce netdevice gso_min_segs attribute
From: David Laight @ 2014-10-06 10:20 UTC (permalink / raw)
  To: 'Eric Dumazet', Amir Vadai, David S. Miller
  Cc: Eric Dumazet, netdev@vger.kernel.org, Yevgeny Petrilin,
	Or Gerlitz, Ido Shamay
In-Reply-To: <1412529087.11091.14.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <edumazet@google.com>
> Some TSO engines might have a too heavy setup cost, that impacts
> performance on hosts sending small bursts (2 MSS per packet).
> 
> This patch adds a device gso_min_segs, allowing drivers to set
> a minimum segment size for TSO packets, according to the NIC
> performance.
> 
> Tested on a mlx4 NIC, this allows to get a ~110% increase of
> throughput when sending 2 MSS per packet.

Doesn't this all depend on what you need to optimise for.
I can think of three^Wseveral main cases:
1) minimising cpu use while saturating the local network.
2) minimising latency for single packets.
3) maximising throughput for a single connection.
4) minimising cpu use when handling a large number of connections.
plus all the variations in packet size.

I'm not sure what you are trading for what here.

Maybe gso = tx_bursting is almost always faster on some hardware?
(Especially if an idle mac engine is 'kicked' for the first packet
of a burst.)

	David


^ permalink raw reply

* Re: CPSW bug with AM437x SK
From: Mugunthan V N @ 2014-10-06  9:54 UTC (permalink / raw)
  To: balbi
  Cc: davem, netdev, Linux OMAP Mailing List,
	Linux ARM Kernel Mailing List, Linux Kernel Mailing List
In-Reply-To: <20141003010418.GA9612@saruman>

On Friday 03 October 2014 06:34 AM, Felipe Balbi wrote:
> [  261.177168] [<c0648d48>] (skb_panic) from [<c0565edc>] (skb_put+0x5c/0x60)
> [  261.184415] [<c0565edc>] (skb_put) from [<c0605aac>] (unix_stream_sendmsg+0x164/0x390)
> [  261.192712] [<c0605aac>] (unix_stream_sendmsg) from [<c055b364>] (sock_aio_write+0xdc/0xfc)
> [  261.201475] [<c055b364>] (sock_aio_write) from [<c014c42c>] (do_sync_write+0x8c/0xb4)
> [  261.209697] [<c014c42c>] (do_sync_write) from [<c014cf70>] (vfs_write+0x118/0x1c0)
> [  261.217652] [<c014cf70>] (vfs_write) from [<c014d564>] (SyS_write+0x4c/0xa0)
> [  261.225054] [<c014d564>] (SyS_write) from [<c000ed40>] (ret_fast_syscall+0x0/0x48)
> [  261.232988] Code: e58d4008 e58de00c e59f0008 ebfff48e (e7f001f2) 
> [  261.239378] ---[ end trace d64258d586f40104 ]---

The BT shows that the warn came from a unix socket interface, so this
cannot be a CPSW bug, its a bug in unix socket.

Are you not seeing this issue with file system in any other media?

I will try to reproduce this locally with my AM437x EVMsk.

Regards
Mugunthan V N

^ permalink raw reply

* Re: [net-next PATCH v1 1/3] net: sched: af_packet support for direct ring access
From: Daniel Borkmann @ 2014-10-06  9:49 UTC (permalink / raw)
  To: John Fastabend
  Cc: Florian Westphal, gerlitz.or, hannes, netdev, john.ronciak, amirv,
	eric.dumazet, danny.zhou
In-Reply-To: <5431EC82.7010305@gmail.com>

Hi John,

On 10/06/2014 03:12 AM, John Fastabend wrote:
> On 10/05/2014 05:29 PM, Florian Westphal wrote:
>> John Fastabend <john.fastabend@gmail.com> wrote:
>>> There is one critical difference when running with these interfaces
>>> vs running without them. In the normal case the af_packet module
>>> uses a standard descriptor format exported by the af_packet user
>>> space headers. In this model because we are working directly with
>>> driver queues the descriptor format maps to the descriptor format
>>> used by the device. User space applications can learn device
>>> information from the socket option PACKET_DEV_DESC_INFO which
>>> should provide enough details to extrapulate the descriptor formats.
>>> Although this adds some complexity to user space it removes the
>>> requirement to copy descriptor fields around.
>>
>> I find it very disappointing that we seem to have to expose such
>> hardware specific details to userspace via hw-independent interface.
>
> Well it was only for convenience if it doesn't fit as a socket
> option we can remove it. We can look up the device using the netdev
> name from the bind call. I see your point though so if there is
> consensus that this is not needed that is fine.
>
>> How big of a cost are we talking about when you say that it 'removes
>> the requirement to copy descriptor fields'?
>
> This was likely a poor description. If you want to let user space
> poll on the ring (without using system calls or interrupts) then
> I don't see how you can _not_ expose the ring directly complete with
> the vendor descriptor formats.

But how big is the concrete performance degradation you're seeing if you
use an e.g. `netmap-alike` Linux-own variant as a hw-neutral interface
that does *not* directly expose hw descriptor formats to user space?

With 1 core netmap does 10G line-rate on 64b; I don't know their numbers
on 40G when run on decent hardware though.

It would really be great if we have something vendor neutral exposed as
a stable ABI and could leverage emerging infrastructure we already have
in the kernel such as eBPF and recent qdisc batching for raw sockets
instead of reinventing the wheels. (Don't get me wrong, I would love to
see AF_PACKET improved ...)

Thanks,
Daniel

^ permalink raw reply

* RE: [PATCH v2 net-next] r8169:add support for RTL8168EP
From: Hau @ 2014-10-06  8:56 UTC (permalink / raw)
  To: Francois Romieu
  Cc: netdev@vger.kernel.org, nic_swsd, linux-kernel@vger.kernel.org
In-Reply-To: <20141003203244.GA19965@electric-eye.fr.zoreil.com>


> -----Original Message-----
> From: Francois Romieu [mailto:romieu@fr.zoreil.com]
> Sent: Saturday, October 04, 2014 4:33 AM
> To: Hau
> Cc: netdev@vger.kernel.org; nic_swsd; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v2 net-next] r8169:add support for RTL8168EP
> 
> Chun-Hao Lin <hau@realtek.com> :
> [...]
> > diff --git a/drivers/net/ethernet/realtek/r8169.c
> > b/drivers/net/ethernet/realtek/r8169.c
> > index 54476ba..3efdf4d 100644
> > --- a/drivers/net/ethernet/realtek/r8169.c
> > +++ b/drivers/net/ethernet/realtek/r8169.c
> [...]
> > @@ -1276,6 +1273,52 @@ static void rtl_w0w1_eri(struct rtl8169_private
> *tp, int addr, u32 mask, u32 p,
> >  	rtl_eri_write(tp, addr, mask, (val & ~m) | p, type);  }
> >
> > +static u32 ocp_read(struct rtl8169_private *tp, u8 mask, u16 reg) {
> > +	void __iomem *ioaddr = tp->mmio_addr;
> > +
> > +	switch (tp->mac_version) {
> > +	case RTL_GIGA_MAC_VER_27:
> > +	case RTL_GIGA_MAC_VER_28:
> > +	case RTL_GIGA_MAC_VER_31:
> > +		RTL_W32(OCPAR, ((u32)mask & 0x0f) << 12 | (reg & 0x0fff));
> > +		return rtl_udelay_loop_wait_high(tp, &rtl_ocpar_cond, 100,
> 20)
> > +			? RTL_R32(OCPDR) : ~0;
> 
> '?' should be on the previous line. There isn't more room than needed but it's
> still ok.
> 
> [...]
> > +static void rtl8168ep_2_hw_phy_config(struct rtl8169_private *tp) {
> [...]
> > +	rtl_w0w1_phy(tp, 0x14, 0x7C00, ~0x7Cff);
> 
> Nit:	rtl_w0w1_phy(tp, 0x14, 0x7c00, ~0x7cff);
> 
> [...]
> +	rtl_writephy(tp, 0x1f, 0x0bC8);
> 
> Nit:	rtl_writephy(tp, 0x1f, 0x0bc8);
> 
> Tangent: please find feature wise identical code below without moves.
> I have avoided introducing more helpers that may have kept the code more
> balanced for 8168dp vs 8168ep as it wasn't the point and it is still possible to
> change the code from there.
> 
> It provides a different review experience. Feel free to give it a thought.

Do you mean I should collect similar hardware parameters setting into one function?
or
I should set hardware parameters according to hardware feature support version?
For example,
If mac_version == RTL8168DP
	dash_ver = 1
else If mac_version == RTL8168DP
	dash_ver = 2

if dashver == 1
	...
else if dashver == 2
	...

^ permalink raw reply

* [PATCH net-next 5/5] ipv6: don't walk node's leaf during serial number update
From: Hannes Frederic Sowa @ 2014-10-06  8:52 UTC (permalink / raw)
  To: netdev; +Cc: hideaki, kafai
In-Reply-To: <cover.1412585162.git.hannes@stressinduktion.org>

Cc: YOSHIFUJI Hideaki <hideaki@yoshifuji.org>
Cc: Martin Lau <kafai@fb.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/ipv6/ip6_fib.c | 47 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 30 insertions(+), 17 deletions(-)

diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 6c10c26..f36207f 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -50,6 +50,7 @@ struct fib6_cleaner_t {
 	struct fib6_walker_t w;
 	struct net *net;
 	int (*func)(struct rt6_info *, void *arg);
+	int sernum;
 	void *arg;
 };
 
@@ -105,6 +106,10 @@ static int fib6_new_sernum(struct net *net)
 	return new;
 }
 
+enum {
+	FIB6_NO_SERNUM_CHANGE = 0,
+};
+
 /*
  *	Auxiliary address test functions for the radix tree.
  *
@@ -1514,6 +1519,16 @@ static int fib6_clean_node(struct fib6_walker_t *w)
 		.nl_net = c->net,
 	};
 
+	if (c->sernum != FIB6_NO_SERNUM_CHANGE &&
+	    w->node->fn_sernum != c->sernum)
+		w->node->fn_sernum = c->sernum;
+
+	if (!c->func) {
+		WARN_ON_ONCE(c->sernum == FIB6_NO_SERNUM_CHANGE);
+		w->leaf = NULL;
+		return 0;
+	}
+
 	for (rt = w->leaf; rt; rt = rt->dst.rt6_next) {
 		res = c->func(rt, c->arg);
 		if (res < 0) {
@@ -1547,7 +1562,7 @@ static int fib6_clean_node(struct fib6_walker_t *w)
 
 static void fib6_clean_tree(struct net *net, struct fib6_node *root,
 			    int (*func)(struct rt6_info *, void *arg),
-			    bool prune, void *arg)
+			    bool prune, int sernum, void *arg)
 {
 	struct fib6_cleaner_t c;
 
@@ -1557,14 +1572,16 @@ static void fib6_clean_tree(struct net *net, struct fib6_node *root,
 	c.w.count = 0;
 	c.w.skip = 0;
 	c.func = func;
+	c.sernum = sernum;
 	c.arg = arg;
 	c.net = net;
 
 	fib6_walk(&c.w);
 }
 
-void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
-		    void *arg)
+static void __fib6_clean_all(struct net *net,
+			     int (*func)(struct rt6_info *, void *),
+			     int sernum, void *arg)
 {
 	struct fib6_table *table;
 	struct hlist_head *head;
@@ -1576,13 +1593,19 @@ void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
 		hlist_for_each_entry_rcu(table, head, tb6_hlist) {
 			write_lock_bh(&table->tb6_lock);
 			fib6_clean_tree(net, &table->tb6_root,
-					func, false, arg);
+					func, false, sernum, arg);
 			write_unlock_bh(&table->tb6_lock);
 		}
 	}
 	rcu_read_unlock();
 }
 
+void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *),
+		    void *arg)
+{
+	__fib6_clean_all(net, func, FIB6_NO_SERNUM_CHANGE, arg);
+}
+
 static int fib6_prune_clone(struct rt6_info *rt, void *arg)
 {
 	if (rt->rt6i_flags & RTF_CACHE) {
@@ -1595,25 +1618,15 @@ static int fib6_prune_clone(struct rt6_info *rt, void *arg)
 
 static void fib6_prune_clones(struct net *net, struct fib6_node *fn)
 {
-	fib6_clean_tree(net, fn, fib6_prune_clone, true, NULL);
-}
-
-static int fib6_update_sernum(struct rt6_info *rt, void *arg)
-{
-	int sernum = *(__u32 *)arg;
-
-	if (rt->rt6i_node &&
-	    rt->rt6i_node->fn_sernum != sernum)
-		rt->rt6i_node->fn_sernum = sernum;
-
-	return 0;
+	fib6_clean_tree(net, fn, fib6_prune_clone, true,
+			FIB6_NO_SERNUM_CHANGE, NULL);
 }
 
 static void fib6_flush_trees(struct net *net)
 {
 	int new_sernum = fib6_new_sernum(net);
 
-	fib6_clean_all(net, fib6_update_sernum, &new_sernum);
+	__fib6_clean_all(net, NULL, new_sernum, NULL);
 }
 
 /*
-- 
1.9.3

^ permalink raw reply related

* [PATCH net-next 4/5] ipv6: make fib6 serial number per namespace
From: Hannes Frederic Sowa @ 2014-10-06  8:52 UTC (permalink / raw)
  To: netdev; +Cc: hideaki, kafai
In-Reply-To: <cover.1412585162.git.hannes@stressinduktion.org>

Try to reduce number of possible fn_sernum mutation by constraining them
to their namespace.

Also remove rt_genid which I forgot to remove in 705f1c869d577c ("ipv6:
remove rt6i_genid").

Cc: YOSHIFUJI Hideaki <hideaki@yoshifuji.org>
Cc: Martin Lau <kafai@fb.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 include/net/netns/ipv6.h |  2 +-
 net/ipv6/af_inet6.c      |  2 +-
 net/ipv6/ip6_fib.c       | 13 ++++++-------
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index eade27a..69ae41f 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -76,7 +76,7 @@ struct netns_ipv6 {
 #endif
 #endif
 	atomic_t		dev_addr_genid;
-	atomic_t		rt_genid;
+	atomic_t		fib6_sernum;
 };
 
 #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 34f726f..e8c4400 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -766,7 +766,7 @@ static int __net_init inet6_net_init(struct net *net)
 	net->ipv6.sysctl.icmpv6_time = 1*HZ;
 	net->ipv6.sysctl.flowlabel_consistency = 1;
 	net->ipv6.sysctl.auto_flowlabels = 0;
-	atomic_set(&net->ipv6.rt_genid, 0);
+	atomic_set(&net->ipv6.fib6_sernum, 1);
 
 	err = ipv6_init_mibs(net);
 	if (err)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index a55a072..6c10c26 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -74,8 +74,6 @@ static int fib6_walk_continue(struct fib6_walker_t *w);
  *	result of redirects, path MTU changes, etc.
  */
 
-static atomic_t rt_sernum = ATOMIC_INIT(1);
-
 static void fib6_gc_timer_cb(unsigned long arg);
 
 static LIST_HEAD(fib6_walkers);
@@ -95,14 +93,15 @@ static void fib6_walker_unlink(struct fib6_walker_t *w)
 	write_unlock_bh(&fib6_walker_lock);
 }
 
-static int fib6_new_sernum(void)
+static int fib6_new_sernum(struct net *net)
 {
 	int new, old;
 
 	do {
-		old = atomic_read(&rt_sernum);
+		old = atomic_read(&net->ipv6.fib6_sernum);
 		new = old < INT_MAX ? old + 1 : 1;
-	} while (atomic_cmpxchg(&rt_sernum, old, new) != old);
+	} while (atomic_cmpxchg(&net->ipv6.fib6_sernum,
+				old, new) != old);
 	return new;
 }
 
@@ -841,7 +840,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info,
 	int err = -ENOMEM;
 	int allow_create = 1;
 	int replace_required = 0;
-	int sernum = fib6_new_sernum();
+	int sernum = fib6_new_sernum(info->nl_net);
 
 	if (info->nlh) {
 		if (!(info->nlh->nlmsg_flags & NLM_F_CREATE))
@@ -1612,7 +1611,7 @@ static int fib6_update_sernum(struct rt6_info *rt, void *arg)
 
 static void fib6_flush_trees(struct net *net)
 {
-	int new_sernum = fib6_new_sernum();
+	int new_sernum = fib6_new_sernum(net);
 
 	fib6_clean_all(net, fib6_update_sernum, &new_sernum);
 }
-- 
1.9.3

^ permalink raw reply related

* [PATCH net-next 3/5] ipv6: only generate one new serial number per fib mutation
From: Hannes Frederic Sowa @ 2014-10-06  8:52 UTC (permalink / raw)
  To: netdev; +Cc: hideaki, kafai
In-Reply-To: <cover.1412585162.git.hannes@stressinduktion.org>

Cc: YOSHIFUJI Hideaki <hideaki@yoshifuji.org>
Cc: Martin Lau <kafai@fb.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/ipv6/ip6_fib.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index bfad469..a55a072 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -417,14 +417,13 @@ out:
 static struct fib6_node *fib6_add_1(struct fib6_node *root,
 				     struct in6_addr *addr, int plen,
 				     int offset, int allow_create,
-				     int replace_required)
+				     int replace_required, int sernum)
 {
 	struct fib6_node *fn, *in, *ln;
 	struct fib6_node *pn = NULL;
 	struct rt6key *key;
 	int	bit;
 	__be32	dir = 0;
-	int	sernum = fib6_new_sernum();
 
 	RT6_TRACE("fib6_add_1\n");
 
@@ -842,6 +841,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info,
 	int err = -ENOMEM;
 	int allow_create = 1;
 	int replace_required = 0;
+	int sernum = fib6_new_sernum();
 
 	if (info->nlh) {
 		if (!(info->nlh->nlmsg_flags & NLM_F_CREATE))
@@ -854,7 +854,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info,
 
 	fn = fib6_add_1(root, &rt->rt6i_dst.addr, rt->rt6i_dst.plen,
 			offsetof(struct rt6_info, rt6i_dst), allow_create,
-			replace_required);
+			replace_required, sernum);
 	if (IS_ERR(fn)) {
 		err = PTR_ERR(fn);
 		fn = NULL;
@@ -888,14 +888,14 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info,
 			sfn->leaf = info->nl_net->ipv6.ip6_null_entry;
 			atomic_inc(&info->nl_net->ipv6.ip6_null_entry->rt6i_ref);
 			sfn->fn_flags = RTN_ROOT;
-			sfn->fn_sernum = fib6_new_sernum();
+			sfn->fn_sernum = sernum;
 
 			/* Now add the first leaf node to new subtree */
 
 			sn = fib6_add_1(sfn, &rt->rt6i_src.addr,
 					rt->rt6i_src.plen,
 					offsetof(struct rt6_info, rt6i_src),
-					allow_create, replace_required);
+					allow_create, replace_required, sernum);
 
 			if (IS_ERR(sn)) {
 				/* If it is failed, discard just allocated
@@ -914,7 +914,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info,
 			sn = fib6_add_1(fn->subtree, &rt->rt6i_src.addr,
 					rt->rt6i_src.plen,
 					offsetof(struct rt6_info, rt6i_src),
-					allow_create, replace_required);
+					allow_create, replace_required, sernum);
 
 			if (IS_ERR(sn)) {
 				err = PTR_ERR(sn);
-- 
1.9.3

^ permalink raw reply related

* [PATCH net-next 2/5] ipv6: make rt_sernum atomic and serial number fields ordinary ints
From: Hannes Frederic Sowa @ 2014-10-06  8:52 UTC (permalink / raw)
  To: netdev; +Cc: hideaki, kafai
In-Reply-To: <cover.1412585162.git.hannes@stressinduktion.org>

Cc: YOSHIFUJI Hideaki <hideaki@yoshifuji.org>
Cc: Martin Lau <kafai@fb.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 include/net/ip6_fib.h |  2 +-
 net/ipv6/ip6_fib.c    | 23 +++++++++++++----------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index f4e6b3e..ee07f92 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -64,7 +64,7 @@ struct fib6_node {
 
 	__u16			fn_bit;		/* bit key */
 	__u16			fn_flags;
-	__u32			fn_sernum;
+	int			fn_sernum;
 	struct rt6_info		*rr_ptr;
 };
 
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 92f53db..bfad469 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -74,7 +74,7 @@ static int fib6_walk_continue(struct fib6_walker_t *w);
  *	result of redirects, path MTU changes, etc.
  */
 
-static __u32 rt_sernum;
+static atomic_t rt_sernum = ATOMIC_INIT(1);
 
 static void fib6_gc_timer_cb(unsigned long arg);
 
@@ -95,12 +95,15 @@ static void fib6_walker_unlink(struct fib6_walker_t *w)
 	write_unlock_bh(&fib6_walker_lock);
 }
 
-static u32 fib6_new_sernum(void)
+static int fib6_new_sernum(void)
 {
-	u32 n = ++rt_sernum;
-	if ((__s32)n <= 0)
-		rt_sernum = n = 1;
-	return n;
+	int new, old;
+
+	do {
+		old = atomic_read(&rt_sernum);
+		new = old < INT_MAX ? old + 1 : 1;
+	} while (atomic_cmpxchg(&rt_sernum, old, new) != old);
+	return new;
 }
 
 /*
@@ -421,7 +424,7 @@ static struct fib6_node *fib6_add_1(struct fib6_node *root,
 	struct rt6key *key;
 	int	bit;
 	__be32	dir = 0;
-	__u32	sernum = fib6_new_sernum();
+	int	sernum = fib6_new_sernum();
 
 	RT6_TRACE("fib6_add_1\n");
 
@@ -1598,7 +1601,7 @@ static void fib6_prune_clones(struct net *net, struct fib6_node *fn)
 
 static int fib6_update_sernum(struct rt6_info *rt, void *arg)
 {
-	__u32 sernum = *(__u32 *)arg;
+	int sernum = *(__u32 *)arg;
 
 	if (rt->rt6i_node &&
 	    rt->rt6i_node->fn_sernum != sernum)
@@ -1609,7 +1612,7 @@ static int fib6_update_sernum(struct rt6_info *rt, void *arg)
 
 static void fib6_flush_trees(struct net *net)
 {
-	__u32 new_sernum = fib6_new_sernum();
+	int new_sernum = fib6_new_sernum();
 
 	fib6_clean_all(net, fib6_update_sernum, &new_sernum);
 }
@@ -1822,7 +1825,7 @@ struct ipv6_route_iter {
 	struct fib6_walker_t w;
 	loff_t skip;
 	struct fib6_table *tbl;
-	__u32 sernum;
+	int sernum;
 };
 
 static int ipv6_route_seq_show(struct seq_file *seq, void *v)
-- 
1.9.3

^ permalink raw reply related

* [PATCH net-next 1/5] ipv6: minor fib6 cleanups like type safety, bool conversion, inline removal
From: Hannes Frederic Sowa @ 2014-10-06  8:52 UTC (permalink / raw)
  To: netdev; +Cc: hideaki, kafai
In-Reply-To: <cover.1412585162.git.hannes@stressinduktion.org>

Cc: YOSHIFUJI Hideaki <hideaki@yoshifuji.org>
Cc: Martin Lau <kafai@fb.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 include/net/ip6_fib.h | 14 ++++++++++++--
 net/ipv6/ip6_fib.c    | 35 +++++++++++++----------------------
 2 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index cf485f9..f4e6b3e 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -202,12 +202,22 @@ static inline void ip6_rt_put(struct rt6_info *rt)
 	dst_release(&rt->dst);
 }
 
+enum fib_walk_state_t {
+#ifdef CONFIG_IPV6_SUBTREES
+	FWS_S,
+#endif
+	FWS_L,
+	FWS_R,
+	FWS_C,
+	FWS_U
+};
+
 struct fib6_walker_t {
 	struct list_head lh;
 	struct fib6_node *root, *node;
 	struct rt6_info *leaf;
-	unsigned char state;
-	unsigned char prune;
+	enum fib_walk_state_t state;
+	bool prune;
 	unsigned int skip;
 	unsigned int count;
 	int (*func)(struct fib6_walker_t *);
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 97b9fa8..92f53db 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -46,16 +46,6 @@
 
 static struct kmem_cache *fib6_node_kmem __read_mostly;
 
-enum fib_walk_state_t {
-#ifdef CONFIG_IPV6_SUBTREES
-	FWS_S,
-#endif
-	FWS_L,
-	FWS_R,
-	FWS_C,
-	FWS_U
-};
-
 struct fib6_cleaner_t {
 	struct fib6_walker_t w;
 	struct net *net;
@@ -91,20 +81,21 @@ static void fib6_gc_timer_cb(unsigned long arg);
 static LIST_HEAD(fib6_walkers);
 #define FOR_WALKERS(w) list_for_each_entry(w, &fib6_walkers, lh)
 
-static inline void fib6_walker_link(struct fib6_walker_t *w)
+static void fib6_walker_link(struct fib6_walker_t *w)
 {
 	write_lock_bh(&fib6_walker_lock);
 	list_add(&w->lh, &fib6_walkers);
 	write_unlock_bh(&fib6_walker_lock);
 }
 
-static inline void fib6_walker_unlink(struct fib6_walker_t *w)
+static void fib6_walker_unlink(struct fib6_walker_t *w)
 {
 	write_lock_bh(&fib6_walker_lock);
 	list_del(&w->lh);
 	write_unlock_bh(&fib6_walker_lock);
 }
-static __inline__ u32 fib6_new_sernum(void)
+
+static u32 fib6_new_sernum(void)
 {
 	u32 n = ++rt_sernum;
 	if ((__s32)n <= 0)
@@ -128,7 +119,7 @@ static __inline__ u32 fib6_new_sernum(void)
 # define BITOP_BE32_SWIZZLE	0
 #endif
 
-static __inline__ __be32 addr_bit_set(const void *token, int fn_bit)
+static __be32 addr_bit_set(const void *token, int fn_bit)
 {
 	const __be32 *addr = token;
 	/*
@@ -142,7 +133,7 @@ static __inline__ __be32 addr_bit_set(const void *token, int fn_bit)
 	       addr[fn_bit >> 5];
 }
 
-static __inline__ struct fib6_node *node_alloc(void)
+static struct fib6_node *node_alloc(void)
 {
 	struct fib6_node *fn;
 
@@ -151,12 +142,12 @@ static __inline__ struct fib6_node *node_alloc(void)
 	return fn;
 }
 
-static __inline__ void node_free(struct fib6_node *fn)
+static void node_free(struct fib6_node *fn)
 {
 	kmem_cache_free(fib6_node_kmem, fn);
 }
 
-static __inline__ void rt6_release(struct rt6_info *rt)
+static void rt6_release(struct rt6_info *rt)
 {
 	if (atomic_dec_and_test(&rt->rt6i_ref))
 		dst_free(&rt->dst);
@@ -627,7 +618,7 @@ insert_above:
 	return ln;
 }
 
-static inline bool rt6_qualify_for_ecmp(struct rt6_info *rt)
+static bool rt6_qualify_for_ecmp(struct rt6_info *rt)
 {
 	return (rt->rt6i_flags & (RTF_GATEWAY|RTF_ADDRCONF|RTF_DYNAMIC)) ==
 	       RTF_GATEWAY;
@@ -820,7 +811,7 @@ add:
 	return 0;
 }
 
-static __inline__ void fib6_start_gc(struct net *net, struct rt6_info *rt)
+static void fib6_start_gc(struct net *net, struct rt6_info *rt)
 {
 	if (!timer_pending(&net->ipv6.ip6_fib_timer) &&
 	    (rt->rt6i_flags & (RTF_EXPIRES | RTF_CACHE)))
@@ -1554,7 +1545,7 @@ static int fib6_clean_node(struct fib6_walker_t *w)
 
 static void fib6_clean_tree(struct net *net, struct fib6_node *root,
 			    int (*func)(struct rt6_info *, void *arg),
-			    int prune, void *arg)
+			    bool prune, void *arg)
 {
 	struct fib6_cleaner_t c;
 
@@ -1583,7 +1574,7 @@ void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
 		hlist_for_each_entry_rcu(table, head, tb6_hlist) {
 			write_lock_bh(&table->tb6_lock);
 			fib6_clean_tree(net, &table->tb6_root,
-					func, 0, arg);
+					func, false, arg);
 			write_unlock_bh(&table->tb6_lock);
 		}
 	}
@@ -1602,7 +1593,7 @@ static int fib6_prune_clone(struct rt6_info *rt, void *arg)
 
 static void fib6_prune_clones(struct net *net, struct fib6_node *fn)
 {
-	fib6_clean_tree(net, fn, fib6_prune_clone, 1, NULL);
+	fib6_clean_tree(net, fn, fib6_prune_clone, true, NULL);
 }
 
 static int fib6_update_sernum(struct rt6_info *rt, void *arg)
-- 
1.9.3

^ permalink raw reply related

* [PATCH net-next 0/5] ipv6: cleanup after rt6_genid removal
From: Hannes Frederic Sowa @ 2014-10-06  8:52 UTC (permalink / raw)
  To: netdev; +Cc: hideaki, kafai

Leftover patches after rt6_genid removal after 705f1c869d577c ("ipv6:
remove rt6i_genid").

Major two changes are:
* keep fib6_sernum per namespace to reduce number of flushes in case
  system has high number of namespaces
* make fn_sernum updates cheaper

Hannes Frederic Sowa (5):
  ipv6: minor fib6 cleanups like type safety, bool conversion, inline
    removal
  ipv6: make rt_sernum atomic and serial number fields ordinary ints
  ipv6: only generate one new serial number per fib mutation
  ipv6: make fib6 serial number per namespace
  ipv6: don't walk node's leaf during serial number update

 include/net/ip6_fib.h    |  16 +++++--
 include/net/netns/ipv6.h |   2 +-
 net/ipv6/af_inet6.c      |   2 +-
 net/ipv6/ip6_fib.c       | 106 +++++++++++++++++++++++++----------------------
 4 files changed, 71 insertions(+), 55 deletions(-)

-- 
1.9.3

^ permalink raw reply

* Re: [PATCH v8 net-next 1/2] bonding: display xmit_hash_policy for non-dynamic-tlb mode
From: Nikolay Aleksandrov @ 2014-10-06  8:35 UTC (permalink / raw)
  To: David Miller, maheshb; +Cc: j.vosburgh, andy, vfalico, netdev, edumazet, maze
In-Reply-To: <20141006.005841.1016428020297723523.davem@davemloft.net>

On 06/10/14 06:58, David Miller wrote:
>
> After 8 revisions, I want to see some ACKs before applying these
> two changes :)
> --
> 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
>

On my side all comments have been taken care of, I don't know if it's 
appropriate to also ack the patches as I've already given a reviewed-by to the 
first and my sob to the second :-)

Nik

^ permalink raw reply

* Re: randconfig build error with next-20141001, in drivers/i2c/algos/i2c-algo-bit.c
From: Oliver Hartkopp @ 2014-10-06  8:06 UTC (permalink / raw)
  To: Randy Dunlap, Jim Davis, Stephen Rothwell
  Cc: linux-next, Stephane Grosjean, linux-i2c, netdev@vger.kernel.org,
	linux-can
In-Reply-To: <542C8D93.8090008@infradead.org>

Hello all,

just to get it right:

So far it looks like this in linux/drivers/net/can/sja1000/Kconfig

config CAN_PEAK_PCIEC
        bool "PEAK PCAN-ExpressCard Cards"
        depends on CAN_PEAK_PCI
        select I2C
        select I2C_ALGOBIT

If one would change the

        select I2C

into

        depends on I2C

IMHO the CAN_PEAK_PCIEC hardware would *only* be visible and selectable when
I2C was selected before (from anyone else?).

So what it wrong on the current Kconfig entry?
Is 'select' deprecated?

Or did randconfig generate a configuration that would not be possible by
properly generating the config file with 'make menuconfig' ??

Please explain.

Thanks,
Oliver

On 10/02/2014 01:26 AM, Randy Dunlap wrote:
> On 10/01/14 14:37, Jim Davis wrote:
>> Building with the attached random configuration file,
> 
> Also:
> warning: (CAN_PEAK_PCIEC && SFC && IGB && VIDEO_TW68 && DRM && FB_DDC && FB_VIA) selects I2C_ALGOBIT which has unmet direct dependencies (I2C)
> 
>> drivers/i2c/algos/i2c-algo-bit.c: In function ‘i2c_bit_add_bus’:
>> drivers/i2c/algos/i2c-algo-bit.c:658:33: error: ‘i2c_add_adapter’
>> undeclared (first use in this function)
>>   return __i2c_bit_add_bus(adap, i2c_add_adapter);
>>                                  ^
>> drivers/i2c/algos/i2c-algo-bit.c:658:33: note: each undeclared
>> identifier is reported only once for each function it appears in
>> drivers/i2c/algos/i2c-algo-bit.c: In function ‘i2c_bit_add_numbered_bus’:
>> drivers/i2c/algos/i2c-algo-bit.c:664:33: error:
>> ‘i2c_add_numbered_adapter’ undeclared (first use in this function)
>>   return __i2c_bit_add_bus(adap, i2c_add_numbered_adapter);
>>                                  ^
>>   CC      net/openvswitch/actions.o
>> drivers/i2c/algos/i2c-algo-bit.c: In function ‘i2c_bit_add_bus’:
>> drivers/i2c/algos/i2c-algo-bit.c:659:1: warning: control reaches end of non-void
>>  function [-Wreturn-type]
>>  }
>>  ^
>> drivers/i2c/algos/i2c-algo-bit.c: In function ‘i2c_bit_add_numbered_bus’:
>> drivers/i2c/algos/i2c-algo-bit.c:665:1: warning: control reaches end of non-void
>>  function [-Wreturn-type]
>>  }
>>  ^
>> make[3]: *** [drivers/i2c/algos/i2c-algo-bit.o] Error 1
> 
> In drivers/media/pci/tw68/Kconfig, VIDEO_TW68 should depend on I2C in order
> to make it safe to select I2C_ALGOBIT.
> 
> In drivers/net/can/sja1000/Kconfig, CAN_PEAK_PCIEC should depend on I2C
> instead of selecting I2C (and change the help text).
> 
> 

^ permalink raw reply

* Re: [net 0/8] gianfar: ARM port driver updates (1/2)
From: Claudiu Manoil @ 2014-10-06  7:55 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Li.Xiubo, Shruti
In-Reply-To: <20141005.212722.1867743289839811370.davem@davemloft.net>

On 10/6/2014 4:27 AM, David Miller wrote:
> From: Claudiu Manoil <claudiu.manoil@freescale.com>
> Date: Fri, 3 Oct 2014 19:02:41 +0300
>
>> This is the first round of driver protability fixes and clean-up
>> with the main purpose to make gianfar portable on ARM, for the ARM
>> based SoC that integrates the eTSEC ethernet controller - "ls1021a".
>> The patches primarily address compile time errors, when compiling
>> gianfar on ARM.  They replace PPC specific functions and macros
>> with architecture independent ones, solve arch specific header
>> inclusions, guard code that relates to PPC only, and even address
>> some simple endianess issues (see MAC address setup patch).
>> The patches addressing the bulk of remaining endianess issues,
>> like handling DMA fields (BD and FCB), will follow with the sencond
>> round.
>> These patches were verified on the ls1021a SoC.
>
> If more endianness fixes are necessary and "will follow with the
> second round", I do not see how you could have verified specifically
> these changes on the ls1021a.
>

Hi David,

What I did is to split the initial patchset in 2, to ease up the review
process.
This first part is fairly straightforward, these patches make localized
code changes and can be more easily ported among different kernel 
versions.  The second part has fewer patches but touches more code,
because it handles endianess conversions for all the reads/writes to
the buffer descriptors.  Please let me now if you have objections to
this approach.
As for testing, we have our internal kernel tree for ARM supporting
ls1021a, and these gianfar patches have been there for a while and 
tested.  Now it's time to upstream (a cleaned-up version of) them.
(see git.freescale.com/git/cgit.cgi/layerscape/ls1021a/linux.git/)
Please note that the current (upstream) net tree does not include the
support for ls1021a (which is to be propagated via the arm tree).

Thanks and regards,
Claudiu

^ permalink raw reply

* Re: [PATCH net-next] ipvs: Avoid null-pointer deref in debug code
From: Julian Anastasov @ 2014-10-06  6:49 UTC (permalink / raw)
  To: Alex Gartrell; +Cc: horms, dan.carpenter, lvs-devel, netdev, kernel-team
In-Reply-To: <1412556895-26891-1-git-send-email-agartrell@fb.com>


	Hello,

On Sun, 5 Oct 2014, Alex Gartrell wrote:

> Ensure that the pointer is non-NULL before dereferencing it for debugging
> purposes.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Alex Gartrell <agartrell@fb.com>
> ---
>  net/netfilter/ipvs/ip_vs_xmit.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
> index 91f17c1..06bba9b 100644
> --- a/net/netfilter/ipvs/ip_vs_xmit.c
> +++ b/net/netfilter/ipvs/ip_vs_xmit.c
> @@ -316,7 +316,7 @@ __ip_vs_get_out_rt(int skb_af, struct sk_buff *skb, struct ip_vs_dest *dest,
>  	if (unlikely(crosses_local_route_boundary(skb_af, skb, rt_mode,
>  						  local))) {
>  		IP_VS_DBG_RL("We are crossing local and non-local addresses"
> -			     " daddr=%pI4\n", &dest->addr.ip);
> +			     " daddr=%pI4\n", dest ? &dest->addr.ip : NULL);
>  		goto err_put;
>  	}
>  
> @@ -458,7 +458,7 @@ __ip_vs_get_out_rt_v6(int skb_af, struct sk_buff *skb, struct ip_vs_dest *dest,
>  	if (unlikely(crosses_local_route_boundary(skb_af, skb, rt_mode,
>  						  local))) {
>  		IP_VS_DBG_RL("We are crossing local and non-local addresses"
> -			     " daddr=%pI6\n", &dest->addr.in6);
> +			     " daddr=%pI6\n", dest ? &dest->addr.in6 : NULL);
>  		goto err_put;
>  	}

	You have to print the "daddr" variable as
it was done before your patchset in the
"Stopping traffic to %s address, dest: %p..." message
because dest is not present in all cases, for example,
for *bypass_xmit. Other places provide cp->daddr but
for backup server some conns can live without cp->dest.

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* Re: [PATCH net-next] net: introduce netdevice gso_min_segs attribute
From: Amir Vadai @ 2014-10-06  6:41 UTC (permalink / raw)
  To: Eric Dumazet, David S. Miller
  Cc: Eric Dumazet, netdev, Yevgeny Petrilin, Or Gerlitz, Ido Shamay
In-Reply-To: <1412529087.11091.14.camel@edumazet-glaptop2.roam.corp.google.com>

On 10/5/2014 8:11 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> Some TSO engines might have a too heavy setup cost, that impacts
> performance on hosts sending small bursts (2 MSS per packet).
> 
> This patch adds a device gso_min_segs, allowing drivers to set
> a minimum segment size for TSO packets, according to the NIC
> performance.
> 
> Tested on a mlx4 NIC, this allows to get a ~110% increase of
> throughput when sending 2 MSS per packet.
> 

Amazing!

Shouldn't there be a netif_set_gso_min_size() too?

> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> mlx4 patch will be sent later, its a one liner.
> 
>  include/linux/netdevice.h |    4 +++-
>  net/core/dev.c            |    9 ++++++---
>  2 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 22d54b9b700d..2df86f50261c 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1416,6 +1416,8 @@ enum netdev_priv_flags {
>   *	@gso_max_size:	Maximum size of generic segmentation offload
>   *	@gso_max_segs:	Maximum number of segments that can be passed to the
>   *			NIC for GSO
> + *	@gso_min_segs:	Minimum number of segments that can be passed to the
> + *			NIC for GSO
>   *
>   *	@dcbnl_ops:	Data Center Bridging netlink ops
>   *	@num_tc:	Number of traffic classes in the net device
> @@ -1666,7 +1668,7 @@ struct net_device {
>  	unsigned int		gso_max_size;
>  #define GSO_MAX_SEGS		65535
>  	u16			gso_max_segs;
> -
> +	u16			gso_min_segs;
>  #ifdef CONFIG_DCB
>  	const struct dcbnl_rtnl_ops *dcbnl_ops;
>  #endif
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 1a90530f83ff..16e8ebbd3316 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2567,10 +2567,12 @@ static netdev_features_t harmonize_features(struct sk_buff *skb,
>  
>  netdev_features_t netif_skb_features(struct sk_buff *skb)
>  {
> +	const struct net_device *dev = skb->dev;
> +	netdev_features_t features = dev->features;
> +	u16 gso_segs = skb_shinfo(skb)->gso_segs;
>  	__be16 protocol = skb->protocol;
> -	netdev_features_t features = skb->dev->features;
>  
> -	if (skb_shinfo(skb)->gso_segs > skb->dev->gso_max_segs)
> +	if (gso_segs > dev->gso_max_segs || gso_segs < dev->gso_min_segs)
>  		features &= ~NETIF_F_GSO_MASK;
>  
>  	if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) {
> @@ -2581,7 +2583,7 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
>  	}
>  
>  	features = netdev_intersect_features(features,
> -					     skb->dev->vlan_features |
> +					     dev->vlan_features |
>  					     NETIF_F_HW_VLAN_CTAG_TX |
>  					     NETIF_F_HW_VLAN_STAG_TX);
>  
> @@ -6658,6 +6660,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
>  
>  	dev->gso_max_size = GSO_MAX_SIZE;
>  	dev->gso_max_segs = GSO_MAX_SEGS;
> +	dev->gso_min_segs = 0;
>  
>  	INIT_LIST_HEAD(&dev->napi_list);
>  	INIT_LIST_HEAD(&dev->unreg_list);
> 
> 

^ 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