Re: Reference counting struct inet_peer

2017-01-23 Thread Julian Anastasov
Hello, On Mon, 23 Jan 2017, David Windsor wrote: > Hi, > > I'm working on a patchset that adds overflow protection to kernel > reference counters, as part of the KSPP effort. We're introducing a > new type, tentatively called refcount_t, that will ultimately replace > atomic_t as the

Re: [PATCH net-next 3/3] net/tcp-fastopen: Add new API support

2017-01-23 Thread Willy Tarreau
On Mon, Jan 23, 2017 at 10:59:22AM -0800, Wei Wang wrote: > This patch adds a new socket option, TCP_FASTOPEN_CONNECT, as an > alternative way to perform Fast Open on the active side (client). Wei, I think that nothing prevents from reusin the original TCP_FASTOPEN sockopt instead of adding a new

Re: [PATCH] Bluetooth: hidp: might sleep error in hidp_session_thread

2017-01-23 Thread jeffy
Hi brian, On 01/24/2017 10:31 AM, Brian Norris wrote: Hi Jeffy, On Fri, Jan 20, 2017 at 09:52:08PM +0800, Jeffy Chen wrote: [ 39.044329] do not call blocking ops when !TASK_RUNNING; state=1 set at [] hidp_session_thread+0x110/0x568 [hidp] ... [ 40.159664] Call trace: [ 40.162122] []

Re: [patch net-next 1/4] net: Introduce psample, a new genetlink channel for packet sampling

2017-01-23 Thread Jiri Pirko
Tue, Jan 24, 2017 at 12:57:50AM CET, step...@networkplumber.org wrote: >On Sun, 22 Jan 2017 12:44:44 +0100 >Jiri Pirko wrote: > >> +static LIST_HEAD(psample_groups_list); >> +static DEFINE_SPINLOCK(psample_groups_lock); >> + > >Why not a mutex? You aren't acquiring this in IRQ

Re: [patch] samples/bpf: silence shift wrapping warning

2017-01-23 Thread Alexei Starovoitov
On Mon, Jan 23, 2017 at 5:27 AM, Arnaldo Carvalho de Melo wrote: > Em Sun, Jan 22, 2017 at 02:51:25PM -0800, Alexei Starovoitov escreveu: >> On Sat, Jan 21, 2017 at 07:51:43AM +0300, Dan Carpenter wrote: >> > max_key is a value in the 0-63 range, so on 32 bit systems the

[PATCH] ibmveth: Add a proper check for the availability of the checksum features

2017-01-23 Thread Thomas Huth
When using the ibmveth driver in a KVM/QEMU based VM, it currently always prints out a scary error message like this when it is started: ibmveth 7103 (unregistered net_device): unable to change checksum offload settings. 1 rc=-2 ret_attr=7103 This happens because the driver always

[PATCH v8 08/13] net: ethernet: aquantia: PCI operations

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Add functions that handle the PCI bus interface. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel Belous Signed-off-by:

[PATCH v8 05/13] net: ethernet: aquantia: Support for NIC-specific code

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Add support for code specific to the Atlantic NIC. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel Belous

[PATCH v8 02/13] net: ethernet: aquantia: Common functions and definitions

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Add files containing the functions and definitions used in common in different functional areas. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel

[PATCH v8 11/13] net: ethernet: aquantia: Ethtool support

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Add the driver interfaces required for support by the ethtool utility. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel Belous

[PATCH v8 10/13] net: ethernet: aquantia: Hardware interface and utility functions

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Add functions to interface with the hardware and some utility functions. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel Belous

[PATCH v8 07/13] net: ethernet: aquantia: Vector operations

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Add functions to manululate the vector of receive and transmit rings. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel.Belous

[PATCH v8 13/13] net: ethernet: aquantia: Integrate AQtion 2.5/5 GB NIC driver

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Modify the drivers/net/ethernet/{Makefile,Kconfig} file to make them a part of the network drivers build. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by:

[PATCH v8 12/13] net: ethernet: aquantia: Receive side scaling

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Add definitions that support receive side scaling. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel Belous

[PATCH v8 09/13] net: ethernet: aquantia: Atlantic hardware abstraction layer

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Add common functions for Atlantic hardware abstraction layer. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel Belous

[PATCH v8 06/13] net: ethernet: aquantia: Atlantic A0 and B0 specific functions.

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Add Atlantic A0 and B0 specific functions. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel Belous Signed-off-by: Dmitry

[PATCH v8 01/13] net: ethernet: aquantia: Make and configuration files.

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Patches to create the make and configuration files. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel Belous

[PATCH v8 03/13] net: ethernet: aquantia: Add ring support code

2017-01-23 Thread Alexander Loktionov
From: David VomLehn Add code to support the transmit and receive ring buffers. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov Signed-off-by: Pavel Belous

[PATCH v8 00/13] net: ethernet: aquantia: Add AQtion 2.5/5 GB NIC driver

2017-01-23 Thread Alexander Loktionov
From: David VomLehn This series introduces the AQtion NIC driver for the aQuantia AQC107/AQC108 network devices. v1: Initial version v2: o Make necessary drivers/net/ethernet changes to integrate software o Drop intermediate atlantic directory o Remove Makefile things

[PATCH net] sctp: sctp gso should set feature with NETIF_F_SG when calling skb_segment

2017-01-23 Thread Xin Long
Now sctp gso puts segments into skb's frag_list, then processes these segments in skb_segment. But skb_segment handles them only when gs is enabled, as it's in the same branch with skb's frags. Although almost all the NICs support sg other than some old ones, but since commit 1e16aa3ddf86 ("net:

[PATCH net] sctp: sctp_addr_id2transport should verify the addr before looking up assoc

2017-01-23 Thread Xin Long
sctp_addr_id2transport is a function for sockopt to look up assoc by address. As the address is from userspace, it can be a v4-mapped v6 address. But in sctp protocol stack, it always handles a v4-mapped v6 address as a v4 address. So it's necessary to convert it to a v4 address before looking up

Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()

2017-01-23 Thread Joe Perches
On Tue, 2017-01-24 at 05:18 +, Valo, Kalle wrote: > Joe Perches writes: > > > On Mon, 2017-01-23 at 15:04 +, Srinivas Kandagatla wrote: > > > use dma_zalloc_coherent() instead of dma_alloc_coherent and memset(). > > > > [] > > > diff --git

loopback device reference count leakage

2017-01-23 Thread Kaiwen Xu
Hi netdev folks, I am currently experiencing an issue related with the loopback during network devices shutdown inside a network namespace, which mainfested as unregister_netdevice: waiting for lo to become free. Usage count = 1 showing up every 10 seconds or so in the kernel log. It

Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()

2017-01-23 Thread Valo, Kalle
Joe Perches writes: > On Mon, 2017-01-23 at 15:04 +, Srinivas Kandagatla wrote: >> use dma_zalloc_coherent() instead of dma_alloc_coherent and memset(). > [] >> diff --git a/drivers/net/wireless/ath/ath10k/pci.c >> b/drivers/net/wireless/ath/ath10k/pci.c > [] >> @@ -896,7

linux-next: manual merge of the kselftest tree with the net-next tree

2017-01-23 Thread Stephen Rothwell
Hi Shuah, Today's linux-next merge of the kselftest tree got a conflict in: tools/testing/selftests/bpf/Makefile between commit: 4d3381f5a322 ("bpf: Add tests for the lpm trie map") from the net-next tree and commit: 88baa78d1f31 ("selftests: remove duplicated all and clean target")

[PATCH net-next v2 0/2] vxlan: misc fdb fixes

2017-01-23 Thread Roopa Prabhu
From: Roopa Prabhu Balakrishnan Raman (1): vxlan: do not age static remote mac entries Roopa Prabhu (1): vxlan: don't flush static fdb entries on admin down drivers/net/vxlan.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- v1 -> v2: use

[PATCH net-next v2 2/2] vxlan: do not age static remote mac entries

2017-01-23 Thread Roopa Prabhu
From: Balakrishnan Raman Mac aging is applicable only for dynamically learnt remote mac entries. Check for user configured static remote mac entries and skip aging. Signed-off-by: Balakrishnan Raman Signed-off-by: Roopa Prabhu

[PATCH net-next v2 1/2] vxlan: don't flush static fdb entries on admin down

2017-01-23 Thread Roopa Prabhu
From: Roopa Prabhu This patch skips flushing static fdb entries in ndo_stop, but flushes all fdb entries during vxlan device delete. This is consistent with the bridge driver fdb Signed-off-by: Roopa Prabhu --- drivers/net/vxlan.c | 8

Re: XDP offload to hypervisor

2017-01-23 Thread Michael S. Tsirkin
On Mon, Jan 23, 2017 at 07:50:31PM -0800, Alexei Starovoitov wrote: > On Tue, Jan 24, 2017 at 05:33:37AM +0200, Michael S. Tsirkin wrote: > > On Mon, Jan 23, 2017 at 05:02:02PM -0800, Alexei Starovoitov wrote: > > > Frankly I don't understand the whole virtio nit picking that was > > > happening.

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread Andy Lutomirski
On Mon, Jan 23, 2017 at 8:05 PM, David Ahern wrote: > On 1/23/17 8:37 PM, Andy Lutomirski wrote: >> Yes, it is a bug because cgroup+bpf causes unwitting programs to be >> subject to BPF code installed by a different, potentially unrelated >> process. That's a new

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread Andy Lutomirski
On Mon, Jan 23, 2017 at 8:10 PM, David Ahern wrote: > On 1/23/17 7:39 PM, Andy Lutomirski wrote: >> I'm not sure I followed what you meant. If I understood right (which >> is a big if) you're saying that ip vrf when run in a netns works >> correctly in that netns. I

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread David Ahern
On 1/23/17 8:37 PM, Andy Lutomirski wrote: > Yes, it is a bug because cgroup+bpf causes unwitting programs to be > subject to BPF code installed by a different, potentially unrelated > process. That's a new situation. The failure can happen when a > privileged supervisor (whoever runs ip vrf)

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread David Ahern
On 1/23/17 7:39 PM, Andy Lutomirski wrote: > I'm not sure I followed what you meant. If I understood right (which > is a big if) you're saying that ip vrf when run in a netns works > correctly in that netns. I agree, but I think that it would continue > to work (even more reliably) if the hooks

