[RFC PATCH bpf-next v2 4/4] error-injection: Support fault injection framework

2017-12-25 Thread Masami Hiramatsu
Support in-kernel fault-injection framework via debugfs. This allows you to inject a conditional error to specified function using debugfs interfaces. Signed-off-by: Masami Hiramatsu --- Documentation/fault-injection/fault-injection.txt |5 + kernel/Makefile

[RFC PATCH bpf-next v2 3/4] error-injection: Separate error-injection from kprobe

2017-12-25 Thread Masami Hiramatsu
Since error-injection framework is not limited to be used by kprobes, nor bpf. Other kernel subsystems can use it freely for checking safeness of error-injection, e.g. livepatch, ftrace etc. So this separate error-injection framework from kprobes. Some differences has been made: - "kprobe" word i

[RFC PATCH bpf-next v2 2/4] tracing/kprobe: bpf: Compare instruction pointer with original one

2017-12-25 Thread Masami Hiramatsu
Compare instruction pointer with original one on the stack instead using per-cpu bpf_kprobe_override flag. This patch also consolidates reset_current_kprobe() and preempt_enable_no_resched() blocks. Those can be done in one place. Signed-off-by: Masami Hiramatsu --- kernel/trace/bpf_trace.c

[RFC PATCH bpf-next v2 1/4] tracing/kprobe: bpf: Check error injectable event is on function entry

2017-12-25 Thread Masami Hiramatsu
Check whether error injectable event is on function entry or not. Currently it checks the event is ftrace-based kprobes or not, but that is wrong. It should check if the event is on the entry of target function. Since error injection will override a function to just return with modified return valu

[RFC PATCH bpf-next v2 0/4] Separate error injection table from kprobes

2017-12-25 Thread Masami Hiramatsu
Hi Josef and Alexei, Here are the 2nd version of patches to moving error injection table from kprobes. In this series I did a small fixes and add function-based fault injection. Here is the previous version: https://lkml.org/lkml/2017/12/22/554 There are 2 main reasons why I separate it from kp

Re: [PATCH net-next] virtio_net: Add ethtool stats

2017-12-25 Thread Toshiaki Makita
On 2017/12/26 1:47, Florian Fainelli wrote: > On December 25, 2017 3:45:36 AM PST, Toshiaki Makita > wrote: >> On 2017/12/25 3:16, Stephen Hemminger wrote: >>> On Wed, 20 Dec 2017 13:40:37 +0900 >>> Toshiaki Makita wrote: >>> + +static const struct virtnet_gstats virtnet_gstrings_stats

xfrm: Forbid state updates from changing encap type

2017-12-25 Thread Herbert Xu
Currently we allow state updates to competely replace the contents of x->encap. This is bad because on the user side ESP only sets up header lengths depending on encap_type once when the state is first created. This could result in the header lengths getting out of sync with the actual state conf

[PATCH net-next 1/1] forcedeth: optimize the rx with likely

2017-12-25 Thread Zhu Yanjun
In the rx fastpath, the function netdev_alloc_skb rarely fails. Therefore, a likely() optimization is added to this error check conditional. CC: Srinivas Eeda CC: Joe Jin CC: Junxiao Bi Signed-off-by: Zhu Yanjun --- drivers/net/ethernet/nvidia/forcedeth.c | 4 ++-- 1 file changed, 2 insertion

Re: iproute2 net-next

2017-12-25 Thread Stephen Hemminger
On Tue, 26 Dec 2017 06:47:43 +0200 Leon Romanovsky wrote: > On Mon, Dec 25, 2017 at 10:49:19AM -0800, Stephen Hemminger wrote: > > David Ahern has agreed to take over managing the net-next branch of > > iproute2. > > The new location is: > > https://git.kernel.org/pub/scm/linux/kernel/git/dsahe

[PATCH net] net/sched: Fix update of lastuse in act modules implementing stats_update

