Re: [PATCH v3 bpf-next 08/19] bpf: insert explicit zero extension insn when hardware doesn't do it implicitly

2019-04-15 Thread Naveen N. Rao
Jiong Wang wrote: On 15 Apr 2019, at 19:21, Naveen N. Rao wrote: Jiong Wang wrote: It will be great if you could test the latest set on PowerPC to see if there is any regression for example for those under test_progs and test_verifier. With test_bpf, I am seeing a few failures with this pa

[PATCH v5 2/2] net: phy: vitesse: Remove support for VSC8514

2019-04-15 Thread Kavyasree.Kotagiri
Add support for VSC8514 in Microsemi driver (mscc.c) with more features. Signed-off-by: Kavya Sree Kotagiri --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/net/phy/vitesse.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/

[PATCH v5 1/2] net: phy: mscc: add support for VSC8514 PHY.

2019-04-15 Thread Kavyasree.Kotagiri
The VSC8514 PHY is a 4-ports PHY that is 10/100/1000BASE-T, 100BASE-FX, 1000BASE-X, can communicate with the MAC via QSGMII. The MAC interface protocol for each port within QSGMII can be either 1000BASE-X or SGMII, if the QSGMII MAC that the VSC8514 is connecting to supports this functionality. VSC

[PATCH v5 0/2] net: phy: mscc: Improvements to VSC8514 PHY driver

2019-04-15 Thread Kavyasree.Kotagiri
The VSC8514 PHY is a 4-ports PHY that is 10/100/1000BASE-T, 100BASE-FX, 1000BASE-X, can communicate with the MAC via QSGMII. The MAC interface protocol for each port within QSGMII can be either 1000BASE-X or SGMII, if the QSGMII MAC that the VSC8514 is connecting to supports thi

Re: [PATCH v3] net: Fix missing meta data in skb with vlan packet

2019-04-15 Thread Toshiaki Makita
On 2019/04/16 10:22, Yuya Kusakabe wrote: > skb_reorder_vlan_header() should move XDP meta data with ethernet header > if XDP meta data exists. > > Fixes: de8f3a83b0a0 ("bpf: add meta pointer for direct access") > Signed-off-by: Yuya Kusakabe > Signed-off-by: Takeru Hayasaka > Co-developed-by: T

Re: [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio

2019-04-15 Thread kbuild test robot
Hi David, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on net/master] [also build test WARNING on v5.1-rc5 next-20190415] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci

Re: [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio

2019-04-15 Thread kbuild test robot
Hi David, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on net/master] [also build test WARNING on v5.1-rc5 next-20190415] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci

Re: [PATCH] ipv4: set the tcp_min_rtt_wlen range from 0 to u32_max_div_HZ

2019-04-15 Thread zhangxiaoxu (A)
Thank you very much. I have updated the patch: https://lore.kernel.org/netdev/1555379244-71866-1-git-send-email-zhangxiao...@huawei.com/ On 4/16/2019 1:53 AM, Eric Dumazet wrote: On 04/15/2019 12:15 AM, ZhangXiaoxu wrote: There is a UBSAN report as below: UBSAN: Undefined behaviour in net/ip

[PATCH] ipv4: set the tcp_min_rtt_wlen range from 0 to one day

2019-04-15 Thread ZhangXiaoxu
There is a UBSAN report as below: UBSAN: Undefined behaviour in net/ipv4/tcp_input.c:2877:56 signed integer overflow: 2147483647 * 1000 cannot be represented in type 'int' CPU: 3 PID: 0 Comm: swapper/3 Not tainted 5.1.0-rc4-00058-g582549e #1 Call Trace: dump_stack+0x8c/0xba ubsan_epilogue+0x11/

Re: [PATCH v4 bpf-next 01/15] bpf: split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32

2019-04-15 Thread Alexei Starovoitov
On Mon, Apr 15, 2019 at 06:26:11PM +0100, Jiong Wang wrote: > Register liveness infrastructure doesn't track register read width at the > moment, while the width information will be needed for the later 32-bit > safety analysis pass. > > This patch take the first step to split read liveness into R

[PATCH v3] net: Fix missing meta data in skb with vlan packet

2019-04-15 Thread Yuya Kusakabe
skb_reorder_vlan_header() should move XDP meta data with ethernet header if XDP meta data exists. Fixes: de8f3a83b0a0 ("bpf: add meta pointer for direct access") Signed-off-by: Yuya Kusakabe Signed-off-by: Takeru Hayasaka Co-developed-by: Takeru Hayasaka --- net/core/skbuff.c | 10 +-

Re: [PATCH v2] net: Fix missing meta data in skb with vlan packet

2019-04-15 Thread Yuya Kusakabe
On 4/16/19 9:45 AM, Toshiaki Makita wrote: > On 2019/04/15 23:21, Yuya Kusakabe wrote: >> skb_reorder_vlan_header() should move XDP meta data with ethernet header >> if XDP meta data exists. >> >> Fixes: de8f3a83b0a0 ("bpf: add meta pointer for direct access") >> Signed-off-by: Yuya Kusakabe >> Si

