[PATCH v3 00/10] of_net: Add NVMEM support to of_get_mac_address

2019-05-03 Thread Petr Štetiar
Hi, this patch series is a continuation of my previous attempt[1], where I've tried to wire MTD layer into of_get_mac_address, so it would be possible to load MAC addresses from various NVMEMs as EEPROMs etc. Predecessor of this patch which used directly MTD layer has originated in OpenWrt some t

[PATCH v3 01/10] of_net: add NVMEM support to of_get_mac_address

2019-05-03 Thread Petr Štetiar
Many embedded devices have information such as MAC addresses stored inside NVMEMs like EEPROMs and so on. Currently there are only two drivers in the tree which benefit from NVMEM bindings. Adding support for NVMEM into every other driver would mean adding a lot of repetitive code. This patch allo

[PATCH v3 04/10] net: davinci: support of_get_mac_address new ERR_PTR error

2019-05-03 Thread Petr Štetiar
There was NVMEM support added directly to of_get_mac_address, and it uses nvmem_get_mac_address under the hood, so we can remove it. As of_get_mac_address can now return NULL and ERR_PTR encoded error values, adjust to that as well. Signed-off-by: Petr Štetiar --- Changes since v2: * ERR_PTR

Possible refcount bug in ip6_expire_frag_queue()?

2019-05-03 Thread Stefan Bader
In commit 05c0b86b9696802fd0ce5676a92a63f1b455bdf3 "ipv6: frags: rewrite ip6_expire_frag_queue()" this function got changed to be like ip_expire() (after dropping a clone there). This was backported to 4.4.y stable (amongst other stable trees) in v4.4.174. Since then we got reports that in evironm

[PATCH v2 7/8] netlink: add infrastructure to expose policies to userspace

2019-05-03 Thread Johannes Berg
From: Johannes Berg Add, and use in generic netlink, helpers to dump out a netlink policy to userspace, including all the range validation data, nested policies etc. This lets userspace discover what the kernel understands. For families/commands other than generic netlink, the helpers need to b

[PATCH v2 8/8] netlink: limit recursion depth in policy validation

2019-05-03 Thread Johannes Berg
From: Johannes Berg Now that we have nested policies, we can theoretically recurse forever parsing attributes if a (sub-)policy refers back to a higher level one. This is a situation that has happened in nl80211, and we've avoided it there by not linking it. Add some code to netlink parsing to l

[PATCH v2 3/8] netlink: extend policy range validation

2019-05-03 Thread Johannes Berg
From: Johannes Berg Using a pointer to a struct indicating the min/max values, extend the ability to do range validation for arbitrary values. Small values in the s16 range can be kept in the policy directly. Signed-off-by: Johannes Berg --- include/net/netlink.h | 45 + lib/n

[PATCH v2 4/8] netlink: allow NLA_MSECS to have range validation

2019-05-03 Thread Johannes Berg
From: Johannes Berg Since NLA_MSECS is really equivalent to NLA_U64, allow it to have range validation as well. Signed-off-by: Johannes Berg --- include/net/netlink.h | 6 -- lib/nlattr.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/net/netlink.h

[PATCH v2 5/8] netlink: remove NLA_EXACT_LEN_WARN

2019-05-03 Thread Johannes Berg
From: Johannes Berg Use a validation type instead, so we can later expose the NLA_* values to userspace for policy descriptions. Signed-off-by: Johannes Berg --- include/net/netlink.h | 15 --- lib/nlattr.c | 16 ++-- 2 files changed, 18 insertions(+), 13 delet

[PATCH v2 0/8] netlink policy export and recursive validation

2019-05-03 Thread Johannes Berg
Here's (finally, sorry) the respin with the range/range_signed assignment fixed up. I've now included the validation recursion protection so it's clear that it applies on top of the other patches only. johannes

[PATCH v2 1/8] nl80211: fix NL80211_ATTR_FTM_RESPONDER policy

2019-05-03 Thread Johannes Berg
From: Johannes Berg The nested policy here should be established using the NLA_POLICY_NESTED() macro so the length is properly filled in. Fixes: 81e54d08d9d8 ("cfg80211: support FTM responder configuration/statistics") Signed-off-by: Johannes Berg --- net/wireless/nl80211.c | 6 ++ 1 file

[PATCH v2 6/8] netlink: factor out policy range helpers

2019-05-03 Thread Johannes Berg
From: Johannes Berg Add helpers to get the policy's signed/unsigned range validation data. Signed-off-by: Johannes Berg --- include/net/netlink.h | 5 +++ lib/nlattr.c | 95 +-- 2 files changed, 79 insertions(+), 21 deletions(-) diff --git a/i

[PATCH v2 2/8] netlink: remove type-unsafe validation_data pointer

2019-05-03 Thread Johannes Berg
From: Johannes Berg In the netlink policy, we currently have a void *validation_data that's pointing to different things: * a u32 value for bitfield32, * the netlink policy for nested/nested array * the string for NLA_REJECT Remove the pointer and place appropriate type-safe items in the unio

[PATCH v6 bpf-next 05/17] bpf: verifier: insert BPF_ZEXT according to zext analysis result

