Re: bpf pointer alignment validation

2017-05-09 Thread Alexei Starovoitov
On Tue, May 09, 2017 at 02:32:34PM -0400, David Miller wrote: > > +static u32 calc_align(u32 imm) > +{ > + u32 align = 1; > + > + if (!imm) > + return 1U << 31; > + > + while (!(imm & 1)) { > + imm >>= 1; > + align <<= 1; > + } > + return

Re: DQL and TCQ_F_CAN_BYPASS destroy performance under virtualizaiton (Was: "Re: net_sched strange in 4.11")

2017-05-09 Thread Anton Ivanov
[snip] > Virtio-net net does not support BQL. Before commit ea7735d97ba9 > ("virtio-net: move free_old_xmit_skbs"), it's even impossible to > support that since we don't have tx interrupt for each packet. I > haven't measured the impact of xmit_more, maybe I was wrong but I > think it may help

Re: DQL and TCQ_F_CAN_BYPASS destroy performance under virtualizaiton (Was: "Re: net_sched strange in 4.11")

2017-05-09 Thread Anton Ivanov
On 10/05/17 03:18, Jason Wang wrote: > > > On 2017年05月09日 23:11, Stefan Hajnoczi wrote: >> On Tue, May 09, 2017 at 08:46:46AM +0100, Anton Ivanov wrote: >>> I have figured it out. Two issues. >>> >>> 1) skb->xmit_more is hardly ever set under virtualization because >>> the qdisc >>> is usually

Re: [PATCH] net: fec: select queue depending on VLAN priority

2017-05-09 Thread Stefan Agner
On 2017-05-09 06:39, David Miller wrote: > From: Stefan Agner > Date: Mon, 8 May 2017 22:37:08 -0700 > >> Since the addition of the multi queue code with commit 59d0f7465644 >> ("net: fec: init multi queue date structure") the queue selection >> has been handelt by the default

Re: [PATCH] libertas: Avoid reading past end of buffer

2017-05-09 Thread Joe Perches
On Tue, 2017-05-09 at 16:23 -0700, Kees Cook wrote: > Using memcpy() from a string that is shorter than the length copied means > the destination buffer is being filled with arbitrary data from the kernel > rodata segment. Instead, use strncpy() which will fill the trailing bytes > with zeros.

Re: [PATCH] net: dsa: loop: Free resources if initialization is deferred

2017-05-09 Thread Julia Lawall
On Wed, 10 May 2017, Christophe JAILLET wrote: > Free some devm'allocated memory in case of deferred driver initialization. > This avoid to waste some memory in such a case. I really think it would be helpful to mention the special behavior of -EPROBE_DEFER. It doesn't take much space, and it

[PATCH] net: dsa: loop: Free resources if initialization is deferred

2017-05-09 Thread Christophe JAILLET
Free some devm'allocated memory in case of deferred driver initialization. This avoid to waste some memory in such a case. Suggested-by: Joe Perches Signed-off-by: Christophe JAILLET --- drivers/net/dsa/dsa_loop.c | 5 - 1 file changed, 4

[PATCH net-next V4 01/10] ptr_ring: batch ring zeroing

2017-05-09 Thread Jason Wang
From: "Michael S. Tsirkin" A known weakness in ptr_ring design is that it does not handle well the situation when ring is almost full: as entries are consumed they are immediately used again by the producer, so consumer and producer are writing to a shared cache line. To fix

[PATCH net-next V4 02/10] ptr_ring: add ptr_ring_unconsume

2017-05-09 Thread Jason Wang
From: "Michael S. Tsirkin" Applications that consume a batch of entries in one go can benefit from ability to return some of them back into the ring. Add an API for that - assuming there's space. If there's no space naturally can't do this and have to drop entries, but this

[PATCH net-next V4 03/10] skb_array: introduce skb_array_unconsume

2017-05-09 Thread Jason Wang
Signed-off-by: Jason Wang --- include/linux/skb_array.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h index f4dfade..79850b6 100644 --- a/include/linux/skb_array.h +++ b/include/linux/skb_array.h @@ -156,6

[PATCH net-next V4 00/10] vhost_net batch dequeuing

2017-05-09 Thread Jason Wang
This series tries to implement rx batching for vhost-net. This is done by batching the dequeuing from skb_array which was exported by underlayer socket and pass the sbk back through msg_control to finish userspace copying. This is also the requirement for more batching implemention on rx path.

[PATCH net-next V4 05/10] skb_array: introduce batch dequeuing

2017-05-09 Thread Jason Wang
Signed-off-by: Jason Wang --- include/linux/skb_array.h | 25 + 1 file changed, 25 insertions(+) diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h index 79850b6..35226cd 100644 --- a/include/linux/skb_array.h +++

[PATCH net-next V4 04/10] ptr_ring: introduce batch dequeuing

2017-05-09 Thread Jason Wang
This patch introduce a batched version of consuming, consumer can dequeue more than one pointers from the ring at a time. We don't care about the reorder of reading here so no need for compiler barrier. Signed-off-by: Jason Wang --- include/linux/ptr_ring.h | 65

