Re: [PATCH 6/6] ebpf: allow BPF_REG_X in src_reg conditional jumps

2015-09-04 Thread Alexei Starovoitov
On Fri, Sep 04, 2015 at 04:43:50PM -0600, Tycho Andersen wrote: > > The fix should be something like this: > > diff --git a/net/core/filter.c b/net/core/filter.c > > index 13079f03902e..05a04ea87172 100644 > > --- a/net/core/filter.c > > +++ b/net/core/filter.c > > @@ -478,9 +478,9 @@ do_pass: > >

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Tycho Andersen
On Fri, Sep 04, 2015 at 04:08:53PM -0700, Andy Lutomirski wrote: > On Fri, Sep 4, 2015 at 3:28 PM, Tycho Andersen > wrote: > > On Fri, Sep 04, 2015 at 02:48:03PM -0700, Andy Lutomirski wrote: > >> On Fri, Sep 4, 2015 at 1:45 PM, Tycho Andersen > >> wrote: > >> > On Fri, Sep 04, 2015 at 01:17:30PM

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Andy Lutomirski
On Fri, Sep 4, 2015 at 4:27 PM, Kees Cook wrote: > On Fri, Sep 4, 2015 at 3:28 PM, Tycho Andersen > wrote: >> On Fri, Sep 04, 2015 at 02:48:03PM -0700, Andy Lutomirski wrote: >>> On Fri, Sep 4, 2015 at 1:45 PM, Tycho Andersen >>> wrote: >>> > On Fri, Sep 04, 2015 at 01:17:30PM -0700, Kees Cook w

Re: [PATCH RFC v2 net 4/5] ipv6: Avoid double dst_free