2019-05-03 Thread Jiong Wang
After previous patches, verifier has marked those instructions that really need zero extension on dst_reg. It is then for all back-ends to decide how to use such information to eliminate unnecessary zero extension code-gen during JIT compilation. One approach is: 1. Verifier insert explicit zer

[PATCH v6 bpf-next 02/17] bpf: verifier: mark verified-insn with sub-register zext flag

2019-05-03 Thread Jiong Wang
eBPF ISA specification requires high 32-bit cleared when low 32-bit sub-register is written. This applies to destination register of ALU32 etc. JIT back-ends must guarantee this semantic when doing code-gen. x86-64 and arm64 ISA has the same semantic, so the corresponding JIT back-end doesn't need

[PATCH v6 bpf-next 06/17] bpf: introduce new bpf prog load flags "BPF_F_TEST_RND_HI32"

2019-05-03 Thread Jiong Wang
x86_64 and AArch64 perhaps are two arches that running bpf testsuite frequently, however the zero extension insertion pass is not enabled for them because of their hardware support. It is critical to guarantee the pass correction as it is supposed to be enabled at default for a couple of other arc

[PATCH v6 bpf-next 00/17] bpf: eliminate zero extensions for sub-register writes

2019-05-03 Thread Jiong Wang
v6: - Fixed s390 kbuild test robot error. (kbuild) - Make comment style in backends patches more consistent. v5: - Adjusted several test_verifier helpers to make them works on hosts w and w/o hardware zext. (Naveen) - Make sure zext flag not set when verifier by-passed, for example,

[PATCH v6 bpf-next 04/17] bpf: introduce new alu insn BPF_ZEXT for explicit zero extension

2019-05-03 Thread Jiong Wang
This patch introduce new alu32 insn BPF_ZEXT, and allocate the unused opcode 0xe0 to it. Compared with the other alu32 insns, zero extension on low 32-bit is the only semantics for this instruction. It also allows various JIT back-ends to do optimal zero extension code-gen. BPF_ZEXT is supposed t

[PATCH v6 bpf-next 10/17] selftests: bpf: enable hi32 randomization for all tests

2019-05-03 Thread Jiong Wang
The previous libbpf patch allows user to specify "prog_flags" to bpf program load APIs. To enable high 32-bit randomization for a test, we need to set BPF_F_TEST_RND_HI32 in "prog_flags". To enable such randomization for all tests, we need to make sure all places are passing BPF_F_TEST_RND_HI32. C

[PATCH v6 bpf-next 16/17] riscv: bpf: eliminate zero extension code-gen

2019-05-03 Thread Jiong Wang
Acked-by: Björn Töpel Signed-off-by: Jiong Wang --- arch/riscv/net/bpf_jit_comp.c | 36 +++- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/arch/riscv/net/bpf_jit_comp.c b/arch/riscv/net/bpf_jit_comp.c index 80b12aa..3074c9b 100644 --- a/arch/risc

[PATCH v6 bpf-next 07/17] bpf: verifier: randomize high 32-bit when BPF_F_TEST_RND_HI32 is set

2019-05-03 Thread Jiong Wang
This patch randomizes high 32-bit of a definition when BPF_F_TEST_RND_HI32 is set. It does this once the flag set no matter there is hardware zero extension support or not. Because this is a test feature and we want to deliver the most stressful test. Suggested-by: Alexei Starovoitov Signed-off-

[PATCH v6 bpf-next 01/17] bpf: verifier: offer more accurate helper function arg and return type

2019-05-03 Thread Jiong Wang
BPF helper call transfers execution from eBPF insns to native functions while verifier insn walker only walks eBPF insns. So, verifier can only knows argument and return value types from explicit helper function prototype descriptions. For 32-bit optimization, it is important to know whether argum

[PATCH v6 bpf-next 13/17] s390: bpf: eliminate zero extension code-gen

2019-05-03 Thread Jiong Wang
Cc: Martin Schwidefsky Cc: Heiko Carstens Signed-off-by: Jiong Wang --- arch/s390/net/bpf_jit_comp.c | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 51dd026..8315b2e 100644 --- a/arch/s39

[PATCH v6 bpf-next 03/17] bpf: verifier: mark patched-insn with sub-register zext flag

2019-05-03 Thread Jiong Wang
Patched insns do not go through generic verification, therefore doesn't has zero extension information collected during insn walking. We don't bother analyze them at the moment, for any sub-register def comes from them, just conservatively mark it as needing zero extension. Signed-off-by: Jiong W

[PATCH v6 bpf-next 14/17] sparc: bpf: eliminate zero extension code-gen

2019-05-03 Thread Jiong Wang
Cc: David S. Miller Signed-off-by: Jiong Wang --- arch/sparc/net/bpf_jit_comp_64.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/sparc/net/bpf_jit_comp_64.c b/arch/sparc/net/bpf_jit_comp_64.c index 65428e7..8bac761 100644 --- a/arch/sparc/net/bpf_jit_comp_

[PATCH v6 bpf-next 15/17] x32: bpf: eliminate zero extension code-gen

2019-05-03 Thread Jiong Wang
Cc: Wang YanQing Signed-off-by: Jiong Wang --- arch/x86/net/bpf_jit_comp32.c | 39 --- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c index 0d9cdff..16c4f4e 100644 --- a/arch/x86/ne

[PATCH v6 bpf-next 12/17] powerpc: bpf: eliminate zero extension code-gen