[PATCH net-next V4 08/10] tun: support receiving skb through msg_control

2017-05-09 Thread Jason Wang
This patch makes tun_recvmsg() can receive from skb from its caller through msg_control. Vhost_net will be the first user. Signed-off-by: Jason Wang --- drivers/net/tun.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git

[PATCH net-next V4 06/10] tun: export skb_array

2017-05-09 Thread Jason Wang
This patch exports skb_array through tun_get_skb_array(). Caller can then manipulate skb array directly. Signed-off-by: Jason Wang --- drivers/net/tun.c | 13 + include/linux/if_tun.h | 5 + 2 files changed, 18 insertions(+) diff --git

[PATCH net-next V4 07/10] tap: export skb_array

2017-05-09 Thread Jason Wang
This patch exports skb_array through tap_get_skb_array(). Caller can then manipulate skb array directly. Signed-off-by: Jason Wang --- drivers/net/tap.c | 13 + include/linux/if_tap.h | 5 + 2 files changed, 18 insertions(+) diff --git

[PATCH net-next V4 09/10] tap: support receiving skb from msg_control

2017-05-09 Thread Jason Wang
This patch makes tap_recvmsg() can receive from skb from its caller through msg_control. Vhost_net will be the first user. Signed-off-by: Jason Wang --- drivers/net/tap.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/tap.c

[PATCH net-next V4 10/10] vhost_net: try batch dequing from skb array

2017-05-09 Thread Jason Wang
We used to dequeue one skb during recvmsg() from skb_array, this could be inefficient because of the bad cache utilization and spinlock touching for each packet. This patch tries to batch them by calling batch dequeuing helpers explicitly on the exported skb array and pass the skb back through

Re: [PATCH net 2/2] xdp: disallow use of native and generic hook at once

2017-05-09 Thread Jakub Kicinski
On Wed, 10 May 2017 03:31:31 +0200, Daniel Borkmann wrote: > While working on the iproute2 generic XDP frontend, I noticed that > as of right now it's possible to have native *and* generic XDP > programs loaded both at the same time for the case when a driver > supports native XDP. Nice

RE: [PATCH] net: fec: select queue depending on VLAN priority

2017-05-09 Thread Andy Duan
From: David Miller Sent: Tuesday, May 09, 2017 9:39 PM >To: ste...@agner.ch >Cc: Andy Duan ; and...@lunn.ch; >feste...@gmail.com; netdev@vger.kernel.org; linux- >ker...@vger.kernel.org >Subject: Re: [PATCH] net: fec: select queue depending on VLAN

[PATCH net-next V3 2/9] skb_array: introduce skb_array_unconsume

2017-05-09 Thread Jason Wang
Signed-off-by: Jason Wang --- include/linux/skb_array.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h index f4dfade..79850b6 100644 --- a/include/linux/skb_array.h +++ b/include/linux/skb_array.h @@ -156,6

[PATCH net-next V3 1/9] ptr_ring: add ptr_ring_unconsume

2017-05-09 Thread Jason Wang
From: "Michael S. Tsirkin" Applications that consume a batch of entries in one go can benefit from ability to return some of them back into the ring. Add an API for that - assuming there's space. If there's no space naturally can't do this and have to drop entries, but this

[PATCH net-next V3 0/9] vhost_net rx batch dequeuing

2017-05-09 Thread Jason Wang
This series tries to implement rx batching for vhost-net. This is done by batching the dequeuing from skb_array which was exported by underlayer socket and pass the sbk back through msg_control to finish userspace copying. This is also the requirement for more batching implemention on rx path.

[PATCH net-next V3 3/9] ptr_ring: introduce batch dequeuing

2017-05-09 Thread Jason Wang
This patch introduce a batched version of consuming, consumer can dequeue more than one pointers from the ring at a time. We don't care about the reorder of reading here so no need for compiler barrier. Signed-off-by: Jason Wang --- include/linux/ptr_ring.h | 65

[PATCH net-next V3 4/9] skb_array: introduce batch dequeuing

2017-05-09 Thread Jason Wang
Signed-off-by: Jason Wang --- include/linux/skb_array.h | 25 + 1 file changed, 25 insertions(+) diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h index 79850b6..35226cd 100644 --- a/include/linux/skb_array.h +++

[PATCH net-next V3 6/9] tap: export skb_array

2017-05-09 Thread Jason Wang
This patch exports skb_array through tap_get_skb_array(). Caller can then manipulate skb array directly. Signed-off-by: Jason Wang --- drivers/net/tap.c | 13 + include/linux/if_tap.h | 5 + 2 files changed, 18 insertions(+) diff --git

[PATCH net-next V3 5/9] tun: export skb_array

2017-05-09 Thread Jason Wang
This patch exports skb_array through tun_get_skb_array(). Caller can then manipulate skb array directly. Signed-off-by: Jason Wang --- drivers/net/tun.c | 13 + include/linux/if_tun.h | 5 + 2 files changed, 18 insertions(+) diff --git

