[patch net-next v4 07/10] rocker: Register FIB notifier before creating ports

2016-12-03 Thread Jiri Pirko
From: Ido Schimmel We can miss FIB notifications sent between the time the ports were created and the FIB notification block registered. Instead of receiving these notifications only when they are replayed for the FIB notification block during registration, just register

[patch net-next v4 09/10] ipv4: fib: Allow for consistent FIB dumping

2016-12-03 Thread Jiri Pirko
From: Ido Schimmel The next patch will enable listeners of the FIB notification chain to request a dump of the FIB tables. However, since RTNL isn't taken during the dump, it's possible for the FIB tables to change mid-dump, which will result in inconsistency between the

[patch net-next v4 04/10] mlxsw: spectrum_router: Implement FIB offload in deferred work

2016-12-03 Thread Jiri Pirko
From: Ido Schimmel FIB offload is currently done in process context with RTNL held, but we're about to dump the FIB tables in RCU critical section, so we can no longer sleep. Instead, defer the operation to process context using deferred work. Make sure fib info isn't freed

[patch net-next v4 05/10] rocker: Create an ordered workqueue for FIB offload

2016-12-03 Thread Jiri Pirko
From: Ido Schimmel As explained in the previous commits, we need to process FIB entries addition / deletion events in FIFO order or otherwise we can have a mismatch between the kernel's FIB table and the device's. Create an ordered workqueue for rocker to which these work

[patch net-next v4 01/10] ipv4: fib: Export free_fib_info()

2016-12-03 Thread Jiri Pirko
From: Ido Schimmel The FIB notification chain is going to be converted to an atomic chain, which means switchdev drivers will have to offload FIB entries in deferred work, as hardware operations entail sleeping. However, while the work is queued fib info might be freed, so

[patch net-next v4 08/10] ipv4: fib: Convert FIB notification chain to be atomic

2016-12-03 Thread Jiri Pirko
From: Ido Schimmel In order not to hold RTNL for long periods of time we're going to dump the FIB tables using RCU. Convert the FIB notification chain to be atomic, as we can't block in RCU critical sections. Signed-off-by: Ido Schimmel Signed-off-by:

[patch net-next v4 03/10] mlxsw: core: Create an ordered workqueue for FIB offload

2016-12-03 Thread Jiri Pirko
From: Ido Schimmel We're going to start processing FIB entries addition / deletion events in deferred work. These work items must be processed in the order they were submitted or otherwise we can have differences between the kernel's FIB table and the device's. Solve this

Re: [PATCH 1/1] net: ethernet: 3com: set error code on failures

2016-12-03 Thread Pan Bian
From: PanBian Hi, Lino, There is no special reason to map different errors to -EIO. In the original source code, err is set to -EIO on most error paths. I copied that. I guess it has no difference with the error value provided by the called functions in the view of

Re: net: use-after-free in worker_thread

2016-12-03 Thread Andrey Konovalov
On Sat, Dec 3, 2016 at 2:49 PM, Eric Dumazet wrote: > On Sat, 2016-12-03 at 14:05 +0100, Andrey Konovalov wrote: >> On Sat, Dec 3, 2016 at 1:58 PM, Andrey Konovalov >> wrote: >> > +syzkal...@googlegroups.com >> > >> > On Sat, Dec 3, 2016 at 1:56