2019-05-03 Thread Jiong Wang
Cc: Naveen N. Rao Cc: Sandipan Das Signed-off-by: Jiong Wang --- arch/powerpc/net/bpf_jit_comp64.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c index 21a1dcd..9fef73dc 100644 --- a/arch/p

[PATCH v6 bpf-next 08/17] libbpf: add "prog_flags" to bpf_program/bpf_prog_load_attr/bpf_load_program_attr

2019-05-03 Thread Jiong Wang
libbpf doesn't allow passing "prog_flags" during bpf program load in a couple of load related APIs, "bpf_load_program_xattr", "load_program" and "bpf_prog_load_xattr". It makes sense to allow passing "prog_flags" which is useful for customizing program loading. Reviewed-by: Jakub Kicinski Signed

[PATCH v6 bpf-next 11/17] arm: bpf: eliminate zero extension code-gen

2019-05-03 Thread Jiong Wang
Cc: Shubham Bansal Signed-off-by: Jiong Wang --- arch/arm/net/bpf_jit_32.c | 35 ++- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index c8bfbbf..a6f78c8 100644 --- a/arch/arm/net/bpf_jit_32.c

[PATCH v6 bpf-next 09/17] selftests: bpf: adjust several test_verifier helpers for insn insertion

2019-05-03 Thread Jiong Wang
- bpf_fill_ld_abs_vlan_push_pop: Prevent zext happens inside PUSH_CNT loop. This could happen because of BPF_LD_ABS (32-bit def) + BPF_JMP (64-bit use), or BPF_LD_ABS + EXIT (64-bit use of R0). So, change BPF_JMP to BPF_JMP32 and redefine R0 at exit path to cut off the data-flow f

[PATCH v6 bpf-next 17/17] nfp: bpf: eliminate zero extension code-gen

2019-05-03 Thread Jiong Wang
This patch eliminate zero extension code-gen for instructions including both alu and load/store. The only exception is for ctx load, because offload target doesn't go through host ctx convert logic so we do customized load and ignores zext flag set by verifier. Reviewed-by: Jakub Kicinski Signed-

[PATCH net-next] drivers: net: davinci_mdio: fix return value check in davinci_mdio_probe()

2019-05-03 Thread Wei Yongjun
In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 03f66f067560 ("net: ethernet: ti: davinci_mdio: use devm_ioremap()") Signed-off-by: Wei Yongjun --- drivers/net/ethernet/ti/davi

Re: Possible refcount bug in ip6_expire_frag_queue()?