[PATCH net-next V3 7/9] tun: support receiving skb through msg_control

2017-05-09 Thread Jason Wang
This patch makes tun_recvmsg() can receive from skb from its caller through msg_control. Vhost_net will be the first user. Signed-off-by: Jason Wang --- drivers/net/tun.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git

[PATCH net-next V3 9/9] vhost_net: try batch dequing from skb array

2017-05-09 Thread Jason Wang
We used to dequeue one skb during recvmsg() from skb_array, this could be inefficient because of the bad cache utilization and spinlock touching for each packet. This patch tries to batch them by calling batch dequeuing helpers explicitly on the exported skb array and pass the skb back through

[PATCH net-next V3 8/9] tap: support receiving skb from msg_control

2017-05-09 Thread Jason Wang
This patch makes tap_recvmsg() can receive from skb from its caller through msg_control. Vhost_net will be the first user. Signed-off-by: Jason Wang --- drivers/net/tap.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/tap.c

Re: DQL and TCQ_F_CAN_BYPASS destroy performance under virtualizaiton (Was: "Re: net_sched strange in 4.11")

2017-05-09 Thread Jason Wang
On 2017年05月09日 23:11, Stefan Hajnoczi wrote: On Tue, May 09, 2017 at 08:46:46AM +0100, Anton Ivanov wrote: I have figured it out. Two issues. 1) skb->xmit_more is hardly ever set under virtualization because the qdisc is usually bypassed because of TCQ_F_CAN_BYPASS. Once TCQ_F_CAN_BYPASS is

Re: [PATCH v2 net-next] bnxt: add dma mapping attributes

2017-05-09 Thread Michael Chan
On Tue, May 9, 2017 at 6:30 PM, Shannon Nelson wrote: > On the SPARC platform we need to use the DMA_ATTR_WEAK_ORDERING attribute > in our Rx path dma mapping in order to get the expected performance out > of the receive path. Adding it to the Tx path has little

Re: [PATCH RFC v2] ptr_ring: add ptr_ring_unconsume

2017-05-09 Thread Jason Wang
On 2017年05月09日 21:26, Michael S. Tsirkin wrote: On Wed, Apr 26, 2017 at 05:09:42PM +0800, Jason Wang wrote: On 2017年04月25日 00:01, Michael S. Tsirkin wrote: Applications that consume a batch of entries in one go can benefit from ability to return some of them back into the ring. Add an API

[PATCH v2 net-next] bnxt: add dma mapping attributes

2017-05-09 Thread Shannon Nelson
On the SPARC platform we need to use the DMA_ATTR_WEAK_ORDERING attribute in our Rx path dma mapping in order to get the expected performance out of the receive path. Adding it to the Tx path has little effect, so that's not a part of this patch. Signed-off-by: Shannon Nelson

[PATCH net 0/2] Two generic xdp related follow-ups

2017-05-09 Thread Daniel Borkmann
Two follow-ups for the generic XDP API, would be great if both could still be considered, since the XDP API is not frozen yet. For details please see individual patches. Thanks! Daniel Borkmann (2): xdp: add flag to enforce driver mode xdp: disallow use of native and generic hook at once

[PATCH net 1/2] xdp: add flag to enforce driver mode

2017-05-09 Thread Daniel Borkmann
After commit b5cdae3291f7 ("net: Generic XDP") we automatically fall back to a generic XDP variant if the driver does not support native XDP. Allow for an option where the user can specify that always the native XDP variant should be selected and in case it's not supported by a driver, just bail

[PATCH net 2/2] xdp: disallow use of native and generic hook at once

2017-05-09 Thread Daniel Borkmann
While working on the iproute2 generic XDP frontend, I noticed that as of right now it's possible to have native *and* generic XDP programs loaded both at the same time for the case when a driver supports native XDP. The intended model for generic XDP from b5cdae3291f7 ("net: Generic XDP") is,

Re: [PATCH v1] ACPI: Switch to use generic UUID API

2017-05-09 Thread Zhang Rui
On Thu, 2017-05-04 at 12:21 +0300, Andy Shevchenko wrote: > acpi_evaluate_dsm() and friends take a pointer to a raw buffer of 16 > bytes. Instead we convert them to use uuid_le type. At the same time > we > convert current users. > > acpi_str_to_uuid() becomes useless after the conversion and

Re: [PATCH net-next] bnxt: add dma mapping attributes

2017-05-09 Thread Shannon Nelson
On 5/9/2017 5:49 PM, David Miller wrote: From: Shannon Nelson Date: Tue, 9 May 2017 13:37:33 -0700 @@ -66,6 +66,12 @@ MODULE_DESCRIPTION("Broadcom BCM573xx network driver"); MODULE_VERSION(DRV_MODULE_VERSION); +#ifdef CONFIG_SPARC +#define BNXT_DMA_ATTRS

Re:Re: [PATCH net v2] driver: vrf: Fix one possible use-after-free issue