[PATCH net-next 09/13] ipv6: Pass fib6_result to rt6_device_match

2019-04-15 Thread David Ahern
From: David Ahern Pass fib6_result to rt6_device_match with f6i set. rt6_device_match updates f6i in the result if it finds a better match and sets nh. Signed-off-by: David Ahern --- net/ipv6/route.c | 49 ++--- 1 file changed, 30 insertions(+), 19 d

[PATCH net-next 01/13] ipv6: Rename fib6_multipath_select and pass fib6_result

2019-04-15 Thread David Ahern
From: David Ahern Add 'struct fib6_result' to hold the fib entry and fib6_nh from a fib lookup as separate entries, similar to what IPv4 now has with fib_result. Rename fib6_multipath_select to fib6_select_path, pass fib6_result to it, and set f6i and nh in the result once a path selection is do

[PATCH net-next 06/13] ipv6: Pass fib6_result to ip6_rt_get_dev_rcu and ip6_rt_copy_init

2019-04-15 Thread David Ahern
From: David Ahern Now that all callers are update to have a fib6_result, pass it down to ip6_rt_get_dev_rcu, ip6_rt_copy_init, and ip6_rt_init_dst. In the process, change ort to f6i in ip6_rt_copy_init to make it clear it is a reference to a fib6_info. Signed-off-by: David Ahern --- net/ipv6/

[PATCH net-next 11/13] ipv6: Pass fib6_result to fib6_table_lookup tracepoint

2019-04-15 Thread David Ahern
From: David Ahern Change fib6_table_lookup tracepoint to take the fib6_result and use the fib6_info and fib6_nh from it. Signed-off-by: David Ahern --- include/trace/events/fib6.h | 16 net/ipv6/route.c| 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-)

[PATCH net-next 10/13] ipv6: Pass fib6_result to rt6_select and find_rr_leaf

2019-04-15 Thread David Ahern
From: David Ahern Pass fib6_result to rt6_select. Instead of returning the fib entry, it will set f6i and nh based on the lookup. find_rr_leaf is changed to remove the match option in favor of taking fib6_result and having __find_rr_leaf set f6i in the result. In the process, update fib6_info r

[PATCH net-next 12/13] ipv6: Pass fib6_result to fib lookups

2019-04-15 Thread David Ahern
From: David Ahern Change fib6_lookup and fib6_table_lookup to take a fib6_result and set f6i and nh rather than returning a fib6_info. For now both always return 0. A later patch set can make these more like the IPv4 counterparts and return EINVAL, EACCESS, etc based on fib6_type. Signed-off-by

[PATCH net-next 04/13] ipv6: Pass fib6_result to ip6_create_rt_rcu

2019-04-15 Thread David Ahern
From: David Ahern Change ip6_create_rt_rcu to take fib6_result over a fib6_info. Signed-off-by: David Ahern --- net/ipv6/route.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index f267b3060ac7..5

[PATCH net-next 08/13] ipv6: Pass fib6_result to ip6_mtu_from_fib6 and fib6_mtu

2019-04-15 Thread David Ahern
From: David Ahern Change ip6_mtu_from_fib6 and fib6_mtu to take a fib6_result over a fib6_info. Update both to use the fib6_nh from fib6_result. Since the signature of ip6_mtu_from_fib6 is already changing, add const to daddr and saddr. Signed-off-by: David Ahern --- include/net/ip6_route.h

[PATCH net-next 00/13] ipv6: Use fib6_result for fib_lookups

2019-04-15 Thread David Ahern
From: David Ahern Add fib6_result as a single data structure to hold results from a fib lookup. IPv6 currently has everything in 1 data structure - a fib6_info, but with nexthop objects the fib6_nh can be in a nexthop or a nexthop can be a blackhole which affects the fib6_type and flags (REJECT).

[PATCH net-next 07/13] ipv6: Pass fib6_result to rt6_insert_exception

2019-04-15 Thread David Ahern
From: David Ahern Update rt6_insert_exception to take a fib6_result over a fib6_info. Change ort to f6i from the fib6_result and rename to better reflect what it references (a fib6_info). Since this function is already getting changed, update the comments to reference fib6_info variables rather

[PATCH net-next 03/13] ipv6: Pass fib6_result to ip6_rt_cache_alloc

2019-04-15 Thread David Ahern
From: David Ahern Change ip6_rt_cache_alloc to take a fib6_result over a fib6_info. Since ip6_rt_cache_alloc is only the caller, update the rt6_is_gw_or_nonexthop helper to take fib6_result. Signed-off-by: David Ahern --- net/ipv6/route.c | 46 +- 1

[PATCH net-next 05/13] ipv6: Pass fib6_result to pcpu route functions

2019-04-15 Thread David Ahern
From: David Ahern Update ip6_rt_pcpu_alloc, rt6_get_pcpu_route and rt6_make_pcpu_route to a fib6_result over a fib6_info. Signed-off-by: David Ahern --- net/ipv6/route.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv

[PATCH net-next 13/13] ipv6: Add fib6_type and fib6_flags to fib6_result

