Re: [PATCH/RFC bpf-next 04/16] bpf: mark sub-register writes that really need zero extension to high bits

2019-04-05 Thread Jiong Wang
Alexei Starovoitov writes: > On Fri, Apr 05, 2019 at 09:44:49PM +0100, Jiong Wang wrote: >> >> > On 26 Mar 2019, at 18:44, Edward Cree wrote: >> > >> > On 26/03/2019 18:05, Jiong Wang wrote: >> >> eBPF ISA specification requires high 32-bit cleared when low 32-bit >> >> sub-register is writte

Re: [PATCH net-next] net: sched: flower: insert filter to ht before offloading it to hw

2019-04-05 Thread Jiri Pirko
Fri, Apr 05, 2019 at 07:56:26PM CEST, vla...@mellanox.com wrote: >John reports: > >Recent refactoring of fl_change aims to use the classifier spinlock to >avoid the need for rtnl lock. In doing so, the fl_hw_replace_filer() >function was moved to before the lock is taken. This can create problems >

Re: [PATCH bpf-next v4 00/16] BPF support for global data

2019-04-05 Thread Martin Lau
On Fri, Apr 05, 2019 at 10:59:26PM +0200, Daniel Borkmann wrote: > This series is a major rework of previously submitted libbpf > patches [0] in order to add global data support for BPF. The > kernel has been extended to add proper infrastructure that allows > for full .bss/.data/.rodata sections o

Re: [PATCH iproute2-next] ip xfrm: support setting/printing XFRMA_IF_ID attribute in states/policies

2019-04-05 Thread Antony Antony
On Fri, Apr 05, 2019 at 03:07:58PM -0700, Stephen Hemminger wrote: > On Thu, 4 Apr 2019 19:07:38 +0300 > Eyal Birger wrote: > > > The XFRMA_IF_ID attribute is set in policies/states for them to be > > associated with an XFRM interface (4.19+). > > > > Add support for setting / displaying this a

Re: [PATCH/RFC bpf-next 04/16] bpf: mark sub-register writes that really need zero extension to high bits

2019-04-05 Thread Alexei Starovoitov
On Fri, Apr 05, 2019 at 09:44:49PM +0100, Jiong Wang wrote: > > > On 26 Mar 2019, at 18:44, Edward Cree wrote: > > > > On 26/03/2019 18:05, Jiong Wang wrote: > >> eBPF ISA specification requires high 32-bit cleared when low 32-bit > >> sub-register is written. This applies to destination registe

Re: [PATCH bpf-next v4 01/16] bpf: implement lookup-free direct value access for maps