Re: [PATCH net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog

2016-12-03 Thread Jesper Dangaard Brouer
On Fri, 2 Dec 2016 15:23:30 -0800 Martin KaFai Lau wrote: > -bool bpf_helper_changes_skb_data(void *func) > +BPF_CALL_2(bpf_xdp_adjust_head, struct xdp_buff *, xdp, int, offset) > +{ > + /* Both mlx4 and mlx5 driver align each packet to PAGE_SIZE when > + * XDP prog is

Re: [PATCH net-next 0/4]: Allow head adjustment in XDP prog

2016-12-03 Thread Jesper Dangaard Brouer
On Fri, 2 Dec 2016 15:23:29 -0800 Martin KaFai Lau wrote: > This series adds a helper to allow head adjustment in XDP prog. mlx4 > driver has been modified to support this feature. An example is written > to encapsulate a packet with an IPv4/v6 header and then XDP_TX it > out.

Re: [PATCH v2 net] ixgbevf: fix invalid uses of napi_hash_del()

2016-12-03 Thread Eric Dumazet
On Wed, 2016-11-16 at 07:26 -0800, Eric Dumazet wrote: > From: Eric Dumazet > > Calling napi_hash_del() before netif_napi_del() is dangerous > if a synchronize_rcu() is not enforced before NAPI struct freeing. > > Lets leave this detail to core networking stack to get it

Re: [PATCH net] team: team_port_add should check link_up before enable port

2016-12-03 Thread Marcelo Ricardo Leitner
On Sat, Dec 03, 2016 at 09:42:11PM +0800, Xin Long wrote: > Now when users add a nic to team dev, the option 'enable' of the port > is true by default, as team_port_enable enables it after dev_open in > team_port_add. > > But even if the port_dev has no carrier, like it's cable was unpluged, >

Re: arp_filter and IPv6 ND

2016-12-03 Thread Saku Ytti
On 2 December 2016 at 20:39, Hannes Frederic Sowa wrote: Hey, > E.g. you can use IP addresses bound to other interfaces to send replys > on another interface. This can be useful if you have a limited amount of > IP addresses on the system but much more interfaces.

[PATCH net] team: team_port_add should check link_up before enable port

2016-12-03 Thread Xin Long
Now when users add a nic to team dev, the option 'enable' of the port is true by default, as team_port_enable enables it after dev_open in team_port_add. But even if the port_dev has no carrier, like it's cable was unpluged, the port is still enabled. It leads to that team dev couldn't work well

Re: [PATCH 1/1] net: ethernet: 3com: set error code on failures

2016-12-03 Thread Lino Sanfilippo
Hi, On 03.12.2016 14:24, Pan Bian wrote: > From: Pan Bian > > In function typhoon_init_one(), returns the value of variable err on > errors. However, on some error paths, variable err is not set to a > negative errno. This patch assigns "-EIO" to err on those paths. > >

[PATCH 1/1] net: dcb: set error code on failures

2016-12-03 Thread Pan Bian
From: Pan Bian In function dcbnl_cee_fill(), returns the value of variable err on errors. However, on some error paths (e.g. nla put fails), its value may be 0. It may be better to explicitly set a negative errno to variable err before returning. Bugzilla:

Re: net: use-after-free in worker_thread

2016-12-03 Thread Eric Dumazet
On Sat, 2016-12-03 at 14:05 +0100, Andrey Konovalov wrote: > On Sat, Dec 3, 2016 at 1:58 PM, Andrey Konovalov > wrote: > > +syzkal...@googlegroups.com > > > > On Sat, Dec 3, 2016 at 1:56 PM, Andrey Konovalov > > wrote: > >> Hi! > >> > >> I'm seeing

[PATCH 1/1] net: ethernet: 3com: set error code on failures

2016-12-03 Thread Pan Bian
From: Pan Bian In function typhoon_init_one(), returns the value of variable err on errors. However, on some error paths, variable err is not set to a negative errno. This patch assigns "-EIO" to err on those paths. Signed-off-by: Pan Bian ---

Re: [PATCH 1/1] net: caif: fix ineffective error check

2016-12-03 Thread Sergei Shtylyov
Hello. On 12/3/2016 2:18 PM, Pan Bian wrote: In function caif_sktinit_module(), the check of the return value of sock_register() seems ineffective. This patch fixes it. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188751 Signed-off-by: Pan Bian ---

Possible regression due to "net/sched: cls_flower: Add offload support using egress Hardware device"

2016-12-03 Thread Simon Horman
Hi Hadar, in net-next I am observing what appears to be an regression in net-next due to: 7091d8c7055d ("net/sched: cls_flower: Add offload support using egress Hardware device") The problem occurs when adding a flower filter (without offload to a virtio device). # ethtool -d eth0 ethtool -i

Re: net: use-after-free in worker_thread

2016-12-03 Thread Andrey Konovalov
+syzkal...@googlegroups.com On Sat, Dec 3, 2016 at 1:56 PM, Andrey Konovalov wrote: > Hi! > > I'm seeing lots of the following error reports while running the > syzkaller fuzzer. > > Reports appeared when I updated to 3c49de52 (Dec 2) from 2caceb32 (Dec 1). > >

Re: net: use-after-free in worker_thread

2016-12-03 Thread Andrey Konovalov
On Sat, Dec 3, 2016 at 1:58 PM, Andrey Konovalov wrote: > +syzkal...@googlegroups.com > > On Sat, Dec 3, 2016 at 1:56 PM, Andrey Konovalov > wrote: >> Hi! >> >> I'm seeing lots of the following error reports while running the >> syzkaller fuzzer. >>

net: use-after-free in worker_thread

2016-12-03 Thread Andrey Konovalov
Hi! I'm seeing lots of the following error reports while running the syzkaller fuzzer. Reports appeared when I updated to 3c49de52 (Dec 2) from 2caceb32 (Dec 1). == BUG: KASAN: use-after-free in worker_thread+0x17d8/0x18a0 Read of

[PATCH 1/1] atm: lanai: set error code when ioremap fails

2016-12-03 Thread Pan Bian
In function lanai_dev_open(), when the call to ioremap() fails, the value of return variable result is 0. 0 means no error in this context. This patch fixes the bug, assigning "-ENOMEM" to result when ioremap() returns a NULL pointer. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188791

[PATCH 1/1] net: caif: fix ineffective error check

2016-12-03 Thread Pan Bian
In function caif_sktinit_module(), the check of the return value of sock_register() seems ineffective. This patch fixes it. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188751 Signed-off-by: Pan Bian --- net/caif/caif_socket.c | 2 +- 1 file changed, 1

[PATCH 1/1] net: bridge: set error code on failure

2016-12-03 Thread Pan Bian
Function br_sysfs_addbr() does not set error code when the call kobject_create_and_add() returns a NULL pointer. It may be better to return "-ENOMEM" when kobject_create_and_add() fails. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188781 Signed-off-by: Pan Bian

[PATCH 1/1] net: usb: set error code when usb_alloc_urb fails

2016-12-03 Thread Pan Bian
In function lan78xx_probe(), variable ret takes the errno code on failures. However, when the call to usb_alloc_urb() fails, its value will keeps 0. 0 indicates success in the context, which is inconsistent with the execution result. This patch fixes the bug, assigning "-ENOMEM" to ret when

Re: [PATCH v2 net-next 1/2] flow dissector: ICMP support

2016-12-03 Thread Jiri Pirko
Fri, Dec 02, 2016 at 09:31:41PM CET, simon.hor...@netronome.com wrote: >Allow dissection of ICMP(V6) type and code. This re-uses transport layer >port dissection code as although ICMP is not a transport protocol and their >type and code are not ports this allows sharing of both code and storage. >

[PATCH 1/1] net: wireless: marvell: fix improper return value

2016-12-03 Thread Pan Bian
Function lbs_cmd_802_11_sleep_params() always return 0, even if the call to lbs_cmd_with_response() fails. In this case, the parameter @sp will keep uninitialized. Because the return value is 0, its caller (say lbs_sleepparams_read()) will not detect the error, and will copy the uninitialized

[PATCH 1/1] net: wireless: intersil: fix improper return value

2016-12-03 Thread Pan Bian
Function orinoco_ioctl_commit() returns 0 (indicates success) when the call to orinoco_lock() fails. Thus, the return value is inconsistent with the execution status. It may be better to return "-EBUSY" when the call to orinoco_lock() fails. Bugzilla:

[PATCH 1/1] net: wireless: intersil: fix improper return value

2016-12-03 Thread Pan Bian
Function orinoco_ioctl_commit() returns 0 (indicates success) when the call to orinoco_lock() fails. Thus, the return value is inconsistent with the execution status. It may be better to return "-EBUSY" when the call to orinoco_lock() fails. Bugzilla:

[PATCH 1/1] netdev: broadcom: propagate error code

2016-12-03 Thread Pan Bian
Function bnxt_hwrm_stat_ctx_alloc() always returns 0, even if the call to _hwrm_send_message() fails. It may be better to propagate the errors to the caller of bnxt_hwrm_stat_ctx_alloc(). Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188661 Signed-off-by: Pan Bian

[PATCH net-next] net: remove abuse of VLAN DEI/CFI bit

2016-12-03 Thread Michał Mirosław
This All-in-one patch removes abuse of VLAN CFI bit, so it can be passed intact through linux networking stack. Signed-off-by: Michał Mirosław --- Dear NetDevs I guess this needs to be split to the prep..convert[]..finish sequence, but if you like it as is,

[net-next 12/18] i40e: Remove unreachable code

2016-12-03 Thread Jeff Kirsher
From: Henry Tieman The code at the end of i40e_read_phy_register_clause22() contained unreachable code and redundant control statements. This change removes the unreachable code. And deletes the redundant goto statement and if statement. Change-ID:

[net-next 18/18] i40e: change message to only appear when extra debug info is wanted

2016-12-03 Thread Jeff Kirsher
From: Carolyn Wyborny This patch changes an X722 informational message so that it only appears when extra messages are desired. Without this patch, on X722 devices, this message appears at load, potentially causing unnecessary alarm. Change-ID:

[net-next 02/18] i40evf: Be much more verbose about what we can and cannot offload

2016-12-03 Thread Jeff Kirsher
From: Alexander Duyck This change makes it so that we are much more robust about defining what we can and cannot offload. Previously we were performing no checks. This should bring us up to parity with the i40e PF driver. In addition the device only supports GSO

[net-next 16/18] i40e: set broadcast promiscuous mode for each active VLAN

2016-12-03 Thread Jeff Kirsher
From: Jacob Keller A previous workaround added to ensure receipt of all broadcast frames incorrectly set the broadcast promiscuous mode unconditionally regardless of active VLAN status. Replace this partial workaround with a complete solution that sets the broadcast

Re: [PATCH v3 00/13] net: ethernet: ti: cpts: update and fixes

2016-12-03 Thread Richard Cochran
On Fri, Dec 02, 2016 at 02:30:10PM -0600, Grygorii Strashko wrote: > It is preparation series intended to clean up and optimize TI CPTS driver to > facilitate further integration with other TI's SoCs like Keystone 2. > > Changes in v3: > - patches reordered: fixes and small updates moved first >

[net-next 13/18] i40e: Pass unknown PHY type for unknown PHYs

2016-12-03 Thread Jeff Kirsher
From: Henry Tieman The PHY type value for unrecognized PHYs and cables was changed based on firmware version number. Newer hardware use lower firmware version numbers and this was causing some PHYs to be identified as type 0x16 instead of 0xe (unknown). Without this

[net-next 05/18] i40e: avoid duplicate private flags definitions

2016-12-03 Thread Jeff Kirsher
From: Jacob Keller Separate the global private flags and the regular private flags per interface into two arrays. Future additions of private flags will not need to be duplicated which may lead to buggy code. Also rename "i40e_priv_flags_strings_gl" to

[net-next 15/18] i40e: Fix for ethtool Supported link modes

2016-12-03 Thread Jeff Kirsher
From: Harshitha Ramamurthy This patch fixes the problem where the ethtool Supported link modes list backplane interfaces on X722 devices for 10GbE with SFP+ and Cortina retimer. This patch fixes the problem by setting and using a flag for this particular device

[net-next 04/18] i40e: remove second check of VLAN_N_VID in i40e_vlan_rx_add_vid

2016-12-03 Thread Jeff Kirsher
From: Jacob Keller Replace a check of magic number 4095 with VLAN_N_VID. This makes it obvious that a later check against VLAN_N_VID is always true and can be removed. Change-ID: I28998f127a61a529480ce63d8a07e266f6c63b7b Signed-off-by: Jacob Keller

[net-next 03/18] i40e: remove error_param_int label from i40e_vc_config_promiscuous_mode_msg

2016-12-03 Thread Jeff Kirsher
From: Jacob Keller This label is unnecessary, as are jumping to a block that checks aq_ret and then immediately skipping it and returning. So just jump straight to the error_param and remove this unnecessary label. Also use goto error_param even in the last check for

[net-next 17/18] i40e/i40evf: replace for memcpy with single memcpy call in ethtool

2016-12-03 Thread Jeff Kirsher
From: Jacob Keller memcpy replaced with single memcpy call in ethtool. Change-ID: I3f5bef6bcc593412c56592c6459784db41575a0a Signed-off-by: Jacob Keller Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher

[net-next 11/18] i40evf: check for msix_entries null dereference

2016-12-03 Thread Jeff Kirsher
From: Alan Brady It is possible for msix_entries to be freed by a previous suspend/remove before a VF is closed. This patch fixes the issue by checking for NULL before dereferencing msix_entries and returning early in the case where it is NULL within the i40evf_close code

[net-next 01/18] i40e: Be much more verbose about what we can and cannot offload

2016-12-03 Thread Jeff Kirsher
From: Alexander Duyck This change makes it so that we are much more robust about defining what we can and cannot offload. Previously we were just checking for the L4 tunnel header length, however there are other fields we should be verifying as there are multiple

[net-next 00/18][pull request] 40GbE Intel Wired LAN Driver Updates 2016-12-02

2016-12-03 Thread Jeff Kirsher
This series contains updates to i40e and i40evf only. Alex provides changes so that we are much more robust about defining what we can and cannot offload in i40e and i40evf by doing additional checks other than L4 tunnel header length. Jake provides several fixes/changes, first cleaning up a

[net-next 06/18] i40e: Add Clause22 implementation

2016-12-03 Thread Jeff Kirsher
From: Michal Kosiarz Some external PHYs require Clause22 method for accessing registers. This patch also adds some defines to support blink led on devices using 10CBaseT PHY. Change-ID: I868a4326911900f6c89e7e522fda4968b0825f14 Signed-off-by: Michal Kosiarz

[net-next 10/18] i40evf: Move some i40evf_reset_task code to separate function

2016-12-03 Thread Jeff Kirsher
From: Joe Perches The i40evf_reset_task function is a couple hundred lines and it has a separable block that disables VF. Move that block to a new i40evf_disable_vf function to shorten i40evf_reset_task a bit. Signed-off-by: Joe Perches Tested-by: Andrew

Re: bpf bounded loops. Was: [flamebait] xdp

2016-12-03 Thread Sargun Dhillon
On Fri, Dec 2, 2016 at 4:20 PM, Alexei Starovoitov wrote: > On Fri, Dec 02, 2016 at 11:42:15AM -0800, John Fastabend wrote: >> >> As far as pattern search for DNS packets... >> >> it was requested by Cloudflare guys back in March: >> >>

[net-next 09/18] i40e: fix panic on SPARC while changing num of desc

2016-12-03 Thread Jeff Kirsher
From: Tushar Dave On SPARC, writel() should not be used to write directly to memory address but only to memory mapped I/O address otherwise it causes data access exception. Commit 147e81ec75689 ("i40e: Test memory before ethtool alloc succeeds") introduced a code that

[net-next 07/18] i40e: fix trivial typo in naming of i40e_sync_filters_subtask

2016-12-03 Thread Jeff Kirsher
From: Jacob Keller A comment incorrectly referred to i40e_vsi_sync_filters_subtask which does not actually exist. Reference the correct function instead. Change-ID: I6bd805c605741ffb6fe34377259bb0d597edfafd Signed-off-by: Jacob Keller

[net-next 08/18] i40e: Add protocols over MCTP to i40e_aq_discover_capabilities

2016-12-03 Thread Jeff Kirsher
From: Piotr Raczynski Add logical_id to I40E_AQ_CAP_ID_MNG_MODE capability starting from major version 2. Change-ID: Idb29214b172ea5c70cbd45a99e6745c0215af7e4 Signed-off-by: Piotr Raczynski Tested-by: Andrew Bowers

[net-next 14/18] i40evf: protect against NULL msix_entries and q_vectors pointers

2016-12-03 Thread Jeff Kirsher
From: Jacob Keller Update the functions which free msix_entries and q_vectors so that they are safe against NULL values. This allows calling code to not care whether these have already been freed when disabling and freeing them. Change-ID:

[PATCH iproute2/net-next v3 1/3] tc: flower: document SCTP ip_proto

2016-12-03 Thread Simon Horman
Add SCTP ip_proto to help text and man page. Signed-off-by: Simon Horman --- man/man8/tc-flower.8 | 14 +++--- tc/f_flower.c| 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/man/man8/tc-flower.8 b/man/man8/tc-flower.8 index

[PATCH iproute2/net-next v3 0/3] tc: flower: SCTP and other port fixes

2016-12-03 Thread Simon Horman
Hi Stephen, this short series: * Makes some improvements to the documentation of flower; A follow-up to recent work by Paul Blakey and myself. * Corrects some errors introduced when SCTP port matching support was recently added. Changes v2->v3: * Rebase * Dropped merged patch Changes

Re: [[PATCH iproute2/net-next v2] 2/4] tc: flower: document SCTP ip_proto

2016-12-03 Thread Simon Horman
On Fri, Dec 02, 2016 at 03:06:08PM -0800, Stephen Hemminger wrote: > On Fri, 2 Dec 2016 09:45:19 +0100 > Simon Horman wrote: > > > Add SCTP ip_proto to help text and man page. > > > > Signed-off-by: Simon Horman > > This doesn't apply

[PATCH iproute2/net-next v3 2/3] tc: flower: correct name of ip_proto parameter to flower_parse_port()

2016-12-03 Thread Simon Horman
This corrects a typo. Fixes: a1fb0d484237 ("tc: flower: Support matching on SCTP ports") Signed-off-by: Simon Horman --- tc/f_flower.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tc/f_flower.c b/tc/f_flower.c index

[PATCH iproute2/net-next v3 3/3] tc: flower: make use of flower_port_attr_type() safe and silent

2016-12-03 Thread Simon Horman
Make use of flower_port_attr_type() safe: * flower_port_attr_type() may return a valid index into tb[] or -1. Only access tb[] in the case of the former. * Do not access null entries in tb[] Also make usage silent - it is valid for ip_proto to be invalid, for example if it is not specified as

Re: [PATCH iproute2/net-next] ss: initialise variables outside of for loop

2016-12-03 Thread Simon Horman
On Fri, Dec 02, 2016 at 02:18:17PM -0800, Stephen Hemminger wrote: > On Fri, 2 Dec 2016 12:56:05 +0100 > Simon Horman wrote: > > > Initialise for loops outside of for loops. GCC flags this as being > > out of spec unless C99 or C11 mode is used. > > > > With this

[PATCH] net: af_mpls.c add space before open parenthesis

2016-12-03 Thread Suraj Deshmukh
Adding space after switch keyword before open parenthesis for readability purpose. This patch fixes the checkpatch.pl warning: space required before the open parenthesis '(' Signed-off-by: Suraj Deshmukh --- net/mpls/af_mpls.c | 2 +- 1 file changed, 1 insertion(+), 1

<    1   2