2015-09-04 Thread Martin KaFai Lau
On Fri, Sep 04, 2015 at 04:12:41PM -0700, Martin KaFai Lau wrote: > @@ -1962,6 +1961,9 @@ static int __ip6_del_rt(struct rt6_info *rt, struct > nl_info *info) > if (rt == net->ipv6.ip6_null_entry) { > err = -ENOENT; > goto out; > + } else if (rt->dst.flags & D

Re: [RFC PATCH 0/3] Network stack, first user of SLAB/kmem_cache bulk free API.

2015-09-04 Thread Christoph Lameter
On Fri, 4 Sep 2015, Alexander Duyck wrote: > Right, but one of the reasons for Jesper to implement the bulk alloc/free is > to avoid the cmpxchg that is being used to get stuff into or off of the per > cpu lists. There is no full cmpxchg used for the per cpu lists. Its a cmpxchg without lock seman

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Kees Cook
On Fri, Sep 4, 2015 at 3:28 PM, Tycho Andersen wrote: > On Fri, Sep 04, 2015 at 02:48:03PM -0700, Andy Lutomirski wrote: >> On Fri, Sep 4, 2015 at 1:45 PM, Tycho Andersen >> wrote: >> > On Fri, Sep 04, 2015 at 01:17:30PM -0700, Kees Cook wrote: >> >> On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen

Re: [PATCH net] openvswitch: Remove conntrack Kconfig option.

2015-09-04 Thread Pravin Shelar
On Fri, Sep 4, 2015 at 1:07 PM, Joe Stringer wrote: > There's no particular desire to have conntrack action support in Open > vSwitch as an independently configurable bit, rather just to ensure > there is not a hard dependency. This exposed option doesn't accurately > reflect the conntrack depende

Re: [PATCH net 1/1] r8169: fix sleepable allocation during netdevice stats retrieval.

2015-09-04 Thread David Miller
From: Francois Romieu Date: Sat, 5 Sep 2015 01:11:05 +0200 > David Miller : > [...] >> Is there any reason we cannot allocate this DMA buffer at probe or >> open time? > > None. > > As a fix for 6e85d5ad36a2 or as net-next material ? I think we should just do it right to fix this bug, it's ne

[PATCH RFC v2 net 3/5] ipv6: Fix dst_entry refcnt bugs in ip6_tunnel

2015-09-04 Thread Martin KaFai Lau
Problems in the current dst_entry cache in the ip6_tunnel: 1. ip6_tnl_dst_set is racy. There is no lock to protect it: - One major problem is that the dst refcnt gets messed up. F.e. the same dst_cache can be released multiple times and then triggering the infamous dst refcnt < 0 war

[PATCH RFC v2 net 2/5] ipv6: Rename the dst_cache helper functions in ip6_tunnel

2015-09-04 Thread Martin KaFai Lau
It is a prep work to fix the dst_entry refcnt bugs in ip6_tunnel. This patch rename: 1. ip6_tnl_dst_check() to ip6_tnl_dst_get() to better reflect that it will take a dst refcnt in the next patch. 2. ip6_tnl_dst_store() to ip6_tnl_dst_set() to have a more conventional name matching with ip6_

[PATCH RFC v2 net 5/5] ipv6: Replace spinlock with seqlock and rcu in ip6_tunnel

2015-09-04 Thread Martin KaFai Lau
This patch uses a seqlock to ensure consistency between idst->dst and idst->cookie. It also makes dst freeing from fib tree to undergo a rcu grace period. Signed-off-by: Martin KaFai Lau --- include/net/ip6_tunnel.h | 4 ++-- net/ipv6/ip6_fib.c | 9 +++-- net/ipv6/ip6_tunnel.c|

[PATCH RFC v2 net 0/5] ipv6: Fix dst_entry refcnt bugs in ip6_tunnel

2015-09-04 Thread Martin KaFai Lau
v2: - Add patch 4 and 5 to remove the spinlock v1: This patch series is to fix the dst refcnt bugs in ip6_tunnel. Patch 1 and 2 are the prep works. Patch 3 is the fix. I can reproduce the bug by adding and removing the ip6gre tunnel while running a super_netperf TCP_CRR test. I get the followi

[PATCH RFC v2 net 1/5] ipv6: Refactor common ip6gre_tunnel_init codes

2015-09-04 Thread Martin KaFai Lau
It is a prep work to fix the dst_entry refcnt bugs in ip6_tunnel. This patch refactors some common init codes used by both ip6gre_tunnel_init and ip6gre_tap_init. Signed-off-by: Martin KaFai Lau --- net/ipv6/ip6_gre.c | 42 +- 1 file changed, 25 insertion

[PATCH RFC v2 net 4/5] ipv6: Avoid double dst_free

2015-09-04 Thread Martin KaFai Lau
It is a prep work to get dst freeing from fib tree undergo a rcu grace period. The following is a common paradigm: if (ip6_del_rt(rt)) dst_free(rt) which means, if rt cannot be deleted from the fib tree, dst_free(rt) now. 1. We don't know the ip6_del_rt(rt) failure is because it was no

Re: [PATCH net 1/1] r8169: fix sleepable allocation during netdevice stats retrieval.

2015-09-04 Thread Francois Romieu
David Miller : [...] > Is there any reason we cannot allocate this DMA buffer at probe or > open time? None. As a fix for 6e85d5ad36a2 or as net-next material ? -- Ueimor -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Andy Lutomirski
On Fri, Sep 4, 2015 at 3:28 PM, Tycho Andersen wrote: > On Fri, Sep 04, 2015 at 02:48:03PM -0700, Andy Lutomirski wrote: >> On Fri, Sep 4, 2015 at 1:45 PM, Tycho Andersen >> wrote: >> > On Fri, Sep 04, 2015 at 01:17:30PM -0700, Kees Cook wrote: >> >> On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen

Re: [PATCH 6/6] ebpf: allow BPF_REG_X in src_reg conditional jumps

2015-09-04 Thread Tycho Andersen
Hi Alexei, On Fri, Sep 04, 2015 at 02:06:19PM -0700, Alexei Starovoitov wrote: > On Fri, Sep 04, 2015 at 10:04:24AM -0600, Tycho Andersen wrote: > > The classic converter generates conditional jumps with: > > > > if (BPF_SRC(fp->code) == BPF_K && (int) fp->k < 0) { > > ... > > } else { >

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Tycho Andersen
On Fri, Sep 04, 2015 at 02:48:03PM -0700, Andy Lutomirski wrote: > On Fri, Sep 4, 2015 at 1:45 PM, Tycho Andersen > wrote: > > On Fri, Sep 04, 2015 at 01:17:30PM -0700, Kees Cook wrote: > >> On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen > >> wrote: > >> > This commit adds a way to dump eBPF prog

Re: [PATCH net 1/1] r8169: fix sleepable allocation during netdevice stats retrieval.

2015-09-04 Thread David Miller
From: Francois Romieu Date: Fri, 4 Sep 2015 22:59:04 +0200 > net/core/net-sysfs.c::netstat_show fetches statistics under dev_base_lock. > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=104031 > Fixes: 6e85d5ad36a2 ("r8169: Add values missing in @get_stats64 from HW > counters") > Signe

Re: [PATCH 2/6] seccomp: make underlying bpf ref counted as well

2015-09-04 Thread Andy Lutomirski
On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen wrote: > Additionally, we mark classic converted seccomp filters as seccomp eBPF > programs, since they are a subset of what is supported in seccomp eBPF. Off the top of my head, I'm okay with this. --Andy -- To unsubscribe from this list: send the

Re: [PATCH 1/6] ebpf: add a seccomp program type

2015-09-04 Thread Andy Lutomirski
On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen wrote: > seccomp uses eBPF as its underlying storage and execution format, and eBPF > has features that seccomp would like to make use of in the future. This > patch adds a formal seccomp type to the eBPF verifier. > > The current implementation of th

Re: [PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-09-04 Thread John Stultz
On Thu, Sep 3, 2015 at 4:20 PM, Hall, Christopher S wrote: > For example, supply the ART value as an argument and, in the case of the > realtime > clock, keep a short history of clock changes. It would fail in cases where > there > are a lot of calls to adjtimex(), but it will would work most o

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Andy Lutomirski
On Fri, Sep 4, 2015 at 1:45 PM, Tycho Andersen wrote: > On Fri, Sep 04, 2015 at 01:17:30PM -0700, Kees Cook wrote: >> On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen >> wrote: >> > This commit adds a way to dump eBPF programs. The initial implementation >> > doesn't support maps, and therefore onl

RE: [PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-09-04 Thread Hall, Christopher S
> -Original Message- > From: Peter Zijlstra [mailto:pet...@infradead.org] > Sent: Friday, September 04, 2015 7:28 AM > To: Richard Cochran > Cc: Hall, Christopher S; Thomas Gleixner; Kirsher, Jeffrey T; > h...@zytor.com; mi...@redhat.com; john.stu...@linaro.org; x...@kernel.org; > linux-ker

Re: [PATCH] RDS: verify the underlying transport exists before creating a connection

2015-09-04 Thread santosh.shilim...@oracle.com
On 9/4/15 12:44 PM, Sasha Levin wrote: On 09/04/2015 01:32 PM, santosh shilimkar wrote: Sasha, On 9/4/2015 9:43 AM, Sasha Levin wrote: There was no verification that an underlying transport exists when creating a connection, this would cause dereferencing a NULL ptr. Signed-off-by: Sasha Lev

Re: [PATCH 1/6] ebpf: add a seccomp program type

2015-09-04 Thread Tycho Andersen
On Fri, Sep 04, 2015 at 01:17:47PM -0700, Alexei Starovoitov wrote: > On Fri, Sep 04, 2015 at 10:04:19AM -0600, Tycho Andersen wrote: > > seccomp uses eBPF as its underlying storage and execution format, and eBPF > > has features that seccomp would like to make use of in the future. This > > patch

Re: [PATCH 1/6] ebpf: add a seccomp program type

2015-09-04 Thread Kees Cook
On Fri, Sep 4, 2015 at 2:06 PM, Tycho Andersen wrote: > On Fri, Sep 04, 2015 at 01:34:12PM -0700, Kees Cook wrote: >> On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen >> wrote: >> > +static const struct bpf_func_proto * >> > +seccomp_func_proto(enum bpf_func_id func_id) >> > +{ >> > + /* Righ

[PATCH net 1/1] cxgb4: fix usage of uninitialized variable

2015-09-04 Thread Francois Romieu
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c: In function ‘init_one’: drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:4579:8: warning: ‘chip’ may be used uninitialized in this function [-Wmaybe-uninitialized] chip |= CHELSIO_CHIP_CODE(CHELSIO_T4, pl_rev); ^ drivers/net/ethernet/chels

Re: [PATCH 1/6] ebpf: add a seccomp program type

2015-09-04 Thread Tycho Andersen
On Fri, Sep 04, 2015 at 01:34:12PM -0700, Kees Cook wrote: > On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen > wrote: > > +static const struct bpf_func_proto * > > +seccomp_func_proto(enum bpf_func_id func_id) > > +{ > > + /* Right now seccomp eBPF loading doesn't support maps; seccomp > > f

Re: [PATCH 6/6] ebpf: allow BPF_REG_X in src_reg conditional jumps

2015-09-04 Thread Alexei Starovoitov
On Fri, Sep 04, 2015 at 10:04:24AM -0600, Tycho Andersen wrote: > The classic converter generates conditional jumps with: > > if (BPF_SRC(fp->code) == BPF_K && (int) fp->k < 0) { > ... > } else { > insn->dst_reg = BPF_REG_A; > insn->src_reg = BPF_REG_X; > insn->imm

RE: [PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-09-04 Thread Hall, Christopher S
> -Original Message- > From: Thomas Gleixner [mailto:t...@linutronix.de] > Sent: Friday, September 04, 2015 9:35 AM > To: Peter Zijlstra > Cc: Richard Cochran; Hall, Christopher S; Kirsher, Jeffrey T; > h...@zytor.com; mi...@redhat.com; john.stu...@linaro.org; x...@kernel.org; > linux-ker..

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Tycho Andersen
On Fri, Sep 04, 2015 at 01:58:25PM -0700, Alexei Starovoitov wrote: > On Fri, Sep 04, 2015 at 01:50:55PM -0700, Kees Cook wrote: > > On Fri, Sep 4, 2015 at 1:45 PM, Tycho Andersen > > wrote: > > > On Fri, Sep 04, 2015 at 01:17:30PM -0700, Kees Cook wrote: > > >> On Fri, Sep 4, 2015 at 9:04 AM, Tyc

[PATCH net 1/1] r8169: fix sleepable allocation during netdevice stats retrieval.

2015-09-04 Thread Francois Romieu
net/core/net-sysfs.c::netstat_show fetches statistics under dev_base_lock. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=104031 Fixes: 6e85d5ad36a2 ("r8169: Add values missing in @get_stats64 from HW counters") Signed-off-by: Francois Romieu Cc: Corinna Vinschen --- Applies against da

Re: [PATCH 4/6] seccomp: add a way to access filters via bpf fds

2015-09-04 Thread Tycho Andersen
On Fri, Sep 04, 2015 at 01:29:49PM -0700, Alexei Starovoitov wrote: > On Fri, Sep 04, 2015 at 01:26:42PM -0700, Kees Cook wrote: > > On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen > > wrote: > > > This patch adds a way for a process that is "real root" to access the > > > seccomp filters of anothe

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Alexei Starovoitov
On Fri, Sep 04, 2015 at 01:50:55PM -0700, Kees Cook wrote: > On Fri, Sep 4, 2015 at 1:45 PM, Tycho Andersen > wrote: > > On Fri, Sep 04, 2015 at 01:17:30PM -0700, Kees Cook wrote: > >> On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen > >> wrote: > >> > This commit adds a way to dump eBPF programs.

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Kees Cook
On Fri, Sep 4, 2015 at 1:45 PM, Tycho Andersen wrote: > On Fri, Sep 04, 2015 at 01:17:30PM -0700, Kees Cook wrote: >> On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen >> wrote: >> > This commit adds a way to dump eBPF programs. The initial implementation >> > doesn't support maps, and therefore onl

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Tycho Andersen
On Fri, Sep 04, 2015 at 01:17:30PM -0700, Kees Cook wrote: > On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen > wrote: > > This commit adds a way to dump eBPF programs. The initial implementation > > doesn't support maps, and therefore only allows dumping seccomp ebpf > > programs which themselves d

Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-04 Thread Kees Cook
On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen wrote: > This is the final bit needed to support seccomp filters created via the bpf > syscall. > > One concern with this patch is exactly what the interface should look like > for users, since seccomp()'s second argument is a pointer, we could ask >

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Tycho Andersen
Hi Alexei, On Fri, Sep 04, 2015 at 01:27:05PM -0700, Alexei Starovoitov wrote: > On Fri, Sep 04, 2015 at 10:04:21AM -0600, Tycho Andersen wrote: > > This commit adds a way to dump eBPF programs. The initial implementation > > doesn't support maps, and therefore only allows dumping seccomp ebpf > >

Re: [PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-04 Thread Alexei Starovoitov
On Fri, Sep 04, 2015 at 10:04:23AM -0600, Tycho Andersen wrote: > This is the final bit needed to support seccomp filters created via the bpf > syscall. > > One concern with this patch is exactly what the interface should look like > for users, since seccomp()'s second argument is a pointer, we co

Re: [RFC PATCH 0/3] Network stack, first user of SLAB/kmem_cache bulk free API.

2015-09-04 Thread Alexander Duyck
On 09/04/2015 11:55 AM, Christoph Lameter wrote: On Fri, 4 Sep 2015, Alexander Duyck wrote: were to create a per-cpu pool for skbs that could be freed and allocated in NAPI context. So for example we already have napi_alloc_skb, why not just add a napi_free_skb and then make the array of objec

Re: eBPF / seccomp globals?

2015-09-04 Thread Kees Cook
On Fri, Sep 4, 2015 at 1:29 PM, Michael Tirado wrote: >> What we did in Chrome OS was to use the "minijail" tool[2] to >> LD_PRELOAD a .so that sets up the seccomp filter after the exec. It's >> a bit of a hack, but works in well-defined environments. You are >> talking about namespaces, though, s

Re: [PATCH 1/6] ebpf: add a seccomp program type

2015-09-04 Thread Kees Cook
On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen wrote: > seccomp uses eBPF as its underlying storage and execution format, and eBPF > has features that seccomp would like to make use of in the future. This > patch adds a formal seccomp type to the eBPF verifier. > > The current implementation of th

Re: [Linux 4.2-rc8+] circular locking dependency detected: [pppd] ppp_dev_uninit() | rtnl_lock()

2015-09-04 Thread Sedat Dilek
> Could this be caused by this commit...? > > commit 8cb775bc0a34dc596837e7da03fd22c747be618b > "ppp: fix device unregistration upon netns deletion" > With the Revert "ppp: fix device unregistration upon netns deletion" I do not see any lockdep issues. - Sedat - -- To unsubscribe from this list:

Re: [PATCH 4/6] seccomp: add a way to access filters via bpf fds

2015-09-04 Thread Alexei Starovoitov
On Fri, Sep 04, 2015 at 01:26:42PM -0700, Kees Cook wrote: > On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen > wrote: > > This patch adds a way for a process that is "real root" to access the > > seccomp filters of another process. The process first does a > > PTRACE_SECCOMP_GET_FILTER_FD to get an

Re: eBPF / seccomp globals?

2015-09-04 Thread Michael Tirado
> What we did in Chrome OS was to use the "minijail" tool[2] to > LD_PRELOAD a .so that sets up the seccomp filter after the exec. It's > a bit of a hack, but works in well-defined environments. You are > talking about namespaces, though, so maybe minijail is worth a look? > It does that too and a

Re: [PATCH 4/6] seccomp: add a way to access filters via bpf fds

2015-09-04 Thread Kees Cook
On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen wrote: > This patch adds a way for a process that is "real root" to access the > seccomp filters of another process. The process first does a > PTRACE_SECCOMP_GET_FILTER_FD to get an fd with that process' seccomp filter > attached, and then iterates o

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Alexei Starovoitov
On Fri, Sep 04, 2015 at 10:04:21AM -0600, Tycho Andersen wrote: > This commit adds a way to dump eBPF programs. The initial implementation > doesn't support maps, and therefore only allows dumping seccomp ebpf > programs which themselves don't currently support maps. > > > Signed-off-by: Tycho An

Re: [PATCH] RDS: verify the underlying transport exists before creating a connection

2015-09-04 Thread Sergei Shtylyov
Hello. On 09/04/2015 07:43 PM, Sasha Levin wrote: There was no verification that an underlying transport exists when creating a connection, this would cause dereferencing a NULL ptr. Signed-off-by: Sasha Levin --- net/rds/connection.c |6 ++ 1 file changed, 6 insertions(+) diff --

Re: [PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Kees Cook
On Fri, Sep 4, 2015 at 9:04 AM, Tycho Andersen wrote: > This commit adds a way to dump eBPF programs. The initial implementation > doesn't support maps, and therefore only allows dumping seccomp ebpf > programs which themselves don't currently support maps. > > We export the GPL bit as well as a u

Re: [PATCH 1/6] ebpf: add a seccomp program type

2015-09-04 Thread Alexei Starovoitov
On Fri, Sep 04, 2015 at 10:04:19AM -0600, Tycho Andersen wrote: > seccomp uses eBPF as its underlying storage and execution format, and eBPF > has features that seccomp would like to make use of in the future. This > patch adds a formal seccomp type to the eBPF verifier. > > The current implementa

[PATCH net] openvswitch: Remove conntrack Kconfig option.

2015-09-04 Thread Joe Stringer
There's no particular desire to have conntrack action support in Open vSwitch as an independently configurable bit, rather just to ensure there is not a hard dependency. This exposed option doesn't accurately reflect the conntrack dependency when enabled, so simplify this by removing the option. Co

Re: [PATCH] RDS: verify the underlying transport exists before creating a connection

2015-09-04 Thread Sasha Levin
On 09/04/2015 01:32 PM, santosh shilimkar wrote: > Sasha, > > On 9/4/2015 9:43 AM, Sasha Levin wrote: >> There was no verification that an underlying transport exists when creating >> a connection, this would cause dereferencing a NULL ptr. >> >> Signed-off-by: Sasha Levin >> --- >> net/rds/con

Re: [RFC PATCH 0/3] Network stack, first user of SLAB/kmem_cache bulk free API.

2015-09-04 Thread Christoph Lameter
On Fri, 4 Sep 2015, Alexander Duyck wrote: > were to create a per-cpu pool for skbs that could be freed and allocated in > NAPI context. So for example we already have napi_alloc_skb, why not just add > a napi_free_skb and then make the array of objects to be freed part of a pool > that could be

Re: [RFC PATCH 1/3] net: introduce kfree_skb_bulk() user of kmem_cache_free_bulk()

2015-09-04 Thread Tom Herbert
On Fri, Sep 4, 2015 at 10:00 AM, Jesper Dangaard Brouer wrote: > Introduce the first user of SLAB bulk free API kmem_cache_free_bulk(), > in the network stack in form of function kfree_skb_bulk() which bulk > free SKBs (not skb clones or skb->head, yet). > > As this is the third user of SKB refere

[PATCH net-next 2/7] net: dsa: mv88e6xxx: extract ATU data write access

2015-09-04 Thread Vivien Didelot
Other ATU commands need to write the ATU data register. To ease the introduction of such commands, extract the ATU data write access from _mv88e6xxx_atu_load to its own function. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx.c | 43 --- 1 fil

[PATCH net-next 3/7] net: dsa: mv88e6xxx: rework ATU Flush operation

2015-09-04 Thread Vivien Didelot
These Marvell switches have 4 operations to flush or (re)move, all or only non-static MAC addresses, from the entire set of databases or from just a particular one. The value of the EntryState bits will determine if the operation is either a Flush (0x0) or a Move (0xF). When moving entries from o

[PATCH net-next 0/7] net: dsa: mv88e6xxx: improve ATU move operations

2015-09-04 Thread Vivien Didelot
Hi! This patchset completes the set of available Address Translation Unit operations. These Marvell switches have 4 operations to flush or (re)move, all or only non-static MAC addresses, from the entire set of databases or from just a particular one. The first 3 patches introduce a generic _mv88

[PATCH net-next 5/7] net: dsa: mv88e6xxx: flush all addresses when adding a VLAN

2015-09-04 Thread Vivien Didelot
When choosing an address database for a new VLAN, flush every entries, not only the non-static ones. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index

Re: BUG: sleeping function called from invalid context at mm/page_alloc.c:3186

2015-09-04 Thread David Miller
From: poma Date: Fri, 4 Sep 2015 16:05:12 +0200 > Call Trace: > [] dump_stack+0x4b/0x63 > [] ___might_sleep+0x179/0x230 > [] __might_sleep+0x49/0x80 > [] __alloc_pages_nodemask+0x2fe/0xb90 > [] ? debug_object_activate+0xb6/0x1e0 > [] ? debug_object_active_state+0x91/0x150 > [] dma_generic_

[PATCH net-next 4/7] net: dsa: mv88e6xxx: flush ATU on initial setup

2015-09-04 Thread Vivien Didelot
Purge all MAC addresses from the entire set of address databases when the driver initializes the device. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index c67090f.

[PATCH net-next 1/7] net: dsa: mv88e6xxx: extract FID write from ATU command

2015-09-04 Thread Vivien Didelot
Not every ATU commands apply to an FID, thus remove the FID writing from mv88e6xxx_atu_cmd and write it explicitly where needed, in order to ease introduction of such commands. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx.c | 32 +++- 1 file changed, 23

[PATCH net-next 7/7] net: dsa: mv88e6xxx: remove all MACs when disabling a port

2015-09-04 Thread Vivien Didelot
When we're moving a port from Learning or Forwarding state to Disabled or Blocking or Listening state, remove all non-static MAC addresses mapped to this port in the entire set of databases, not only one. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6xxx.c | 2 +- 1 file changed, 1 ins

[PATCH net-next 6/7] net: dsa: mv88e6xxx: remove addresses when a port leaves a VLAN

2015-09-04 Thread Vivien Didelot
Add a new _mv88e6xxx_atu_move function to prepare the ATU data register for the move operation. The ports vector will contain the source port and destination port of the Move operation. If the destination port is 0xF, the MAC addresses mapped to the source port are removed for the address database(

Re: [RFC, RFT PATCH 1/2] dl2k: Add support for IP1000A-based cards

2015-09-04 Thread Ondrej Zary
On Tuesday 25 August 2015 23:26:13 Ondrej Zary wrote: > On Tuesday 25 August 2015 23:04:30 David Miller wrote: > > From: Ondrej Zary > > Date: Sun, 23 Aug 2015 23:06:27 +0200 > > > > > Add support for IP1000A chips to dl2k driver. > > > IP1000A chip looks like a TC9020 with integrated PHY. > > > >

Re: [RFC PATCH 0/3] Network stack, first user of SLAB/kmem_cache bulk free API.

2015-09-04 Thread Alexander Duyck
On 09/04/2015 10:00 AM, Jesper Dangaard Brouer wrote: During TX DMA completion cleanup there exist an opportunity in the NIC drivers to perform bulk free, without introducing additional latency. For an IPv4 forwarding workload the network stack is hitting the slowpath of the kmem_cache "slub" al

Re: [GIT] Networking

2015-09-04 Thread Rustad, Mark D
> On Sep 4, 2015, at 2:07 AM, David Laight wrote: > >> I find them useful as syntactic sugar. We have not used them a lot, but >> there are cases in our crypto >> handling code where we have fixed size array inputs/outputs and there we >> opted to use them. They make >> it easy to remember what

Re: [PATCH] RDS: verify the underlying transport exists before creating a connection

2015-09-04 Thread santosh shilimkar
Sasha, On 9/4/2015 9:43 AM, Sasha Levin wrote: There was no verification that an underlying transport exists when creating a connection, this would cause dereferencing a NULL ptr. Signed-off-by: Sasha Levin --- net/rds/connection.c |6 ++ 1 file changed, 6 insertions(+) diff --git

[RFC PATCH 3/3] ixgbe: bulk free SKBs during TX completion cleanup cycle

2015-09-04 Thread Jesper Dangaard Brouer
First user of the SKB bulk free API (namely kfree_skb_bulk() via waitlist helper add-and-flush API). There is an opportunity to bulk free SKBs during reclaiming of resources after DMA transmit completes in ixgbe_clean_tx_irq. Thus, bulk freeing at this point does not introduce any added latency.

[RFC PATCH 2/3] net: NIC helper API for building array of skbs to free

2015-09-04 Thread Jesper Dangaard Brouer
The NIC device drivers are expected to use this small helper API, when building up an array of objects/skbs to bulk free, while (loop) processing objects to free. Objects to be free'ed later is added (dev_free_waitlist_add) to an array and flushed if the array runs full. After processing the arra

[RFC PATCH 1/3] net: introduce kfree_skb_bulk() user of kmem_cache_free_bulk()

2015-09-04 Thread Jesper Dangaard Brouer
Introduce the first user of SLAB bulk free API kmem_cache_free_bulk(), in the network stack in form of function kfree_skb_bulk() which bulk free SKBs (not skb clones or skb->head, yet). As this is the third user of SKB reference decrementing, split out refcnt decrement into helper function and use

[RFC PATCH 0/3] Network stack, first user of SLAB/kmem_cache bulk free API.

2015-09-04 Thread Jesper Dangaard Brouer
During TX DMA completion cleanup there exist an opportunity in the NIC drivers to perform bulk free, without introducing additional latency. For an IPv4 forwarding workload the network stack is hitting the slowpath of the kmem_cache "slub" allocator. This slowpath can be mitigated by bulk free vi

[PATCH] RDS: verify the underlying transport exists before creating a connection

2015-09-04 Thread Sasha Levin
There was no verification that an underlying transport exists when creating a connection, this would cause dereferencing a NULL ptr. Signed-off-by: Sasha Levin --- net/rds/connection.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/net/rds/connection.c b/net/rds/connection.c index

Re: [PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-09-04 Thread Thomas Gleixner
On Fri, 4 Sep 2015, Peter Zijlstra wrote: > On Fri, Sep 04, 2015 at 05:17:43PM +0200, Richard Cochran wrote: > > On Fri, Sep 04, 2015 at 05:10:21PM +0200, Peter Zijlstra wrote: > > > I think what they're getting at is asking if there's a rate limit to > > > time adjustments, without that, saving th

c/r of seccomp filters via underlying eBPF

2015-09-04 Thread Tycho Andersen
Hi all, Here is a set that enables checkpoint restore of the underlying eBPF programs that power seccomp filters via the API we discussed several months ago. A few notes: * We expose prog_id in the ebpf dump as the pointer to the ebpf program in kernel memory, since this is unique. I'm not sure

[PATCH 1/6] ebpf: add a seccomp program type

2015-09-04 Thread Tycho Andersen
seccomp uses eBPF as its underlying storage and execution format, and eBPF has features that seccomp would like to make use of in the future. This patch adds a formal seccomp type to the eBPF verifier. The current implementation of the seccomp eBPF type is very limited, and doesn't support some in

[PATCH 4/6] seccomp: add a way to access filters via bpf fds

2015-09-04 Thread Tycho Andersen
This patch adds a way for a process that is "real root" to access the seccomp filters of another process. The process first does a PTRACE_SECCOMP_GET_FILTER_FD to get an fd with that process' seccomp filter attached, and then iterates on this with PTRACE_SECCOMP_NEXT_FILTER using bpf(BPF_PROG_DUMP)

[PATCH 2/6] seccomp: make underlying bpf ref counted as well

2015-09-04 Thread Tycho Andersen
In the next patch, we're going to add a way to access the underlying filters via bpf fds. This means that we need to ref-count both the struct seccomp_filter objects and the struct bpf_prog objects separately, in case a process dies but a filter is still referred to by another process. Additionall

[PATCH 3/6] ebpf: add a way to dump an eBPF program

2015-09-04 Thread Tycho Andersen
This commit adds a way to dump eBPF programs. The initial implementation doesn't support maps, and therefore only allows dumping seccomp ebpf programs which themselves don't currently support maps. We export the GPL bit as well as a unique ID for the program so that userspace can detect when two s

[PATCH 5/6] seccomp: add a way to attach a filter via eBPF fd

2015-09-04 Thread Tycho Andersen
This is the final bit needed to support seccomp filters created via the bpf syscall. One concern with this patch is exactly what the interface should look like for users, since seccomp()'s second argument is a pointer, we could ask people to pass a pointer to the fd, but implies we might write to

[PATCH 6/6] ebpf: allow BPF_REG_X in src_reg conditional jumps

2015-09-04 Thread Tycho Andersen
The classic converter generates conditional jumps with: if (BPF_SRC(fp->code) == BPF_K && (int) fp->k < 0) { ... } else { insn->dst_reg = BPF_REG_A; insn->src_reg = BPF_REG_X; insn->imm = fp->k; bpf_src = BPF_SRC(fp->code); } but here, we enforce that the s

Re: [PATCH net-next] net: dsa: mv88e6171: add hardware 802.1Q support

2015-09-04 Thread Andrew Lunn
On Fri, Sep 04, 2015 at 11:22:24AM -0400, Vivien Didelot wrote: > The Marvell 88E6171 switch is in the 88E6351 family, which supports > 802.1Q, thus add support from the generic mv88e6xxx functions. > > Signed-off-by: Vivien Didelot Reviewed-by: Andrew Lunn Thanks Andrew > --- > driv

Re: [PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-09-04 Thread Peter Zijlstra
On Fri, Sep 04, 2015 at 05:17:43PM +0200, Richard Cochran wrote: > On Fri, Sep 04, 2015 at 05:10:21PM +0200, Peter Zijlstra wrote: > > I think what they're getting at is asking if there's a rate limit to > > time adjustments, without that, saving the last n transition points will > > still not cove

Re: [PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-09-04 Thread Richard Cochran
On Fri, Sep 04, 2015 at 03:02:19PM +0200, Thomas Gleixner wrote: > No. This function is explicitely for the precise timestamp usecase, > which is required by PTP and other sane use cases. Right. The audio department only needs to know the (ART, ptp) offset. The kernel and user space never need th

Re: [PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-09-04 Thread Richard Cochran
On Fri, Sep 04, 2015 at 05:10:21PM +0200, Peter Zijlstra wrote: > I think what they're getting at is asking if there's a rate limit to > time adjustments, without that, saving the last n transition points will > still not cover any given length of history. As if the ntp code isn't complex enough a

[PATCH net-next] net: dsa: mv88e6171: add hardware 802.1Q support

2015-09-04 Thread Vivien Didelot
The Marvell 88E6171 switch is in the 88E6351 family, which supports 802.1Q, thus add support from the generic mv88e6xxx functions. Signed-off-by: Vivien Didelot --- drivers/net/dsa/mv88e6171.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/

Re: [PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-09-04 Thread Peter Zijlstra
On Fri, Sep 04, 2015 at 03:02:19PM +0200, Thomas Gleixner wrote: > > For example, supply the ART value as an argument and, in the case of > > the realtime clock, keep a short history of clock changes. It would > > It's not only clock realtime which is affected by those. > > > fail in cases where

Re: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning

2015-09-04 Thread Thomas Graf
On 09/04/15 at 12:49pm, Geert Uytterhoeven wrote: > drivers/net/vxlan.c: In function ‘vxlan_udp_encap_recv’: > drivers/net/vxlan.c:1226: warning: ‘info’ may be used uninitialized in this > function > > While this warning is a false positive, it can be killed easily by > getting rid of the pointer

Re: ip_rcv_finish() NULL pointer and possibly related Oopses

2015-09-04 Thread Shaun Crampton
On 03/09/2015 13:10, "Eric Dumazet" wrote: >On Thu, 2015-09-03 at 10:09 +, Shaun Crampton wrote: >> >... >> >> Is there anything I can do on a running system to help figure this >>out? >> >> Some sort of kernel equivalent to pmap to find out what module or >>device >> >> owns that chunk of

pull-request: mac80211 2015-09-04

2015-09-04 Thread Johannes Berg
Hi, First pull request for this cycle, and the fix for the pointer issue is the first patch in it :) Since nobody really has devices with enough streams where this matters, it was pretty harmless though. Other than that, there are a few fixes all over - let me know if you see any issues. johanne

Re: [PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-09-04 Thread Peter Zijlstra
On Fri, Sep 04, 2015 at 10:11:22AM +0200, Richard Cochran wrote: > On Thu, Sep 03, 2015 at 11:20:37PM +, Hall, Christopher S wrote: > > In addition to the network interface, ART will be used in the audio > > interface as well. > > We need to support the case where an audio co-processor will co

BUG: sleeping function called from invalid context at mm/page_alloc.c:3186

2015-09-04 Thread poma
Call Trace: [] dump_stack+0x4b/0x63 [] ___might_sleep+0x179/0x230 [] __might_sleep+0x49/0x80 [] __alloc_pages_nodemask+0x2fe/0xb90 [] ? debug_object_activate+0xb6/0x1e0 [] ? debug_object_active_state+0x91/0x150 [] dma_generic_alloc_coherent+0x96/0x130 [] x86_swiotlb_alloc_coherent+0x25/0x50

Re: eBPF / seccomp globals?

2015-09-04 Thread Tycho Andersen
Hi all, On Thu, Sep 03, 2015 at 08:17:05PM -0700, Alexei Starovoitov wrote: > On Fri, Sep 04, 2015 at 01:01:20AM +, Michael Tirado wrote: > > Hiyall, > > > > I have created a seccomp white list filter for a program that launches > > other less trustworthy programs. It's working great so far,

Re: [PATCH] device property: Don't overwrite addr when failing in device_get_mac_address

2015-09-04 Thread Jeremy Linton
On 09/03/2015 05:59 PM, Julien Grall wrote: The function device_get_mac_address is trying different property names in order to get the mac address. To check the return value, the variable addr (which contain the buffer pass by the caller) will be re-used. This means that if the previous property

Re: [PATCH] ethernet: synopsys: SYNOPSYS_DWC_ETH_QOS should depend on HAS_DMA

2015-09-04 Thread Lars Persson
On Fri, 2015-09-04 at 14:44 +0200, Geert Uytterhoeven wrote: > If NO_DMA=y: > > ERROR: "dma_alloc_coherent" > [drivers/net/ethernet/synopsys/dwc_eth_qos.ko] undefined! > ERROR: "dma_free_coherent" [drivers/net/ethernet/synopsys/dwc_eth_qos.ko] > undefined! > ERROR: "dma_unmap_single"

Re: [PATCH] vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning

2015-09-04 Thread Jiri Benc
On Fri, 4 Sep 2015 12:49:32 +0200, Geert Uytterhoeven wrote: > drivers/net/vxlan.c: In function ‘vxlan_udp_encap_recv’: > drivers/net/vxlan.c:1226: warning: ‘info’ may be used uninitialized in this > function > > While this warning is a false positive, it can be killed easily by > getting rid of

RE: [PATCH v3 1/4] Add correlated clocksource deriving system time from an auxiliary clocksource

2015-09-04 Thread Thomas Gleixner
On Thu, 3 Sep 2015, Hall, Christopher S wrote: Can you please teach your mail client to add proper line breaks around 80? Your mail renders horrible in a text based mail client. > In addition to the network interface, ART will be used in the audio > interface as well. We need to support the case

RE: [PATCH] net: tipc: fix stall during bclink wakeup procedure

2015-09-04 Thread Jon Maloy
Reviewed again, and finally understood. You are right; I just didn't understand the problem description correctly. Reviewed-by: Jon Maloy ///jon > -Original Message- > From: netdev-ow...@vger.kernel.org [mailto:netdev- > ow...@vger.kernel.org] On Behalf Of Jon Maloy > Sent: Thursday,

[PATCH] ethernet: synopsys: SYNOPSYS_DWC_ETH_QOS should depend on HAS_DMA

2015-09-04 Thread Geert Uytterhoeven
If NO_DMA=y: ERROR: "dma_alloc_coherent" [drivers/net/ethernet/synopsys/dwc_eth_qos.ko] undefined! ERROR: "dma_free_coherent" [drivers/net/ethernet/synopsys/dwc_eth_qos.ko] undefined! ERROR: "dma_unmap_single" [drivers/net/ethernet/synopsys/dwc_eth_qos.ko] undefined! ERROR: "dma

Re: [PATCH] cfg80211: regulatory: restore proper user alpha2

2015-09-04 Thread Johannes Berg
On Wed, 2015-09-02 at 19:00 +0200, Maciej S. Szmigiero wrote: > restore_regulatory_settings() should restore alpha2 > as computed in restore_alpha2(), not raw user_alpha2 to > behave as described in the comment just above that code. > > This fixes endless loop of calling CRDA for "00" and "97" > c

  1   2   >