2019-04-15 Thread David Ahern
From: David Ahern Add the fib6_flags and fib6_type to fib6_result. Update the lookup helpers to set them and update post fib lookup users to use the version from the result. This allows nexthop objects to have blackhole nexthop. Signed-off-by: David Ahern --- include/net/ip6_fib.h | 2

[PATCH net-next 02/13] ipv6: Pass fib6_result to rt6_find_cached_rt

2019-04-15 Thread David Ahern
From: David Ahern Simplify rt6_find_cached_rt for the fast path cases and pass fib6_result to rt6_find_cached_rt. Rename the local return variable to ret to maintain consisting with fib6_result name. Update the comment in rt6_find_cached_rt to reference the new names in a fib6_info vs the old na

Re: [PATCH bpf-next] tools/bpftool: show btf id in program information

2019-04-15 Thread Andrii Nakryiko
On Thu, Apr 11, 2019 at 8:38 AM Yonghong Song wrote: > > > cc Andrii > > On 4/11/19 12:51 AM, Daniel Borkmann wrote: > > On 04/10/2019 05:39 PM, Jakub Kicinski wrote: > >> On Wed, 10 Apr 2019 13:56:42 +0900, Prashant Bhole wrote: > >>> Let's add a way to know whether a program has btf context. > >

Re: [PATCH v2] net: Fix missing meta data in skb with vlan packet

2019-04-15 Thread Toshiaki Makita
On 2019/04/15 23:21, Yuya Kusakabe wrote: > skb_reorder_vlan_header() should move XDP meta data with ethernet header > if XDP meta data exists. > > Fixes: de8f3a83b0a0 ("bpf: add meta pointer for direct access") > Signed-off-by: Yuya Kusakabe > Signed-off-by: Takeru Hayasaka > Co-developed-by: T

[PATCH net-next,v2] ipv6: Add rate limit mask for ICMPv6 messages

2019-04-15 Thread Stephen Suryaputra
To make ICMPv6 closer to ICMPv4, add ratemask parameter. Since the ICMP message types use larger numeric values, a simple bitmask doesn't fit. I use large bitmap. The input and output are the in form of list of ranges. Set the default to rate limit all error messages but Packet Too Big. For Packet

Re: [PATCH v2 net-next] net: phy: switch drivers to use dynamic feature detection

2019-04-15 Thread David Miller
From: Heiner Kallweit Date: Fri, 12 Apr 2019 20:47:03 +0200 > Recently genphy_read_abilities() has been added that dynamically detects > clause 22 PHY abilities. I *think* this detection should work with all > supported PHY's, at least for the ones with basic features sets, i.e. > PHY_BASIC_FEATU

[PATCH bpf-next 2/2] selftests/btf: add VAR and DATASEC case for dedup tests

2019-04-15 Thread andrii.nakryiko
From: Andrii Nakryiko Add test case verifying that dedup happens (INTs are deduped in this case) and VAR/DATASEC types are not deduped, but have their referenced type IDs adjusted correctly. Cc: Daniel Borkmann Cc: Yonghong Song Cc: Alexei Starovoitov Signed-off-by: Andrii Nakryiko --- tool

[PATCH bpf-next 0/2] add btf_dedup() support for VAR and DATASEC

2019-04-15 Thread andrii.nakryiko
From: Andrii Nakryiko This patchset adds support for new BTF_KIND_VAR and BTF_KIND_DATASEC BTF types in btf_dedup() algorithm. VAR and DATASEC are not deduplicated and are always considered to be unique, but they require referenced type IDs adjustment. Patch #1 adds VAR/DATASEC pass-through supp

[PATCH bpf-next 1/2] btf: add support for VAR and DATASEC in btf_dedup()

2019-04-15 Thread andrii.nakryiko
From: Andrii Nakryiko This patch adds support for VAR and DATASEC in btf_dedup(). VAR/DATASEC are never deduplicated, but they need to be processed anyway as types they refer to might need to be remapped due to deduplication and compaction. Cc: Daniel Borkmann Cc: Yonghong Song Cc: Alexei Star

Re: [PATCH bpf-next] kbuild: handle old pahole more gracefully when generating BTF

2019-04-15 Thread Song Liu
> On Apr 15, 2019, at 2:58 PM, andrii.nakry...@gmail.com wrote: > > From: Andrii Nakryiko > > When CONFIG_DEBUG_INFO_BTF is enabled but available version of pahole is too > old to support BTF generation, build script is supposed to emit warning and > proceed with the build. Due to using exit

Re: [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio

2019-04-15 Thread kbuild test robot
Hi David, Thank you for the patch! Yet something to improve: [auto build test ERROR on net/master] [also build test ERROR on v5.1-rc5 next-20190415] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH v4 bpf-next 01/15] bpf: split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32

2019-04-15 Thread Jakub Kicinski
On Mon, 15 Apr 2019 18:26:11 +0100, Jiong Wang wrote: > Register liveness infrastructure doesn't track register read width at the > moment, while the width information will be needed for the later 32-bit > safety analysis pass. > > This patch take the first step to split read liveness into REG_LIV

Re: Per-queue XDP programs, thoughts

2019-04-15 Thread Jakub Kicinski
On Mon, 15 Apr 2019 18:32:58 +0200, Jesper Dangaard Brouer wrote: > On Mon, 15 Apr 2019 13:59:03 +0200 Björn Töpel wrote: > > Hi, > > > > As you probably can derive from the amount of time this is taking, I'm > > not really satisfied with the design of per-queue XDP program. (That, > > plus I'm a

Re: [PATCH bpf] bpf: allow clearing all sock_ops callback flags

2019-04-15 Thread Martin Lau
On Mon, Apr 15, 2019 at 09:54:55AM +, Viet Hoang Tran wrote: > The helper function bpf_sock_ops_cb_flags_set() can be used to both > set and clear the sock_ops callback flags. However, its current > behavior is not consistent. BPF program may clear a flag if more than > one were set, or replace

Re: [PATCH net-next 00/11] Flower flow merging

2019-04-15 Thread David Miller
From: Simon Horman Date: Mon, 15 Apr 2019 16:55:52 +0200 > John Hurley says, > > These patches deal with 'implicit recirculation' on the NFP. This is a > firmware feature whereby a packet egresses to an 'internal' port meaning > that it will recirculate back to the header extract phase with the

[PATCH bpf-next] kbuild: handle old pahole more gracefully when generating BTF

2019-04-15 Thread andrii.nakryiko
From: Andrii Nakryiko When CONFIG_DEBUG_INFO_BTF is enabled but available version of pahole is too old to support BTF generation, build script is supposed to emit warning and proceed with the build. Due to using exit instead of return from BASH function, existing handling code prematurely exits e

Re: [patch net-next rfc 10/15] netdevsim: merge sdev into dev

2019-04-15 Thread Jakub Kicinski
On Sat, 13 Apr 2019 18:21:07 +0200, Jiri Pirko wrote: > From: Jiri Pirko > > As previously introduce dev which is mapped 1:1 to a bus device covers > the purpose of the original shared device, merge the sdev code into dev. > > Signed-off-by: Jiri Pirko One ASIC may have multiple bus devices.

Re: [PATCHv2 net-next 0/2] sctp: fully support memory accounting

2019-04-15 Thread David Miller
From: Xin Long Date: Mon, 15 Apr 2019 17:15:05 +0800 > sctp memory accounting is added in this patchset by using > these kernel APIs on send side: > > - sk_mem_charge() > - sk_mem_uncharge() > - sk_wmem_schedule() > - sk_under_memory_pressure() > - sk_mem_reclaim() > > and these on re

Re: [PATCH net] route: Avoid crash from dereferencing NULL rt->from

2019-04-15 Thread David Miller
From: Jonathan Lemon Date: Sun, 14 Apr 2019 14:21:29 -0700 > When __ip6_rt_update_pmtu() is called, rt->from is RCU dereferenced, but is > never checked for null - rt6_flush_exceptions() may have removed the entry. > > [ 1913.989004] RIP: 0010:ip6_rt_cache_alloc+0x13/0x170 > [ 1914.209410] Call

Re: [PATCH net-next 0/3] mlxsw: Add neighbour offload indication

2019-04-15 Thread David Miller
From: Ido Schimmel Date: Sun, 14 Apr 2019 18:57:46 + > Neighbour entries are programmed to the device's table so that the > correct destination MAC will be specified in a packet after it was > routed. > > Despite being programmed to the device and unlike routes and FDB > entries, neighbour e

Re: Request for net merge into net-next

2019-04-15 Thread David Miller
From: Felix Fietkau Date: Fri, 12 Apr 2019 21:41:36 +0200 > I have a whole bunch of pending mt76 changes for -next which depend on > these two commits: > > commit 2b4a66980217332d91ab1785e1750857d6d52bc8 > mac80211: make ieee80211_schedule_txq schedule empty TXQs > > commit 5b989c18dab2e82bac8a

Re: [PATCH net] bonding: fix event handling for stacked bonds

2019-04-15 Thread David Miller
From: Sabrina Dubroca Date: Fri, 12 Apr 2019 15:04:10 +0200 > When a bond is enslaved to another bond, bond_netdev_event() only > handles the event as if the bond is a master, and skips treating the > bond as a slave. > > This leads to a refcount leak on the slave, since we don't remove the > ad

[no subject]

2019-04-15 Thread desmond denteh
-- - Dragă prieten, Sunt Ramesh Kumar a serviciilor bancare personale în unitatea Emiratele Arabe Unite Universitatea de la Barclays Dubai, am în banca mea, cu o sumă mare de bani aparține clientului, dl Daniel, care se întâmplă cu el același nume. Fondul acum, fără nici o pretenție pent

Re: [PATCH v3 bpf-next 08/19] bpf: insert explicit zero extension insn when hardware doesn't do it implicitly

