* Re: [PATCH net] ipv6: drop non loopback packets claiming to originate from ::1
From: David Miller @ 2017-04-17 19:09 UTC (permalink / raw)
To: fw; +Cc: netdev
In-Reply-To: <20170414182243.24506-1-fw@strlen.de>
From: Florian Westphal <fw@strlen.de>
Date: Fri, 14 Apr 2017 20:22:43 +0200
> We lack a saddr check for ::1. This causes security issues e.g. with acls
> permitting connections from ::1 because of assumption that these originate
> from local machine.
>
> Assuming a source address of ::1 is local seems reasonable.
> RFC4291 doesn't allow such a source address either, so drop such packets.
>
> Reported-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
Applied, thanks Florian.
^ permalink raw reply
* Re: [PATCH RFC] sparc64: eBPF JIT
From: David Miller @ 2017-04-17 19:03 UTC (permalink / raw)
To: daniel; +Cc: sparclinux, netdev, ast
In-Reply-To: <58F50D13.3090001@iogearbox.net>
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Mon, 17 Apr 2017 20:44:35 +0200
> On 04/17/2017 05:38 AM, David Miller wrote:
>> +/* Map BPF registers to SPARC registers */
>> +static const int bpf2sparc[] = {
>> + /* return value from in-kernel function, and exit value from eBPF */
>> + [BPF_REG_0] = I5,
>> +
>> + /* arguments from eBPF program to in-kernel function */
>> + [BPF_REG_1] = I0,
>> + [BPF_REG_2] = I1,
>> + [BPF_REG_3] = I2,
>> + [BPF_REG_4] = I3,
>> + [BPF_REG_5] = I4,
>> +
>> + /* callee saved registers that in-kernel function will preserve */
>> + [BPF_REG_6] = L0,
>> + [BPF_REG_7] = L1,
>> + [BPF_REG_8] = L2,
>> + [BPF_REG_9] = L3,
>> +
>> + /* read-only frame pointer to access stack */
>> + [BPF_REG_FP] = FP,
>
> On a quick initial glance, you also need to map BPF_REG_AX. If
> I understand the convention correctly, you could use L7 for that.
>
> You can test for it through tools/testing/selftests/bpf/test_kmod.sh
> which exercises the test_bpf.ko under various sysctl combinations as
> part of the BPF selftest suite.
Oh I see, it's used for constant blinding. I can use a global register
for that since it's only used as a temporary right?
^ permalink raw reply
* Re: pull request: bluetooth-next 2017-04-14
From: David Miller @ 2017-04-17 19:02 UTC (permalink / raw)
To: johan.hedberg; +Cc: linux-bluetooth, netdev
In-Reply-To: <20170414181212.GA27363@x1c.P-661HNU-F1>
From: Johan Hedberg <johan.hedberg@gmail.com>
Date: Fri, 14 Apr 2017 21:12:12 +0300
> Here's the main batch of Bluetooth & 802.15.4 patches for the 4.12
> kernel.
>
> - Many fixes to 6LoWPAN, in particular for BLE
> - New CA8210 IEEE 802.15.4 device driver (accounting for most of the
> lines of code added in this pull request)
> - Added Nokia Bluetooth (UART) HCI driver
> - Some serdev & TTY changes that are dependencies for the Nokia
> driver (with acks from relevant maintainers and an agreement that
> these come through the bluetooth tree)
> - Support for new Intel Bluetooth device
> - Various other minor cleanups/fixes here and there
>
> Please let me know if there are any issues pulling. Thanks.
Applied, thanks.
^ permalink raw reply
* Re: [PATCH RFC] sparc64: eBPF JIT
From: Daniel Borkmann @ 2017-04-17 18:44 UTC (permalink / raw)
To: David Miller, sparclinux; +Cc: netdev, ast
In-Reply-To: <20170416.233825.1748421481008153466.davem@davemloft.net>
On 04/17/2017 05:38 AM, David Miller wrote:
>
> There are a bunch of things I want to do still, and I know that I have
> to attend to sparc32 more cleanly, but I wanted to post this now that
> I have it passing the BPF testsuite completely:
>
> [24174.315421] test_bpf: Summary: 305 PASSED, 0 FAILED, [297/297 JIT'ed]
Awesome, thanks for working on it! :)
> Only major unimplemented feature is tail calls, which I am very sure I
> can do simply but until something easy to use like test_bpf can
> exercise it I probably won't do it.
There is samples/bpf/sockex3_kern.c, which exercises it. To
run it, it would be (clang/llvm needed due to BPF backend not
available in gcc):
# cd samples/bpf
# make
# ./sockex3
IP src.port -> dst.port bytes packets
127.0.0.1.12865 -> 127.0.0.1.49711 148 2
127.0.0.1.49711 -> 127.0.0.1.12865 108 2
[...]
Inside parse_eth_proto(), it will do tail calls based on the
eth protocol. Over time, we'll move such C based tests over to
tools/testing/selftests/bpf/.
> From my side, what I need to do to turn this into a non-RFC is to sort
> out sparc32. My plan is to take the existing cBPF JIT, rip out all of
> the sparc64 specific bits, and have sparc32 use that. And do it in
> such a way that git bisection is not broken.
Makes sense. That would follow the same model as ppc32/64.
> As a future optimization I'd like to add support for emitting cbcond
> instructions on newer chips.
>
> This implementation grabs a register window all the time, and we could
> avoid that and use a leaf function in certatin situations. The
> register layout is also not optimal, and one side effect is that we
> have to move the argument registers over during function calls.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
[...]
> +/* Map BPF registers to SPARC registers */
> +static const int bpf2sparc[] = {
> + /* return value from in-kernel function, and exit value from eBPF */
> + [BPF_REG_0] = I5,
> +
> + /* arguments from eBPF program to in-kernel function */
> + [BPF_REG_1] = I0,
> + [BPF_REG_2] = I1,
> + [BPF_REG_3] = I2,
> + [BPF_REG_4] = I3,
> + [BPF_REG_5] = I4,
> +
> + /* callee saved registers that in-kernel function will preserve */
> + [BPF_REG_6] = L0,
> + [BPF_REG_7] = L1,
> + [BPF_REG_8] = L2,
> + [BPF_REG_9] = L3,
> +
> + /* read-only frame pointer to access stack */
> + [BPF_REG_FP] = FP,
On a quick initial glance, you also need to map BPF_REG_AX. If
I understand the convention correctly, you could use L7 for that.
You can test for it through tools/testing/selftests/bpf/test_kmod.sh
which exercises the test_bpf.ko under various sysctl combinations as
part of the BPF selftest suite.
> + /* temporary register for internal BPF JIT */
> + [TMP_REG_1] = G1,
> + [TMP_REG_2] = G3,
> + [TMP_REG_3] = L6,
> +
> + [SKB_HLEN_REG] = L4,
> + [SKB_DATA_REG] = L5,
> +};
Thanks a lot!
Daniel
^ permalink raw reply
* [Patch net-next v3] net_sched: move the empty tp check from ->destroy() to ->delete()
From: Cong Wang @ 2017-04-17 18:30 UTC (permalink / raw)
To: netdev; +Cc: Cong Wang, Daniel Borkmann, John Fastabend, Jamal Hadi Salim
Roi reported we could have a race condition where in ->classify() path
we dereference tp->root and meanwhile a parallel ->destroy() makes it
a NULL.
This is possible because ->destroy() could be called when deleting
a filter to check if we are the last one in tp, this tp is still
linked and visible at that time.
Daniel fixed this in commit d936377414fa
("net, sched: respect rcu grace period on cls destruction"), but
the root cause of this problem is the semantic of ->destroy(), it
does two things (for non-force case):
1) check if tp is empty
2) if tp is empty we could really destroy it
and its caller, if cares, needs to check its return value to see if
it is really destroyed. Therefore we can't unlink tp unless we know
it is empty.
As suggested by Daniel, we could actually move the test logic to ->delete()
so that we can safely unlink tp after ->delete() tells us the last one is
just deleted and before ->destroy().
What's more, even we unlink it before ->destroy(), it could still have
readers since we don't wait for a grace period here, we should not modify
tp->root in ->destroy() either.
Reported-by: Roi Dayan <roid@mellanox.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
include/net/sch_generic.h | 4 +--
net/sched/cls_api.c | 27 +++++++++---------
net/sched/cls_basic.c | 10 +++----
net/sched/cls_bpf.c | 11 ++++----
net/sched/cls_cgroup.c | 8 ++----
net/sched/cls_flow.c | 10 +++----
net/sched/cls_flower.c | 10 ++-----
net/sched/cls_fw.c | 30 +++++++++++---------
net/sched/cls_matchall.c | 7 ++---
net/sched/cls_route.c | 30 ++++++++++----------
net/sched/cls_rsvp.h | 34 +++++++++++------------
net/sched/cls_tcindex.c | 14 +++++-----
net/sched/cls_u32.c | 71 +++++++++++++++++++++++++++--------------------
13 files changed, 134 insertions(+), 132 deletions(-)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 65d5026..22e5209 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -204,14 +204,14 @@ struct tcf_proto_ops {
const struct tcf_proto *,
struct tcf_result *);
int (*init)(struct tcf_proto*);
- bool (*destroy)(struct tcf_proto*, bool);
+ void (*destroy)(struct tcf_proto*);
unsigned long (*get)(struct tcf_proto*, u32 handle);
int (*change)(struct net *net, struct sk_buff *,
struct tcf_proto*, unsigned long,
u32 handle, struct nlattr **,
unsigned long *, bool);
- int (*delete)(struct tcf_proto*, unsigned long);
+ int (*delete)(struct tcf_proto*, unsigned long, bool*);
void (*walk)(struct tcf_proto*, struct tcf_walker *arg);
/* rtnetlink specific */
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index e2c68c3..55d7b4e7 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -178,14 +178,11 @@ static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol,
return ERR_PTR(err);
}
-static bool tcf_proto_destroy(struct tcf_proto *tp, bool force)
+static void tcf_proto_destroy(struct tcf_proto *tp)
{
- if (tp->ops->destroy(tp, force)) {
- module_put(tp->ops->owner);
- kfree_rcu(tp, rcu);
- return true;
- }
- return false;
+ tp->ops->destroy(tp);
+ module_put(tp->ops->owner);
+ kfree_rcu(tp, rcu);
}
void tcf_destroy_chain(struct tcf_proto __rcu **fl)
@@ -194,7 +191,7 @@ void tcf_destroy_chain(struct tcf_proto __rcu **fl)
while ((tp = rtnl_dereference(*fl)) != NULL) {
RCU_INIT_POINTER(*fl, tp->next);
- tcf_proto_destroy(tp, true);
+ tcf_proto_destroy(tp);
}
}
EXPORT_SYMBOL(tcf_destroy_chain);
@@ -360,7 +357,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n)
RCU_INIT_POINTER(*back, next);
tfilter_notify(net, skb, n, tp, fh,
RTM_DELTFILTER, false);
- tcf_proto_destroy(tp, true);
+ tcf_proto_destroy(tp);
err = 0;
goto errout;
}
@@ -371,24 +368,28 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n)
goto errout;
}
} else {
+ bool last;
+
switch (n->nlmsg_type) {
case RTM_NEWTFILTER:
if (n->nlmsg_flags & NLM_F_EXCL) {
if (tp_created)
- tcf_proto_destroy(tp, true);
+ tcf_proto_destroy(tp);
err = -EEXIST;
goto errout;
}
break;
case RTM_DELTFILTER:
- err = tp->ops->delete(tp, fh);
+ err = tp->ops->delete(tp, fh, &last);
if (err)
goto errout;
next = rtnl_dereference(tp->next);
tfilter_notify(net, skb, n, tp, t->tcm_handle,
RTM_DELTFILTER, false);
- if (tcf_proto_destroy(tp, false))
+ if (last) {
RCU_INIT_POINTER(*back, next);
+ tcf_proto_destroy(tp);
+ }
goto errout;
case RTM_GETTFILTER:
err = tfilter_notify(net, skb, n, tp, fh,
@@ -410,7 +411,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n)
tfilter_notify(net, skb, n, tp, fh, RTM_NEWTFILTER, false);
} else {
if (tp_created)
- tcf_proto_destroy(tp, true);
+ tcf_proto_destroy(tp);
}
errout:
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index 422414f..c4fd63a 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -93,30 +93,28 @@ static void basic_delete_filter(struct rcu_head *head)
kfree(f);
}
-static bool basic_destroy(struct tcf_proto *tp, bool force)
+static void basic_destroy(struct tcf_proto *tp)
{
struct basic_head *head = rtnl_dereference(tp->root);
struct basic_filter *f, *n;
- if (!force && !list_empty(&head->flist))
- return false;
-
list_for_each_entry_safe(f, n, &head->flist, link) {
list_del_rcu(&f->link);
tcf_unbind_filter(tp, &f->res);
call_rcu(&f->rcu, basic_delete_filter);
}
kfree_rcu(head, rcu);
- return true;
}
-static int basic_delete(struct tcf_proto *tp, unsigned long arg)
+static int basic_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
+ struct basic_head *head = rtnl_dereference(tp->root);
struct basic_filter *f = (struct basic_filter *) arg;
list_del_rcu(&f->link);
tcf_unbind_filter(tp, &f->res);
call_rcu(&f->rcu, basic_delete_filter);
+ *last = list_empty(&head->flist);
return 0;
}
diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c
index 7ddd08e..5ebeae9 100644
--- a/net/sched/cls_bpf.c
+++ b/net/sched/cls_bpf.c
@@ -274,25 +274,24 @@ static void __cls_bpf_delete(struct tcf_proto *tp, struct cls_bpf_prog *prog)
call_rcu(&prog->rcu, cls_bpf_delete_prog_rcu);
}
-static int cls_bpf_delete(struct tcf_proto *tp, unsigned long arg)
+static int cls_bpf_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
+ struct cls_bpf_head *head = rtnl_dereference(tp->root);
+
__cls_bpf_delete(tp, (struct cls_bpf_prog *) arg);
+ *last = list_empty(&head->plist);
return 0;
}
-static bool cls_bpf_destroy(struct tcf_proto *tp, bool force)
+static void cls_bpf_destroy(struct tcf_proto *tp)
{
struct cls_bpf_head *head = rtnl_dereference(tp->root);
struct cls_bpf_prog *prog, *tmp;
- if (!force && !list_empty(&head->plist))
- return false;
-
list_for_each_entry_safe(prog, tmp, &head->plist, link)
__cls_bpf_delete(tp, prog);
kfree_rcu(head, rcu);
- return true;
}
static unsigned long cls_bpf_get(struct tcf_proto *tp, u32 handle)
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index b5e7c1b..12ce547 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -131,20 +131,16 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
return err;
}
-static bool cls_cgroup_destroy(struct tcf_proto *tp, bool force)
+static void cls_cgroup_destroy(struct tcf_proto *tp)
{
struct cls_cgroup_head *head = rtnl_dereference(tp->root);
- if (!force)
- return false;
/* Head can still be NULL due to cls_cgroup_init(). */
if (head)
call_rcu(&head->rcu, cls_cgroup_destroy_rcu);
-
- return true;
}
-static int cls_cgroup_delete(struct tcf_proto *tp, unsigned long arg)
+static int cls_cgroup_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
return -EOPNOTSUPP;
}
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c
index 008ba7e..3065752 100644
--- a/net/sched/cls_flow.c
+++ b/net/sched/cls_flow.c
@@ -562,12 +562,14 @@ static int flow_change(struct net *net, struct sk_buff *in_skb,
return err;
}
-static int flow_delete(struct tcf_proto *tp, unsigned long arg)
+static int flow_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
+ struct flow_head *head = rtnl_dereference(tp->root);
struct flow_filter *f = (struct flow_filter *)arg;
list_del_rcu(&f->list);
call_rcu(&f->rcu, flow_destroy_filter);
+ *last = list_empty(&head->filters);
return 0;
}
@@ -583,20 +585,16 @@ static int flow_init(struct tcf_proto *tp)
return 0;
}
-static bool flow_destroy(struct tcf_proto *tp, bool force)
+static void flow_destroy(struct tcf_proto *tp)
{
struct flow_head *head = rtnl_dereference(tp->root);
struct flow_filter *f, *next;
- if (!force && !list_empty(&head->filters))
- return false;
-
list_for_each_entry_safe(f, next, &head->filters, list) {
list_del_rcu(&f->list);
call_rcu(&f->rcu, flow_destroy_filter);
}
kfree_rcu(head, rcu);
- return true;
}
static unsigned long flow_get(struct tcf_proto *tp, u32 handle)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 3e7bd78..31ee340 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -328,21 +328,16 @@ static void fl_destroy_rcu(struct rcu_head *rcu)
schedule_work(&head->work);
}
-static bool fl_destroy(struct tcf_proto *tp, bool force)
+static void fl_destroy(struct tcf_proto *tp)
{
struct cls_fl_head *head = rtnl_dereference(tp->root);
struct cls_fl_filter *f, *next;
- if (!force && !list_empty(&head->filters))
- return false;
-
list_for_each_entry_safe(f, next, &head->filters, list)
__fl_delete(tp, f);
__module_get(THIS_MODULE);
call_rcu(&head->rcu, fl_destroy_rcu);
-
- return true;
}
static unsigned long fl_get(struct tcf_proto *tp, u32 handle)
@@ -947,7 +942,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
return err;
}
-static int fl_delete(struct tcf_proto *tp, unsigned long arg)
+static int fl_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
struct cls_fl_head *head = rtnl_dereference(tp->root);
struct cls_fl_filter *f = (struct cls_fl_filter *) arg;
@@ -956,6 +951,7 @@ static int fl_delete(struct tcf_proto *tp, unsigned long arg)
rhashtable_remove_fast(&head->ht, &f->ht_node,
head->ht_params);
__fl_delete(tp, f);
+ *last = list_empty(&head->filters);
return 0;
}
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index 9962090..d388536 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -127,20 +127,14 @@ static void fw_delete_filter(struct rcu_head *head)
kfree(f);
}
-static bool fw_destroy(struct tcf_proto *tp, bool force)
+static void fw_destroy(struct tcf_proto *tp)
{
struct fw_head *head = rtnl_dereference(tp->root);
struct fw_filter *f;
int h;
if (head == NULL)
- return true;
-
- if (!force) {
- for (h = 0; h < HTSIZE; h++)
- if (rcu_access_pointer(head->ht[h]))
- return false;
- }
+ return;
for (h = 0; h < HTSIZE; h++) {
while ((f = rtnl_dereference(head->ht[h])) != NULL) {
@@ -150,17 +144,17 @@ static bool fw_destroy(struct tcf_proto *tp, bool force)
call_rcu(&f->rcu, fw_delete_filter);
}
}
- RCU_INIT_POINTER(tp->root, NULL);
kfree_rcu(head, rcu);
- return true;
}
-static int fw_delete(struct tcf_proto *tp, unsigned long arg)
+static int fw_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
struct fw_head *head = rtnl_dereference(tp->root);
struct fw_filter *f = (struct fw_filter *)arg;
struct fw_filter __rcu **fp;
struct fw_filter *pfp;
+ int ret = -EINVAL;
+ int h;
if (head == NULL || f == NULL)
goto out;
@@ -173,11 +167,21 @@ static int fw_delete(struct tcf_proto *tp, unsigned long arg)
RCU_INIT_POINTER(*fp, rtnl_dereference(f->next));
tcf_unbind_filter(tp, &f->res);
call_rcu(&f->rcu, fw_delete_filter);
- return 0;
+ ret = 0;
+ break;
}
}
+
+ *last = true;
+ for (h = 0; h < HTSIZE; h++) {
+ if (rcu_access_pointer(head->ht[h])) {
+ *last = false;
+ break;
+ }
+ }
+
out:
- return -EINVAL;
+ return ret;
}
static const struct nla_policy fw_policy[TCA_FW_MAX + 1] = {
diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index 0dbcca6..2efb36c 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -90,19 +90,18 @@ static void mall_destroy_hw_filter(struct tcf_proto *tp,
&offload);
}
-static bool mall_destroy(struct tcf_proto *tp, bool force)
+static void mall_destroy(struct tcf_proto *tp)
{
struct cls_mall_head *head = rtnl_dereference(tp->root);
struct net_device *dev = tp->q->dev_queue->dev;
if (!head)
- return true;
+ return;
if (tc_should_offload(dev, tp, head->flags))
mall_destroy_hw_filter(tp, head, (unsigned long) head);
call_rcu(&head->rcu, mall_destroy_rcu);
- return true;
}
static unsigned long mall_get(struct tcf_proto *tp, u32 handle)
@@ -216,7 +215,7 @@ static int mall_change(struct net *net, struct sk_buff *in_skb,
return err;
}
-static int mall_delete(struct tcf_proto *tp, unsigned long arg)
+static int mall_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
return -EOPNOTSUPP;
}
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index a371075..8e2baf8 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -276,20 +276,13 @@ static void route4_delete_filter(struct rcu_head *head)
kfree(f);
}
-static bool route4_destroy(struct tcf_proto *tp, bool force)
+static void route4_destroy(struct tcf_proto *tp)
{
struct route4_head *head = rtnl_dereference(tp->root);
int h1, h2;
if (head == NULL)
- return true;
-
- if (!force) {
- for (h1 = 0; h1 <= 256; h1++) {
- if (rcu_access_pointer(head->table[h1]))
- return false;
- }
- }
+ return;
for (h1 = 0; h1 <= 256; h1++) {
struct route4_bucket *b;
@@ -312,12 +305,10 @@ static bool route4_destroy(struct tcf_proto *tp, bool force)
kfree_rcu(b, rcu);
}
}
- RCU_INIT_POINTER(tp->root, NULL);
kfree_rcu(head, rcu);
- return true;
}
-static int route4_delete(struct tcf_proto *tp, unsigned long arg)
+static int route4_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
struct route4_head *head = rtnl_dereference(tp->root);
struct route4_filter *f = (struct route4_filter *)arg;
@@ -325,7 +316,7 @@ static int route4_delete(struct tcf_proto *tp, unsigned long arg)
struct route4_filter *nf;
struct route4_bucket *b;
unsigned int h = 0;
- int i;
+ int i, h1;
if (!head || !f)
return -EINVAL;
@@ -356,16 +347,25 @@ static int route4_delete(struct tcf_proto *tp, unsigned long arg)
rt = rtnl_dereference(b->ht[i]);
if (rt)
- return 0;
+ goto out;
}
/* OK, session has no flows */
RCU_INIT_POINTER(head->table[to_hash(h)], NULL);
kfree_rcu(b, rcu);
+ break;
+ }
+ }
- return 0;
+out:
+ *last = true;
+ for (h1 = 0; h1 <= 256; h1++) {
+ if (rcu_access_pointer(head->table[h1])) {
+ *last = false;
+ break;
}
}
+
return 0;
}
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index d7f2923..9e3748b 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -302,22 +302,13 @@ static void rsvp_delete_filter(struct tcf_proto *tp, struct rsvp_filter *f)
call_rcu(&f->rcu, rsvp_delete_filter_rcu);
}
-static bool rsvp_destroy(struct tcf_proto *tp, bool force)
+static void rsvp_destroy(struct tcf_proto *tp)
{
struct rsvp_head *data = rtnl_dereference(tp->root);
int h1, h2;
if (data == NULL)
- return true;
-
- if (!force) {
- for (h1 = 0; h1 < 256; h1++) {
- if (rcu_access_pointer(data->ht[h1]))
- return false;
- }
- }
-
- RCU_INIT_POINTER(tp->root, NULL);
+ return;
for (h1 = 0; h1 < 256; h1++) {
struct rsvp_session *s;
@@ -337,10 +328,9 @@ static bool rsvp_destroy(struct tcf_proto *tp, bool force)
}
}
kfree_rcu(data, rcu);
- return true;
}
-static int rsvp_delete(struct tcf_proto *tp, unsigned long arg)
+static int rsvp_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
struct rsvp_head *head = rtnl_dereference(tp->root);
struct rsvp_filter *nfp, *f = (struct rsvp_filter *)arg;
@@ -348,7 +338,7 @@ static int rsvp_delete(struct tcf_proto *tp, unsigned long arg)
unsigned int h = f->handle;
struct rsvp_session __rcu **sp;
struct rsvp_session *nsp, *s = f->sess;
- int i;
+ int i, h1;
fp = &s->ht[(h >> 8) & 0xFF];
for (nfp = rtnl_dereference(*fp); nfp;
@@ -361,7 +351,7 @@ static int rsvp_delete(struct tcf_proto *tp, unsigned long arg)
for (i = 0; i <= 16; i++)
if (s->ht[i])
- return 0;
+ goto out;
/* OK, session has no flows */
sp = &head->ht[h & 0xFF];
@@ -370,13 +360,23 @@ static int rsvp_delete(struct tcf_proto *tp, unsigned long arg)
if (nsp == s) {
RCU_INIT_POINTER(*sp, s->next);
kfree_rcu(s, rcu);
- return 0;
+ goto out;
}
}
- return 0;
+ break;
}
}
+
+out:
+ *last = true;
+ for (h1 = 0; h1 < 256; h1++) {
+ if (rcu_access_pointer(head->ht[h1])) {
+ *last = false;
+ break;
+ }
+ }
+
return 0;
}
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index 2ab0013..8a8a583 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -150,7 +150,7 @@ static void tcindex_destroy_fexts(struct rcu_head *head)
kfree(f);
}
-static int tcindex_delete(struct tcf_proto *tp, unsigned long arg)
+static int tcindex_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
struct tcindex_data *p = rtnl_dereference(tp->root);
struct tcindex_filter_result *r = (struct tcindex_filter_result *) arg;
@@ -186,6 +186,8 @@ static int tcindex_delete(struct tcf_proto *tp, unsigned long arg)
call_rcu(&f->rcu, tcindex_destroy_fexts);
else
call_rcu(&r->rcu, tcindex_destroy_rexts);
+
+ *last = false;
return 0;
}
@@ -193,7 +195,9 @@ static int tcindex_destroy_element(struct tcf_proto *tp,
unsigned long arg,
struct tcf_walker *walker)
{
- return tcindex_delete(tp, arg);
+ bool last;
+
+ return tcindex_delete(tp, arg, &last);
}
static void __tcindex_destroy(struct rcu_head *head)
@@ -529,14 +533,11 @@ static void tcindex_walk(struct tcf_proto *tp, struct tcf_walker *walker)
}
}
-static bool tcindex_destroy(struct tcf_proto *tp, bool force)
+static void tcindex_destroy(struct tcf_proto *tp)
{
struct tcindex_data *p = rtnl_dereference(tp->root);
struct tcf_walker walker;
- if (!force)
- return false;
-
pr_debug("tcindex_destroy(tp %p),p %p\n", tp, p);
walker.count = 0;
walker.skip = 0;
@@ -544,7 +545,6 @@ static bool tcindex_destroy(struct tcf_proto *tp, bool force)
tcindex_walk(tp, &walker);
call_rcu(&p->rcu, __tcindex_destroy);
- return true;
}
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 9e2f330..d20e72a 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -585,37 +585,13 @@ static bool ht_empty(struct tc_u_hnode *ht)
return true;
}
-static bool u32_destroy(struct tcf_proto *tp, bool force)
+static void u32_destroy(struct tcf_proto *tp)
{
struct tc_u_common *tp_c = tp->data;
struct tc_u_hnode *root_ht = rtnl_dereference(tp->root);
WARN_ON(root_ht == NULL);
- if (!force) {
- if (root_ht) {
- if (root_ht->refcnt > 1)
- return false;
- if (root_ht->refcnt == 1) {
- if (!ht_empty(root_ht))
- return false;
- }
- }
-
- if (tp_c->refcnt > 1)
- return false;
-
- if (tp_c->refcnt == 1) {
- struct tc_u_hnode *ht;
-
- for (ht = rtnl_dereference(tp_c->hlist);
- ht;
- ht = rtnl_dereference(ht->next))
- if (!ht_empty(ht))
- return false;
- }
- }
-
if (root_ht && --root_ht->refcnt == 0)
u32_destroy_hnode(tp, root_ht);
@@ -640,20 +616,22 @@ static bool u32_destroy(struct tcf_proto *tp, bool force)
}
tp->data = NULL;
- return true;
}
-static int u32_delete(struct tcf_proto *tp, unsigned long arg)
+static int u32_delete(struct tcf_proto *tp, unsigned long arg, bool *last)
{
struct tc_u_hnode *ht = (struct tc_u_hnode *)arg;
struct tc_u_hnode *root_ht = rtnl_dereference(tp->root);
+ struct tc_u_common *tp_c = tp->data;
+ int ret = 0;
if (ht == NULL)
- return 0;
+ goto out;
if (TC_U32_KEY(ht->handle)) {
u32_remove_hw_knode(tp, ht->handle);
- return u32_delete_key(tp, (struct tc_u_knode *)ht);
+ ret = u32_delete_key(tp, (struct tc_u_knode *)ht);
+ goto out;
}
if (root_ht == ht)
@@ -666,7 +644,40 @@ static int u32_delete(struct tcf_proto *tp, unsigned long arg)
return -EBUSY;
}
- return 0;
+out:
+ *last = true;
+ if (root_ht) {
+ if (root_ht->refcnt > 1) {
+ *last = false;
+ goto ret;
+ }
+ if (root_ht->refcnt == 1) {
+ if (!ht_empty(root_ht)) {
+ *last = false;
+ goto ret;
+ }
+ }
+ }
+
+ if (tp_c->refcnt > 1) {
+ *last = false;
+ goto ret;
+ }
+
+ if (tp_c->refcnt == 1) {
+ struct tc_u_hnode *ht;
+
+ for (ht = rtnl_dereference(tp_c->hlist);
+ ht;
+ ht = rtnl_dereference(ht->next))
+ if (!ht_empty(ht)) {
+ *last = false;
+ break;
+ }
+ }
+
+ret:
+ return ret;
}
#define NR_U32_NODE (1<<12)
--
2.5.5
^ permalink raw reply related
* Re: [PATCH net-next v2] bonding: deliver link-local packets with skb->dev set to link that packets arrived on
From: Jay Vosburgh @ 2017-04-17 18:28 UTC (permalink / raw)
To: Chonggang Li
Cc: andy, vfalico, nikolay, edumazet, davem, netdev, Mahesh Bandewar,
Maciej Żenczykowski
In-Reply-To: <20170416190218.57224-1-chonggangli@google.com>
Chonggang Li <chonggangli@google.com> wrote:
>Bonding driver changes the skb->dev to the bonding-master before
>passing the packet to stack for further processing. This, however
>does not make sense for the link-local packets and it looses "the
>link info" once its skb->dev is changed to bonding-master. This
>patch changes this behavior for link-local packets by not changing
>the skb->dev to the bonding-master and maintaining it as it is,
>i.e. the link on which the packet arrived.
Minor nit: "looses" should be "loses". Other than that:
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
>Signed-off-by: Chonggang Li <chonggangli@google.com>
>Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>Signed-off-by: Maciej Żenczykowski <maze@google.com>
>---
>Changes in v2:
> - Make the commit message more clearer.
>
> drivers/net/bonding/bond_main.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 01e4a69af421..6bd3b50faf48 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1176,6 +1176,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
> }
> }
>
>+ /* don't change skb->dev for link-local packets */
>+ if (is_link_local_ether_addr(eth_hdr(skb)->h_dest))
>+ return RX_HANDLER_PASS;
> if (bond_should_deliver_exact_match(skb, slave, bond))
> return RX_HANDLER_EXACT;
>
>--
>2.12.2.762.g0e3151a226-goog
>
^ permalink raw reply
* Re: [PATCH linux 2/2] net sched actions: fix refcount decrement on error
From: Cong Wang @ 2017-04-17 18:10 UTC (permalink / raw)
To: Wolfgang Bumiller
Cc: Jamal Hadi Salim, Linux Kernel Network Developers, LKML,
David S. Miller, Roman Mashak
In-Reply-To: <1985738840.18.1492282135309@webmail.proxmox.com>
On Sat, Apr 15, 2017 at 11:48 AM, Wolfgang Bumiller
<w.bumiller@proxmox.com> wrote:
>
>> On April 15, 2017 at 8:20 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
>>
>>
>> On Fri, Apr 14, 2017 at 2:08 AM, Wolfgang Bumiller
>> <w.bumiller@proxmox.com> wrote:
>> > Before I do that - trying to wrap my head around the interdependencies
>> > here better to be thorough - I noticed that tcf_hash_release() can
>> > return ACT_P_DELETED. The ACT_P_CREATED case means tcf_hash_create()
>> > was used, in the other case the tc_action's ref & bind count is bumped
>> > by tcf_hash_check() and then also decremented by tcf_hash_release() if
>> > it existed, iow. kept at 1, but not always: It does always happen in
>> > act_police.c but in other files such as act_bpf.c or act_connmark.c if
>> > eg. bind is set they return without decrementing, so both ref&bind count
>> > are bumped when they return - the refcount logic isn't easy to follow
>> > for a newcomer. Now there are two uses of __tcf_hash_release() in
>> > act_api.c which check for a return value of ACT_P_DELETED, in which case
>> > they call module_put().
>>
>>
>> That's the nasty part... IIRC, Jamal has fixed two bugs on action refcnt'ing.
>> We really need to clean up the code.
>>
>> > So I'm not sure exactly how the module and tc_action counts are related
>> > (and I usually like to understand my own patches ;-) ).
>>
>>
>> Each action holds a refcnt to its module, each filter holds a refcnt to
>> its bound or referenced (unbound) action.
>>
>>
>> > Maybe I'm missing something obvious but I'm currently a bit confused as
>> > to whether the tcf_hash_release() call there is okay, or should have its
>> > return value checked or should depend on ->init()'s ACT_P_CREATED value
>> > as well?
>> >
>>
>> I think it's the same? If we have ACT_P_CREATED here, tcf_hash_release()
>> will return ACT_P_DELETED for sure because the newly created action has
>> refcnt==1?
>
> Makes sense on the one hand, but for ACT_P_DELETED both ref and bind
> count need to reach 0, so I'm still concerned that the different behaviors
Bind refcnt is only used when it is bound to a filter and refcnt is always used,
so either bind refcnt is 0 or it is same with refcnt.
> I mentioned above might be problematic if we use ACT_P_CREATED only.
> (It also means my patches still leak a count - which is probably still
> better than the previous underflow, but ultimately doesn't satisfy me.)
> Should I still resend it this way for the record with the Acked-bys?
> (Since given the fact that with unprivileged containers it's possible to
> trigger this access and potentially crash the kernel I strongly feel that
> some version of this should end up in the 4.11 release.)
I think so.
Thanks.
^ permalink raw reply
* bluetooth 6lowpan interfaces are not virtual anymore
From: Alexander Aring @ 2017-04-17 17:56 UTC (permalink / raw)
To: Network Development
Cc: Jukka Rissanen, Luiz Augusto von Dentz,
linux-wpan@vger.kernel.org, Linux Bluetooth
Hi,
bluetooth-next contains patches which introduces a queue for bluetooth
6LoWPAN interfaces. [0]
At first, the current behaviour is now that 802.15.4 6LoWPAN interfaces
are virtual and bluetooth 6LoWPAN interfaces are not virtual anymore.
To have a different handling in both subsystems is _definitely_ wrong.
What does the 6LoWPAN interface?
It will do a protocol change (an adaptation, because 6LoWPAN should
provide the same functionality as IPv6) from IPv6 to 6LoWPAN (tx) and
vice versa for (rx). In my opinion this should be handled as a virtual
interface and not as an interface with a queue.
What makes a queue on 6LoWPAN interfaces?
It will queue IPv6 packets which waits for it adaptation (the protocol
change) with some additional qdisc handling.
If finally the xmit_do callback will occur it will replace IPv6 header
with 6LoWPAN, etc. After that it should be queued into some queue on
link layer side which should be do the transmit finally.
Why I think bluetooth introduced a queue handling on 6LoWPAN interfaces?
Because I think they don't like their own *qdisc* handling on their link
layer interface. I write *qdisc* here because, they have no net_devices
and use some kind of own qdisc handling.
My question: is this correct?
How to fix that (In my opinion):
So commit [0] says something "out of credits" that's what I think it's
the *qdisc* handling. If you cannot queue anymore -> you need to drop
it. If you don't like how the current behaviour is, you need to change
your *qdisc* handling on your link layer interface. Introducing queue at
6LoWPAN interfaces will introduce "buffer bloating".
---
I don't care what bluetooth does with the 6LoWPAN interface. If bluetooth
people wants such behaviour, then I am okay with that.
I will bookmark this mail for the time when somebody reverts it to a
virtual interface again. I think somebody will change it again, or maybe
somebody will argument why we need a queue here.
- Alex
[0] https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/?id=814f1b243d2c63928f6aa72d66bec0e5fae2f4a9
^ permalink raw reply
* Re: [PATCH net-next 0/6] bpf: LRU performance and test-program improvements
From: David Miller @ 2017-04-17 17:56 UTC (permalink / raw)
To: kafai; +Cc: netdev, ast, daniel
In-Reply-To: <20170414173030.2853860-1-kafai@fb.com>
From: Martin KaFai Lau <kafai@fb.com>
Date: Fri, 14 Apr 2017 10:30:24 -0700
> The first 4 patches make a few improvements to the LRU tests.
>
> Patch 5/6 is to improve the performance of BPF_F_NO_COMMON_LRU map.
>
> Patch 6/6 adds an example in using LRU map with map-in-map.
Series applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next 1/1] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
From: Roman Mashak @ 2017-04-17 17:51 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jamal Hadi Salim, Jiri Pirko, davem, netdev, xiyou.wangcong
In-Reply-To: <1492448905.10587.109.camel@edumazet-glaptop3.roam.corp.google.com>
Eric Dumazet <eric.dumazet@gmail.com> writes:
> On Mon, 2017-04-17 at 12:46 -0400, Jamal Hadi Salim wrote:
>
>> Of course it is trivial to add this as attributes and 32 bits
>> for this case is not a big deal because it is done once. I want to talk
>> about the pads instead ;-> What do you suggest we do with pads?
>
> We do nothing with pads. Just leave them.
>
> Or, you need something to make sure to not break old user applications.
>
> Something like a version.
Would be a new NLM_F_* modifier for GET request an option for large
dumps implementation? Looks like there are extract bits and Johannes'
patches for extended ACK do not use it.
^ permalink raw reply
* Re: [PATCH net-next] ibmvnic: Report errors when failing to release sub-crqs
From: David Miller @ 2017-04-17 17:49 UTC (permalink / raw)
To: nfont; +Cc: netdev, tlfalcon, jallen
In-Reply-To: <20170414164517.50438.14612.stgit@ltcalpine2-lp23.aus.stglabs.ibm.com>
Please do not submit a set of changes to the same driver like this.
Instead, submit a proper patch series which is numbered (so that the
dependencies betweeen changes, if any, are explciit) and also with
a proper "[PATCH 0/N] ..." header posting which describes what the
patch series is doing, how it is doing it, and why it is doing it
that way.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next] net: mvneta: fix failed to suspend if WOL is enabled
From: David Miller @ 2017-04-17 17:48 UTC (permalink / raw)
To: jszhang; +Cc: thomas.petazzoni, netdev, linux-kernel, linux-arm-kernel
In-Reply-To: <20170414110732.3100-1-jszhang@marvell.com>
From: Jisheng Zhang <jszhang@marvell.com>
Date: Fri, 14 Apr 2017 19:07:32 +0800
> Recently, suspend/resume and WOL support are added into mvneta driver.
> If we enable WOL, then we get some error as below on Marvell BG4CT
> platforms during suspend:
>
> [ 184.149723] dpm_run_callback(): mdio_bus_suspend+0x0/0x50 returns -16
> [ 184.149727] PM: Device f7b62004.mdio-mi:00 failed to suspend: error -16
>
> -16 means -EBUSY, phy_suspend() will return -EBUSY if it finds the
> device has WOL enabled.
>
> We fix this issue by properly setting the netdev's power.can_wakeup
> and power.wakeup, i.e
>
> 1. in mvneta_mdio_probe(), call device_set_wakeup_capable() to set
> power.can_wakeup if the phy support WOL.
>
> 2. in mvneta_ethtool_set_wol(), call device_set_wakeup_enable() to
> set power.wakeup if WOL has been successfully enabled in phy.
>
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net: bridge: notify on hw fdb takeover
From: David Miller @ 2017-04-17 17:45 UTC (permalink / raw)
To: nikolay; +Cc: netdev, roopa, bridge, stephen, idosch
In-Reply-To: <1492166974-20578-1-git-send-email-nikolay@cumulusnetworks.com>
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Fri, 14 Apr 2017 13:49:34 +0300
> Recently we added support for SW fdbs to take over HW ones, but that
> results in changing a user-visible fdb flag thus we need to send a
> notification, also it's consistent with how HW takes over SW entries.
>
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net/ncsi: fix checksum validation in response packet
From: David Miller @ 2017-04-17 17:36 UTC (permalink / raw)
To: clg; +Cc: gwshan, joel, netdev, linux-kernel
In-Reply-To: <1492160197-13816-1-git-send-email-clg@kaod.org>
From: Cédric Le Goater <clg@kaod.org>
Date: Fri, 14 Apr 2017 10:56:37 +0200
> htonl was used instead of ntohl. Surely a typo.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
I don't think so, "checksum" is of type "u32" thus is in host byte
order. Therefore "htonl()" is correct.
^ permalink raw reply
* Re: [PATCH v2 net 0/2] Fix crash caused by reporting inconsistent skb->len to BQL
From: David Miller @ 2017-04-17 17:34 UTC (permalink / raw)
To: sean.wang; +Cc: john, nbd, netdev, linux-kernel, linux-mediatek, keyhaede
In-Reply-To: <1492139952-8104-1-git-send-email-sean.wang@mediatek.com>
From: <sean.wang@mediatek.com>
Date: Fri, 14 Apr 2017 11:19:10 +0800
> From: Sean Wang <sean.wang@mediatek.com>
>
> Changes since v1:
> - fix inconsistent enumeration which easily causes the potential bug
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH v3] net: phy: micrel: fix crash when statistic requested for KSZ9031 phy
From: David Miller @ 2017-04-17 17:33 UTC (permalink / raw)
To: grygorii.strashko; +Cc: netdev, andrew, f.fainelli, nsekhar, linux-kernel
In-Reply-To: <20170413191127.5406-1-grygorii.strashko@ti.com>
From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Thu, 13 Apr 2017 14:11:27 -0500
> Now the command:
> ethtool --phy-statistics eth0
> will cause system crash with meassage "Unable to handle kernel NULL pointer
> dereference at virtual address 00000010" from:
>
> (kszphy_get_stats) from [<c069f1d8>] (ethtool_get_phy_stats+0xd8/0x210)
> (ethtool_get_phy_stats) from [<c06a0738>] (dev_ethtool+0x5b8/0x228c)
> (dev_ethtool) from [<c06b5484>] (dev_ioctl+0x3fc/0x964)
> (dev_ioctl) from [<c0679f7c>] (sock_ioctl+0x170/0x2c0)
> (sock_ioctl) from [<c02419d4>] (do_vfs_ioctl+0xa8/0x95c)
> (do_vfs_ioctl) from [<c02422c4>] (SyS_ioctl+0x3c/0x64)
> (SyS_ioctl) from [<c0107d60>] (ret_fast_syscall+0x0/0x44)
>
> The reason: phy_driver structure for KSZ9031 phy has no .probe() callback
> defined. As result, struct phy_device *phydev->priv pointer will not be
> initializes (null).
> This issue will affect also following phys:
> KSZ8795, KSZ886X, KSZ8873MLL, KSZ9031, KSZ9021, KSZ8061, KS8737
>
> Fix it by:
> - adding .probe() = kszphy_probe() callback to KSZ9031, KSZ9021
> phys. The kszphy_probe() can be re-used as it doesn't do any phy specific
> settings.
> - removing statistic callbacks from other phys (KSZ8795, KSZ886X,
> KSZ8873MLL, KSZ8061, KS8737) as they doesn't have corresponding
> statistic counters.
>
> Fixes: 2b2427d06426 ("phy: micrel: Add ethtool statistics counters")
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Applied.
^ permalink raw reply
* Re: [Patch net-next] kcm: remove a useless copy_from_user()
From: David Miller @ 2017-04-17 17:28 UTC (permalink / raw)
To: xiyou.wangcong; +Cc: netdev, tom
In-Reply-To: <1492108682-30505-1-git-send-email-xiyou.wangcong@gmail.com>
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Thu, 13 Apr 2017 11:38:02 -0700
> struct kcm_clone only contains fd, and kcm_clone() only
> writes this struct, so there is no need to copy it from user.
>
> Cc: Tom Herbert <tom@herbertland.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH net] net: vrf: Fix setting NLM_F_EXCL flag when adding l3mdev rule
From: David Miller @ 2017-04-17 17:28 UTC (permalink / raw)
To: dsa; +Cc: netdev
In-Reply-To: <20170413165715.10365-1-dsa@cumulusnetworks.com>
From: David Ahern <dsa@cumulusnetworks.com>
Date: Thu, 13 Apr 2017 10:57:15 -0600
> Only need 1 l3mdev FIB rule. Fix setting NLM_F_EXCL in the nlmsghdr.
>
> Fixes: 1aa6c4f6b8cd8 ("net: vrf: Add l3mdev rules on first device create")
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [patch net-next] MAINTAINERS: rename TC entry and add couple of header files
From: David Miller @ 2017-04-17 17:26 UTC (permalink / raw)
To: jiri; +Cc: netdev, mlxsw, jhs
In-Reply-To: <1492100031-13462-1-git-send-email-jiri@resnulli.us>
From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 13 Apr 2017 18:13:51 +0200
> From: Jiri Pirko <jiri@mellanox.com>
>
> The section is not specific only to "TC classifiers", but applies to the
> whole TC subsystem. Also, add couple of forgotten headers.
>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/2] net: phy: simplify phy_supported_speeds()
From: David Miller @ 2017-04-17 17:25 UTC (permalink / raw)
To: rmk+kernel; +Cc: f.fainelli, andrew, netdev
In-Reply-To: <E1cygzo-0002s5-T0@rmk-PC.armlinux.org.uk>
From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Thu, 13 Apr 2017 16:49:20 +0100
> Simplify the loop in phy_supported_speeds().
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Also applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH 1/2] net: phy: improve phylib correctness for non-autoneg settings
From: David Miller @ 2017-04-17 17:25 UTC (permalink / raw)
To: rmk+kernel; +Cc: f.fainelli, andrew, netdev
In-Reply-To: <E1cygzj-0002rx-PW@rmk-PC.armlinux.org.uk>
From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Thu, 13 Apr 2017 16:49:15 +0100
> phylib has some undesirable behaviour when forcing a link mode through
> ethtool. phylib uses this code:
>
> idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex),
> features);
>
> to find an index in the settings table. phy_find_setting() starts at
> index 0, and scans upwards looking for an exact speed and duplex match.
> When it doesn't find it, it returns MAX_NUM_SETTINGS - 1, which is
> 10baseT-Half duplex.
>
> phy_find_valid() then scans from the point (and effectively only checks
> one entry) before bailing out, returning MAX_NUM_SETTINGS - 1.
>
> phy_sanitize_settings() then sets ->speed to SPEED_10 and ->duplex to
> DUPLEX_HALF whether or not 10baseT-Half is supported or not. This goes
> against all the comments against these functions, and 10baseT-Half may
> not even be supported by the hardware.
>
> Rework these functions, introducing a new method of scanning the table.
> There are two modes of lookup that phylib wants: exact, and inexact.
>
> - in exact mode, we return either an exact match or failure
> - in inexact mode, we return an exact match if it exists, a match at
> the highest speed that is not greater than the requested speed
> (ignoring duplex), or failing that, the lowest supported speed, or
> failure.
>
> The biggest difference is that we always check whether the entry is
> supported before further consideration, so all unsupported entries are
> not considered as candidates.
>
> This results in arguably saner behaviour, better matches the comments,
> and is probably what users would expect.
>
> This becomes important as ethernet speeds increase, PHYs exist which do
> not support the 10Mbit speeds, and half-duplex is likely to become
> obsolete - it's already not even an option on 10Gbit and faster links.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Applied to net-next
^ permalink raw reply
* Re: [PATCH net-next v2] Subject: net: allow configuring default qdisc
From: David Miller @ 2017-04-17 17:23 UTC (permalink / raw)
To: stephen; +Cc: netdev, sthemmin
In-Reply-To: <20170413154053.27568-1-sthemmin@microsoft.com>
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Thu, 13 Apr 2017 08:40:53 -0700
> Since 3.12 it has been possible to configure the default queuing
> discipline via sysctl. This patch adds ability to configure the
> default queue discipline in kernel configuration. This is useful for
> environments where configuring the value from userspace is difficult
> to manage.
>
> The default is still the same as before (pfifo_fast) and it is
> possible to change after kernel init with sysctl. This is similar
> to how TCP congestion control works.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
> v2 -- add another level of indirection to make it easier for
> users blindly doing make oldconfig
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next 1/1] net sched actions: dump more than TCA_ACT_MAX_PRIO actions per batch
From: Eric Dumazet @ 2017-04-17 17:08 UTC (permalink / raw)
To: Jamal Hadi Salim; +Cc: Jiri Pirko, davem, netdev, xiyou.wangcong
In-Reply-To: <0bd1e885-cdf3-60fc-783b-a075b777560b@mojatatu.com>
On Mon, 2017-04-17 at 12:46 -0400, Jamal Hadi Salim wrote:
> Of course it is trivial to add this as attributes and 32 bits
> for this case is not a big deal because it is done once. I want to talk
> about the pads instead ;-> What do you suggest we do with pads?
We do nothing with pads. Just leave them.
Or, you need something to make sure to not break old user applications.
Something like a version.
^ permalink raw reply
* Re: [PATCH net-next 0/2] qed/qede: aRFS support
From: David Miller @ 2017-04-17 17:06 UTC (permalink / raw)
To: manish.chopra; +Cc: netdev, Yuval.Mintz
In-Reply-To: <20170413115445.16662-1-manish.chopra@cavium.com>
From: Manish Chopra <manish.chopra@cavium.com>
Date: Thu, 13 Apr 2017 04:54:43 -0700
> This series adds support for Accelerated Flow Steering
> in qede driver for TCP/UDP over IPv4/IPv6 protocols.
>
> Please consider applying this series to "net-next"
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH v4] smsc95xx: Add comments to the registers definition
From: David Miller @ 2017-04-17 17:05 UTC (permalink / raw)
To: martin-ufNpD2TjPakDzzZUHZsW5w
Cc: Woojung.Huh-UWL1GkI3JZL3oGB3hsPCZA, andrew-g2DYL2Zd6BY,
steve.glendinning-nksJyM/082jR7s880joybQ,
UNGLinuxDriver-UWL1GkI3JZL3oGB3hsPCZA,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20170413080844.zgud2zr7ht6kw2tx@SMX-2>
From: Martin Wetterwald <martin-ufNpD2TjPakDzzZUHZsW5w@public.gmane.org>
Date: Thu, 13 Apr 2017 10:08:44 +0200
> This chip is used by a lot of embedded devices and also by the Raspberry
> Pi 1, 2 & 3 which were created to promote the study of computer
> sciences. Students wanting to learn kernel / network device driver
> programming through those devices can only rely on the Linux kernel
> driver source to make their own.
>
> This commit adds a lot of comments to the registers definition to expand
> the register names.
>
> Cc: Steve Glendinning <steve.glendinning-nksJyM/082jR7s880joybQ@public.gmane.org>
> Cc: Microchip Linux Driver Support <UNGLinuxDriver-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org>
> CC: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> Signed-off-by: Martin Wetterwald <martin-ufNpD2TjPakDzzZUHZsW5w@public.gmane.org>
> Reviewed-by: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
> Acked-by: Steve Glendinning <steve.glendinning-nksJyM/082jR7s880joybQ@public.gmane.org>
Applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox