Re: [PATCH net] sctp: validate chunk len before actually using it

2016-10-25 Thread Xin Long
On Wed, Oct 26, 2016 at 12:27 AM, Marcelo Ricardo Leitner wrote: > Andrey Konovalov reported that KASAN detected that SCTP was using a slab > beyond the boundaries. It was caused because when handling out of the > blue packets in function sctp_sf_ootb() it was checking

Re: [PATCH net] packet: on direct_xmit, limit tso and csum to supported devices

2016-10-25 Thread Willem de Bruijn
On Tue, Oct 25, 2016 at 8:57 PM, Eric Dumazet wrote: > On Tue, 2016-10-25 at 20:28 -0400, Willem de Bruijn wrote: >> From: Willem de Bruijn >> >> When transmitting on a packet socket with PACKET_VNET_HDR and >> PACKET_QDISC_BYPASS, validate device

Re: [PATCH net-next 2/3] bpf: Add new cgroups prog type to enable sock modifications

2016-10-25 Thread David Ahern
On 10/25/16 8:48 PM, Eric Dumazet wrote: > Maybe I do not understand how you plan to use this. > > Let say you want a filter to force a BIND_TO_DEVICE xxx because a task > runs in a cgroup yyy > > Then a program doing a socket() + connect (127.0.0.1) will fail ? maybe. VRF devices can have

Re: [PATCH net-next 2/3] bpf: Add new cgroups prog type to enable sock modifications

2016-10-25 Thread Eric Dumazet
On Tue, 2016-10-25 at 20:21 -0600, David Ahern wrote: > On 10/25/16 5:39 PM, Eric Dumazet wrote: > > On Tue, 2016-10-25 at 15:30 -0700, David Ahern wrote: > >> Add new cgroup based program type, BPF_PROG_TYPE_CGROUP_SOCK. Similar to > >> BPF_PROG_TYPE_CGROUP_SKB programs can be attached to a

[PATCH v2 3/5] kconfig: regenerate *.c_shipped files after previous changes

2016-10-25 Thread Nicolas Pitre
Signed-off-by: Nicolas Pitre --- scripts/kconfig/zconf.hash.c_shipped | 228 ++--- scripts/kconfig/zconf.tab.c_shipped | 1631 -- 2 files changed, 888 insertions(+), 971 deletions(-) diff --git a/scripts/kconfig/zconf.hash.c_shipped

[PATCH v2 5/5] posix-timers: make it configurable

2016-10-25 Thread Nicolas Pitre
Some embedded systems have no use for them. This removes about 22KB from the kernel binary size when configured out. Corresponding syscalls are routed to a stub logging the attempt to use those syscalls which should be enough of a clue if they were disabled without proper consideration. They

[PATCH v2 1/5] kconfig: introduce the "imply" keyword

2016-10-25 Thread Nicolas Pitre
The "imply" keyword is a weak version of "select" where the target config symbol can still be turned off, avoiding those pitfalls that come with the "select" keyword. This is useful e.g. with multiple drivers that want to indicate their ability to hook into a given subsystem while still being

Re: [PATCH net-next 2/3] bpf: Add new cgroups prog type to enable sock modifications

2016-10-25 Thread David Ahern
On 10/25/16 7:55 PM, Alexei Starovoitov wrote: > Same question as Daniel... why extra helper? It can be dropped. wrong path while learning this code. > If program overwrites bpf_sock->sk_bound_dev_if can we use that > after program returns? > Also do you think it's possible to extend this patch

[PATCH v2 4/5] ptp_clock: allow for it to be optional

2016-10-25 Thread Nicolas Pitre
In order to break the hard dependency between the PTP clock subsystem and ethernet drivers capable of being clock providers, this patch provides simple PTP stub functions to allow linkage of those drivers into the kernel even when the PTP subsystem is configured out. Drivers must be ready to

[PATCH v2 2/5] kconfig: introduce the "suggest" keyword

2016-10-25 Thread Nicolas Pitre
Similar to "imply" but with no added restrictions on the target symbol's value. Useful for providing a default value to another symbol. Suggested by Edward Cree. Signed-off-by: Nicolas Pitre --- Documentation/kbuild/kconfig-language.txt | 6 ++ scripts/kconfig/expr.h

[no subject]

2016-10-25 Thread Nicolas Pitre
From: Nicolas Pitre Subject: [PATCH v2 0/5] make POSIX timers optional with some Kconfig help Many embedded systems don't need the full POSIX timer support. Configuring them out provides a nice kernel image size reduction. When POSIX timers are configured out, the PTP

Re: [PATCH net-next 2/3] bpf: Add new cgroups prog type to enable sock modifications

2016-10-25 Thread David Ahern
On 10/25/16 5:39 PM, Eric Dumazet wrote: > On Tue, 2016-10-25 at 15:30 -0700, David Ahern wrote: >> Add new cgroup based program type, BPF_PROG_TYPE_CGROUP_SOCK. Similar to >> BPF_PROG_TYPE_CGROUP_SKB programs can be attached to a cgroup and run >> any time a process in the cgroup opens an AF_INET

[PATCH] ip6_tunnel: Update skb->protocol to ETH_P_IPV6 in ip6_tnl_xmit()

2016-10-25 Thread Eli Cooper
This patch updates skb->protocol to ETH_P_IPV6 in ip6_tnl_xmit() when an IPv6 header is installed to a socket buffer. This is not a cosmetic change. Without updating this value, GSO packets transmitted through an ipip6 tunnel have the protocol of ETH_P_IP and skb_mac_gso_segment() will attempt

Re: [PATCH net-next 2/3] bpf: Add new cgroups prog type to enable sock modifications

2016-10-25 Thread David Ahern
On 10/25/16 5:28 PM, Daniel Borkmann wrote: >> +BPF_CALL_3(bpf_sock_store_u32, struct sock *, sk, u32, offset, u32, val) >> +{ >> +u8 *ptr = (u8 *)sk; >> + >> +if (unlikely(offset > sizeof(*sk))) >> +return -EFAULT; >> + >> +*((u32 *)ptr) = val; >> + >> +return 0; >> +} >

Re: [PATCH net-next 2/3] bpf: Add new cgroups prog type to enable sock modifications

2016-10-25 Thread Alexei Starovoitov
On Wed, Oct 26, 2016 at 01:28:24AM +0200, Daniel Borkmann wrote: > On 10/26/2016 12:30 AM, David Ahern wrote: > >Add new cgroup based program type, BPF_PROG_TYPE_CGROUP_SOCK. Similar to > >BPF_PROG_TYPE_CGROUP_SKB programs can be attached to a cgroup and run > >any time a process in the cgroup

Re: [PATCH net] bpf: fix samples to add fake KBUILD_MODNAME

2016-10-25 Thread Alexei Starovoitov
On Wed, Oct 26, 2016 at 12:37:53AM +0200, Daniel Borkmann wrote: > Some of the sample files are causing issues when they are loaded with tc > and cls_bpf, meaning tc bails out while trying to parse the resulting ELF > file as program/map/etc sections are not present, which can be easily > spotted

[PATCH net-next V3 8/9] liquidio CN23XX: copyrights changes and alignment

2016-10-25 Thread Raghu Vatsavayi
Updated copyrights comments and also changed some other comments alignments. Signed-off-by: Raghu Vatsavayi Signed-off-by: Derek Chickles Signed-off-by: Satanand Burla Signed-off-by:

[PATCH net-next V3 4/9] liquidio CN23XX: mailbox interrupt processing

2016-10-25 Thread Raghu Vatsavayi
Adds support for mailbox interrupt processing of various commands. Signed-off-by: Raghu Vatsavayi Signed-off-by: Derek Chickles Signed-off-by: Satanand Burla Signed-off-by: Felix Manlunas

[PATCH net-next V3 9/9] liquidio CN23XX: fix for new check patch errors

2016-10-25 Thread Raghu Vatsavayi
New checkpatch script shows some errors with pre-existing driver. This patch provides fix for those errors. Signed-off-by: Raghu Vatsavayi Signed-off-by: Derek Chickles Signed-off-by: Satanand Burla

[PATCH net-next V3 6/9] liquidio CN23XX: device states

2016-10-25 Thread Raghu Vatsavayi
Cleaned up resource leaks during destroy resources by introducing more device states. Signed-off-by: Raghu Vatsavayi Signed-off-by: Derek Chickles Signed-off-by: Satanand Burla

[PATCH net-next V3 5/9] liquidio CN23XX: VF related operations

2016-10-25 Thread Raghu Vatsavayi
Adds support for VF related operations like mac address vlan and link changes. Signed-off-by: Raghu Vatsavayi Signed-off-by: Derek Chickles Signed-off-by: Satanand Burla Signed-off-by:

[PATCH net-next V3 0/9] liquidio CN23XX VF support

2016-10-25 Thread Raghu Vatsavayi
Dave, Following is the V3 patch series for adding VF support on CN23XX devices. This version addressed: 1) Your concern for ordering of local variable declarations from longest to shortest line. 2) As recommended by you removed custom module parameter max_vfs. 3) Minor changes for fixing new

[PATCH net-next V3 1/9] liquidio CN23XX: HW config for VF support

2016-10-25 Thread Raghu Vatsavayi
Adds support for configuring HW for creating VFs. Signed-off-by: Raghu Vatsavayi Signed-off-by: Derek Chickles Signed-off-by: Satanand Burla Signed-off-by: Felix Manlunas

[PATCH net-next V3 7/9] liquidio CN23XX: code cleanup

2016-10-25 Thread Raghu Vatsavayi
Cleaned up unnecessary comments and added some minor macros. Signed-off-by: Raghu Vatsavayi Signed-off-by: Derek Chickles Signed-off-by: Satanand Burla Signed-off-by: Felix Manlunas

[PATCH net-next V3 3/9] liquidio CN23XX: Mailbox support

2016-10-25 Thread Raghu Vatsavayi
Adds support for mailbox communication between PF and VF. Signed-off-by: Raghu Vatsavayi Signed-off-by: Derek Chickles Signed-off-by: Satanand Burla Signed-off-by: Felix Manlunas

[PATCH net-next V3 2/9] liquidio CN23XX: sysfs VF config support

2016-10-25 Thread Raghu Vatsavayi
Adds sysfs based support for enabling or disabling VFs. Signed-off-by: Raghu Vatsavayi Signed-off-by: Derek Chickles Signed-off-by: Satanand Burla Signed-off-by: Felix Manlunas

Re: [PATCH net] packet: on direct_xmit, limit tso and csum to supported devices

2016-10-25 Thread Eric Dumazet
On Tue, 2016-10-25 at 20:28 -0400, Willem de Bruijn wrote: > From: Willem de Bruijn > > When transmitting on a packet socket with PACKET_VNET_HDR and > PACKET_QDISC_BYPASS, validate device support for features requested > in vnet_hdr. You probably need to add an

[PATCH net] packet: on direct_xmit, limit tso and csum to supported devices

2016-10-25 Thread Willem de Bruijn
From: Willem de Bruijn When transmitting on a packet socket with PACKET_VNET_HDR and PACKET_QDISC_BYPASS, validate device support for features requested in vnet_hdr. Drop TSO packets sent to devices that do not support TSO or have the feature disabled. Note that the latter

Re: [PATCH] net: Reset skb to network header in neigh_hh_output

2016-10-25 Thread Eric Dumazet
On Wed, 2016-10-26 at 01:57 +0200, Abdelrhman Ahmed wrote: > > What is the issue you want to fix exactly ? > > Please describe the use case. > > When netfilter hook uses skb_push to add a specific header between network > header and hardware header. > For the first time(s) before caching

[PATCH net-next] ibmveth: v1 calculate correct gso_size and set gso_type

2016-10-25 Thread Jon Maxwell
We recently encountered a bug where a few customers using ibmveth on the same LPAR hit an issue where a TCP session hung when large receive was enabled. Closer analysis revealed that the session was stuck because the one side was advertising a zero window repeatedly. We narrowed this down to

Re: [PATCH] net: Reset skb to network header in neigh_hh_output

2016-10-25 Thread Abdelrhman Ahmed
> What is the issue you want to fix exactly ? > Please describe the use case. When netfilter hook uses skb_push to add a specific header between network header and hardware header. For the first time(s) before caching hardware header, this header will be removed / overwritten by hardware

Re: [PATCH net-next 2/3] bpf: Add new cgroups prog type to enable sock modifications

2016-10-25 Thread Eric Dumazet
On Tue, 2016-10-25 at 15:30 -0700, David Ahern wrote: > Add new cgroup based program type, BPF_PROG_TYPE_CGROUP_SOCK. Similar to > BPF_PROG_TYPE_CGROUP_SKB programs can be attached to a cgroup and run > any time a process in the cgroup opens an AF_INET or AF_INET6 socket. > Currently only

Re: [PATCH net-next 2/3] bpf: Add new cgroups prog type to enable sock modifications

2016-10-25 Thread Daniel Borkmann
On 10/26/2016 12:30 AM, David Ahern wrote: Add new cgroup based program type, BPF_PROG_TYPE_CGROUP_SOCK. Similar to BPF_PROG_TYPE_CGROUP_SKB programs can be attached to a cgroup and run any time a process in the cgroup opens an AF_INET or AF_INET6 socket. Currently only sk_bound_dev_if is

Re: [PATCH net-next 1/3] bpf: Refactor cgroups code in prep for new type

2016-10-25 Thread David Ahern
On 10/25/16 5:01 PM, Daniel Borkmann wrote: >> diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c >> index a0ab43f264b0..918c01a6f129 100644 >> --- a/kernel/bpf/cgroup.c >> +++ b/kernel/bpf/cgroup.c >> @@ -117,6 +117,19 @@ void __cgroup_bpf_update(struct cgroup *cgrp, >> } >> } >> >>

[PATCH] uapi: Fix userspace compilation of ip_tables.h/ip6_tables.h in C++ mode

2016-10-25 Thread Jason Gunthorpe
The implicit cast from void * is not allowed for C++ compilers, and the arithmetic on void * generates warnings if a C++ application tries to include these UAPI headers. $ g++ -c t.cc ip_tables.h:221:24: warning: pointer of type 'void *' used in arithmetic ip_tables.h:221:24: error: invalid

Re: [PATCH net-next 1/3] bpf: Refactor cgroups code in prep for new type

2016-10-25 Thread Daniel Borkmann
On 10/26/2016 12:30 AM, David Ahern wrote: Code move only; no functional change intended. Not quite, see below. Signed-off-by: David Ahern --- kernel/bpf/cgroup.c | 27 ++- kernel/bpf/syscall.c | 28 +++- 2 files

Re: [PATCH net] inet: Fix missing return value in inet6_hash

2016-10-25 Thread Soheil Hassas Yeganeh
On Tue, Oct 25, 2016 at 6:08 PM, Craig Gallek wrote: > From: Craig Gallek > > As part of a series to implement faster SO_REUSEPORT lookups, > commit 086c653f5862 ("sock: struct proto hash function may error") > added return values to protocol hash

[PATCH net] bpf: fix samples to add fake KBUILD_MODNAME

2016-10-25 Thread Daniel Borkmann
Some of the sample files are causing issues when they are loaded with tc and cls_bpf, meaning tc bails out while trying to parse the resulting ELF file as program/map/etc sections are not present, which can be easily spotted with readelf(1). Currently, BPF samples are including some of the kernel

[PATCH net-next 2/3] bpf: Add new cgroups prog type to enable sock modifications

2016-10-25 Thread David Ahern
Add new cgroup based program type, BPF_PROG_TYPE_CGROUP_SOCK. Similar to BPF_PROG_TYPE_CGROUP_SKB programs can be attached to a cgroup and run any time a process in the cgroup opens an AF_INET or AF_INET6 socket. Currently only sk_bound_dev_if is exported to userspace for modification by a bpf

[PATCH net-next 1/3] bpf: Refactor cgroups code in prep for new type

2016-10-25 Thread David Ahern
Code move only; no functional change intended. Signed-off-by: David Ahern --- kernel/bpf/cgroup.c | 27 ++- kernel/bpf/syscall.c | 28 +++- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git

[PATCH net-next 3/3] samples: bpf: add userspace example for modifying sk_bound_dev_if

2016-10-25 Thread David Ahern
Add a simple program to demonstrate the ability to attach a bpf program to a cgroup that sets sk_bound_dev_if for AF_INET{6} sockets when they are created. Signed-off-by: David Ahern --- samples/bpf/Makefile | 2 ++ samples/bpf/bpf_helpers.h | 2 ++

[PATCH net-next 0/3] Add bpf support to set sk_bound_dev_if

2016-10-25 Thread David Ahern
The recently added VRF support in Linux leverages the bind-to-device API for programs to specify an L3 domain for a socket. While SO_BINDTODEVICE has been around for ages, not every ipv4/ipv6 capable program has support for it. Even for those programs that do support it, the API requires processes

[PATCH net] inet: Fix missing return value in inet6_hash

2016-10-25 Thread Craig Gallek
From: Craig Gallek As part of a series to implement faster SO_REUSEPORT lookups, commit 086c653f5862 ("sock: struct proto hash function may error") added return values to protocol hash functions and commit 496611d7b5ea ("inet: create IPv6-equivalent inet_hash function")

Re: [net-next PATCH 04/27] arch/arc: Add option to skip sync on DMA mapping

2016-10-25 Thread Vineet Gupta
On 10/25/2016 02:38 PM, Alexander Duyck wrote: > This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to > avoid invoking cache line invalidation if the driver will just handle it > later via a sync_for_cpu or sync_for_device call. > > Cc: Vineet Gupta > Cc:

[net-next PATCH 05/27] arch/arm: Add option to skip sync on DMA map and unmap

2016-10-25 Thread Alexander Duyck
The use of DMA_ATTR_SKIP_CPU_SYNC was not consistent across all of the DMA APIs in the arch/arm folder. This change is meant to correct that so that we get consistent behavior. Cc: Russell King Signed-off-by: Alexander Duyck ---

[net-next PATCH 04/27] arch/arc: Add option to skip sync on DMA mapping

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it later via a sync_for_cpu or sync_for_device call. Cc: Vineet Gupta Cc: linux-snps-...@lists.infradead.org Signed-off-by: Alexander

[net-next PATCH 07/27] arch/blackfin: Add option to skip sync on DMA map

2016-10-25 Thread Alexander Duyck
The use of DMA_ATTR_SKIP_CPU_SYNC was not consistent across all of the DMA APIs in the arch/arm folder. This change is meant to correct that so that we get consistent behavior. Cc: Steven Miao Signed-off-by: Alexander Duyck ---

[net-next PATCH 22/27] arch/xtensa: Add option to skip DMA sync as a part of mapping

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: Max Filippov Signed-off-by: Alexander Duyck ---

[net-next PATCH 01/27] swiotlb: Drop unused function swiotlb_map_sg

2016-10-25 Thread Alexander Duyck
There are no users for swiotlb_map_sg so we might as well just drop it. Acked-by: Konrad Rzeszutek Wilk Signed-off-by: Alexander Duyck --- include/linux/swiotlb.h |4 lib/swiotlb.c |8 2 files changed, 12

[net-next PATCH 03/27] swiotlb: Add support for DMA_ATTR_SKIP_CPU_SYNC

2016-10-25 Thread Alexander Duyck
As a first step to making DMA_ATTR_SKIP_CPU_SYNC apply to architectures beyond just ARM I need to make it so that the swiotlb will respect the flag. In order to do that I also need to update the swiotlb-xen since it heavily makes use of the functionality. Cc: Konrad Rzeszutek Wilk

[net-next PATCH 23/27] dma: Add calls for dma_map_page_attrs and dma_unmap_page_attrs

2016-10-25 Thread Alexander Duyck
Add support for mapping and unmapping a page with attributes. The primary use for this is currently to allow for us to pass the DMA_ATTR_SKIP_CPU_SYNC attribute when mapping and unmapping a page. On some architectures such as ARM the synchronization has significant overhead and if we are already

[net-next PATCH 24/27] mm: Add support for releasing multiple instances of a page

2016-10-25 Thread Alexander Duyck
This patch adds a function that allows us to batch free a page that has multiple references outstanding. Specifically this function can be used to drop a page being used in the page frag alloc cache. With this drivers can make use of functionality similar to the page frag alloc cache without

[RFC PATCH ethtool 1/2] ethtool-copy.h: sync with net

2016-10-25 Thread Vidya Sagar Ravipati
From: Vidya Sagar Ravipati Sending out this review as RFC to get early feedback on fec options and output changes as changes to kernel uapi to ethtool is under review on netdev currently and might change based on review.. http://patchwork.ozlabs.org/patch/686293/

[net-next PATCH 08/27] arch/c6x: Add option to skip sync on DMA map and unmap

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it later via a sync_for_cpu or sync_for_device call. Cc: Mark Salter Cc: Aurelien Jacquiot Signed-off-by:

[net-next PATCH 18/27] arch/powerpc: Add option to skip DMA sync as a part of mapping

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael

[net-next PATCH 20/27] arch/sparc: Add option to skip DMA sync as a part of map and unmap

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: "David S. Miller" Cc: sparcli...@vger.kernel.org Signed-off-by: Alexander Duyck

[net-next PATCH 21/27] arch/tile: Add option to skip DMA sync as a part of map and unmap

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: Chris Metcalf Signed-off-by: Alexander Duyck ---

[RFC PATCH ethtool 0/2] ethtool: Add support for FEC encoding configuration

2016-10-25 Thread Vidya Sagar Ravipati
From: Vidya Sagar Ravipati Forward Error Correction (FEC) modes i.e Base-R and Reed-Solomon modes are introduced in 25G/40G/100G standards for providing good BER at high speeds. Various networking devices which support 25G/40G/100G provides ability to manage supported

[RFC PATCH ethtool 2/2] ethtool: Support for FEC encoding control

2016-10-25 Thread Vidya Sagar Ravipati
From: Vidya Sagar Ravipati As FEC settings and different FEC modes are mandatory and configurable across various interfaces of 25G/50G/100G/40G , the lack of FEC encoding control and reporting today is a source for interoperability issues for many vendors

[net-next PATCH 15/27] arch/nios2: Add option to skip DMA sync as a part of map and unmap

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: Ley Foon Tan Signed-off-by: Alexander Duyck ---

[net-next PATCH 19/27] arch/sh: Add option to skip DMA sync as a part of mapping

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: Yoshinori Sato Cc: Rich Felker Cc:

[net-next PATCH 13/27] arch/microblaze: Add option to skip DMA sync as a part of map and unmap

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: Michal Simek Signed-off-by: Alexander Duyck ---

[net-next PATCH 00/27] Add support for DMA writable pages being writable by the network stack

2016-10-25 Thread Alexander Duyck
The first 22 patches in the set add support for the DMA attribute DMA_ATTR_SKIP_CPU_SYNC on multiple platforms/architectures. This is needed so that we can flag the calls to dma_map/unmap_page so that we do not invalidate cache lines that do not currently belong to the device. Instead we have to

[net-next PATCH 10/27] arch/hexagon: Add option to skip DMA sync as a part of mapping

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it later via a sync_for_cpu or sync_for_device call. Cc: Richard Kuo Cc: linux-hexa...@vger.kernel.org Signed-off-by: Alexander Duyck

[net-next PATCH 09/27] arch/frv: Add option to skip sync on DMA map

2016-10-25 Thread Alexander Duyck
The use of DMA_ATTR_SKIP_CPU_SYNC was not consistent across all of the DMA APIs in the arch/arm folder. This change is meant to correct that so that we get consistent behavior. Signed-off-by: Alexander Duyck --- arch/frv/mb93090-mb00/pci-dma-nommu.c | 14

[net-next PATCH 11/27] arch/m68k: Add option to skip DMA sync as a part of mapping

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it later via a sync_for_cpu or sync_for_device call. Cc: Geert Uytterhoeven Cc: linux-m...@lists.linux-m68k.org Signed-off-by:

[net-next PATCH 17/27] arch/parisc: Add option to skip DMA sync as a part of map and unmap

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: "James E.J. Bottomley" Cc: Helge Deller Cc:

[net-next PATCH 12/27] arch/metag: Add option to skip DMA sync as a part of map and unmap

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: James Hogan Cc: linux-me...@vger.kernel.org Signed-off-by: Alexander Duyck

[net-next PATCH 14/27] arch/mips: Add option to skip DMA sync as a part of map and unmap

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: Ralf Baechle Cc: Keguang Zhang Cc:

[net-next PATCH 06/27] arch/avr32: Add option to skip sync on DMA map

2016-10-25 Thread Alexander Duyck
The use of DMA_ATTR_SKIP_CPU_SYNC was not consistent across all of the DMA APIs in the arch/arm folder. This change is meant to correct that so that we get consistent behavior. Acked-by: Hans-Christian Noren Egtvedt Signed-off-by: Alexander Duyck

[net-next PATCH 26/27] igb: Update code to better handle incrementing page count

2016-10-25 Thread Alexander Duyck
This patch updates the driver code so that we do bulk updates of the page reference count instead of just incrementing it by one reference at a time. The advantage to doing this is that we cut down on atomic operations and this in turn should give us a slight improvement in cycles per packet. In

[net-next PATCH 27/27] igb: Revert "igb: Revert support for build_skb in igb"

2016-10-25 Thread Alexander Duyck
This reverts commit f9d40f6a9921 ("igb: Revert support for build_skb in igb") and adds a few changes to update it to work with the latest version of igb. We are now able to revert the removal of this due to the fact that with the recent changes to the page count and the use of

[net-next PATCH 16/27] arch/openrisc: Add option to skip DMA sync as a part of mapping

2016-10-25 Thread Alexander Duyck
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to avoid invoking cache line invalidation if the driver will just handle it via a sync_for_cpu or sync_for_device call. Cc: Jonas Bonn Signed-off-by: Alexander Duyck ---

[net-next PATCH 25/27] igb: Update driver to make use of DMA_ATTR_SKIP_CPU_SYNC

2016-10-25 Thread Alexander Duyck
The ARM architecture provides a mechanism for deferring cache line invalidation in the case of map/unmap. This patch makes use of this mechanism to avoid unnecessary synchronization. A secondary effect of this change is that the portion of the page that has been synchronized for use by the CPU

[net-next PATCH 02/27] swiotlb-xen: Enforce return of DMA_ERROR_CODE in mapping function

2016-10-25 Thread Alexander Duyck
The mapping function should always return DMA_ERROR_CODE when a mapping has failed as this is what the DMA API expects when a DMA error has occurred. The current function for mapping a page in Xen was returning either DMA_ERROR_CODE or 0 depending on where it failed. On x86 DMA_ERROR_CODE is 0,

Re: [PATCH net-next] ibmveth: calculate correct gso_size and set gso_type

2016-10-25 Thread Jonathan Maxwell
>> + u16 hdr_len = ETH_HLEN + sizeof(struct tcphdr); > Compiler may optmize this, but maybe move hdr_len to [*] ?> There are other places in the stack where a u16 is used for the same purpose. So I'll rather stick to that convention. I'll make the other formatting changes you suggested and

[PATCH v2] cw1200: fix bogus maybe-uninitialized warning

2016-10-25 Thread Arnd Bergmann
On x86, the cw1200 driver produces a rather silly warning about the possible use of the 'ret' variable without an initialization presumably after being confused by the architecture specific definition of WARN_ON: drivers/net/wireless/st/cw1200/wsm.c: In function ‘wsm_handle_rx’:

Re: [PATCH] cw1200: fix bogus maybe-uninitialized warning

2016-10-25 Thread Arnd Bergmann
On Tuesday, October 25, 2016 1:24:55 PM CEST David Laight wrote: > > diff --git a/drivers/net/wireless/st/cw1200/wsm.c > > b/drivers/net/wireless/st/cw1200/wsm.c > > index 680d60eabc75..094e6637ade2 100644 > > --- a/drivers/net/wireless/st/cw1200/wsm.c > > +++

Re: [PATCH] virtio-net: Update the mtu code to match virtio spec

2016-10-25 Thread Aaron Conole
Aaron Conole writes: >> From: Aaron Conole >> >> The virtio committee recently ratified a change, VIRTIO-152, which >> defines the mtu field to be 'max' MTU, not simply desired MTU. >> >> This commit brings the virtio-net device in compliance with

[PATCH v2 net-next] virtio-net: Update the mtu code to match virtio spec

2016-10-25 Thread Aaron Conole
The virtio committee recently ratified a change, VIRTIO-152, which defines the mtu field to be 'max' MTU, not simply desired MTU. This commit brings the virtio-net device in compliance with VIRTIO-152. Additionally, drop the max_mtu branch - it cannot be taken since the u16 returned by

Re: [PATCH] virtio-net: Update the mtu code to match virtio spec

2016-10-25 Thread Aaron Conole
> From: Aaron Conole > > The virtio committee recently ratified a change, VIRTIO-152, which > defines the mtu field to be 'max' MTU, not simply desired MTU. > > This commit brings the virtio-net device in compliance with VIRTIO-152. > > Additionally, drop the max_mtu branch -

Re: [PATCH net] udp: fix IP_CHECKSUM handling

2016-10-25 Thread Eric Dumazet
On Tue, 2016-10-25 at 15:43 -0400, Willem de Bruijn wrote: > On Sun, Oct 23, 2016 at 9:03 PM, Eric Dumazet wrote: > > From: Eric Dumazet > > > > First bug was added in commit ad6f939ab193 ("ip: Add offset parameter to > > ip_cmsg_recv") : Tom missed

[PATCH v2] netfilter: fix type mismatch with error return from nft_parse_u32_check

2016-10-25 Thread John W. Linville
Commit 36b701fae12ac ("netfilter: nf_tables: validate maximum value of u32 netlink attributes") introduced nft_parse_u32_check with a return value of "unsigned int", yet on error it returns "-ERANGE". This patch corrects the mismatch by changing the return value to "int", which happens to match

Re: [PATCH] netfilter: fix type mismatch with error return from nft_parse_u32_check

2016-10-25 Thread John W. Linville
On Tue, Oct 25, 2016 at 03:08:04PM -0400, John W. Linville wrote: > Commit 36b701fae12ac ("netfilter: nf_tables: validate maximum value of > u32 netlink attributes") introduced nft_parse_u32_check with a return > value of "unsigned int", yet on error it returns "-ERANGE". > > This patch corrects

Re: [PATCH net] udp: fix IP_CHECKSUM handling

2016-10-25 Thread Willem de Bruijn
On Sun, Oct 23, 2016 at 9:03 PM, Eric Dumazet wrote: > From: Eric Dumazet > > First bug was added in commit ad6f939ab193 ("ip: Add offset parameter to > ip_cmsg_recv") : Tom missed that ipv4 udp messages could be received on > AF_INET6 socket.

[PATCH] netfilter: fix type mismatch with error return from nft_parse_u32_check

2016-10-25 Thread John W. Linville
Commit 36b701fae12ac ("netfilter: nf_tables: validate maximum value of u32 netlink attributes") introduced nft_parse_u32_check with a return value of "unsigned int", yet on error it returns "-ERANGE". This patch corrects the mismatch by changing the return value to "int", which happens to match

Re: [PATCH] cw1200: fix bogus maybe-uninitialized warning