2017-05-09 Thread Gao Feng
At 2017-05-10 02:37:36, "David Miller" wrote: >From: gfree.w...@vip.163.com >Date: Tue, 9 May 2017 18:27:33 +0800 > >> @@ -989,6 +989,7 @@ static u32 vrf_fib_table(const struct net_device *dev) >> >> static int vrf_rcv_finish(struct net *net, struct sock *sk, struct

Re: [PATCH net-next] bnxt: add dma mapping attributes

2017-05-09 Thread David Miller
From: Shannon Nelson Date: Tue, 9 May 2017 13:37:33 -0700 > @@ -66,6 +66,12 @@ > MODULE_DESCRIPTION("Broadcom BCM573xx network driver"); > MODULE_VERSION(DRV_MODULE_VERSION); > > +#ifdef CONFIG_SPARC > +#define BNXT_DMA_ATTRS DMA_ATTR_WEAK_ORDERING > +#else >

Re: [PATCH 0/2] net: Set maximum receive packet size on veth interfaces

2017-05-09 Thread Fredrik Markström
On Tue, May 9, 2017 at 7:48 PM, David Miller wrote: > > From: Fredrik Markstrom > Date: Tue, 9 May 2017 14:44:36 +0200 > > > Currently veth drops all packets larger then the mtu set on the > > receiving end of the pair. This is inconsistent with

Re: [Patch net] ipv6/dccp: do not inherit ipv6_mc_list from parent

2017-05-09 Thread Eric Dumazet
On Tue, 2017-05-09 at 16:59 -0700, Cong Wang wrote: > Like commit 657831ffc38e ("dccp/tcp: do not inherit mc_list from parent") > we should clear ipv6_mc_list etc. for IPv6 sockets too. > > Cc: Eric Dumazet > Signed-off-by: Cong Wang > --- Thanks

[PATCH] arp: honour gratuitous ARP _replies_

2017-05-09 Thread Ihar Hrachyshka
When arp_accept is 1, gratuitous ARPs are supposed to override matching entries irrespective of whether they arrive during locktime. This was implemented in commit 56022a8fdd87 ("ipv4: arp: update neighbour address when a gratuitous arp is received and arp_accept is set") There is a glitch in the

[PATCH] neighbour: update neigh timestamps iff update is effective

2017-05-09 Thread Ihar Hrachyshka
It's a common practice to send gratuitous ARPs after moving an IP address to another device to speed up healing of a service. To fulfill service availability constraints, the timing of network peers updating their caches to point to a new location of an IP address can be particularly important.

[Patch net] ipv6/dccp: do not inherit ipv6_mc_list from parent

2017-05-09 Thread Cong Wang
Like commit 657831ffc38e ("dccp/tcp: do not inherit mc_list from parent") we should clear ipv6_mc_list etc. for IPv6 sockets too. Cc: Eric Dumazet Signed-off-by: Cong Wang --- net/dccp/ipv6.c | 6 ++ net/ipv6/tcp_ipv6.c | 2 ++ 2 files

Re: [Patch net] ipv4: restore rt->fi for reference counting

2017-05-09 Thread Eric Dumazet
On Tue, 2017-05-09 at 16:35 -0700, Cong Wang wrote: > This statement is only used to ensure we pass the "dead == fi->fib_nhs" > check right below the inner loop, it is fine to keep it without break since > fi is not changed in the inner loop. > So the dead++ above wont end up with (dead >

Re: [Patch net] ipv4: restore rt->fi for reference counting

2017-05-09 Thread Eric Dumazet
On Tue, 2017-05-09 at 16:35 -0700, Cong Wang wrote: > All of them take RCU read lock, so, as I explained in the code comment, > they all should be fine because of synchronize_net() on unregister path. > Do you see anything otherwise? They might take rcu lock, but compiler is still allowed to

Re: [Patch net] ipv4: restore rt->fi for reference counting

2017-05-09 Thread Cong Wang
On Tue, May 9, 2017 at 4:09 PM, Eric Dumazet wrote: > On Tue, 2017-05-09 at 15:54 -0700, Eric Dumazet wrote: >> On Tue, 2017-05-09 at 15:52 -0700, Eric Dumazet wrote: >> > On Tue, 2017-05-09 at 15:07 -0700, Cong Wang wrote: >> > > On Tue, May 9, 2017 at 1:56 PM, Cong Wang

[PATCH] libertas: Avoid reading past end of buffer

2017-05-09 Thread Kees Cook
Using memcpy() from a string that is shorter than the length copied means the destination buffer is being filled with arbitrary data from the kernel rodata segment. Instead, use strncpy() which will fill the trailing bytes with zeros. Additionally adjust indentation to keep checkpatch.pl happy.

Re: [Patch net] ipv4: restore rt->fi for reference counting

2017-05-09 Thread Eric Dumazet
On Tue, 2017-05-09 at 15:54 -0700, Eric Dumazet wrote: > On Tue, 2017-05-09 at 15:52 -0700, Eric Dumazet wrote: > > On Tue, 2017-05-09 at 15:07 -0700, Cong Wang wrote: > > > On Tue, May 9, 2017 at 1:56 PM, Cong Wang > > > wrote: > > > > Wait... if we transfer dst->dev

Re: [PATCH] wcn36xx: Close SMD channel on device removal

2017-05-09 Thread Bjorn Andersson
On Mon 08 May 23:17 PDT 2017, Kalle Valo wrote: > Bjorn Andersson writes: > > > The SMD channel is not the primary WCNSS channel and must explicitly be > > closed as the device is removed, or the channel will already by open on > > a subsequent probe call in e.g. the

Re: [PATCH net-next] bnxt: add dma mapping attributes

2017-05-09 Thread Shannon Nelson
On 5/9/2017 2:05 PM, Michael Chan wrote: On Tue, May 9, 2017 at 1:37 PM, Shannon Nelson wrote: On the SPARC platform we need to use the DMA_ATTR_WEAK_ORDERING attribute in our Rx path dma mapping in order to get the expected performance out of the receive path.

Re: [Patch net] ipv4: restore rt->fi for reference counting

2017-05-09 Thread Eric Dumazet
On Tue, 2017-05-09 at 15:52 -0700, Eric Dumazet wrote: > On Tue, 2017-05-09 at 15:07 -0700, Cong Wang wrote: > > On Tue, May 9, 2017 at 1:56 PM, Cong Wang wrote: > > > Wait... if we transfer dst->dev to loopback_dev because we don't > > > want to block unregister path,

Re: [Patch net] ipv4: restore rt->fi for reference counting

2017-05-09 Thread Eric Dumazet
On Tue, 2017-05-09 at 15:07 -0700, Cong Wang wrote: > On Tue, May 9, 2017 at 1:56 PM, Cong Wang wrote: > > Wait... if we transfer dst->dev to loopback_dev because we don't > > want to block unregister path, then we might have a similar problem > > for rt->fi too,

Re: [PATCH v2 net] dccp/tcp: do not inherit mc_list from parent

2017-05-09 Thread Eric Dumazet
On Tue, 2017-05-09 at 15:37 -0700, Cong Wang wrote: > On Tue, May 9, 2017 at 6:29 AM, Eric Dumazet wrote: > > From: Eric Dumazet > > > > syzkaller found a way to trigger double frees from ip_mc_drop_socket() > > > > It turns out that leave a copy of

Re: [PATCH v2 net] dccp/tcp: do not inherit mc_list from parent

2017-05-09 Thread Cong Wang
On Tue, May 9, 2017 at 6:29 AM, Eric Dumazet wrote: > From: Eric Dumazet > > syzkaller found a way to trigger double frees from ip_mc_drop_socket() > > It turns out that leave a copy of parent mc_list at accept() time, > which is very bad. > > Very

Re: [Patch net] ipv4: restore rt->fi for reference counting

2017-05-09 Thread Cong Wang
On Tue, May 9, 2017 at 1:56 PM, Cong Wang wrote: > Wait... if we transfer dst->dev to loopback_dev because we don't > want to block unregister path, then we might have a similar problem > for rt->fi too, fib_info is still referenced by dst, so these nh_dev's still > hold

Re: [PATCH net-next] bnxt: add dma mapping attributes

2017-05-09 Thread Michael Chan
On Tue, May 9, 2017 at 1:37 PM, Shannon Nelson wrote: > On the SPARC platform we need to use the DMA_ATTR_WEAK_ORDERING attribute > in our Rx path dma mapping in order to get the expected performance out > of the receive path. Adding it to the Tx path has little

Re: [Patch net] ipv4: restore rt->fi for reference counting

2017-05-09 Thread Cong Wang
On Tue, May 9, 2017 at 9:56 AM, Eric Dumazet wrote: > On Tue, 2017-05-09 at 09:44 -0700, Cong Wang wrote: > >> >> Eric, how did you produce it? >> I guess it's because of nh_dev which is the only netdevice pointer inside >> fib_info. Let me take a deeper look. >> > >

[PATCH net-next] bnxt: add dma mapping attributes

2017-05-09 Thread Shannon Nelson
On the SPARC platform we need to use the DMA_ATTR_WEAK_ORDERING attribute in our Rx path dma mapping in order to get the expected performance out of the receive path. Adding it to the Tx path has little effect, so that's not a part of this patch. Signed-off-by: Shannon Nelson

Re: arch: arm: bpf: Converting cBPF to eBPF for arm 32 bit

2017-05-09 Thread Daniel Borkmann
On 05/09/2017 10:12 PM, Shubham Bansal wrote: Hi Daniel, I just tried running test_bpf.ko module. $ echo 2 >> /proc/sys/net/core/bpf_jit_enable $ insmod test_bpf.ko test_bpf: #0 TAX bpf_jit: flen=14 proglen=212 pass=2 image=7f15a83c from=insmod pid=730 JIT code: : f0 05 2d e9 40 d2

Re: arch: arm: bpf: Converting cBPF to eBPF for arm 32 bit

2017-05-09 Thread David Miller
From: Shubham Bansal Date: Wed, 10 May 2017 01:42:10 +0530 > Why is trying to execute TAX which is a cBPF instruction? Because some of the tests are classic BPF programs which get translated into eBPF ones and sent to the JIT for compilation.

[PATCH nf] xtables: zero padding in data_to_user

2017-05-09 Thread Willem de Bruijn
From: Willem de Bruijn When looking up an iptables rule, the iptables binary compares the aligned match and target data (XT_ALIGN). In some cases this can exceed the actual data size to include padding bytes. Before commit f77bc5b23fb1 ("iptables: use match, target and data

Re: arch: arm: bpf: Converting cBPF to eBPF for arm 32 bit

2017-05-09 Thread Shubham Bansal
Hi Daniel, I just tried running test_bpf.ko module. $ echo 2 >> /proc/sys/net/core/bpf_jit_enable $ insmod test_bpf.ko test_bpf: #0 TAX bpf_jit: flen=14 proglen=212 pass=2 image=7f15a83c from=insmod pid=730 JIT code: : f0 05 2d e9 40 d2 4d e2 00 40 a0 e3 0c 42 8d e5 JIT code: 0010:

[GIT] Networking

2017-05-09 Thread David Miller
1) Fix multiqueue in stmmac driver on PCI, from Andy Shevchenko. 2) cdc_ncm doesn't actually fully zero out the padding area is allocates on TX, from Jim Baxter. 3) Don't leak map addresses in BPF verifier, from Daniel Borkmann. 4) If we randomize TCP timestamps, we have to do it everywhere