2019-04-05 Thread Alexei Starovoitov
On Fri, Apr 05, 2019 at 10:59:27PM +0200, Daniel Borkmann wrote: > > -/* when bpf_ldimm64->src_reg == BPF_PSEUDO_MAP_FD, bpf_ldimm64->imm == fd */ > +/* When BPF ldimm64's insn[0].src_reg != 0 then this can have > + * two extensions: > + * > + * insn[0].src_reg: BPF_PSEUDO_MAP_FD BPF_PSEUDO_MA

Re: [PATCH net-next 00/18] ipv4: Enable support for IPv6 gateway with IPv4 routes

2019-04-05 Thread David Ahern
On 4/5/19 8:56 AM, Ido Schimmel wrote: > Reviewed-by: Ido Schimmel > > I also ran some tests and it looks good. > > Great work! Thanks for the review. I fixed the typos and messages you pointed out. In v2 I also moved the fib6_nh_release in patch 9 to 'if (!err)' branch since the intention is t

[PATCH v2 net-next 02/18] ipv6: Add neighbor helpers that use the ipv6 stub

2019-04-05 Thread David Ahern
From: David Ahern Add ipv6 helpers to handle ndisc references via the stub. Update bpf_ipv6_fib_lookup to use __ipv6_neigh_lookup_noref_stub instead of the open code ___neigh_lookup_noref with the stub. Signed-off-by: David Ahern Reviewed-by: Ido Schimmel --- include/net/ndisc.h | 40

[PATCH v2 net-next 00/18] ipv4: Enable support for IPv6 gateway with IPv4 routes

2019-04-05 Thread David Ahern
From: David Ahern Last set of three with the end goal of enabling IPv6 gateways with IPv4 routes. This set adds fib6_nh_init and release to the IPv6 stubs, and adds neighbor helpers that IPv4 code invokes to resolve an IPv6 address. When using an IPv6 neighbor entry the hh_cache is bypassed as i

[PATCH v2 net-next 12/18] bpf: Handle ipv6 gateway in bpf_ipv4_fib_lookup

2019-04-05 Thread David Ahern
From: David Ahern Update bpf_ipv4_fib_lookup to handle an ipv6 gateway. Signed-off-by: David Ahern --- net/core/filter.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index abd5b6ce031a..41f633cf4fc1 100644 --- a/ne

[PATCH v2 net-next 14/18] ipv4: Handle ipv6 gateway in fib_detect_death

2019-04-05 Thread David Ahern
From: David Ahern Update fib_detect_death to handle an ipv6 gateway. Signed-off-by: David Ahern --- net/ipv4/fib_semantics.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index dd95725c318e..e5a6d431bfab 100644

[PATCH v2 net-next 05/18] ipv4: Prepare fib_config for IPv6 gateway

2019-04-05 Thread David Ahern
From: David Ahern Similar to rtable, fib_config needs to allow the gateway to be either an IPv4 or an IPv6 address. To that end, rename fc_gw to fc_gw4 to mean an IPv4 address and add fc_gw_family. Checks on 'is a gateway set' are changed to see if fc_gw_family is set. In the process prepare the

[PATCH v2 net-next 11/18] ipv4: Add helpers for neigh lookup for nexthop

2019-04-05 Thread David Ahern
From: David Ahern A common theme in the output path is looking up a neigh entry for a nexthop, either the gateway in an rtable or a fallback to the daddr in the skb: nexthop = (__force u32)rt_nexthop(rt, ip_hdr(skb)->daddr); neigh = __ipv4_neigh_lookup_noref(dev, nexthop);

[PATCH v2 net-next 04/18] ipv4: Prepare rtable for IPv6 gateway

2019-04-05 Thread David Ahern
From: David Ahern To allow the gateway to be either an IPv4 or IPv6 address, remove rt_uses_gateway from rtable and replace with rt_gw_family. If rt_gw_family is set it implies rt_uses_gateway. Rename rt_gateway to rt_gw4 to represent the IPv4 version. Signed-off-by: David Ahern Reviewed-by: Id

[PATCH v2 net-next 10/18] neighbor: Add skip_cache argument to neigh_output

2019-04-05 Thread David Ahern
From: David Ahern A later patch allows an IPv6 gateway with an IPv4 route. The neighbor entry will exist in the v6 ndisc table and the cached header will contain the ipv6 protocol which is wrong for an IPv4 packet. For an IPv4 packet to use the v6 neighbor entry, neigh_output needs to skip the ca

[PATCH v2 net-next 09/18] ipv4: Add fib_check_nh_v6_gw

2019-04-05 Thread David Ahern
From: David Ahern Add helper to use fib6_nh_init to validate a nexthop spec with an IPv6 gateway. Signed-off-by: David Ahern Reviewed-by: Ido Schimmel --- net/ipv4/fib_semantics.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/net/ipv4/fib_semantics.c b/net/i

[PATCH v2 net-next 15/18] ipv4: Handle ipv6 gateway in fib_good_nh

2019-04-05 Thread David Ahern
From: David Ahern Update fib_good_nh to handle an ipv6 gateway. Signed-off-by: David Ahern --- net/ipv4/fib_semantics.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index e5a6d431bfab..c1ea138335a2 100644 ---

[PATCH v2 net-next 13/18] ipv4: Handle ipv6 gateway in ipv4_confirm_neigh

2019-04-05 Thread David Ahern
From: David Ahern Update ipv4_confirm_neigh to handle an ipv6 gateway. Signed-off-by: David Ahern --- net/ipv4/route.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 32ecb4c1c7e3..efa6a36cbfff 100644 --- a/net/ipv4/route

[PATCH v2 net-next 08/18] ipv4: Refactor fib_check_nh

2019-04-05 Thread David Ahern
From: David Ahern fib_check_nh is currently huge covering multiple uses cases - device only, device + gateway, and device + gateway with ONLINK. The next patch adds validation checks for IPv6 which only further complicates it. So, break fib_check_nh into 2 helpers - one for gateway validation and

[PATCH v2 net-next 16/18] ipv4: Flag fib_info with a fib_nh using IPv6 gateway

2019-04-05 Thread David Ahern
From: David Ahern Until support is added to the offload drivers, they need to be able to reject routes with an IPv6 gateway. To that end add a flag to fib_info that indicates if any fib_nh has a v6 gateway. The flag allows the drivers to efficiently know the use of a v6 gateway without walking al

[PATCH v2 net-next 07/18] ipv4: Add support to fib_config for IPv6 gateway

2019-04-05 Thread David Ahern
From: David Ahern Add support for an IPv6 gateway to fib_config. Since a gateway is either IPv4 or IPv6, make it a union with fc_gw4 where fc_gw_family decides which address is in use. Update current checks on family and gw4 to handle ipv6 as well. Signed-off-by: David Ahern Reviewed-by: Ido Sc

[PATCH v2 net-next 01/18] ipv6: Add fib6_nh_init and release to stubs

2019-04-05 Thread David Ahern
From: David Ahern Add fib6_nh_init and fib6_nh_release to ipv6_stubs. If fib6_nh_init fails, callers should not invoke fib6_nh_release, so there is no reason to have a dummy stub for the IPv6 is not enabled case. Signed-off-by: David Ahern Reviewed-by: Ido Schimmel --- include/net/ipv6_stubs.

[PATCH v2 net-next 17/18] ipv4: Allow ipv6 gateway with ipv4 routes

2019-04-05 Thread David Ahern
From: David Ahern Add support for RTA_VIA and allow an IPv6 nexthop for v4 routes: $ ip ro add 172.16.1.0/24 via inet6 2001:db8::1 dev eth0 $ ip ro ls ... 172.16.1.0/24 via inet6 2001:db8::1 dev eth0 For convenience and simplicity, userspace can use RTA_VIA to specify AF_INET or AF_I

[PATCH v2 net-next 06/18] ipv4: Add support to rtable for ipv6 gateway

2019-04-05 Thread David Ahern
From: David Ahern Add support for an IPv6 gateway to rtable. Since a gateway is either IPv4 or IPv6, make it a union with rt_gw4 where rt_gw_family decides which address is in use. When dumping the route data, encode an ipv6 nexthop using RTA_VIA. Signed-off-by: David Ahern Reviewed-by: Ido Sc

[PATCH v2 net-next 18/18] selftests: fib_tests: Add tests for ipv6 gateway with ipv4 route

2019-04-05 Thread David Ahern
From: David Ahern Add tests for ipv6 gateway with ipv4 route. Tests include basic single path with ping to verify connectivity and multipath. Signed-off-by: David Ahern --- tools/testing/selftests/net/fib_tests.sh | 70 +++- 1 file changed, 69 insertions(+), 1 delet

[PATCH v2 net-next 03/18] net: Replace nhc_has_gw with nhc_gw_family

2019-04-05 Thread David Ahern
From: David Ahern Allow the gateway in a fib_nh_common to be from a different address family than the outer fib{6}_nh. To that end, replace nhc_has_gw with nhc_gw_family and update users of nhc_has_gw to check nhc_gw_family. Now nhc_family is used to know if the nh_common is part of a fib_nh or f

Re: [PATCH v3 iproute2] ip: support for xfrm interfaces

2019-04-05 Thread Stephen Hemminger
On Thu, 4 Apr 2019 10:08:45 -0400 Matt Ellison wrote: > Interfaces take a 'if_id' which is an interface id which can be set on > an xfrm policy as its interface lookup key (XFRMA_IF_ID). > > Signed-off-by: Matt Ellison Looks good, applied. Extra credit for making a test.

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Andrew Lunn
> + if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, > + phydev->supported)) > + phydev->is_gigabit_capable = 1; > + if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, > + phydev->supported)) > +

Re: [PATCH iproute2-next] ip xfrm: support setting/printing XFRMA_IF_ID attribute in states/policies

2019-04-05 Thread Stephen Hemminger
On Thu, 4 Apr 2019 19:07:38 +0300 Eyal Birger wrote: > The XFRMA_IF_ID attribute is set in policies/states for them to be > associated with an XFRM interface (4.19+). > > Add support for setting / displaying this attribute. > > Note that 0 is a valid value therefore set XFRMA_IF_ID if any valu

[RFC] netlink: limit recursion depth in policy validation

2019-04-05 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

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Florian Fainelli
On 4/5/19 2:52 PM, Heiner Kallweit wrote: > On 05.04.2019 23:38, Heiner Kallweit wrote: >> On 05.04.2019 23:27, Andrew Lunn wrote: + if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, +phydev->supported)) + phydev->is_gigabit_capable = 1; >>

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Heiner Kallweit
On 05.04.2019 23:38, Heiner Kallweit wrote: > On 05.04.2019 23:27, Andrew Lunn wrote: >>> + if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, >>> + phydev->supported)) >>> + phydev->is_gigabit_capable = 1; >>> + if (linkmode_test_bit(ETHTOOL_LINK_MODE

Re: [PATCH bpf-next 1/3] bpf: support input __sk_buff context in BPF_PROG_TEST_RUN

2019-04-05 Thread Stanislav Fomichev
On 04/05, Martin Lau wrote: > On Thu, Apr 04, 2019 at 11:51:31AM -0700, Stanislav Fomichev wrote: > > Add new set of arguments to bpf_attr for BPF_PROG_TEST_RUN: > > * ctx_in/ctx_size_in - input context > > * ctx_out/ctx_size_out - output context > > > > The intended use case is to pass some meta

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Heiner Kallweit
On 05.04.2019 23:27, Andrew Lunn wrote: >> +if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, >> + phydev->supported)) >> +phydev->is_gigabit_capable = 1; >> +if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, >> +

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

2019-04-05 Thread kbuild test robot
Hi Tom, Thank you for the patch! Yet something to improve: [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Tom-Herbert/exthdrs-Make-ext-headers-options-useful-Part-I/20190406-001623 config: mips-allmodconfig (attached as .config) compiler: mips-linux-

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Florian Fainelli
On 4/5/19 2:20 PM, Heiner Kallweit wrote: > On 05.04.2019 23:16, Heiner Kallweit wrote: >> On 05.04.2019 23:11, Florian Fainelli wrote: >>> On 4/5/19 1:51 PM, Heiner Kallweit wrote: On 05.04.2019 22:43, Andrew Lunn wrote: >> Right. BMSR_ESTATEN should not be set on a Fast PHY. Handling of

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Heiner Kallweit
On 05.04.2019 23:16, Heiner Kallweit wrote: > On 05.04.2019 23:11, Florian Fainelli wrote: >> On 4/5/19 1:51 PM, Heiner Kallweit wrote: >>> On 05.04.2019 22:43, Andrew Lunn wrote: > Right. BMSR_ESTATEN should not be set on a Fast PHY. Handling of this > case didn't change. > >> A Fa

[net-next V2 13/15] net/mlx5: A write memory barrier is sufficient in EQ ci update

2019-04-05 Thread Saeed Mahameed
From: Tariq Toukan Soften the memory barrier call of mb() by a sufficient wmb() in the consumer index update of the event queues. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) d

[net-next V2 12/15] net/mlx5e: Do not rewrite fields with the same match

2019-04-05 Thread Saeed Mahameed
From: Eli Britstein If we have a match for the same value of a rewrite field, there is no point for the rewrite. In order to save rewrite actions, and avoid entirely rewrite actions (if all rewrites are the same), ignore such rewrite fields. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan

[net-next V2 14/15] net/mlx5e: Obsolete param field holding a constant value

2019-04-05 Thread Saeed Mahameed
From: Tariq Toukan The LRO WQE size is a constant, obsolete the parameter field that holds it. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 - drivers/net/ethernet/mellanox/mlx5/core/en_mai

[net-next V2 15/15] net/mlx5e: Unify logic of MTU boundaries

2019-04-05 Thread Saeed Mahameed
From: Tariq Toukan Expose a new helper that wraps the logic for setting the netdevice's MTU boundaries. Use it for the different components (Eth, rep, IPoIB). Set the netdevice min MTU to ETH_MIN_MTU, and the max according to both the FW capability and the kernel definition. Signed-off-by: Tari

[net-next V2 05/15] net/mlx5e: Deletes unnecessary setting of esw_attr->parse_attr

2019-04-05 Thread Saeed Mahameed
From: Tonghao Zhang This patch deletes unnecessary setting of the esw_attr->parse_attr to parse_attr in parse_tc_fdb_actions() because it is already done by the mlx5e_flow_esw_attr_init() function. Signed-off-by: Tonghao Zhang Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/

[net-next V2 01/15] net/mlx5: Handle event of power detection in the PCIE slot

2019-04-05 Thread Saeed Mahameed
From: Aya Levin Handle event of power state change in the PCIE slot. When the event occurs, check if query power state and PCI power fields is supported. If so, read these fields from MPEIN (management PCIE info) register and issue a corresponding message. Signed-off-by: Aya Levin Signed-off-by

[net-next V2 03/15] net/mlx5e: Make the log friendly when decapsulation offload not supported

2019-04-05 Thread Saeed Mahameed
From: Tonghao Zhang If we try to offload decapsulation actions to VFs hw, we get the log [1]. It's not friendly, because the kind of net device is null, and we don't know what '0' means. [1] "mlx5_core :05:01.2 vf_0: decapsulation offload is not supported for net device (0)" Signed-off-by

[pull request][net-next V2 00/15] Mellanox, mlx5 updates 2019-04-02

2019-04-05 Thread Saeed Mahameed
Hi Dave, This series adds misc updates to mlx5 driver. For more information please see tag log below. Please pull and let me know if there is any problem. v1->v2: remove inline keywords from static functions in c files. Please note that the series starts with a merge of mlx5-next branch, to

[net-next V2 10/15] net/mlx5e: Offload TC e-switch rules with egress VLAN device

2019-04-05 Thread Saeed Mahameed
From: Eli Britstein Upon redirection to an uplink VLAN device, emulate vlan push actions according to the VLAN properties of the VLAN device and redirect to the uplink. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/e

[net-next V2 07/15] net/mlx5e: Use helpers to get headers criteria and value pointers

2019-04-05 Thread Saeed Mahameed
From: Eli Britstein The headers criteria and value pointers may be either of the inner packet, if a tunnel exists, or of the outer. Simplify the code by using helper functions to retrieve them. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- .../net/ethe

[net-next V2 09/15] net/mlx5e: Allow VLAN rewrite of prio field with the same match

2019-04-05 Thread Saeed Mahameed
From: Eli Britstein Changing the prio field of the VLAN is not supported. With commit 37410902874c ("net/mlx5e: Support VLAN modify action") zero value indicated "no-change". Allow the vid rewrite if the prio match is the same as the prio set value. Fixes: 37410902874c ("net/mlx5e: Support VLAN

[net-next V2 04/15] net/mlx5e: Remove 'parse_attr' argument in parse_tc_fdb_actions()

2019-04-05 Thread Saeed Mahameed
From: Tonghao Zhang This patch is a little improvement. Simplify the parse_tc_fdb_actions(). Signed-off-by: Tonghao Zhang Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -

[net-next V2 06/15] net/mlx5e: Return -EOPNOTSUPP when attempting to offload an unsupported action

2019-04-05 Thread Saeed Mahameed
From: Tonghao Zhang * Now the encapsulation is not supported for mlx5 VFs. When we try to offload that action, the -EINVAL is returned, but not -EOPNOTSUPP. This patch changes the returned value and ignore to confuse user. The command is shown as below [1]. * When max modify header action is zer

[net-next V2 08/15] net/mlx5e: Deny VLAN rewrite if there is no VLAN header match

2019-04-05 Thread Saeed Mahameed
From: Eli Britstein Rewrite of the packet in the VLAN offset may corrupt the packet if it's not VLAN tagged. Deny the rewrite in this case. Fixes: 37410902874c ("net/mlx5e: Support VLAN modify action") Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- driv

[net-next V2 11/15] net/mlx5e: Offload TC e-switch rules with ingress VLAN device

2019-04-05 Thread Saeed Mahameed
From: Eli Britstein Offload TC rule on a VLAN device by matching the VLAN properties of the VLAN device and emulating vlan pop actions. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/en_rep.c | 3 +- .../net/etherne

[net-next V2 02/15] net/mlx5: E-Switch, Fix double mutex initialization

2019-04-05 Thread Saeed Mahameed
From: Max Gurtovoy Delete mutex_init call of a lock that's initialized in inner function. Fixes: eca8cc389535 ("net/mlx5: E-Switch, Refactor offloads flow steering init/cleanup") Signed-off-by: Max Gurtovoy Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellan

Re: [iproute2] ip: support for xfrm interfaces

2019-04-05 Thread Matt Ellison
> One comment. It seems to accept -ve value for if_id and quietly set > to 0 may be throw an error for -ve values? or take it as u32? > in my opinion setting to 0 is confusing Ah good catch. I'll add the check in my version. -- Please be advised that this email may contain confidential info

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Heiner Kallweit
On 05.04.2019 23:11, Florian Fainelli wrote: > On 4/5/19 1:51 PM, Heiner Kallweit wrote: >> On 05.04.2019 22:43, Andrew Lunn wrote: Right. BMSR_ESTATEN should not be set on a Fast PHY. Handling of this case didn't change. > A Fast MAC connected to a Giga PHY. The MAC driver will

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Florian Fainelli
On 4/5/19 1:51 PM, Heiner Kallweit wrote: > On 05.04.2019 22:43, Andrew Lunn wrote: >>> Right. BMSR_ESTATEN should not be set on a Fast PHY. Handling of this >>> case didn't change. >>> A Fast MAC connected to a Giga PHY. The MAC driver will of used phy_set_max_speed() to indicate its lim

Re: [iproute2] ip: support for xfrm interfaces

2019-04-05 Thread Antony Antony
Tested-by: Antony Antony On Fri, Apr 05, 2019 at 03:46:02PM -0400, Matt Ellison wrote: > I recently submitted v3 of the patch, please take a look there. great. I am testing v3 now. One comment. It seems to accept -ve value for if_id and quietly set to 0 may be throw an error for -ve values? o

[PATCH bpf-next v4 06/16] bpf: add specification for BTF Var and DataSec kinds

2019-04-05 Thread Daniel Borkmann
This adds the BTF specification and UAPI bits for supporting BTF Var and DataSec kinds. This is following LLVM upstream commit ac4082b77e07 ("[BPF] Add BTF Var and DataSec Support") which has been merged recently. Var itself is for describing a global variable and DataSec to describe ELF sections e

[PATCH bpf-next v4 14/16] bpf, selftest: test {rd,wr}only flags and direct value access

2019-04-05 Thread Daniel Borkmann
Extend test_verifier with various test cases around the two kernel extensions, that is, {rd,wr}only map support as well as direct map value access. All passing, one skipped due to xskmap not present on test machine: # ./test_verifier [...] #920/p XDP pkt read, pkt_data <= pkt_meta', bad acce

[PATCH bpf-next v4 13/16] bpf: bpftool support for dumping data/bss/rodata sections

2019-04-05 Thread Daniel Borkmann
Add the ability to bpftool to handle BTF Var and DataSec kinds in order to dump them out of btf_dumper_type(). The value has a single object with the section name, which itself holds an array of variables it dumps. A single variable is an object by itself printed along with its name. From there fur

[PATCH bpf-next v4 01/16] bpf: implement lookup-free direct value access for maps

2019-04-05 Thread Daniel Borkmann
This generic extension to BPF maps allows for directly loading an address residing inside a BPF map value as a single BPF ldimm64 instruction! The idea is similar to what BPF_PSEUDO_MAP_FD does today, which is a special src_reg flag for ldimm64 instruction that indicates that inside the first part

[PATCH bpf-next v4 11/16] bpf, libbpf: support global data/bss/rodata sections

2019-04-05 Thread Daniel Borkmann
This work adds BPF loader support for global data sections to libbpf. This allows to write BPF programs in more natural C-like way by being able to define global variables and const data. Back at LPC 2018 [0] we presented a first prototype which implemented support for global data sections by exte

[PATCH bpf-next v4 16/16] bpf, selftest: add test cases for BTF Var and DataSec

2019-04-05 Thread Daniel Borkmann
Extend test_btf with various positive and negative tests around BTF verification of kind Var and DataSec. All passing as well: # ./test_btf [...] BTF raw test[4] (global data test #1): OK BTF raw test[5] (global data test #2): OK BTF raw test[6] (global data test #3): OK BTF raw test[7

[PATCH bpf-next v4 15/16] bpf, selftest: test global data/bss/rodata sections

2019-04-05 Thread Daniel Borkmann
From: Joe Stringer Add tests for libbpf relocation of static variable references into the .data, .rodata and .bss sections of the ELF, also add read-only test for .rodata. All passing: # ./test_progs [...] test_global_data:PASS:load program 0 nsec test_global_data:PASS:pass global data r

[PATCH bpf-next v4 04/16] bpf: add syscall side map freeze support

2019-04-05 Thread Daniel Borkmann
This patch adds a new BPF_MAP_FREEZE command which allows to "freeze" the map globally as read-only / immutable from syscall side. Map permission handling has been refactored into map_get_sys_perms() and drops FMODE_CAN_WRITE in case of locked map. Main use case is to allow for setting up .rodata

[PATCH bpf-next v4 08/16] bpf: allow for key-less BTF in array map

2019-04-05 Thread Daniel Borkmann
Given we'll be reusing BPF array maps for global data/bss/rodata sections, we need a way to associate BTF DataSec type as its map value type. In usual cases we have this ugly BPF_ANNOTATE_KV_PAIR() macro hack e.g. via 38d5d3b3d5db ("bpf: Introduce BPF_ANNOTATE_KV_PAIR") to get initial map to type a

[PATCH bpf-next v4 02/16] bpf: do not retain flags that are not tied to map lifetime

2019-04-05 Thread Daniel Borkmann
Both BPF_F_WRONLY / BPF_F_RDONLY flags are tied to the map file descriptor, but not to the map object itself! Meaning, at map creation time BPF_F_RDONLY can be set to make the map read-only from syscall side, but this holds only for the returned fd, so any other fd either retrieved via bpf file sys

[PATCH bpf-next v4 05/16] bpf: allow . char as part of the object name

2019-04-05 Thread Daniel Borkmann
Trivial addition to allow '.' aside from '_' as "special" characters in the object name. Used to allow for substrings in maps from loader side such as ".bss", ".data", ".rodata", but could also be useful for other purposes. Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko --- kernel/bpf

[PATCH bpf-next v4 00/16] BPF support for global data

2019-04-05 Thread Daniel Borkmann
This series is a major rework of previously submitted libbpf patches [0] in order to add global data support for BPF. The kernel has been extended to add proper infrastructure that allows for full .bss/.data/.rodata sections on BPF loader side based upon feedback from LPC discussions [1]. Latter su

[PATCH bpf-next v4 10/16] bpf, libbpf: refactor relocation handling

2019-04-05 Thread Daniel Borkmann
From: Joe Stringer Adjust the code for relocations slightly with no functional changes, so that upcoming patches that will introduce support for relocations into the .data, .rodata and .bss sections can be added independent of these changes. Signed-off-by: Joe Stringer Signed-off-by: Daniel Bor

[PATCH bpf-next v4 03/16] bpf: add program side {rd,wr}only support for maps

2019-04-05 Thread Daniel Borkmann
This work adds two new map creation flags BPF_F_RDONLY_PROG and BPF_F_WRONLY_PROG in order to allow for read-only or write-only BPF maps from a BPF program side. Today we have BPF_F_RDONLY and BPF_F_WRONLY, but this only applies to system call side, meaning the BPF program has full read/write acce

[PATCH bpf-next v4 09/16] bpf: sync {btf,bpf}.h uapi header from tools infrastructure

2019-04-05 Thread Daniel Borkmann
Pull in latest changes from both headers, so we can make use of them in libbpf. Signed-off-by: Daniel Borkmann --- tools/include/uapi/linux/bpf.h | 24 ++-- tools/include/uapi/linux/btf.h | 32 2 files changed, 50 insertions(+), 6 deletions(-)

[PATCH bpf-next v4 12/16] bpf, libbpf: add support for BTF Var and DataSec

2019-04-05 Thread Daniel Borkmann
This adds libbpf support for BTF Var and DataSec kinds. Main point here is that libbpf needs to do some preparatory work before the whole BTF object can be loaded into the kernel, that is, fixing up of DataSec size taken from the ELF section size and non-static variable offset which needs to be tak

[PATCH bpf-next v4 07/16] bpf: kernel side support for BTF Var and DataSec

2019-04-05 Thread Daniel Borkmann
This work adds kernel-side verification, logging and seq_show dumping of BTF Var and DataSec kinds which are emitted with latest LLVM. The following constraints apply: BTF Var must have: - Its kind_flag is 0 - Its vlen is 0 - Must point to a valid type - Type must not resolve to a forward type -

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Heiner Kallweit
On 05.04.2019 22:43, Andrew Lunn wrote: >> Right. BMSR_ESTATEN should not be set on a Fast PHY. Handling of this >> case didn't change. >> >>> A Fast MAC connected to a Giga PHY. The MAC driver will of used >>> phy_set_max_speed() to indicate its limits. In that case, MII_STAT1000 >>> does exist an

Re: [net-next 13/15] net/mlx5: A write memory barrier is sufficient in EQ ci update

2019-04-05 Thread Saeed Mahameed
On Thu, Apr 4, 2019 at 4:46 AM Gal Pressman wrote: > > On 03-Apr-19 02:03, Saeed Mahameed wrote: > > From: Tariq Toukan > > > > Soften the memory barrier call of mb() by a sufficient wmb() in the > > consumer index update of the event queues. > > > > Signed-off-by: Tariq Toukan > > Signed-off-by

Re: [PATCH/RFC bpf-next 04/16] bpf: mark sub-register writes that really need zero extension to high bits

2019-04-05 Thread Jiong Wang
> On 26 Mar 2019, at 18:44, Edward Cree wrote: > > On 26/03/2019 18:05, Jiong Wang wrote: >> 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 doin

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Andrew Lunn
> Right. BMSR_ESTATEN should not be set on a Fast PHY. Handling of this > case didn't change. > > > A Fast MAC connected to a Giga PHY. The MAC driver will of used > > phy_set_max_speed() to indicate its limits. In that case, MII_STAT1000 > > does exist and we should report what the peer is advert

Re: [net-next 07/15] net/mlx5e: Use helpers to get headers criteria and value pointers

2019-04-05 Thread Saeed Mahameed
On Wed, Apr 3, 2019 at 9:52 PM David Miller wrote: > > From: Saeed Mahameed > Date: Tue, 2 Apr 2019 16:03:42 -0700 > > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c > > b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c > > index 7c1ea0a17024..d3a507be72d4 100644 > > --- a/drive

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Heiner Kallweit
On 05.04.2019 22:27, Andrew Lunn wrote: > On Fri, Apr 05, 2019 at 10:04:22PM +0200, Heiner Kallweit wrote: >> On 05.04.2019 21:48, Andrew Lunn wrote: >>> On Fri, Apr 05, 2019 at 09:23:13PM +0200, Heiner Kallweit wrote: genphy_read_status() so far checks phydev->supported, not the actual P

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Andrew Lunn
On Fri, Apr 05, 2019 at 10:04:22PM +0200, Heiner Kallweit wrote: > On 05.04.2019 21:48, Andrew Lunn wrote: > > On Fri, Apr 05, 2019 at 09:23:13PM +0200, Heiner Kallweit wrote: > >> genphy_read_status() so far checks phydev->supported, not the actual > >> PHY capabilities. This can make a difference

[RFC 4/7] netlink: allow NLA_MSECS to have range validation

2019-04-05 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

[RFC 7/7] netlink: add infrastructure to expose policies to userspace

2019-04-05 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

[RFC 2/7] netlink: remove type-unsafe validation_data pointer

2019-04-05 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

[RFC 3/7] netlink: extend policy range validation

2019-04-05 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

[RFC 6/7] netlink: factor out policy range helpers

2019-04-05 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

[RFC 5/7] netlink: remove NLA_EXACT_LEN_WARN

2019-04-05 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

[RFC 1/7] netlink: expose policy to userspace

2019-04-05 Thread Johannes Berg
Now that it's working, here's the first draft of the code to expose the netlink policy to userspace. One thing I didn't think I would do but did anyway now is to map the NLA_* type to a new attribute, and translate it for userspace. This may not be the most convenient, but I think we would prefer

[RFC 1/7] nl80211: fix NL80211_ATTR_FTM_RESPONDER policy

2019-04-05 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

Re: [Patch net v2 2/3] bluetooth: validate HCI_EV_LE_META packet carefully

2019-04-05 Thread Dan Carpenter
As I explained in my email, the original code is buggy if num_reports > 1 (probably uncommon), but your code is buggy for num_reports >= 1 (everything). regards, dan carpenter

Re: [PATCH bpf-next 1/3] bpf: support input __sk_buff context in BPF_PROG_TEST_RUN

2019-04-05 Thread Martin Lau
On Thu, Apr 04, 2019 at 11:51:31AM -0700, Stanislav Fomichev wrote: > Add new set of arguments to bpf_attr for BPF_PROG_TEST_RUN: > * ctx_in/ctx_size_in - input context > * ctx_out/ctx_size_out - output context > > The intended use case is to pass some meta data to the test runs that > operate on

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Heiner Kallweit
On 05.04.2019 21:48, Andrew Lunn wrote: > On Fri, Apr 05, 2019 at 09:23:13PM +0200, Heiner Kallweit wrote: >> genphy_read_status() so far checks phydev->supported, not the actual >> PHY capabilities. This can make a difference if the supported speeds >> have been limited by of_set_phy_supported() o

Re: [PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Andrew Lunn
On Fri, Apr 05, 2019 at 09:23:13PM +0200, Heiner Kallweit wrote: > genphy_read_status() so far checks phydev->supported, not the actual > PHY capabilities. This can make a difference if the supported speeds > have been limited by of_set_phy_supported() or phy_set_max_speed(). > > It seems that thi

Re: [iproute2] ip: support for xfrm interfaces

2019-04-05 Thread Matt Ellison
I recently submitted v3 of the patch, please take a look there. > Question: is it easy to add "if_id" to "ip link show" output? Yes, it should show up under the detailed output for the interface (-d). - Matt -- Please be advised that this email may contain confidential information. If you

Re: [PATCH net] r8169: switch off ASPM by default and add sysfs attribute to control ASPM

2019-04-05 Thread Heiner Kallweit
On 05.04.2019 21:10, Bjorn Helgaas wrote: > On Wed, Apr 03, 2019 at 07:45:29PM +0200, Heiner Kallweit wrote: >> On 03.04.2019 15:14, Bjorn Helgaas wrote: >>> On Wed, Apr 03, 2019 at 07:53:40AM +0200, Heiner Kallweit wrote: On 02.04.2019 23:57, Bjorn Helgaas wrote: > On Tue, Apr 02, 2019 at

[PATCH net-next] net: phy: improve link partner capability detection

2019-04-05 Thread Heiner Kallweit
genphy_read_status() so far checks phydev->supported, not the actual PHY capabilities. This can make a difference if the supported speeds have been limited by of_set_phy_supported() or phy_set_max_speed(). It seems that this issue only affects the link partner advertisements as displayed by ethtoo

Re: [PATCH net] r8169: switch off ASPM by default and add sysfs attribute to control ASPM

2019-04-05 Thread Bjorn Helgaas
On Wed, Apr 03, 2019 at 07:45:29PM +0200, Heiner Kallweit wrote: > On 03.04.2019 15:14, Bjorn Helgaas wrote: > > On Wed, Apr 03, 2019 at 07:53:40AM +0200, Heiner Kallweit wrote: > >> On 02.04.2019 23:57, Bjorn Helgaas wrote: > >>> On Tue, Apr 02, 2019 at 10:41:20PM +0200, Heiner Kallweit wrote: > >

[PATCH net] r8169: disable ASPM again

2019-04-05 Thread Heiner Kallweit
There's a significant number of reports that re-enabling ASPM causes different issues, ranging from decreased performance to system not booting at all. This affects only a minority of users, but the number of affected users is big enough that we better switch off ASPM again. This will hurt noteboo

[PATCH net-next] net: sched: flower: insert filter to ht before offloading it to hw

2019-04-05 Thread Vlad Buslov
John reports: Recent refactoring of fl_change aims to use the classifier spinlock to avoid the need for rtnl lock. In doing so, the fl_hw_replace_filer() function was moved to before the lock is taken. This can create problems for drivers if duplicate filters are created (commmon in ovs tc offload

Re: [Patch net v2 2/3] bluetooth: validate HCI_EV_LE_META packet carefully

2019-04-05 Thread Cong Wang
On Thu, Apr 4, 2019 at 1:35 AM Dan Carpenter wrote: > > On Wed, Apr 03, 2019 at 04:08:34PM -0700, Cong Wang wrote: > > static void hci_le_ext_adv_report_evt(struct hci_dev *hdev, struct sk_buff > > *skb) > > { > > - u8 num_reports = skb->data[0]; > > - void *ptr = &skb->data[1]; > > +

  1   2   >