2019-04-15 Thread Jiong Wang
> On 15 Apr 2019, at 19:21, Naveen N. Rao > wrote: > > Jiong Wang wrote: >> It will be great if you could test the latest set on PowerPC to see if >> there is any regression for example for those under test_progs and >> test_verifier. > > With test_bpf, I am seeing a few failures with this pa

Re: [patch net-next rfc 00/15] netdevsim: impement proper device model

2019-04-15 Thread Jakub Kicinski
On Sat, 13 Apr 2019 18:20:57 +0200, Jiri Pirko wrote: > From: Jiri Pirko > > Currently the model of netdevsim is a bit odd in multiple ways. > 1) devlink instance is not in any way related with actual netdevsim >netdevices. Instead, it is created per-namespace. > 2) multi-port netdevsim devic

Re: [PATCH net] route: Avoid crash from dereferencing NULL rt->from

2019-04-15 Thread David Ahern
On 4/15/19 10:17 AM, Martin Lau wrote: > Hi David, is similar check also needed in rt6_do_redirect() and > inet6_rtm_getroute()? good question. I think both could be returning an rt6_info from the exception cache so yes they should have a similar check.

Re: [PATCH v3 bpf-next 1/2] bpftool: Use print_entry_error() in case of ENOENT when dumping

2019-04-15 Thread Jakub Kicinski
On Mon, 15 Apr 2019 16:15:35 +0900, Benjamin Poirier wrote: > Commit bf598a8f0f77 ("bpftool: Improve handling of ENOENT on map dumps") > used print_entry_plain() in case of ENOENT. However, that commit introduces > dead code. Per-cpu maps are zero-filled. When reading them, it's all or > nothing. T

Re: [PATCH v3 bpf-next 2/2] bpftool: Improve handling of ENOSPC on reuseport_array map dumps

2019-04-15 Thread Jakub Kicinski
On Mon, 15 Apr 2019 16:15:36 +0900, Benjamin Poirier wrote: > avoids outputting a series of > value: > No space left on device > > The value itself is not wrong but bpf_fd_reuseport_array_lookup_elem() can > only return it if the map was created with value_size = 8. There's nothing > b

Re: [PATCH v3 bpf-next 08/19] bpf: insert explicit zero extension insn when hardware doesn't do it implicitly

2019-04-15 Thread Naveen N. Rao
Jiong Wang wrote: It will be great if you could test the latest set on PowerPC to see if there is any regression for example for those under test_progs and test_verifier. With test_bpf, I am seeing a few failures with this patchset. And it will be even greater if you also use latest llvm sn

Re: [PATCH] arm64: do_csum: implement accelerated scalar version

2019-04-15 Thread Robin Murphy
On 12/04/2019 10:52, Will Deacon wrote: On Fri, Apr 12, 2019 at 10:31:16AM +0800, Zhangshaokun wrote: On 2019/2/19 7:08, Ard Biesheuvel wrote: It turns out that the IP checksumming code is still exercised often, even though one might expect that modern NICs with checksum offload have no use for

Re: Per-queue XDP programs, thoughts

2019-04-15 Thread Jonathan Lemon
On 15 Apr 2019, at 9:32, Jesper Dangaard Brouer wrote: On Mon, 15 Apr 2019 13:59:03 +0200 Björn Töpel wrote: Hi, As you probably can derive from the amount of time this is taking, I'm not really satisfied with the design of per-queue XDP program. (That, plus I'm a terribly slow hacker..

Re: [PATCH] ipv4: set the tcp_min_rtt_wlen range from 0 to u32_max_div_HZ

2019-04-15 Thread Eric Dumazet
On 04/15/2019 12:15 AM, ZhangXiaoxu wrote: > There is a UBSAN report as below: > UBSAN: Undefined behaviour in net/ipv4/tcp_input.c:2877:56 > signed integer overflow: > 2147483647 * 1000 cannot be represented in type 'int' > CPU: 3 PID: 0 Comm: swapper/3 Not tainted 5.1.0-rc4-00058-g582549e #1 >

[PATCH v3 net-next 7/7] ip6tlvs: Validation of TX Destination and Hop-by-Hop options

2019-04-15 Thread Tom Herbert
Validate Destination and Hop-by-Hop options. This uses the information in the TLV parameters table to validate various aspects of both individual TLVs as well as a list of TLVs in an extension header. There are two levels of validation that can be performed: simple checks and deep checks. Simple c

[PATCH v3 net-next 4/7] exthdrs: Registration of TLV handlers and parameters

2019-04-15 Thread Tom Herbert
Create a single TLV parameter table that holds meta information for IPv6 Hop-by-Hop and Destination TLVs. The data structure is composed of a 256 element array of u8's (one entry for each TLV type to allow O(1) lookup). Each entry provides an offset into an array of TLV proc data structures which f

Re: [PATCH] wil6210: fix potential out-of-bounds read

2019-04-15 Thread Gustavo A. R. Silva
On 4/15/19 12:24 PM, me...@codeaurora.org wrote: > On 2019-04-15 17:56, Gustavo A. R. Silva wrote: >> Notice that *rc* can evaluate to up to 5, include/linux/netdevice.h: >> >> enum gro_result { >>     GRO_MERGED, >>     GRO_MERGED_FREE, >>     GRO_HELD, >>     GRO_NORMAL, >>    

[PATCH v3 net-next 2/7] exthdrs: Move generic EH functions to exthdrs_core.c

2019-04-15 Thread Tom Herbert
Move generic functions in exthdrs.c to exthdrs_core.c so that exthdrs.c only contains functions that are specific to IPv6 processing, and exthdrs_core.c contains functions that are generic. --- net/ipv6/exthdrs.c | 138 --- net/ipv6/exthdrs_core.c |

[PATCH v3 net-next 5/7] exthdrs: Add TX parameters

2019-04-15 Thread Tom Herbert
Define a number of transmit parameters for TLV Parameter table definitions. These will be used for validating TLVs that are set on a socket. --- include/net/ipv6.h | 26 - include/uapi/linux/in6.h | 8 +++ net/ipv6/exthdrs.c | 2 +- net/ipv6/exthdrs_core

[PATCH v3 net-next 3/7] ipv6: Consolidate option cases in ip6_datagram_send_ctl

2019-04-15 Thread Tom Herbert
Consolidate cases for IPV6_2292HOPOPTS, IPV6_HOPOPTS, IPV6_2292DSTOPTS, IPV6_DSTOPTS, and IPV6_RTHDRDSTOPTS. Most of the work and verifications are common for all these case, individual differences in processing can be implemented with an embedded switch statement. --- net/ipv6/datagram.c | 66 +++

[PATCH v3 net-next 6/7] ip6tlvs: Add netlink interface

2019-04-15 Thread Tom Herbert
Add a netlink interface to manage the TX TLV parameters. Managed parameters include those for validating and sending TLVs being sent such as alignment, TLV ordering, length limits, etc. --- include/net/ipv6.h | 18 +++ include/uapi/linux/in6.h | 31 + net/ipv6/exthdrs_core.c| 2

[PATCH v3 net-next 0/7] exthdrs: Make ext. headers & options useful - Part I

2019-04-15 Thread Tom Herbert
Extension headers are the mechanism of extensibility for the IPv6 protocol, however to date they have only seen limited deployment. The reasons for that are because intermediate devices don't handle them well, and there haven't really be any useful extension headers defined. In particular, Destinat

[PATCH v3 net-next 1/7] exthdrs: Create exthdrs_options.c

2019-04-15 Thread Tom Herbert
Create exthdrs_options.c to hold code related to specific Hop-by-Hop and Destination extension header options. Move related functions in exthdrs.c to the new file. --- include/net/ipv6.h | 15 net/ipv6/Makefile | 2 +- net/ipv6/exthdrs.c | 204 -

[PATCH bpf-next v5 6/6] selftests/bpf: add flow dissector bpf_skb_load_bytes helper test

2019-04-15 Thread Stanislav Fomichev
When flow dissector is called without skb, we want to make sure bpf_skb_load_bytes invocations return error. Add small test which tries to read single byte from a packet. bpf_skb_load_bytes should always fail under BPF_PROG_TEST_RUN because it was converted to the skb-less mode. Signed-off-by: St

[PATCH bpf-next v5 5/6] net: pass net argument to the eth_get_headlen

2019-04-15 Thread Stanislav Fomichev
Update all users eth_get_headlen to pass network namespace and pass it down to the flow dissector. This commit is a noop until administrator inserts BPF flow dissector program. Cc: Maxim Krasnyansky Cc: Saeed Mahameed Cc: Jeff Kirsher Cc: intel-wired-...@lists.osuosl.org Cc: Yisen Zhuang Cc: S

[PATCH bpf-next v5 4/6] flow_dissector: handle no-skb use case

2019-04-15 Thread Stanislav Fomichev
When called without skb, gather all required data from the __skb_flow_dissect's arguments and use recently introduces no-skb mode of bpf flow dissector. Note: WARN_ON_ONCE(!net) will now trigger for eth_get_headlen users. Signed-off-by: Stanislav Fomichev --- include/linux/skbuff.h| 5

[PATCH bpf-next v5 3/6] net: plumb network namespace into __skb_flow_dissect

2019-04-15 Thread Stanislav Fomichev
This new argument will be used in the next patches for the eth_get_headlen use case. eth_get_headlen calls flow dissector with only data (without skb) so there is currently no way to pull attached BPF flow dissector program. With this new argument, we can amend the callers to explicitly pass networ

[PATCH bpf-next v5 2/6] bpf: when doing BPF_PROG_TEST_RUN for flow dissector use no-skb mode

2019-04-15 Thread Stanislav Fomichev
Now that we have bpf_flow_dissect which can work on raw data, use it when doing BPF_PROG_TEST_RUN for flow dissector. Simplifies bpf_prog_test_run_flow_dissector and allows us to test no-skb mode. Note, that previously, with bpf_flow_dissect_skb we used to call eth_type_trans which pulled L2 (ETH

[PATCH bpf-next v5 1/6] flow_dissector: switch kernel context to struct bpf_flow_dissector

2019-04-15 Thread Stanislav Fomichev
struct bpf_flow_dissector has a small subset of sk_buff fields that flow dissector BPF program is allowed to access and an optional pointer to real skb. Real skb is used only in bpf_skb_load_bytes helper to read non-linear data. The real motivation for this is to be able to call flow dissector fro

[PATCH bpf-next v5 0/6] net: flow_dissector: trigger BPF hook when called from eth_get_headlen

2019-04-15 Thread Stanislav Fomichev
Currently, when eth_get_headlen calls flow dissector, it doesn't pass any skb. Because we use passed skb to lookup associated networking namespace to find whether we have a BPF program attached or not, we always use C-based flow dissector in this case. The goal of this patch series is to add new n

[PATCH v4 bpf-next 08/15] selftests: enable hi32 randomization for all tests

2019-04-15 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 v4 bpf-next 02/15] bpf: mark lo32 writes that should be zero extended into hi32

2019-04-15 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 v4 bpf-next 15/15] nfp: bpf: eliminate zero extension code-gen

2019-04-15 Thread Jiong Wang
This patch eliminate zero extension code-gen for instructions except load/store when possible. Elimination for load/store will be supported in up coming patches. Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 119 +-

[PATCH v4 bpf-next 13/15] x32: bpf: eliminate zero extension code-gen

2019-04-15 Thread Jiong Wang
Cc: Wang YanQing Signed-off-by: Jiong Wang --- arch/x86/net/bpf_jit_comp32.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c index 0d9cdff..8c6cf22 100644 --- a/arch/x86/net/bpf_j

[PATCH v4 bpf-next 06/15] bpf: randomize high 32-bit when BPF_F_TEST_RND_HI32 is set

2019-04-15 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 v4 bpf-next 14/15] riscv: bpf: eliminate zero extension code-gen

2019-04-15 Thread Jiong Wang
CC: Björn Töpel Signed-off-by: Jiong Wang --- arch/riscv/net/bpf_jit_comp.c | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/arch/riscv/net/bpf_jit_comp.c b/arch/riscv/net/bpf_jit_comp.c index 80b12aa..9cba262 100644 --- a/arch/riscv/net/bpf_

[PATCH v4 bpf-next 10/15] powerpc: bpf: eliminate zero extension code-gen

2019-04-15 Thread Jiong Wang
Cc: Naveen N. Rao Cc: Sandipan Das Signed-off-by: Jiong Wang --- arch/powerpc/net/bpf_jit_comp64.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c index 21a1dcd..d10621b 100644 --- a/arch/powerpc/ne

[PATCH v4 bpf-next 04/15] bpf: insert explicit zero extension insn when hardware doesn't do it implicitly

2019-04-15 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 v4 bpf-next 11/15] s390: bpf: eliminate zero extension code-gen

2019-04-15 Thread Jiong Wang
Cc: Martin Schwidefsky Cc: Heiko Carstens Signed-off-by: Jiong Wang --- arch/s390/net/bpf_jit_comp.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 51dd026..59592d7 100644 --- a/arch/s390/net/b

[PATCH v4 bpf-next 12/15] sparc: bpf: eliminate zero extension code-gen

2019-04-15 Thread Jiong Wang
Cc: David S. Miller Signed-off-by: Jiong Wang --- arch/sparc/net/bpf_jit_comp_64.c | 8 +++- 1 file changed, 7 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..e58f84e 100644 --- a/arch/sparc/net/bpf_jit_comp_64.c +

[PATCH v4 bpf-next 07/15] libbpf: add "prog_flags" to bpf_program/bpf_prog_load_attr/bpf_load_program_attr

2019-04-15 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 v4 bpf-next 09/15] arm: bpf: eliminate zero extension code-gen

2019-04-15 Thread Jiong Wang
Cc: Shubham Bansal Signed-off-by: Jiong Wang --- arch/arm/net/bpf_jit_32.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index c8bfbbf..8cecd06 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/ar

[PATCH v4 bpf-next 05/15] bpf: introduce new bpf prog load flags "BPF_F_TEST_RND_HI32"

2019-04-15 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 v4 bpf-next 03/15] bpf: reduce false alarm by refining helper call arg types

2019-04-15 Thread Jiong Wang
Unlike BPF to BPF function call, BPF helper call is calls to native insns that verifier can't walk. So, verifier needs helper proto type descriptions for data-flow purpose. There is such information already, but it is not differentiate sub-register read with full register read. This patch split "

[PATCH v4 bpf-next 01/15] bpf: split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32

2019-04-15 Thread Jiong Wang
Register liveness infrastructure doesn't track register read width at the moment, while the width information will be needed for the later 32-bit safety analysis pass. This patch take the first step to split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32. Liveness propagation code are upd

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

2019-04-15 Thread Jiong Wang
v4: - added the two missing fixes which addresses two Jakub's reviewes in v3. - rebase on top of bpf-next. v3: - remove redundant check in "propagate_liveness_reg". (Jakub) - add extra check in "mark_reg_read" to prune more search. (Jakub) - re-implemented "prog_flags" passing mechanism,