2016-10-25 Thread Solomon Peachy
On Tue, Oct 25, 2016 at 01:24:55PM +, David Laight wrote: > > - if (count > 1) { > > - /* We already released one buffer, now for the rest */ > > - ret = wsm_release_tx_buffer(priv, count - 1); > > - if (ret < 0) > > - return ret; > > -

RE: nfs NULL-dereferencing in net-next

2016-10-25 Thread Yotam Gigi
>-Original Message- >From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org] On >Behalf Of Jakub Kicinski >Sent: Monday, October 17, 2016 10:20 PM >To: Andy Adamson ; Anna Schumaker >; linux-...@vger.kernel.org >Cc:

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-25 Thread Jakub Kicinski
On Sat, 22 Oct 2016 04:07:23 +, Shrijeet Mukherjee wrote: > + act = bpf_prog_run_xdp(xdp_prog, ); > + switch (act) { > + case XDP_PASS: > + return XDP_PASS; > + case XDP_TX: > + case XDP_ABORTED: > +

Re: [PATCH 0/2] at803x: don't power-down SGMII link

2016-10-25 Thread Timur Tabi
Zefir Kurtisi wrote: In a device where the ar8031 operates in SGMII mode, we observed that after a suspend-resume cycle in very rare cases the copper side autonegotiation secceeds but the SGMII side fails to come up. As a work-around, a patch was provided that on suspend and resume powers the

Re: [PATCH] virtio-net: Update the mtu code to match virtio spec

2016-10-25 Thread Jarod Wilson
On Tue, Oct 25, 2016 at 12:35:35PM -0400, Aaron Conole wrote: > From: Aaron Conole > > The virtio committee recently ratified a change, VIRTIO-152, which > defines the mtu field to be 'max' MTU, not simply desired MTU. > > This commit brings the virtio-net device in

[PATCH] net: bonding: use new api ethtool_{get|set}_link_ksettings

2016-10-25 Thread Philippe Reynes
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. Signed-off-by: Philippe Reynes --- drivers/net/bonding/bond_main.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git

Re: [PATCH] virtio-net: Update the mtu code to match virtio spec

2016-10-25 Thread Michael S. Tsirkin
On Tue, Oct 25, 2016 at 12:35:35PM -0400, Aaron Conole wrote: > From: Aaron Conole > > The virtio committee recently ratified a change, VIRTIO-152, which > defines the mtu field to be 'max' MTU, not simply desired MTU. > > This commit brings the virtio-net device in

[PATCH] virtio-net: Update the mtu code to match virtio spec

2016-10-25 Thread Aaron Conole
From: Aaron Conole The virtio committee recently ratified a change, VIRTIO-152, which defines the mtu field to be 'max' MTU, not simply desired MTU. This commit brings the virtio-net device in compliance with VIRTIO-152. Additionally, drop the max_mtu branch - it cannot be

[PATCH net] sctp: validate chunk len before actually using it

2016-10-25 Thread Marcelo Ricardo Leitner
Andrey Konovalov reported that KASAN detected that SCTP was using a slab beyond the boundaries. It was caused because when handling out of the blue packets in function sctp_sf_ootb() it was checking the chunk len only after already processing the first chunk, validating only for the 2nd and

RE: [PATCH] netfilter: ip_vs_sync: fix bogus maybe-uninitialized warning

2016-10-25 Thread David Laight
From: Arnd Bergmann > Sent: 24 October 2016 21:22 > On Monday, October 24, 2016 10:47:54 PM CEST Julian Anastasov wrote: > > > diff --git a/net/netfilter/ipvs/ip_vs_sync.c > > > b/net/netfilter/ipvs/ip_vs_sync.c > > > index 1b07578bedf3..9350530c16c1 100644 > > > ---

[PATCH] IB/mlx4: avoid a -Wmaybe-uninitialize warning

2016-10-25 Thread Arnd Bergmann
There is an old warning about mlx4_SW2HW_EQ_wrapper on x86: ethernet/mellanox/mlx4/resource_tracker.c: In function ‘mlx4_SW2HW_EQ_wrapper’: ethernet/mellanox/mlx4/resource_tracker.c:3071:10: error: ‘eq’ may be used uninitialized in this function [-Werror=maybe-uninitialized] The problem here is

Re: [PATCH] [net-next] net: ip, diag: include net/inet_sock.h

2016-10-25 Thread Cyrill Gorcunov
On Tue, Oct 25, 2016 at 05:53:22PM +0200, Arnd Bergmann wrote: > The newly added raw_diag.c fails to build in some configurations > unless we include this header: > > In file included from net/ipv4/raw_diag.c:6:0: > include/net/raw.h:71:21: error: field 'inet' has incomplete type >

[PATCH] [net-next] net: ip, diag: include net/inet_sock.h

2016-10-25 Thread Arnd Bergmann
The newly added raw_diag.c fails to build in some configurations unless we include this header: In file included from net/ipv4/raw_diag.c:6:0: include/net/raw.h:71:21: error: field 'inet' has incomplete type net/ipv4/raw_diag.c: In function 'raw_diag_dump': net/ipv4/raw_diag.c:166:29: error:

Re: [bnx2] [Regression 4.8] Driver loading fails without firmware

2016-10-25 Thread Rick Jones
On 10/25/2016 08:31 AM, Paul Menzel wrote: To my knowledge, the firmware files haven’t changed since years [1]. Indeed - it looks like I read "bnx2" and thought "bnx2x" Must remember to hold-off on replying until after the morning orange juice is consumed :) rick

  1   2   >