Re: [PATCH v2 net] dccp/tcp: do not inherit mc_list from parent

2017-05-09 Thread David Miller
From: Eric Dumazet Date: Tue, 09 May 2017 06:29:19 -0700 > From: Eric Dumazet > > syzkaller found a way to trigger double frees from ip_mc_drop_socket() > > It turns out that leave a copy of parent mc_list at accept() time, > which is very bad. >

Re: Requirements for a shutdown function?

2017-05-09 Thread Florian Fainelli
On 05/09/2017 11:51 AM, Timur Tabi wrote: > On 05/09/2017 01:46 PM, Florian Fainelli wrote: >> A good test case for exercising a .shutdown() function is kexec'ing a >> new kernel for instance. > > I tried that. I run iperf in one window while launching kexec in another. > Even without a shutdown

Re: Requirements for a shutdown function?

2017-05-09 Thread Timur Tabi
On 05/09/2017 01:46 PM, Florian Fainelli wrote: > A good test case for exercising a .shutdown() function is kexec'ing a > new kernel for instance. I tried that. I run iperf in one window while launching kexec in another. Even without a shutdown function, network traffic appear to halt on its own

Re: Requirements for a shutdown function?

2017-05-09 Thread Florian Fainelli
On 05/09/2017 09:58 AM, Timur Tabi wrote: > I'm trying to add a platform_driver.shutdown function to my Ethernet driver > (drivers/net/ethernet/qualcomm/emac/*), but I can't find any definitive > information as to what a network driver shutdown callback is supposed to do. > I also don't know what