[PATCH 1/1] net/core: work around section mismatch warning for ptp_classifier

2019-04-15 Thread Gerald Schaefer
From: Ard Biesheuvel The routine ptp_classifier_init() uses an initializer for an automatic struct type variable which refers to an __initdata symbol. This is perfectly legal, but may trigger a section mismatch warning when running the compiler in -fpic mode, due to the fact that the initializer

[PATCH 0/1] net/core: work around section mismatch warning for ptp_classifier

2019-04-15 Thread Gerald Schaefer
While preparing KASLR for s390, I stumbled over a section mismatch warning after enabling -fPIE compiler option: WARNING: vmlinux.o(.data+0x31070): Section mismatch in reference from the variable print_fmt_kfree_skb to the variable .init.data:ptp_filter.51760 I found a patch that would address thi

Re: Per-queue XDP programs, thoughts

2019-04-15 Thread Toke Høiland-Jørgensen
Jesper Dangaard Brouer writes: > On Mon, 15 Apr 2019 13:59:03 +0200 Björn Töpel wrote: > >> Hi, >> >> As you probably can derive from the amount of time this is taking, I'm >> not really satisfied with the design of per-queue XDP program. (That, >> plus I'm a terribly slow hacker... ;-)) I'll t

Re: [PATCH 1/3] dt-bindings: net: add PHY reset controller binding

2019-04-15 Thread Andrew Lunn
On Mon, Apr 15, 2019 at 02:38:38PM +0200, David Bauer wrote: > Add the documentation for PHY reset lines controlled by a reset controller. Hi David When you respin, please add a patch 0/3 containing a cover note. > Signed-off-by: David Bauer Reviewed-by: Andrew Lunn Andrew

Re: [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio

2019-04-15 Thread Andrew Lunn
On Mon, Apr 15, 2019 at 02:38:40PM +0200, David Bauer wrote: > This renames the GPIO reset of mdio devices from 'reset' to > 'reset_gpio' to better differentiate between GPIO and > reset-controller driven reset line. > > Signed-off-by: David Bauer Reviewed-by: Andrew Lunn Andrew

[PATCH 04/22] netfilter: nf_flowtable: skip device lookup from interface index

2019-04-15 Thread Pablo Neira Ayuso
Use the output device from the route that we cache in the flowtable entry. Signed-off-by: Pablo Neira Ayuso --- net/netfilter/nf_flow_table_ip.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c inde

[PATCH 09/22] netfilter: replace NF_NAT_NEEDED with IS_ENABLED(CONFIG_NF_NAT)

2019-04-15 Thread Pablo Neira Ayuso
From: Florian Westphal NF_NAT_NEEDED is true whenever nat support for either ipv4 or ipv6 is enabled. Now that the af-specific nat configuration switches have been removed, IS_ENABLED(CONFIG_NF_NAT) has the same effect. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso --- inc

[PATCH 02/22] netfilter: nf_tables: remove unused parameter ctx

2019-04-15 Thread Pablo Neira Ayuso
From: Colin Ian King Function nf_tables_set_desc_parse parameter ctx is not being used so remove it as it is redundant. Signed-off-by: Colin Ian King Signed-off-by: Pablo Neira Ayuso --- net/netfilter/nf_tables_api.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net

[PATCH 06/22] netfilter: optimize nf_inet_addr_cmp

2019-04-15 Thread Pablo Neira Ayuso
From: Li RongQing optimize nf_inet_addr_cmp by 64bit xor computation similar to ipv6_addr_equal() Signed-off-by: Yuan Linsi Signed-off-by: Li RongQing Signed-off-by: Pablo Neira Ayuso --- include/linux/netfilter.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/linux/netfi

[PATCH 05/22] ipvs: allow tunneling with gue encapsulation

2019-04-15 Thread Pablo Neira Ayuso
From: Jacky Hu ipip packets are blocked in some public cloud environments, this patch allows gue encapsulation with the tunneling method, which would make tunneling working in those environments. Signed-off-by: Jacky Hu Acked-by: Julian Anastasov Signed-off-by: Simon Horman Signed-off-by: Pab

Re: [PATCH 2/3] net: phy: add support for reset-controller

2019-04-15 Thread Andrew Lunn
On Mon, Apr 15, 2019 at 02:38:39PM +0200, David Bauer wrote: > +static int mdiobus_register_reset(struct mdio_device *mdiodev) > +{ > + struct reset_control *reset = NULL; > + > + if (mdiodev->dev.of_node) > + reset = devm_reset_control_get_exclusive(&mdiodev->dev, > +

Re: Per-queue XDP programs, thoughts

2019-04-15 Thread Jesper Dangaard Brouer
On Mon, 15 Apr 2019 13:59:03 +0200 Björn Töpel wrote: > Hi, > > As you probably can derive from the amount of time this is taking, I'm > not really satisfied with the design of per-queue XDP program. (That, > plus I'm a terribly slow hacker... ;-)) I'll try to expand my thinking > in this mail

  1   2   >