2019-05-03 Thread Eric Dumazet
On Fri, May 3, 2019 at 5:17 AM Stefan Bader wrote: > > In commit 05c0b86b9696802fd0ce5676a92a63f1b455bdf3 "ipv6: frags: > rewrite ip6_expire_frag_queue()" this function got changed to > be like ip_expire() (after dropping a clone there). > This was backported to 4.4.y stable (amongst other stable

Re: Possible refcount bug in ip6_expire_frag_queue()?

2019-05-03 Thread Eric Dumazet
On Fri, May 3, 2019 at 7:12 AM Eric Dumazet wrote: > > On Fri, May 3, 2019 at 5:17 AM Stefan Bader > wrote: > > > > In commit 05c0b86b9696802fd0ce5676a92a63f1b455bdf3 "ipv6: frags: > > rewrite ip6_expire_frag_queue()" this function got changed to > > be like ip_expire() (after dropping a clone t

[patch net-next] devlink: add warning in case driver does not set port type

2019-05-03 Thread Jiri Pirko
From: Jiri Pirko Prevent misbehavior of drivers who would not set port type for longer period of time. Drivers should always set port type. Do WARN if that happens. Note that it is perfectly fine to temporarily not have the type set, during initialization and port type change. Signed-off-by: Ji

[PATCH net] ip6: fix skb leak in ip6frag_expire_frag_queue()

2019-05-03 Thread Eric Dumazet
Since ip6frag_expire_frag_queue() now pulls the head skb from frag queue, we should no longer use skb_get(), since this leads to an skb leak. Stefan Bader initially reported a problem in 4.4.stable [1] caused by the skb_get(), so this patch should also fix this issue. 296583.091021] kernel BUG at

Re: Possible refcount bug in ip6_expire_frag_queue()?

2019-05-03 Thread Eric Dumazet
On Fri, May 3, 2019 at 7:17 AM Eric Dumazet wrote: > > On Fri, May 3, 2019 at 7:12 AM Eric Dumazet wrote: > > > > I will send the following fix > > > > diff --git a/include/net/ipv6_frag.h b/include/net/ipv6_frag.h > > index > > 28aa9b30aeceac9a86ee6754e4b5809be115e947..d3152811b8962705a508b3fd

Re: [linux-sunxi] [PATCH v4 5/9] arm64: dts: allwinner: orange-pi-3: Enable ethernet

2019-05-03 Thread Jagan Teki
On Sat, Apr 13, 2019 at 10:24 PM megous via linux-sunxi wrote: > > From: Ondrej Jirman > > Orange Pi 3 has two regulators that power the Realtek RTL8211E. According > to the phy datasheet, both regulators need to be enabled at the same time, > but we can only specify a single phy-supply in the DT

Re: [RFC HACK] xfrm: make state refcounting percpu

2019-05-03 Thread Eric Dumazet
On 5/3/19 2:07 AM, Steffen Klassert wrote: > On Wed, Apr 24, 2019 at 12:40:23PM +0200, Florian Westphal wrote: >> I'm not sure this is a good idea to begin with, refcount >> is right next to state spinlock which is taken for both tx and rx ops, >> plus this complicates debugging quite a bit. >

Re: Possible refcount bug in ip6_expire_frag_queue()?

2019-05-03 Thread Stefan Bader
On 03.05.19 13:49, Eric Dumazet wrote: > On Fri, May 3, 2019 at 7:17 AM Eric Dumazet wrote: >> >> On Fri, May 3, 2019 at 7:12 AM Eric Dumazet wrote: >>> > >>> I will send the following fix >>> >>> diff --git a/include/net/ipv6_frag.h b/include/net/ipv6_frag.h >>> index >>> 28aa9b30aeceac9a86ee6

[PATCH net] net: atm: clean up a range check

2019-05-03 Thread Dan Carpenter
The code works fine but the problem is that check for negatives is a no-op: if (arg < 0) i = 0; The "i" value isn't used. We immediately overwrite it with: i = array_index_nospec(arg, MAX_LEC_ITF); The array_index_nospec() macro returns zero if "arg" is out of b

[PATCH 1/2 net-next] net: ll_temac: Fix an NULL vs IS_ERR() check in temac_open()

2019-05-03 Thread Dan Carpenter
The phy_connect() function doesn't return NULL pointers. It returns error pointers on error, so I have updated the check. Fixes: 8425c41d1ef7 ("net: ll_temac: Extend support to non-device-tree platforms") Signed-off-by: Dan Carpenter --- drivers/net/ethernet/xilinx/ll_temac_main.c | 4 ++-- 1

[PATCH 2/2 net-next] net: ll_temac: remove an unnecessary condition

2019-05-03 Thread Dan Carpenter
The "pdata->mdio_bus_id" is unsigned so this condition is always true. This patch just removes it. Signed-off-by: Dan Carpenter --- drivers/net/ethernet/xilinx/ll_temac_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/xilinx/ll_temac_mdio.c b/drive

Re: [PATCH net-next] ipmr: Do not define MAXVIFS twice

2019-05-03 Thread Nikolay Aleksandrov
On 03/05/2019 01:23, David Ahern wrote: > From: David Ahern > > b70432f7319eb refactored mroute code to make it common between ipv4 > and ipv6. In the process, MAXVIFS got defined a second time: the > first is in the uapi file linux/mroute.h. A second one was created > presumably for IPv6 but it

Re: [PATCH v6 bpf-next 13/17] s390: bpf: eliminate zero extension code-gen

2019-05-03 Thread Heiko Carstens
On Fri, May 03, 2019 at 11:42:40AM +0100, Jiong Wang wrote: > Cc: Martin Schwidefsky > Cc: Heiko Carstens > Signed-off-by: Jiong Wang > --- > arch/s390/net/bpf_jit_comp.c | 20 +--- > 1 file changed, 17 insertions(+), 3 deletions(-) When sending patches which affect s390, could

[PATCH] net: ucc_geth - fix Oops when changing number of buffers in the ring

2019-05-03 Thread Christophe Leroy
When changing the number of buffers in the RX ring while the interface is running, the following Oops is encountered due to the new number of buffers being taken into account immediately while their allocation is done when opening the device only. [ 69.882706] Unable to handle kernel paging requ

Re: [PATCH v6 bpf-next 13/17] s390: bpf: eliminate zero extension code-gen

2019-05-03 Thread Eric Dumazet
On 5/3/19 9:41 AM, Heiko Carstens wrote: > On Fri, May 03, 2019 at 11:42:40AM +0100, Jiong Wang wrote: >> Cc: Martin Schwidefsky >> Cc: Heiko Carstens >> Signed-off-by: Jiong Wang >> --- >> arch/s390/net/bpf_jit_comp.c | 20 +--- >> 1 file changed, 17 insertions(+), 3 deletio

Re: [PATCH v6 bpf-next 13/17] s390: bpf: eliminate zero extension code-gen

2019-05-03 Thread Jiong Wang
Heiko Carstens writes: > On Fri, May 03, 2019 at 11:42:40AM +0100, Jiong Wang wrote: >> Cc: Martin Schwidefsky >> Cc: Heiko Carstens >> Signed-off-by: Jiong Wang >> --- >> arch/s390/net/bpf_jit_comp.c | 20 +--- >> 1 file changed, 17 insertions(+), 3 deletions(-) > > When sen

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable

2019-05-03 Thread Vivien Didelot
On Wed, 1 May 2019 00:08:30 +0200, Andrew Lunn wrote: > When requested to disable a port, set the port STP state to disabled. > This fully disables the port and should save some power. > > Signed-off-by: Andrew Lunn Reviewed-by: Vivien Didelot

Re: [PATCH net-next 2/2] net: dsa :mv88e6xxx: Disable unused ports

2019-05-03 Thread Vivien Didelot
On Wed, 1 May 2019 00:08:31 +0200, Andrew Lunn wrote: > If the NO_CPU strap is set, the switch starts in 'dumb hub' mode, with > all ports enable. Ports which are then actively used are reconfigured > as required when the driver starts. However unused ports are left > alone. Change this to disabl

[PATCH v4 00/10] of_net: Add NVMEM support to of_get_mac_address

2019-05-03 Thread Petr Štetiar
Hi, this patch series is a continuation of my previous attempt[1], where I've tried to wire MTD layer into of_get_mac_address, so it would be possible to load MAC addresses from various NVMEMs as EEPROMs etc. Predecessor of this patch which used directly MTD layer has originated in OpenWrt some t

[RFC PATCH net-next 0/3] flow_offload: Re-add various features that disappeared

2019-05-03 Thread Edward Cree
When the flow_offload infrastructure was added, a couple of things that were previously possible for drivers to support in TC offload were not plumbed through, perhaps because the drivers in the tree did not fully or correctly implement them. The main issue was with statistics; in TC (and in the

[PATCH net-next 2/4] net: use indirect calls helpers for L3 handler hooks

2019-05-03 Thread Paolo Abeni
So that we avoid another indirect call per RX packet in the common case. Signed-off-by: Paolo Abeni --- net/ipv4/ip_input.c | 6 +- net/ipv6/ip6_input.c | 7 ++- net/ipv6/tcp_ipv6.c | 3 ++- net/ipv6/udp.c | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/n

[PATCH net-next 3/4] net: use indirect calls helpers at early demux stage

2019-05-03 Thread Paolo Abeni
So that we avoid another indirect call per RX packet, if early demux is enabled. Signed-off-by: Paolo Abeni --- net/ipv4/ip_input.c | 5 - net/ipv6/ip6_input.c | 5 - net/ipv6/tcp_ipv6.c | 2 +- net/ipv6/udp.c | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git

[PATCH net-next 0/4] net: extend indirect calls helper usage

2019-05-03 Thread Paolo Abeni
This series applies the indirect calls helper introduced with commit 283c16a2dfd3 ("indirect call wrappers: helpers to speed-up indirect calls of builtin") to more hooks inside the network stack. Overall this avoids up to 4 indirect calls for each RX packets, giving small but measurable gain TCP

[PATCH net-next 4/4] net: use indirect calls helpers at the socket layer

2019-05-03 Thread Paolo Abeni
This avoids an indirect call per {send,recv}msg syscall in the common (IPv6 or IPv4 socket) case. Signed-off-by: Paolo Abeni --- net/socket.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/net/socket.c b/net/socket.c index a180e1a9ff23..472fbefa5d9b 100

[PATCH net-next 1/4] net: use indirect calls helpers for ptype hook

2019-05-03 Thread Paolo Abeni
This avoids an indirect call per RX IPv6/IPv4 packet. Note that we don't want to use the indirect calls helper for taps. Signed-off-by: Paolo Abeni --- net/core/dev.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index 22f2640f559a..108

[RFC PATCH net-next 1/3] flow_offload: copy tcfa_index into flow_action_entry

2019-05-03 Thread Edward Cree
Required for support of shared counters (and possibly other shared per- action entities in future). Signed-off-by: Edward Cree --- include/net/flow_offload.h | 1 + net/sched/cls_api.c| 1 + 2 files changed, 2 insertions(+) diff --git a/include/net/flow_offload.h b/include/net/flow_off

Re: [PATCH net] ip6: fix skb leak in ip6frag_expire_frag_queue()

2019-05-03 Thread Eric Dumazet
On Fri, May 3, 2019 at 10:55 AM Nicolas Dichtel wrote: > > Le 03/05/2019 à 13:47, Eric Dumazet a écrit : > > Since ip6frag_expire_frag_queue() now pulls the head skb > > from frag queue, we should no longer use skb_get(), since > > this leads to an skb leak. > > > > Stefan Bader initially reported

Re: [PATCH net] ip6: fix skb leak in ip6frag_expire_frag_queue()

2019-05-03 Thread Nicolas Dichtel
Le 03/05/2019 à 13:47, Eric Dumazet a écrit : > Since ip6frag_expire_frag_queue() now pulls the head skb > from frag queue, we should no longer use skb_get(), since > this leads to an skb leak. > > Stefan Bader initially reported a problem in 4.4.stable [1] caused > by the skb_get(), so this patch

[RFC PATCH net-next 2/3] flow_offload: restore ability to collect separate stats per action

2019-05-03 Thread Edward Cree
Introduce a new offload command TC_CLSFLOWER_STATS_BYINDEX, similar to the existing TC_CLSFLOWER_STATS but specifying an action_index (the tcfa_index of the action), which is called for each stats-having action on the rule. Drivers should implement either, but not both, of these commands. Sig

[RFC PATCH net-next 3/3] flow_offload: support CVLAN match

2019-05-03 Thread Edward Cree
Plumb it through from the flow_dissector. Signed-off-by: Edward Cree --- include/net/flow_offload.h | 2 ++ net/core/flow_offload.c| 7 +++ 2 files changed, 9 insertions(+) diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index 6f59cdaf6eb6..48847ee7aa3a 100644 --- a

[PATCH v2 net] ip6: fix skb leak in ip6frag_expire_frag_queue()

2019-05-03 Thread Eric Dumazet
Since ip6frag_expire_frag_queue() now pulls the head skb from frag queue, we should no longer use skb_get(), since this leads to an skb leak. Stefan Bader initially reported a problem in 4.4.stable [1] caused by the skb_get(), so this patch should also fix this issue. 296583.091021] kernel BUG at

Re: [PATCH net] ip6: fix skb leak in ip6frag_expire_frag_queue()

2019-05-03 Thread Peter Oskolkov
On Fri, May 3, 2019 at 4:47 AM Eric Dumazet wrote: > > Since ip6frag_expire_frag_queue() now pulls the head skb > from frag queue, we should no longer use skb_get(), since > this leads to an skb leak. > > Stefan Bader initially reported a problem in 4.4.stable [1] caused > by the skb_get(), so thi

[PATCH ipsec-next 1/6] xfrm: remove init_tempsel indirection from xfrm_state_afinfo

2019-05-03 Thread Florian Westphal
Simple initialization, handle it in the caller. Signed-off-by: Florian Westphal --- include/net/xfrm.h | 2 -- net/ipv4/xfrm4_state.c | 19 -- net/ipv6/xfrm6_state.c | 21 net/xfrm/xfrm_state.c | 56 -- 4 files changed, 4

[PATCH ipsec-next 4/6] xfrm: remove state and template sort indirections from xfrm_state_afinfo

2019-05-03 Thread Florian Westphal
No module dependency, placing this in xfrm_state.c avoids need for an indirection. This also removes the state spinlock -- I don't see why we would need to hold it during sorting. This in turn allows to remove the 'net' argument passed to xfrm_tmpl_sort. Last, remove the EXPORT_SYMBOL, there are

[PATCH ipsec-next 0/6] xfrm: reduce xfrm_state_afinfo size

2019-05-03 Thread Florian Westphal
xfrm_state_afinfo is a very large struct; its over 4kbyte on 64bit systems. The size comes from two arrays to store the l4 protocol type pointers (esp, ah, ipcomp and so on). There are only a handful of those, so just use pointers for protocols that we implement instead of mostly-empty arrays. T

[PATCH ipsec-next 5/6] xfrm: remove eth_proto value from xfrm_state_afinfo

2019-05-03 Thread Florian Westphal
xfrm_prepare_input needs to lookup the state afinfo backend again to fetch the address family ethernet protocol value. There are only two address families, so a switch statement is simpler. While at it, use u8 for family and proto and remove the owner member -- its not used anywhere. Signed-off-b

[PATCH ipsec-next 6/6] xfrm: remove type and offload_type map from xfrm_state_afinfo

2019-05-03 Thread Florian Westphal
Only a handful of xfrm_types exist, no need to have 512 pointers for them. Reduces size of afinfo struct from 4k to 120 bytes on 64bit platforms. Also, the unregister function doesn't need to return an error, no single caller does anything useful with it. Just place a WARN_ON() where needed inst

[PATCH ipsec-next 3/6] xfrm: remove init_flags indirection from xfrm_state_afinfo

2019-05-03 Thread Florian Westphal
There is only one implementation of this function; just call it directly. Signed-off-by: Florian Westphal --- include/net/xfrm.h | 1 - net/ipv4/xfrm4_state.c | 8 net/xfrm/xfrm_state.c | 17 +++-- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/includ

[PATCH ipsec-next 2/6] xfrm: remove init_temprop indirection from xfrm_state_afinfo

2019-05-03 Thread Florian Westphal
same as previous patch: just place this in the caller, no need to have an indirection for a structure initialization. Signed-off-by: Florian Westphal --- include/net/xfrm.h | 4 net/ipv4/xfrm4_state.c | 16 net/ipv6/xfrm6_state.c | 16 net/xfrm/xfrm_st

Re: [PATCH net] ip6: fix skb leak in ip6frag_expire_frag_queue()

2019-05-03 Thread Eric Dumazet
On Fri, May 3, 2019 at 11:33 AM Peter Oskolkov wrote: > > This skb_get was introduced by commit 05c0b86b9696802fd0ce5676a92a63f1b455bdf3 > "ipv6: frags: rewrite ip6_expire_frag_queue()", and the rbtree patch > is not in 4.4, where the bug is reported at. > Shouldn't the "Fixes" tag also reference

[PATCH v2 net] neighbor: Call __ipv4_neigh_lookup_noref in neigh_xmit

2019-05-03 Thread David Ahern
From: David Ahern Commit cd9ff4de0107 changed the key for IFF_POINTOPOINT devices to INADDR_ANY, but neigh_xmit which is used for MPLS encapsulations was not updated to use the altered key. The result is that every packet Tx does a lookup on the gateway address which does not find an entry, a new

Re: [RFC HACK] xfrm: make state refcounting percpu

2019-05-03 Thread Florian Westphal
Eric Dumazet wrote: On 5/3/19 2:07 AM, Steffen Klassert wrote: > > On Wed, Apr 24, 2019 at 12:40:23PM +0200, Florian Westphal wrote: > >> I'm not sure this is a good idea to begin with, refcount > >> is right next to state spinlock which is taken for both tx and rx ops, > >> plus this complicates

Re: [PATCH net] ip6: fix skb leak in ip6frag_expire_frag_queue()

2019-05-03 Thread Peter Oskolkov
On Fri, May 3, 2019 at 8:52 AM Eric Dumazet wrote: > > On Fri, May 3, 2019 at 11:33 AM Peter Oskolkov wrote: > > > > This skb_get was introduced by commit > > 05c0b86b9696802fd0ce5676a92a63f1b455bdf3 > > "ipv6: frags: rewrite ip6_expire_frag_queue()", and the rbtree patch > > is not in 4.4, wher

bpftool doc man page build failure

2019-05-03 Thread Yonghong Song
Quentin, I hit the following errors with latest bpf-next. -bash-4.4$ make man GEN bpftool-perf.8 GEN bpftool-map.8 GEN bpftool.8 GEN bpftool-net.8 GEN bpftool-feature.8 GEN bpftool-prog.8 GEN bpftool-cgroup.8 GEN bpftool-btf.8 GEN

Re: bpftool doc man page build failure

2019-05-03 Thread Quentin Monnet
2019-05-03 16:21 UTC+ ~ Yonghong Song > Quentin, > > I hit the following errors with latest bpf-next. > > -bash-4.4$ make man >GEN bpftool-perf.8 >GEN bpftool-map.8 >GEN bpftool.8 >GEN bpftool-net.8 >GEN bpftool-feature.8 >GEN bpftool-pro

Re: bpftool doc man page build failure

2019-05-03 Thread Yonghong Song
On 5/3/19 9:54 AM, Quentin Monnet wrote: > 2019-05-03 16:21 UTC+ ~ Yonghong Song >> Quentin, >> >> I hit the following errors with latest bpf-next. >> >> -bash-4.4$ make man >> GEN bpftool-perf.8 >> GEN bpftool-map.8 >> GEN bpftool.8 >> GEN bpftool-net.8 >

Re: 32-bit zext JIT efficiency (Was Re: [PATCH bpf-next] selftests/bpf: two scale tests)

2019-05-03 Thread Jiong Wang
Jiong Wang writes: >> > if you can craft a test that shows patch_insn issue before your set, >> > then it's ok to hack bpf_fill_scale1 to use alu64. >> >> As described above, does the test_verifier 732 + jit blinding looks >> convincing? >> >> > I would also prefer to go with option 2 (new zext

Re: [PATCH net] ip6: fix skb leak in ip6frag_expire_frag_queue()

2019-05-03 Thread Eric Dumazet
On 5/3/19 11:58 AM, Peter Oskolkov wrote: > On Fri, May 3, 2019 at 8:52 AM Eric Dumazet wrote: >> >> On Fri, May 3, 2019 at 11:33 AM Peter Oskolkov wrote: >>> >>> This skb_get was introduced by commit >>> 05c0b86b9696802fd0ce5676a92a63f1b455bdf3 >>> "ipv6: frags: rewrite ip6_expire_frag_queue

Re: [PATCH net-next 2/2] net: dsa :mv88e6xxx: Disable unused ports

2019-05-03 Thread Florian Fainelli
On 4/30/19 3:08 PM, Andrew Lunn wrote: > If the NO_CPU strap is set, the switch starts in 'dumb hub' mode, with > all ports enable. Ports which are then actively used are reconfigured > as required when the driver starts. However unused ports are left > alone. Change this to disable them, and turn

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Set STP disable state in port_disable

2019-05-03 Thread Florian Fainelli
On 4/30/19 3:08 PM, Andrew Lunn wrote: > When requested to disable a port, set the port STP state to disabled. > This fully disables the port and should save some power. > > Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli -- Florian

[PATCH net] um: vector netdev: adjust to xmit_more API change

2019-05-03 Thread Johannes Berg
From: Johannes Berg Replace skb->xmit_more usage by netdev_xmit_more(). Fixes: 4f296edeb9d4 ("drivers: net: aurora: use netdev_xmit_more helper") Signed-off-by: Johannes Berg --- arch/um/drivers/vector_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/drivers/v

Re: [PATCH bpf] libbpf: add libbpf_util.h to header install.

2019-05-03 Thread William Tu
On Thu, May 2, 2019 at 1:18 PM Y Song wrote: > > On Thu, May 2, 2019 at 11:34 AM William Tu wrote: > > > > The libbpf_util.h is used by xsk.h, so add it to > > the install headers. > > Can we try to change code a little bit to avoid exposing libbpf_util.h? > Originally libbpf_util.h is considered

RE: Hyperv netvsc - regression for 32-PAE kernel

2019-05-03 Thread Dexuan Cui
> From: linux-hyperv-ow...@vger.kernel.org > On Behalf Of Michael Kelley > Sent: Thursday, May 2, 2019 3:24 PM > To: Juliana Rodrigueiro ; > linux-hyp...@vger.kernel.org > Cc: netdev@vger.kernel.org > Subject: RE: Hyperv netvsc - regression for 32-PAE kernel > > From: Juliana Rodrigueiro Sent: T

Re: [PATCH bpf] libbpf: add libbpf_util.h to header install.

2019-05-03 Thread Y Song
On Fri, May 3, 2019 at 12:54 PM William Tu wrote: > > On Thu, May 2, 2019 at 1:18 PM Y Song wrote: > > > > On Thu, May 2, 2019 at 11:34 AM William Tu wrote: > > > > > > The libbpf_util.h is used by xsk.h, so add it to > > > the install headers. > > > > Can we try to change code a little bit to a

[PATCH] net: dsa: mv88e6xxx: refine SMI support

2019-05-03 Thread Vivien Didelot
The Marvell SOHO switches have several ways to access the internal registers. One of them being the System Management Interface (SMI), using the MDC and MDIO pins, with direct and indirect variants. In preparation for adding support for other register accesses, move the SMI code into its own files

Re: [PATCH] net: dsa: mv88e6xxx: refine SMI support

2019-05-03 Thread Florian Fainelli
On 5/3/19 3:49 PM, Vivien Didelot wrote: > The Marvell SOHO switches have several ways to access the internal > registers. One of them being the System Management Interface (SMI), > using the MDC and MDIO pins, with direct and indirect variants. > > In preparation for adding support for other regi

[net-next v2 01/11] i40e: Fix for allowing too many MDD events on VF

2019-05-03 Thread Jeff Kirsher
From: Carolyn Wyborny This patch changes the driver behavior when detecting a VF MDD event. It now disables the VF after one event, which indicates a hw detected problem in the VF. Before this change, the PF would allow a couple of events before doing the reset. Signed-off-by: Carolyn Wyborny

[net-next v2 10/11] i40e: print PCI vendor and device ID during probe

2019-05-03 Thread Jeff Kirsher
From: Stefan Assmann Printing each devices PCI vendor and device ID has the advantage of easily revealing what hardware we're dealing with exactly. It's no longer necessary to match the PCI bus information to the lspci output. Helps with bug reports where no lspci output is available. Output be

[net-next v2 09/11] i40e: fix misleading message about promisc setting on un-trusted VF

2019-05-03 Thread Jeff Kirsher
From: Harshitha Ramamurthy A refactor of the i40e_vc_config_promiscuous_mode_msg function moved the check for un-trusted VF into another function. We have to lie to an un-trusted VF that its request to set promiscuous mode is successful even when it is not because we don't want the VF to find out

[net-next v2 00/11][pull request] 40GbE Intel Wired LAN Driver Updates 2019-05-03

2019-05-03 Thread Jeff Kirsher
This series contains updates to the i40e driver only. Carolyn changes the driver behavior to now disable the VF after one MDD event instead of allowing a couple of MDD events before doing the reset. Aleksandr changes the driver to only report an error when a VF tries to remove VLAN when a port VL

[net-next v2 04/11] i40e: ShadowRAM checksum calculation change

2019-05-03 Thread Jeff Kirsher
From: Maciej Paczkowski Due to changes in FW the SW is required to perform double SR dump in some cases. Implementation adds two new steps to update nvm checksum function: * recalculate checksum and check if checksum in NVM is correct * if checksum in NVM is not correct then update it again Sig

[net-next v2 05/11] i40e: Report advertised link modes on 40GBase_LR4, CR4 and fibre

2019-05-03 Thread Jeff Kirsher
From: Adam Ludkiewicz Add assignments for advertising 40GBase_LR4, 40GBase_CR4 and fibre Signed-off-by: Adam Ludkiewicz Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) dif