[PATCH 2/3] Bluetooth: cmtp: fix possible might sleep error in cmtp_session

2017-01-23 Thread Jeffy Chen
It looks like cmtp_session has same pattern as the issue reported in old rfcomm: while (1) { set_current_state(TASK_INTERRUPTIBLE); if (condition) break; // may call might_sleep here schedule();

[PATCH 1/3] Bluetooth: bnep: fix possible might sleep error in bnep_session

2017-01-23 Thread Jeffy Chen
It looks like bnep_session has same pattern as the issue reported in old rfcomm: while (1) { set_current_state(TASK_INTERRUPTIBLE); if (condition) break; // may call might_sleep here schedule();

[PATCH 3/3] Bluetooth: hidp: fix possible might sleep error in hidp_session_thread

2017-01-23 Thread Jeffy Chen
It looks like hidp_session_thread has same pattern as the issue reported in old rfcomm: while (1) { set_current_state(TASK_INTERRUPTIBLE); if (condition) break; // may call might_sleep here schedule();

Re: XDP offload to hypervisor

2017-01-23 Thread Alexei Starovoitov
On Tue, Jan 24, 2017 at 05:33:37AM +0200, Michael S. Tsirkin wrote: > On Mon, Jan 23, 2017 at 05:02:02PM -0800, Alexei Starovoitov wrote: > > Frankly I don't understand the whole virtio nit picking that was happening. > > imo virtio+xdp by itself is only useful for debugging, development and > >

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread Andy Lutomirski
On Mon, Jan 23, 2017 at 7:13 PM, Alexei Starovoitov wrote: > On Mon, Jan 23, 2017 at 06:42:27PM -0800, Andy Lutomirski wrote: >> Please explain how the change results in a broken ABI and how the >> current ABI is better. I gave a fully worked out example of how the

Re: XDP offload to hypervisor

2017-01-23 Thread Michael S. Tsirkin
On Mon, Jan 23, 2017 at 05:02:02PM -0800, Alexei Starovoitov wrote: > Frankly I don't understand the whole virtio nit picking that was happening. > imo virtio+xdp by itself is only useful for debugging, development and testing > of xdp programs in a VM. The discussion about performance of

[PATCH net-next] net: dsa: Drop WARN() in tag_brcm.c

2017-01-23 Thread Florian Fainelli
We may be able to see invalid Broadcom tags when the hardware and drivers are misconfigured, or just while exercising the error path. Instead of flooding the console with messages, flat out drop the packet. Signed-off-by: Florian Fainelli --- net/dsa/tag_brcm.c | 3 ++- 1

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread Alexei Starovoitov
On Mon, Jan 23, 2017 at 06:42:27PM -0800, Andy Lutomirski wrote: > On Mon, Jan 23, 2017 at 6:09 PM, Alexei Starovoitov > wrote: > > On Mon, Jan 23, 2017 at 12:36:08PM -0800, Andy Lutomirski wrote: > >> To see how cgroup+bpf interacts with network namespaces, I wrote

Re: XDP offload to hypervisor

2017-01-23 Thread Michael S. Tsirkin
On Mon, Jan 23, 2017 at 05:02:02PM -0800, Alexei Starovoitov wrote: > > Another issue is around host/guest ABI. Guest BPF could add new features > > at any point. What if hypervisor can not support it all? I guess we > > could try loading program into hypervisor and run it within guest on > >

Re: [PULL] vhost: cleanups and fixes

2017-01-23 Thread Michael S. Tsirkin
On Mon, Jan 23, 2017 at 01:50:32PM -0800, Linus Torvalds wrote: > On Mon, Jan 23, 2017 at 7:05 AM, Michael S. Tsirkin wrote: > > > > virtio, vhost: fixes, cleanups > > Was there a reason why you sent this twice? > > Or was this *supposed* to be the ARM DMA fix pull request?

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread Andy Lutomirski
On Mon, Jan 23, 2017 at 6:09 PM, Alexei Starovoitov wrote: > On Mon, Jan 23, 2017 at 12:36:08PM -0800, Andy Lutomirski wrote: >> To see how cgroup+bpf interacts with network namespaces, I wrote a >> little program called show_bind that calls getsockopt(..., >>

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread Andy Lutomirski
On Mon, Jan 23, 2017 at 6:31 PM, David Ahern wrote: > On 1/23/17 7:09 PM, Alexei Starovoitov wrote: >>> + */ >>> +if (current->nsproxy->net_ns != _net) >>> +return -EINVAL; >> >> this restriction I actually don't mind, since it indeed can be >>

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread David Ahern
On 1/23/17 7:09 PM, Alexei Starovoitov wrote: >> + */ >> +if (current->nsproxy->net_ns != _net) >> +return -EINVAL; > > this restriction I actually don't mind, since it indeed can be > relaxed later, but please make it proper with net_eq() > I do mind. Why have different

Re: [PATCH] Bluetooth: hidp: might sleep error in hidp_session_thread

2017-01-23 Thread Brian Norris
Hi Jeffy, On Fri, Jan 20, 2017 at 09:52:08PM +0800, Jeffy Chen wrote: > [ 39.044329] do not call blocking ops when !TASK_RUNNING; state=1 set > at [] hidp_session_thread+0x110/0x568 [hidp] > ... > [ 40.159664] Call trace: > [ 40.162122] [] __might_sleep+0x64/0x90 > [ 40.167443] []

Re: [PATCH net-next] bpf, lpm: fix kfree of im_node in trie_update_elem

2017-01-23 Thread David Miller
From: Daniel Borkmann Date: Tue, 24 Jan 2017 01:26:46 +0100 > We need to initialize im_node to NULL, otherwise in case of error path > it gets passed to kfree() as uninitialized pointer. > > Fixes: b95a5c4db09b ("bpf: add a longest prefix match trie map > implementation")

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread Alexei Starovoitov
On Mon, Jan 23, 2017 at 12:36:08PM -0800, Andy Lutomirski wrote: > To see how cgroup+bpf interacts with network namespaces, I wrote a > little program called show_bind that calls getsockopt(..., > SO_BINDTODEVICE, ...) and prints the result. It did this: > > # ./ip link add dev vrf0 type vrf

[PATCH] net: ks8851: Drop eeprom_size structure member

2017-01-23 Thread Stephen Boyd
After commit 51b7b1c34e19 (KSZ8851-SNL: Add ethtool support for EEPROM via eeprom_93cx6, 2011-11-21) this structure member is unused. Delete it. Signed-off-by: Stephen Boyd --- Found while debugging an eeprom issue. drivers/net/ethernet/micrel/ks8851.c | 7 --- 1

Re: XDP offload to hypervisor

2017-01-23 Thread Alexei Starovoitov
On Mon, Jan 23, 2017 at 11:40:29PM +0200, Michael S. Tsirkin wrote: > I've been thinking about passing XDP programs from guest to the > hypervisor. Basically, after getting an incoming packet, we could run > an XDP program in host kernel. > > If the result is XDP_DROP or XDP_TX we don't need to

[PATCH v2 net 2/2] ipv6: fix ip6_tnl_parse_tlv_enc_lim()

2017-01-23 Thread Eric Dumazet
This function suffers from multiple issues. First one is that pskb_may_pull() may reallocate skb->head, so the 'raw' pointer needs either to be reloaded or not used at all. Second issue is that NEXTHDR_DEST handling does not validate that the options are present in skb->data, so we might read

[PATCH v2 net 1/2] ip6_tunnel: must reload ipv6h in ip6ip6_tnl_xmit()

2017-01-23 Thread Eric Dumazet
Since ip6_tnl_parse_tlv_enc_lim() can call pskb_may_pull(), we must reload any pointer that was related to skb->head (or skb->data), or risk use after free. Fixes: c12b395a4664 ("gre: Support GRE over IPv6") Signed-off-by: Eric Dumazet Cc: Dmitry Kozlov ---

[PATCH v2 net 0/2] ipv6: fix ip6_tnl_parse_tlv_enc_lim() issues

2017-01-23 Thread Eric Dumazet
First patch fixes ip6_tnl_parse_tlv_enc_lim() callers, bug added in linux-3.7 Second patch fixes ip6_tnl_parse_tlv_enc_lim() itself, bug predates linux-2.6.12 Based on a report from Dmitry Vyukov, thanks to KASAN. Eric Dumazet (2): ip6_tunnel: must reload ipv6h in ip6ip6_tnl_xmit() ipv6:

linux-next: manual merge of the net-next tree with the net tree

2017-01-23 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the net-next tree got a conflict in: net/mpls/af_mpls.c between commit: 9f427a0e474a ("net: mpls: Fix multipath selection for LSR use case") from the net tree and commit: 27d691056bde ("mpls: Packet stats") from the net-next tree. I fixed it up

Re: [PATCH net-next] bpf, lpm: fix kfree of im_node in trie_update_elem

2017-01-23 Thread Alexei Starovoitov
On Tue, Jan 24, 2017 at 01:26:46AM +0100, Daniel Borkmann wrote: > We need to initialize im_node to NULL, otherwise in case of error path > it gets passed to kfree() as uninitialized pointer. > > Fixes: b95a5c4db09b ("bpf: add a longest prefix match trie map > implementation") > Signed-off-by:

[PATCH net-next] bpf, lpm: fix kfree of im_node in trie_update_elem

2017-01-23 Thread Daniel Borkmann
We need to initialize im_node to NULL, otherwise in case of error path it gets passed to kfree() as uninitialized pointer. Fixes: b95a5c4db09b ("bpf: add a longest prefix match trie map implementation") Signed-off-by: Daniel Borkmann --- Mentioned it in

Re: [PATCH cumulus-4.1.y 2/5] vxlan: don't replace fdb entry if nothing changed

2017-01-23 Thread Roopa Prabhu
On 1/23/17, 9:02 AM, Stephen Hemminger wrote: > On Fri, 20 Jan 2017 23:40:07 -0800 > Roopa Prabhu wrote: > >> +if (!vxlan_addr_equal(>remote_ip, ip) || >> +rd->remote_port != port || >> +rd->remote_vni != vni || >> +rd->remote_ifindex !=

Re: [RFC PATCH] mlx5: Fix page rfcnt issue

2017-01-23 Thread David Miller
From: Tom Herbert Date: Mon, 23 Jan 2017 15:56:58 -0800 > One other potential problem in the driver is the use of put_page in > release pages. Comparing how the allocation is done in other drivers > (for instance comparing to ixgbe) some seem to use __free_pages instead. >

Re: [PATCH net-next 1/2] vxlan: don't flush static fdb entries on admin down

2017-01-23 Thread Roopa Prabhu
On 1/23/17, 1:07 PM, David Miller wrote: > From: Roopa Prabhu > Date: Fri, 20 Jan 2017 23:43:18 -0800 > >> /* Purge the forwarding table */ >> -static void vxlan_flush(struct vxlan_dev *vxlan) >> +static void vxlan_flush(struct vxlan_dev *vxlan, int do_all) > Please

Re: [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down

2017-01-23 Thread Roopa Prabhu
On 1/23/17, 8:59 AM, Stephen Hemminger wrote: > On Fri, 20 Jan 2017 23:40:06 -0800 > Roopa Prabhu wrote: > >> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c >> index 19b1653..15b1c23 100644 >> --- a/drivers/net/vxlan.c >> +++ b/drivers/net/vxlan.c >> @@ -3276,6

Re: [RFC PATCH net-next 0/5] bridge: per vlan lwt and dst_metadata support

2017-01-23 Thread Roopa Prabhu
On 1/23/17, 9:03 AM, Or Gerlitz wrote: > On Mon, Jan 23, 2017 at 6:13 PM, Roopa Prabhu > wrote: > >> Also, the goal is to reduce the number of vxlan devices from say 4k to 1. >> I don't think replacing it with 8k (egress + ingress) rules is going in the >> right

[PATCH net-next 5/5] bpf: enable verifier to better track const alu ops

2017-01-23 Thread Daniel Borkmann
William reported couple of issues in relation to direct packet access. Typical scheme is to check for data + [off] <= data_end, where [off] can be either immediate or coming from a tracked register that contains an immediate, depending on the branch, we can then access the data. However, in case

[PATCH net-next 1/5] bpf: simplify __is_valid_access test on cb

2017-01-23 Thread Daniel Borkmann
The __is_valid_access() test for cb[] from 62c7989b24db ("bpf: allow b/h/w/dw access for bpf's cb in ctx") was done unnecessarily complex, we can just simplify it the same way as recent fix from 2d071c643f1c ("bpf, trace: make ctx access checks more robust") did. Overflow can never happen as size

[PATCH net-next 0/5] Misc BPF improvements

2017-01-23 Thread Daniel Borkmann
This series adds various misc improvements to BPF, f.e. allowing skb_load_bytes() helper to be used with filter/reuseport programs to facilitate programming, test cases for program tag, etc. For details, please see individual patches. Thanks! Daniel Borkmann (5): bpf: simplify

[PATCH net-next 4/5] bpf: add prog tag test case to bpf selftests

2017-01-23 Thread Daniel Borkmann
Add the test case used to compare the results from fdinfo with af_alg's output on the tag. Tests are from min to max sized programs, with and without maps included. # ./test_tag test_tag: OK (40945 tests) Tested on x86_64 and s390x. Signed-off-by: Daniel Borkmann

[PATCH net-next 2/5] bpf: enable load bytes helper for filter/reuseport progs

2017-01-23 Thread Daniel Borkmann
BPF_PROG_TYPE_SOCKET_FILTER are used in various facilities such as for SO_REUSEPORT and packet fanout demuxing, packet filtering, kcm, etc, and yet the only facility they can use is BPF_LD with {BPF_ABS, BPF_IND} for single byte/half/word access. Direct packet access is only restricted to tc

Re: [PATCH net-next 2/2] ipv6: fix ip6_tnl_parse_tlv_enc_lim()

2017-01-23 Thread Eric Dumazet
On Mon, Jan 23, 2017 at 3:58 PM, Eric Dumazet wrote: > This function suffers from multiple issues. > > First one is that pskb_may_pull() may reallocate skb->head, > so the 'raw' pointer needs either to be reloaded or not used at all. > > Second issue is that NEXTHDR_DEST

Re: [RFC PATCH net-next 0/5] bridge: per vlan lwt and dst_metadata support

2017-01-23 Thread Roopa Prabhu
On 1/23/17, 8:24 AM, Jiri Benc wrote: > On Mon, 23 Jan 2017 08:13:30 -0800, Roopa Prabhu wrote: >> And, a 'vlan-to-tunid' mapping is a very common configuration in L2 ethernet >> vpn configurations. > You have one particular and narrow use case in mind and are proposing a > rather large patchset

[PATCH net-next 2/2] ipv6: fix ip6_tnl_parse_tlv_enc_lim()

2017-01-23 Thread Eric Dumazet
This function suffers from multiple issues. First one is that pskb_may_pull() may reallocate skb->head, so the 'raw' pointer needs either to be reloaded or not used at all. Second issue is that NEXTHDR_DEST handling does not validate that the options are present in skb->data, so we might read

[PATCH net 0/2] ipv6: fix ip6_tnl_parse_tlv_enc_lim() issues

2017-01-23 Thread Eric Dumazet
First patch fixes ip6_tnl_parse_tlv_enc_lim() callers, bug added in linux-3.7 Second patch fixes ip6_tnl_parse_tlv_enc_lim() itself, bug predates linux-2.6.12 Based on a report from Dmitry Vyukov, thanks to KASAN. Eric Dumazet (2): ip6_tunnel: must reload ipv6h in ip6ip6_tnl_xmit() ipv6:

[PATCH net-next 1/2] ip6_tunnel: must reload ipv6h in ip6ip6_tnl_xmit()

2017-01-23 Thread Eric Dumazet
Since ip6_tnl_parse_tlv_enc_lim() can call pskb_may_pull(), we must reload any pointer that was related to skb->head (or skb->data), or risk use after free. Fixes: c12b395a4664 ("gre: Support GRE over IPv6") Signed-off-by: Eric Dumazet Cc: Dmitry Kozlov ---

Re: [patch net-next 1/4] net: Introduce psample, a new genetlink channel for packet sampling

2017-01-23 Thread Stephen Hemminger
On Sun, 22 Jan 2017 12:44:44 +0100 Jiri Pirko wrote: > +static LIST_HEAD(psample_groups_list); > +static DEFINE_SPINLOCK(psample_groups_lock); > + Why not a mutex? You aren't acquiring this in IRQ context?

[RFC PATCH] mlx5: Fix page rfcnt issue

2017-01-23 Thread Tom Herbert
This patch is an FYI about possible issuses in mlx5. There are two issues we discovered in the mlx5 backport from 4.9 to 4.6... The bad behaviours we were seeing was a refcnts going to less than zero and eventually killing hosts. We've only seen this running a real application work load and it

Re: sk_buff and reference counting netdev pointers

2017-01-23 Thread Cong Wang
On Mon, Jan 23, 2017 at 2:37 PM, Joel Cunningham wrote: > Hi, > > I’m working on a research effort to understand the synchronization mechanisms > for accessing and modifying a struct net_device object. One area that isn’t > clear is the net device pointer (dev) stored

sk_buff and reference counting netdev pointers

2017-01-23 Thread Joel Cunningham
Hi, I’m working on a research effort to understand the synchronization mechanisms for accessing and modifying a struct net_device object. One area that isn’t clear is the net device pointer (dev) stored in a struct sk_buff. From my investigation, the pointer appears to be assigned without

Re: [PATCH 2/3] ath10k: use dma_zalloc_coherent()

2017-01-23 Thread Joe Perches
On Mon, 2017-01-23 at 15:04 +, Srinivas Kandagatla wrote: > use dma_zalloc_coherent() instead of dma_alloc_coherent and memset(). [] > diff --git a/drivers/net/wireless/ath/ath10k/pci.c > b/drivers/net/wireless/ath/ath10k/pci.c [] > @@ -896,7 +896,7 @@ static int

Re: [PATCH net-next 3/3] net/tcp-fastopen: Add new API support

2017-01-23 Thread Willy Tarreau
On Mon, Jan 23, 2017 at 02:57:31PM -0800, Wei Wang wrote: > Yes. That seems to be a valid fix to it. > Let me try it with my existing test cases as well to see if it works for > all scenarios I have. Perfect. Note that since the state 2 is transient I initially thought about abusing the flags

Re: Question about veth_xmit()

2017-01-23 Thread Cong Wang
On Mon, Jan 23, 2017 at 2:05 PM, Eric Dumazet wrote: > On Mon, 2017-01-23 at 13:46 -0800, Xiangning Yu wrote: >> On Mon, Jan 23, 2017 at 12:56 PM, Cong Wang wrote: >> > On Mon, Jan 23, 2017 at 10:46 AM, Xiangning Yu >> >

Re: [PATCH net-next 3/3] net/tcp-fastopen: Add new API support

2017-01-23 Thread Willy Tarreau
On Mon, Jan 23, 2017 at 11:01:21PM +0100, Willy Tarreau wrote: > On Mon, Jan 23, 2017 at 10:37:32PM +0100, Willy Tarreau wrote: > > On Mon, Jan 23, 2017 at 01:28:53PM -0800, Wei Wang wrote: > > > Hi Willy, > > > > > > True. If you call connect() multiple times on a socket which already has > > >

Re: [net PATCH v5 6/6] virtio_net: XDP support for adjust_head

2017-01-23 Thread Michael S. Tsirkin
On Mon, Jan 23, 2017 at 02:12:47PM -0800, John Fastabend wrote: > On 17-01-23 12:09 PM, Michael S. Tsirkin wrote: > > On Mon, Jan 23, 2017 at 09:22:36PM +0200, Michael S. Tsirkin wrote: > >> On Tue, Jan 17, 2017 at 02:22:59PM -0800, John Fastabend wrote: > >>> diff --git a/drivers/net/virtio_net.c

Re: XDP offload to hypervisor

2017-01-23 Thread Michael S. Tsirkin
On Mon, Jan 23, 2017 at 01:56:16PM -0800, John Fastabend wrote: > On 17-01-23 01:40 PM, Michael S. Tsirkin wrote: > > I've been thinking about passing XDP programs from guest to the > > hypervisor. Basically, after getting an incoming packet, we could run > > an XDP program in host kernel. > > >

Re: [net PATCH v5 6/6] virtio_net: XDP support for adjust_head

2017-01-23 Thread John Fastabend
On 17-01-23 12:09 PM, Michael S. Tsirkin wrote: > On Mon, Jan 23, 2017 at 09:22:36PM +0200, Michael S. Tsirkin wrote: >> On Tue, Jan 17, 2017 at 02:22:59PM -0800, John Fastabend wrote: >>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c >>> index 62dbf4b..3b129b4 100644 >>> ---

Re: [PATCH net-next 3/3] net/tcp-fastopen: Add new API support

2017-01-23 Thread Willy Tarreau
On Mon, Jan 23, 2017 at 10:37:32PM +0100, Willy Tarreau wrote: > On Mon, Jan 23, 2017 at 01:28:53PM -0800, Wei Wang wrote: > > Hi Willy, > > > > True. If you call connect() multiple times on a socket which already has > > cookie without a write(), the second and onward connect() call will return

Re: Question about veth_xmit()

2017-01-23 Thread Eric Dumazet
On Mon, 2017-01-23 at 13:46 -0800, Xiangning Yu wrote: > On Mon, Jan 23, 2017 at 12:56 PM, Cong Wang wrote: > > On Mon, Jan 23, 2017 at 10:46 AM, Xiangning Yu > > wrote: > >> Hi netdev folks, > >> > >> It looks like we call dev_forward_skb() in

Re: [net PATCH v5 1/6] virtio_net: use dev_kfree_skb for small buffer XDP receive

2017-01-23 Thread John Fastabend
On 17-01-23 01:08 PM, Michael S. Tsirkin wrote: > On Tue, Jan 17, 2017 at 02:19:50PM -0800, John Fastabend wrote: >> In the small buffer case during driver unload we currently use >> put_page instead of dev_kfree_skb. Resolve this by adding a check >> for virtnet mode when checking XDP queue type.

Re: XDP offload to hypervisor

2017-01-23 Thread John Fastabend
On 17-01-23 01:40 PM, Michael S. Tsirkin wrote: > I've been thinking about passing XDP programs from guest to the > hypervisor. Basically, after getting an incoming packet, we could run > an XDP program in host kernel. > Interesting. I am planning on adding XDP to tun driver. My use case is we

Re: [PULL] vhost: cleanups and fixes

2017-01-23 Thread Linus Torvalds
On Mon, Jan 23, 2017 at 7:05 AM, Michael S. Tsirkin wrote: > > virtio, vhost: fixes, cleanups Was there a reason why you sent this twice? Or was this *supposed* to be the ARM DMA fix pull request? Because it wasn't. Linus

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread Andy Lutomirski
On Mon, Jan 23, 2017 at 1:03 PM, David Ahern wrote: > On 1/23/17 1:36 PM, Andy Lutomirski wrote: >> To see how cgroup+bpf interacts with network namespaces, I wrote a >> little program called show_bind that calls getsockopt(..., >> SO_BINDTODEVICE, ...) and prints the

Re: Question about veth_xmit()

2017-01-23 Thread Xiangning Yu
On Mon, Jan 23, 2017 at 12:56 PM, Cong Wang wrote: > On Mon, Jan 23, 2017 at 10:46 AM, Xiangning Yu wrote: >> Hi netdev folks, >> >> It looks like we call dev_forward_skb() in veth_xmit(), which calls >> netif_rx() eventually. >> >> While

XDP offload to hypervisor

2017-01-23 Thread Michael S. Tsirkin
I've been thinking about passing XDP programs from guest to the hypervisor. Basically, after getting an incoming packet, we could run an XDP program in host kernel. If the result is XDP_DROP or XDP_TX we don't need to wake up the guest at all! When using tun for networking - especially with

Re: [PATCH net-next 3/3] net/tcp-fastopen: Add new API support

2017-01-23 Thread Willy Tarreau
On Mon, Jan 23, 2017 at 01:28:53PM -0800, Wei Wang wrote: > Hi Willy, > > True. If you call connect() multiple times on a socket which already has > cookie without a write(), the second and onward connect() call will return > EINPROGRESS. > It is basically because the following code block in

Re: [PATCH net-next 3/3] net/tcp-fastopen: Add new API support

2017-01-23 Thread Willy Tarreau
Hi Wei, first, thanks a lot for doing this, it's really awesome! I'm testing it on 4.9 on haproxy and I met a corner case : when I perform a connect() to a server and I have nothing to send, upon POLLOUT notification since I have nothing to send I simply probe the connection using connect()

Re: [PATCH v4 0/3] bpf: add longest prefix match map

2017-01-23 Thread David Miller
From: Daniel Mack Date: Sat, 21 Jan 2017 17:26:10 +0100 > This patch set adds a longest prefix match algorithm that can be used > to match IP addresses to a stored set of ranges. It is exposed as a > bpf map type. > > Internally, data is stored in an unbalanced tree of

Re: [net PATCH v5 1/6] virtio_net: use dev_kfree_skb for small buffer XDP receive

2017-01-23 Thread Michael S. Tsirkin
On Tue, Jan 17, 2017 at 02:19:50PM -0800, John Fastabend wrote: > In the small buffer case during driver unload we currently use > put_page instead of dev_kfree_skb. Resolve this by adding a check > for virtnet mode when checking XDP queue type. Also name the > function so that the code reads

Re: [PATCH net-next 1/2] vxlan: don't flush static fdb entries on admin down

2017-01-23 Thread David Miller
From: Roopa Prabhu Date: Fri, 20 Jan 2017 23:43:18 -0800 > /* Purge the forwarding table */ > -static void vxlan_flush(struct vxlan_dev *vxlan) > +static void vxlan_flush(struct vxlan_dev *vxlan, int do_all) Please use 'bool' and true/false for this new argument.

Re: [PATCH v2] bpf: Restrict cgroup bpf hooks to the init netns

2017-01-23 Thread David Ahern
On 1/23/17 1:36 PM, Andy Lutomirski wrote: > To see how cgroup+bpf interacts with network namespaces, I wrote a > little program called show_bind that calls getsockopt(..., > SO_BINDTODEVICE, ...) and prints the result. It did this: > > # ./ip link add dev vrf0 type vrf table 10 > # ./ip vrf

Re: [PATCH v2] net: xilinx: constify net_device_ops structure

2017-01-23 Thread David Miller
From: Bhumika Goyal Date: Sat, 21 Jan 2017 12:28:58 +0530 > Declare net_device_ops structure as const as it is only stored in > the netdev_ops field of a net_device structure. This field is of type > const, so net_device_ops structures having same properties can be made >

Re: [PATCH v2] net: moxa: constify net_device_ops structures

2017-01-23 Thread David Miller
From: Bhumika Goyal Date: Sat, 21 Jan 2017 12:27:26 +0530 > Declare net_device_ops structure as const as it is only stored in > the netdev_ops field of a net_device structure. This field is of type > const, so net_device_ops structures having same properties can be made >

Re: [RFC PATCH net-next 2/5] net: split skb_checksum_help

2017-01-23 Thread Tom Herbert
On Mon, Jan 23, 2017 at 8:52 AM, Davide Caratti wrote: > skb_checksum_help is designed to compute the Internet Checksum only. To > avoid duplicating code when other checksumming algorithms (e.g. crc32c) > are used, separate common part from RFC1624-specific part. > >

  1   2   3   >