RE: [PATCH net-next 9/9] ipvlan: introduce individual MAC addresses

2017-05-09 Thread Chiappero, Marco
> -Original Message- > From: Dan Williams [mailto:d...@redhat.com] > Sent: Monday, May 8, 2017 7:13 PM > To: Chiappero, Marco ; Jiri Benc > > Cc: netdev@vger.kernel.org; David S . Miller ; Kirsher, > Jeffrey T

Re: [PATCH net v2] driver: vrf: Fix one possible use-after-free issue

2017-05-09 Thread David Miller
From: gfree.w...@vip.163.com Date: Tue, 9 May 2017 18:27:33 +0800 > @@ -989,6 +989,7 @@ static u32 vrf_fib_table(const struct net_device *dev) > > static int vrf_rcv_finish(struct net *net, struct sock *sk, struct sk_buff > *skb) > { > + kfree_skb(skb); > return 0; > } > > @@

Re: bpf pointer alignment validation

2017-05-09 Thread David Miller
From: Daniel Borkmann Date: Mon, 08 May 2017 12:49:25 +0200 > Could you also add test cases specifically to this for test_verifier > in bpf selftests? I'm thinking of the cases when we have no pkt id > and offset originated from reg->off (accumulated through const imm > ops

Re: mlx5 endpoint driver problem

2017-05-09 Thread Joao Pinto
Hi again Saeed, Às 6:44 PM de 5/9/2017, Saeed Mahameed escreveu: > On Tue, May 9, 2017 at 8:38 PM, Joao Pinto wrote: >> Hi Saeed, >> >> Às 6:35 PM de 5/9/2017, Saeed Mahameed escreveu: >>> On Tue, May 9, 2017 at 7:25 PM, Joao Pinto wrote:

Re: [PATCH 0/2] net: Set maximum receive packet size on veth interfaces