[net-next v2 08/11] i40e: update version number

2019-05-03 Thread Jeff Kirsher
From: Alice Michael Just bumping the version number appropriately. Signed-off-by: Alice Michael Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/

[net-next v2 06/11] i40e: Further implementation of LLDP

2019-05-03 Thread Jeff Kirsher
From: Aleksandr Loktionov This code implements driver code changes necessary for LLDP Agent support. Modified i40e_aq_start_lldp() and i40e_aq_stop_lldp() adding false parameter whether LLDP state should be persistent across power cycles. Signed-off-by: Aleksandr Loktionov Tested-by: Andrew Bow

[net-next v2 03/11] i40e: remove error msg when vf with port vlan tries to remove vlan 0

2019-05-03 Thread Jeff Kirsher
From: Aleksandr Loktionov VF's attempt to delete vlan 0 when a port vlan is configured is harmless in this case pf driver just does nothing. If vf will try to remove other vlans when a port vlan is configured it will still produce error as before. Signed-off-by: Aleksandr Loktionov Tested-by:

[net-next v2 07/11] i40e: remove out-of-range comparisons in i40e_validate_cloud_filter

2019-05-03 Thread Jeff Kirsher
From: Jacob Keller The function i40e_validate_cloud_filter checks that the destination and source port numbers are valid by attempting to ensure that the number is non-zero and no larger than 0x. However, the types for the dst_port and src_port variable are __be16 which by definition cannot b

[net-next v2 11/11] i40e: Introduce recovery mode support

2019-05-03 Thread Jeff Kirsher
From: Alice Michael This patch introduces "recovery mode" to the i40e driver. It is part of a new Any2Any idea of upgrading the firmware. In this approach, it is required for the driver to have support for "transition firmware", that is used for migrating from structured to flat firmware image. I

[net-next v2 02/11] i40e: change behavior on PF in response to MDD event

2019-05-03 Thread Jeff Kirsher
From: Carolyn Wyborny TX MDD events reported on the PF are the result of the PF misconfiguring a descriptor and not because of "bad actions" by anything else. No need to reset now because if it results in a Tx hang, the Tx hang check will take care of it. Signed-off-by: Carolyn Wyborny Tested-

  1   2   >