2017-12-25 Thread Roi Dayan
We need to update lastuse to to the most updated value between what is already set and the new value. If HW matching fails, i.e. because of an issue, the stats are not updated but it could be that software did match and updated lastuse. Fixes: 5712bf9c5c30 ("net/sched: act_mirred: Use passed lastu

Re: iproute2 net-next

2017-12-25 Thread Leon Romanovsky
On Mon, Dec 25, 2017 at 10:49:19AM -0800, Stephen Hemminger wrote: > David Ahern has agreed to take over managing the net-next branch of iproute2. > The new location is: > https://git.kernel.org/pub/scm/linux/kernel/git/dsahern/iproute2-next.git/ > > In the past, I have accepted new features into

Re: [PATCH net-next v8 1/2] dt-bindings: net: add DT bindings for Socionext UniPhier AVE

2017-12-25 Thread Florian Fainelli
On December 24, 2017 5:10:37 PM PST, Kunihiko Hayashi wrote: >DT bindings for the AVE ethernet controller found on Socionext's >UniPhier platforms. > >Signed-off-by: Kunihiko Hayashi >Signed-off-by: Jassi Brar >Acked-by: Rob Herring Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH net] phylink: ensure AN is enabled

2017-12-25 Thread David Miller
From: Russell King Date: Wed, 20 Dec 2017 23:21:34 + > Ensure that we mark AN as enabled at boot time, rather than leaving > it disabled. This is noticable if your SFP module is fiber, and you > it supports faster speeds than 1G with 2.5G support in place. > > Signed-off-by: Russell King

Re: [PATCH net] phylink: ensure the PHY interface mode is appropriately set

2017-12-25 Thread David Miller
From: Russell King Date: Wed, 20 Dec 2017 23:21:28 + > When setting the ethtool settings, ensure that the validated PHY > interface mode is propagated to the current link settings, so that > 2500BaseX can be selected. > > Signed-off-by: Russell King Applied.

[RFC PATCH v12 3/5] mwifiex: Disable wakeup irq handling for pcie

2017-12-25 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v13: None Changes in v12: None Changes in v11: None Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None Changes

[RFC PATCH v12 0/5] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-12-25 Thread Jeffy Chen
Currently we are handling wake irq in mrvl wifi driver. Move it into pci core. Tested on my chromebook bob(with cros 4.4 kernel and mrvl wifi). Changes in v13: Fix compiler error reported by kbuild test robot Changes in v12: Only add irq definitions for PCI devices and rewrite the commit mess

[RFC PATCH v12 3/5] mwifiex: Disable wakeup irq handling for pcie

2017-12-25 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v12: None Changes in v11: None Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None Changes in v2: None driver

[RFC PATCH v12 0/5] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-12-25 Thread Jeffy Chen
Currently we are handling wake irq in mrvl wifi driver. Move it into pci core. Tested on my chromebook bob(with cros 4.4 kernel and mrvl wifi). Changes in v12: Enable the wake irq in noirq stage to avoid possible irq storm. Changes in v11: Only add irq definitions for PCI devices and rewrite t

[PATCH V2 net-next] selftests/net: fix bugs in address and port initialization

2017-12-25 Thread Sowmini Varadhan
Address/port initialization should work correctly regardless of the order in which command line arguments are supplied, E.g, cfg_port should be used to connect to the remote host even if it is processed after -D, src/dst address initialization should not require that [-4|-6] be specified before the

Re: [PATCH v5 iproute2 net-next] erspan: add erspan version II support

2017-12-25 Thread David Ahern
On 12/20/17 4:49 PM, William Tu wrote: > The patch adds support for configuring the erspan v2, for both > ipv4 and ipv6 erspan implementation. Three additional fields > are added: 'erspan_ver' for distinguishing v1 or v2, 'erspan_dir' > for specifying direction of the mirrored traffic, and 'erspan

Re: [PATCH v4 iproute2 net-next] erspan: add erspan version II support

2017-12-25 Thread David Ahern
On 12/19/17 8:01 PM, William Tu wrote: > The patch adds support for configuring the erspan v2, for both > ipv4 and ipv6 erspan implementation. Three additional fields > are added: 'erspan_ver' for distinguishing v1 or v2, 'erspan_dir' > for specifying direction of the mirrored traffic, and 'erspan

Re: [PATCH net-next] selftests/net: fix bugs in cfg_port initialization

2017-12-25 Thread Sowmini Varadhan
On (12/25/17 15:49), Willem de Bruijn wrote: > > It would be good to also address the other instance of this at the > same time: protocol family (-4 or -6) has to be set before a call to > setup_sockaddr. Unlike this case, it hits an error() if called in the > "incorrect" order, but that is still

[PATCH bpf-next 3/3] libbpf: break loop earlier

2017-12-25 Thread Eric Leblond
Get out of the loop when we have a match. Signed-off-by: Eric Leblond --- tools/lib/bpf/libbpf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 5fe8aaa2123e..d263748aa341 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @

[PATCH bpf-next 0/3] add XDP loading support to libbpf

2017-12-25 Thread Eric Leblond
Hello, This patchset adds a function to load XDP eBPF file in the libbpf library. It gets the netlink extended ack from the driver in case of failure and print the error to stderr. Best regards, -- Eric Leblond

[PATCH bpf-next 2/3] libbpf: add error reporting in XDP

2017-12-25 Thread Eric Leblond
Parse netlink ext attribute to get the error message returned by the card. Signed-off-by: Eric Leblond --- tools/lib/bpf/Build| 2 +- tools/lib/bpf/bpf.c| 9 +++ tools/lib/bpf/nlattr.c | 188 + tools/lib/bpf/nlattr.h | 164 +

[PATCH bpf-next 1/3] libbpf: add function to setup XDP

2017-12-25 Thread Eric Leblond
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond --- tools/lib/bpf/bpf.c| 126 - tools/lib/bpf/libbpf.c | 2 + tools/lib/bpf/libbpf.h | 4 ++ 3 files c

[PATCH v2 bpf-next 3/3] bpf: fix max call depth check

2017-12-25 Thread Alexei Starovoitov
fix off by one error in max call depth check and add a test Fixes: f4d7e40a5b71 ("bpf: introduce function calls (verification)") Signed-off-by: Alexei Starovoitov --- kernel/bpf/verifier.c | 4 ++-- tools/testing/selftests/bpf/test_verifier.c | 35 +

[PATCH v2 bpf-next 0/3] bpf: two stack check fixes

2017-12-25 Thread Alexei Starovoitov
Jann reported an issue with stack depth tracking. Fix it and add tests. Also fix off-by-one error in MAX_CALL_FRAMES check. This set is on top of Jann's "selftest for late caller stack size increase" test. Alexei Starovoitov (3): bpf: fix maximum stack depth tracking logic selftests/bpf: addi

[PATCH v2 bpf-next 1/3] bpf: fix maximum stack depth tracking logic

2017-12-25 Thread Alexei Starovoitov
Instead of computing max stack depth for current call chain during the main verifier pass track stack depth of each function independently and after do_check() is done do another pass over all instructions analyzing depth of all possible call stacks. Fixes: f4d7e40a5b71 ("bpf: introduce function c

[PATCH v2 bpf-next 2/3] selftests/bpf: additional stack depth tests

2017-12-25 Thread Alexei Starovoitov
to test inner logic of stack depth tracking Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/test_verifier.c | 121 1 file changed, 121 insertions(+) diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifi

Re: [PATCH net-next] selftests/net: fix bugs in cfg_port initialization

2017-12-25 Thread Willem de Bruijn
On Sun, Dec 24, 2017 at 12:23 PM, Sowmini Varadhan wrote: > If -S is not used in the command line, we should > be binding to *.. Similarly, cfg_port should be > used to connect to the remote host even if it is processed > after -D. Thus we need to make sure that the cfg_port in > cfg_src_addr and

iproute2 net-next

2017-12-25 Thread Stephen Hemminger
David Ahern has agreed to take over managing the net-next branch of iproute2. The new location is: https://git.kernel.org/pub/scm/linux/kernel/git/dsahern/iproute2-next.git/ In the past, I have accepted new features into iproute2 master branch, but am changing the policy so that outside of the me

Fw: [Bug 198253] New: stopping htb results in null pointer dereference

2017-12-25 Thread Stephen Hemminger
Begin forwarded message: Date: Mon, 25 Dec 2017 08:25:44 + From: bugzilla-dae...@bugzilla.kernel.org To: step...@networkplumber.org Subject: [Bug 198253] New: stopping htb results in null pointer dereference https://bugzilla.kernel.org/show_bug.cgi?id=198253 Bug ID: 198253

Re: [PATCH net-next] virtio_net: Add ethtool stats

2017-12-25 Thread Florian Fainelli
On December 25, 2017 3:45:36 AM PST, Toshiaki Makita wrote: >On 2017/12/25 3:16, Stephen Hemminger wrote: >> On Wed, 20 Dec 2017 13:40:37 +0900 >> Toshiaki Makita wrote: >> >>> + >>> +static const struct virtnet_gstats virtnet_gstrings_stats[] = { >>> + { "rx_packets", VIRTNET_NETDEV_

Re: [net 02/14] Revert "mlx5: move affinity hints assignments to generic code"

2017-12-25 Thread Sagi Grimberg
Before the offending commit, mlx5 core did the IRQ affinity itself, and it seems that the new generic code have some drawbacks and one of them is the lack for user ability to modify irq affinity after the initial affinity values got assigned. The issue is still being discussed and a solution in

Re: [PATCH] flex_can: Fix checking can_dlc

2017-12-25 Thread Oliver Hartkopp
Answering myself after reading my own comment once more: In fact the code fix seems to be correct but the commit comment was completely wrong which lead to my answer ... can_dlc can hold values from 0 .. 8. The first 4 bytes are placed in data[0..3]. When we have more(!) than 4 bytes in can_

[RFC PATCH v11 3/5] mwifiex: Disable wakeup irq handling for pcie

2017-12-25 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v11: None Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None Changes in v2: None drivers/net/wireless/marvel

[RFC PATCH v11 0/5] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-12-25 Thread Jeffy Chen
Currently we are handling wake irq in mrvl wifi driver. Move it into pci core. Tested on my chromebook bob(with cros 4.4 kernel and mrvl wifi). Changes in v11: Only add irq definitions for PCI devices and rewrite the commit message. Address Brian's comments. Only support 1-per-device PCIe WAKE#

Re: [PATCH net-next] virtio_net: Add ethtool stats

2017-12-25 Thread Toshiaki Makita
On 2017/12/25 3:16, Stephen Hemminger wrote: > On Wed, 20 Dec 2017 13:40:37 +0900 > Toshiaki Makita wrote: > >> + >> +static const struct virtnet_gstats virtnet_gstrings_stats[] = { >> +{ "rx_packets", VIRTNET_NETDEV_STAT(rx_packets) }, >> +{ "tx_packets", VIRTNET_NETDEV_S

Re: [PATCH] flex_can: Fix checking can_dlc

2017-12-25 Thread Oliver Hartkopp
This patch looks wrong to me. On 12/19/2017 09:40 AM, Luu An Phu wrote: From: "phu.luuan" flexcan_start_xmit should write data to register when can_dlc > 4. Because can_dlc is data length and it has value from 1 to 8. No. can_dlc can contain values from 0 to 8. Even 0 is a valid DLC. But C

Re: [patch net-next 02/10] devlink: Add support for resource abstraction

2017-12-25 Thread Arkadi Sharshevsky
On 12/20/2017 09:43 PM, David Miller wrote: > From: Jiri Pirko > Date: Wed, 20 Dec 2017 12:58:13 +0100 > >> From: Arkadi Sharshevsky >> >> Add support for hardware resource abstraction over devlink. Each resource >> is identified via id, furthermore it contains information regarding its >> siz

Re: [patch net-next v4 00/10] net: sched: allow qdiscs to share filter block instances

2017-12-25 Thread Jiri Pirko
Sun, Dec 24, 2017 at 05:25:41PM CET, dsah...@gmail.com wrote: >On 12/24/17 1:19 AM, Jiri Pirko wrote: >> Sun, Dec 24, 2017 at 02:54:47AM CET, dsah...@gmail.com wrote: >>> On 12/23/17 9:54 AM, Jiri Pirko wrote: So back to the example. First, we create 2 qdiscs. Both will share block number

Re: [QUESTION] Doubt about NAPI_GRO_CB(skb)->is_atomic in tcpv4 gro process

2017-12-25 Thread Yunsheng Lin
Hi, Alexander On 2017/12/23 0:32, Alexander Duyck wrote: > On Fri, Dec 22, 2017 at 12:49 AM, Yunsheng Lin wrote: >> Hi, Alexander >> >> On 2017/12/22 0:29, Alexander Duyck wrote: >>> On Thu, Dec 21, 2017 at 1:16 AM, Yunsheng Lin >>> wrote: Hi, Alexander On 2017/12/21 0:24, Alexan

[patch net-next 0/2] net: sched: Fix RED qdisc offload flag

2017-12-25 Thread Nogah Frankel
Replacing the RED offload flag (TC_RED_OFFLOADED) with the generic one (TCQ_F_OFFLOADED) deleted some of the logic behind it. This patchset fixes this problem. Nogah Frankel (2): net_sch: red: Fix the new offload indication net: sched: Move offload check till after dump call net/sched/sch_ap

[patch net-next 2/2] net: sched: Move offload check till after dump call

2017-12-25 Thread Nogah Frankel
Move the check of the offload state to after the qdisc dump action was called, so the qdisc could update it if it was changed. Fixes: 7a4fa29106d9 ("net: sched: Add TCA_HW_OFFLOAD") Signed-off-by: Nogah Frankel Reviewed-by: Yuval Mintz --- net/sched/sch_api.c | 5 ++--- 1 file changed, 2 insert

[patch net-next 1/2] net_sch: red: Fix the new offload indication

2017-12-25 Thread Nogah Frankel
Update the offload flag, TCQ_F_OFFLOADED, in each dump call (and ignore the offloading function return value in relation to this flag). This is done because a qdisc is being initialized, and therefore offloaded before being grafted. Since the ability of the driver to offload the qdisc depends on it

[patch iproute2 v3 1/4] lib/libnetlink: Add a function rtnl_talk_msg

2017-12-25 Thread Chris Mi
rtnl_talk can only send a single message to kernel. Add a new function rtnl_talk_msg that can send multiple messages to kernel. Signed-off-by: Chris Mi --- include/libnetlink.h | 3 ++ lib/libnetlink.c | 92 2 files changed, 74 insertions

[patch iproute2 v3 3/4] tc: Add -bs option to batch mode

2017-12-25 Thread Chris Mi
Signed-off-by: Chris Mi --- tc/m_action.c | 91 +-- tc/tc.c| 47 ++ tc/tc_common.h | 8 +++- tc/tc_filter.c | 121 + 4 files changed, 204 insertions(+), 63 deletions(-)

[patch iproute2 v3 4/4] man: Add -bs option to tc manpage

2017-12-25 Thread Chris Mi
Signed-off-by: Chris Mi --- man/man8/tc.8 | 5 + 1 file changed, 5 insertions(+) diff --git a/man/man8/tc.8 b/man/man8/tc.8 index ff071b33..de137e16 100644 --- a/man/man8/tc.8 +++ b/man/man8/tc.8 @@ -601,6 +601,11 @@ must exist already. read commands from provided file or standard input and

[patch iproute2 v3 2/4] utils: Add a function setcmdlinetotal

2017-12-25 Thread Chris Mi
This function calculates how many commands a batch file has and set it to global variable cmdlinetotal. Signed-off-by: Chris Mi --- include/utils.h | 4 lib/utils.c | 20 2 files changed, 24 insertions(+) diff --git a/include/utils.h b/include/utils.h index d3895d

[patch iproute2 v3 0/4] tc: Add -bs option to batch mode

2017-12-25 Thread Chris Mi
Currently in tc batch mode, only one command is read from the batch file and sent to kernel to process. With this patchset, we can accumulate several commands before sending to kernel. The batch size is specified using option -bs or -batchsize. To accumulate the commands in tc, client should alloc

[patch net] mlxsw: spectrum: Relax sanity checks during enslavement

2017-12-25 Thread Jiri Pirko
From: Ido Schimmel Since commit 25cc72a33835 ("mlxsw: spectrum: Forbid linking to devices that have uppers") the driver forbids enslavement to netdevs that already have uppers of their own, as this can result in various ordering problems. This requirement proved to be too strict for some users w

Re: [patch net] mlxsw: spectrum_router: Fix NULL pointer deref

2017-12-25 Thread Jiri Pirko
Mon, Dec 25, 2017 at 08:57:35AM CET, j...@resnulli.us wrote: >From: Ido Schimmel > >When we remove the neighbour associated with a nexthop we should always >refuse to write the nexthop to the adjacency table. Regardless if it is >already present in the table or not. > >Otherwise, we risk dereferen