2017-05-09 Thread David Miller
From: Fredrik Markstrom Date: Tue, 9 May 2017 14:44:36 +0200 > Currently veth drops all packets larger then the mtu set on the > receiving end of the pair. This is inconsistent with most hardware > ethernet drivers. False. In fact, many pieces of ethernet hardware

Re: mlx5 endpoint driver problem

2017-05-09 Thread Saeed Mahameed
On Tue, May 9, 2017 at 8:38 PM, Joao Pinto wrote: > Hi Saeed, > > Às 6:35 PM de 5/9/2017, Saeed Mahameed escreveu: >> On Tue, May 9, 2017 at 7:25 PM, Joao Pinto wrote: >>> Hello, >>> >>> I am making tests with a Mellanox MLX5 Endpoint, and I am

Re: mlx5 endpoint driver problem

2017-05-09 Thread Joao Pinto
Hi Saeed, Às 6:35 PM de 5/9/2017, Saeed Mahameed escreveu: > On Tue, May 9, 2017 at 7:25 PM, Joao Pinto wrote: >> Hello, >> >> I am making tests with a Mellanox MLX5 Endpoint, and I am getting kernel >> hangs >> when trying to enable the hca: >> >> mlx5_core

Re: mlx5 endpoint driver problem

2017-05-09 Thread Saeed Mahameed
On Tue, May 9, 2017 at 7:25 PM, Joao Pinto wrote: > Hello, > > I am making tests with a Mellanox MLX5 Endpoint, and I am getting kernel hangs > when trying to enable the hca: > > mlx5_core :01:00.0: enabling device ( -> 0002) > mlx5_core :01:00.0: Warning:

Re: [PATCH net v2] driver: vrf: Fix one possible use-after-free issue

2017-05-09 Thread Florian Westphal
David Ahern wrote: > On 5/9/17 3:27 AM, gfree.w...@vip.163.com wrote: > > diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c > > index ceda586..db88249 100644 > > --- a/drivers/net/vrf.c > > +++ b/drivers/net/vrf.c > > @@ -989,6 +989,7 @@ static u32 vrf_fib_table(const struct

Requirements for a shutdown function?

2017-05-09 Thread Timur Tabi
I'm trying to add a platform_driver.shutdown function to my Ethernet driver (drivers/net/ethernet/qualcomm/emac/*), but I can't find any definitive information as to what a network driver shutdown callback is supposed to do. I also don't know what testcase I should use to verify that my function

Re: [Patch net] ipv4: restore rt->fi for reference counting

2017-05-09 Thread Eric Dumazet
On Tue, 2017-05-09 at 09:44 -0700, Cong Wang wrote: > > Eric, how did you produce it? > I guess it's because of nh_dev which is the only netdevice pointer inside > fib_info. Let me take a deeper look. > Nothing particular, I am using kexec to boot new kernels, and all my attempts with your

[PATCH net-next] net: stmmac: use correct pointer when printing normal descriptor ring

2017-05-09 Thread Niklas Cassel
From: Niklas Cassel Signed-off-by: Niklas Cassel --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Re: [PATCH net v2] driver: vrf: Fix one possible use-after-free issue

2017-05-09 Thread David Ahern
On 5/9/17 3:27 AM, gfree.w...@vip.163.com wrote: > diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c > index ceda586..db88249 100644 > --- a/drivers/net/vrf.c > +++ b/drivers/net/vrf.c > @@ -989,6 +989,7 @@ static u32 vrf_fib_table(const struct net_device *dev) > > static int

Re: [Patch net] ipv4: restore rt->fi for reference counting

2017-05-09 Thread Cong Wang
On Mon, May 8, 2017 at 7:18 PM, Eric Dumazet wrote: > On Mon, 2017-05-08 at 21:22 -0400, David Miller wrote: >> From: Eric Dumazet >> Date: Mon, 08 May 2017 17:01:20 -0700 >> >> > On Mon, 2017-05-08 at 14:35 -0400, David Miller wrote: >> >> From:

mlx5 endpoint driver problem

2017-05-09 Thread Joao Pinto
Hello, I am making tests with a Mellanox MLX5 Endpoint, and I am getting kernel hangs when trying to enable the hca: mlx5_core :01:00.0: enabling device ( -> 0002) mlx5_core :01:00.0: Warning: couldn't set 64-bit PCI DMA mask mlx5_core :01:00.0: Warning: couldn't set 64-bit

[PATCH] netxen_nic: set rcode to the return status from the call to netxen_issue_cmd

2017-05-09 Thread Colin King
From: Colin Ian King Currently rcode is being initialized to NX_RCODE_SUCCESS and later it is checked to see if it is not NX_RCODE_SUCCESS which is never true. It appears that there is an unintentional missing assignment of rcode from the return of the call to

Re: [PATCH 0/2] net: Set maximum receive packet size on veth interfaces

2017-05-09 Thread Stephen Hemminger
On Tue, 9 May 2017 14:44:36 +0200 Fredrik Markstrom wrote: > Currently veth drops all packets larger then the mtu set on the receiving > end of the pair. This is inconsistent with most hardware ethernet drivers. There is no guarantee that packets larger than MTU +

openvswitch MTU patch needed in 4.10 stable

2017-05-09 Thread Stephen Hemminger
Could you queue the patch to stable? Begin forwarded message: Date: Tue, 09 May 2017 08:21:46 + From: bugzilla-dae...@bugzilla.kernel.org To: step...@networkplumber.org Subject: [Bug 195695] New: openvswitch: Set internal device max mtu to ETH_MAX_MTU

Re: [PATCH RFC net-next 0/6] net: reducing memory footprint of network devices

2017-05-09 Thread David Ahern
On 5/9/17 2:50 AM, Nicolas Dichtel wrote: > Your initial patch tried to make those interfaces transparent, this is not the > case anymore here. It would probably be useful to be able to filter those > interfaces in the kernel during a dump. The earlier email was for hidden devices; the intent

Re: [PATCH net 0/5] qed*: General fixes

2017-05-09 Thread David Miller
From: Yuval Mintz Date: Tue, 9 May 2017 15:07:46 +0300 > This series contain several fixes for qed and qede. > > - #1 [and ~#5] relate to XDP cleanups > - #2 and #5 correct VF behavior > - #3 and #4 fix and add missing configurations needed for RoCE & storage > >

Re: [PATCH net 0/3] mlx4 misc fixes

2017-05-09 Thread David Miller
From: Tariq Toukan Date: Tue, 9 May 2017 14:45:21 +0300 > This patchset contains misc bug fixes from the team > to the mlx4 Core and Eth drivers. > > Series generated against net commit: > 32f1bc0f3d26 Revert "ipv4: restore rt->fi for reference counting" Series applied,

Re: [PATCH] net: dsa: loop: Check for memory allocation failure

2017-05-09 Thread Joe Perches
On Mon, 2017-05-08 at 17:35 -0700, Florian Fainelli wrote: > On 05/08/2017 04:46 PM, Julia Lawall wrote: > > On Mon, 8 May 2017, Joe Perches wrote: > > > Each time -EPROBE_DEFER occurs, another set of calls to > > > dsa_switch_alloc and dev_kzalloc also occurs. > > > > > > Perhaps it'd be better

Re: [PATCH net] ipv6: make sure dev is not NULL before call ip6_frag_reasm

2017-05-09 Thread Eric Dumazet
On Tue, 2017-05-09 at 21:40 +0800, Hangbin Liu wrote: > > I saw we checked the dev in this function > > dev = skb->dev; > if (dev) { > fq->iif = dev->ifindex; > skb->dev = NULL; > } > > and upper caller ipv6_frag_rcv() > > fq =

Re: DQL and TCQ_F_CAN_BYPASS destroy performance under virtualizaiton (Was: "Re: net_sched strange in 4.11")

2017-05-09 Thread Stefan Hajnoczi
On Tue, May 09, 2017 at 08:46:46AM +0100, Anton Ivanov wrote: > I have figured it out. Two issues. > > 1) skb->xmit_more is hardly ever set under virtualization because the qdisc > is usually bypassed because of TCQ_F_CAN_BYPASS. Once TCQ_F_CAN_BYPASS is > set a virtual NIC driver is not likely

Re: [PATCH 0/4] hamradio: Fine-tuning for nine function implementations

2017-05-09 Thread David Miller
You can feel free to continue submitting these changes, even though people have asked you to back off on this, and that there is little to no value to this churn. But I personally am not going to apply any of your changes... Especially since you keep posting even though people are asking you to

RE: sky2: Use seq_putc() in sky2_debug_show()

2017-05-09 Thread David Laight
From: Stephen Hemminger > Sent: 09 May 2017 06:50 > On Mon, 8 May 2017 19:42:46 +0200 > SF Markus Elfring wrote: > > > > Which issue do you mean? I dont see any issue you fix here. > > > > Are the run time characteristics a bit nicer for the function seq_putc > >

[PATCH 4/4] hamradio: Adjust four function calls together with a variable assignment

2017-05-09 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 9 May 2017 15:57:17 +0200 The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix affected source code places. Signed-off-by: Markus Elfring

Re: Marvell phy errata origins?

2017-05-09 Thread Andrew Lunn
> According to Marvell this was errata for 88M1101 , and should not be > applied to any other phy .. So we should be removing these lines and > make a special aneg for 88M1101 then restore everything that doesn't > need this back to the generic aneg, Hi Daniel Thanks for finding this out. Can

[PATCH 3/4] hamradio: Use seq_puts() in bpq_seq_show()

2017-05-09 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 9 May 2017 15:45:09 +0200 A string which did not contain a data format specification should be put into a sequence. Thus use the corresponding function "seq_puts". This issue was detected by using the Coccinelle software.

[PATCH 2/4] hamradio: Adjust four function calls together with a variable assignment

2017-05-09 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 9 May 2017 15:15:16 +0200 The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix affected source code places. Improve a size determination. Signed-off-by:

  1   2   >