[PATCH bpf] samples/bpf: xdp_redirect, correctly get dummy program id

2019-06-19 Thread Prashant Bhole
When we terminate xdp_redirect, it ends up with following message: "Program on iface OUT changed, not removing" This results in dummy prog still attached to OUT interface. It is because signal handler checks if the programs are the same that we had attached. But while fetching dummy_prog_id, curren

RE: [PATCH v3 bpf-next 3/9] bpf: extend is_branch_taken to registers

2019-06-19 Thread John Fastabend
Alexei Starovoitov wrote: > This patch extends is_branch_taken() logic from JMP+K instructions > to JMP+X instructions. > Conditional branches are often done when src and dst registers > contain known scalars. In such case the verifier can follow > the branch that is going to be taken when program

RE: [PATCH v3 bpf-next 2/9] selftests/bpf: fix tests due to const spill/fill

2019-06-19 Thread John Fastabend
Alexei Starovoitov wrote: > fix tests that incorrectly assumed that the verifier > cannot track constants through stack. > > Signed-off-by: Alexei Starovoitov > Acked-by: Andrii Nakryiko > --- > .../bpf/verifier/direct_packet_access.c | 3 +- > .../bpf/verifier/helper_access_var_len.c

Re: [PATCH v3 bpf-next 1/9] bpf: track spill/fill of constants

2019-06-19 Thread John Fastabend
Alexei Starovoitov wrote: > On Wed, Jun 19, 2019 at 05:24:32PM -0700, John Fastabend wrote: > > Alexei Starovoitov wrote: > > > Compilers often spill induction variables into the stack, > > > hence it is necessary for the verifier to track scalar values > > > of the registers through stack slots. >

Re: pull-request: bpf-next 2019-06-19

2019-06-19 Thread David Miller
From: Alexei Starovoitov Date: Wed, 19 Jun 2019 20:57:26 -0700 > The following pull-request contains BPF updates for your *net-next* tree. > > The main changes are: > > 1) new SO_REUSEPORT_DETACH_BPF setsocktopt, from Martin. > > 2) BTF based map definition, from Andrii. > > 3) support bpf_ma

pull-request: bpf-next 2019-06-19

2019-06-19 Thread Alexei Starovoitov
Hi David, The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) new SO_REUSEPORT_DETACH_BPF setsocktopt, from Martin. 2) BTF based map definition, from Andrii. 3) support bpf_map_lookup_elem for xskmap, from Jonathan. 4) bounded loops and scalar pr

Re: [PATCH v3 bpf-next 1/9] bpf: track spill/fill of constants

2019-06-19 Thread Alexei Starovoitov
On Wed, Jun 19, 2019 at 05:24:32PM -0700, John Fastabend wrote: > Alexei Starovoitov wrote: > > Compilers often spill induction variables into the stack, > > hence it is necessary for the verifier to track scalar values > > of the registers through stack slots. > > > > Also few bpf programs were i

Re: [PATCH v3 0/4] Ethernet PHY reset GPIO updates for Amlogic SoCs

2019-06-19 Thread Kevin Hilman
Martin Blumenstingl writes: > While trying to add the Ethernet PHY interrupt on the X96 Max I found > that the current reset line definition is incorrect. Patch #1 fixes > this. > > Since the fix requires moving from the deprecated "snps,reset-gpio" > property to the generic Ethernet PHY reset bi

[PATCH bpf-next] selftests: Add test for veth native XDP

2019-06-19 Thread Toshiaki Makita
Add a test case for veth native XDP. It checks if XDP_PASS, XDP_TX and XDP_REDIRECT work properly. $ cd tools/testing/selftests/bpf $ make \ TEST_CUSTOM_PROGS= \ TEST_GEN_PROGS= \ TEST_GEN_PROGS_EXTENDED= \ TEST_PROGS_EXTENDED= \ TEST_PROGS="test_xdp_vet

Re: [PATCH] page_pool: fix compile warning when CONFIG_PAGE_POOL is disabled

2019-06-19 Thread David Miller
From: Jesper Dangaard Brouer Date: Thu, 20 Jun 2019 00:15:52 +0200 > Kbuild test robot reported compile warning: > warning: no return statement in function returning non-void > in function page_pool_request_shutdown, when CONFIG_PAGE_POOL is disabled. > > The fix makes the code a little more ve

Re: [PATCH 1/2 nf-next] netfilter: nft_meta: add NFT_META_BRI_PVID support

2019-06-19 Thread wenxu
I will post the nftable patches latter. Thanks! 在 2019/6/20 1:02, Pablo Neira Ayuso 写道: > On Wed, Jun 19, 2019 at 03:16:24PM +0800, we...@ucloud.cn wrote: >> From: wenxu >> >> nft add table bridge firewall >> nft add chain bridge firewall zones { type filter hook prerouting priority - >> 300 \;

[PATCH nf-next v2 1/2] netfilter: nft_meta: add NFT_META_BRI_PVID support

2019-06-19 Thread wenxu
From: wenxu nft add table bridge firewall nft add chain bridge firewall zones { type filter hook prerouting priority - 300 \; } nft add rule bridge firewall zones counter ct zone set vlan id map { 100 : 1, 200 : 2 } As above set the bridge port with pvid, the received packet don't contain the

[PATCH nf-next v2 2/2] netfilter: nft_meta: Add NFT_META_BRI_VLAN support

2019-06-19 Thread wenxu
From: wenxu nft add table bridge firewall nft add chain bridge firewall zones { type filter hook prerouting priority - 300 \; } nft add rule bridge firewall zones counter ct zone set vlan id map { 100 : 1, 200 : 2 } As above set the bridge port with pvid, the received packet don't contain the

[net-next:master 1038/1074] drivers/net//ethernet/cadence/macb_main.c:4003:21: error: variable 'fu540_c000_ops' has initializer but incomplete type

2019-06-19 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master head: 6c9bef32c6e742e847fc28c9bf7721cbfa003fa6 commit: c218ad559020ff98f5d7de6c8bca05b635581777 [1038/1074] macb: Add support for SiFive FU540-C000 config: ia64-allmodconfig (attached as .config) compiler: ia64-li

RE: [PATCH v3 bpf-next 1/9] bpf: track spill/fill of constants

2019-06-19 Thread John Fastabend
Alexei Starovoitov wrote: > Compilers often spill induction variables into the stack, > hence it is necessary for the verifier to track scalar values > of the registers through stack slots. > > Also few bpf programs were incorrectly rejected in the past, > since the verifier was not able to track

[PATCH net-next v6 11/11] selftests: pmtu: Make list_flush_ipv6_exception test more demanding

2019-06-19 Thread Stefano Brivio
Instead of just listing and flushing two cached exceptions, create a relatively big number of them, and count how many are listed. Single netlink dump messages contain approximately 25 entries each, and this way we can make sure the partial dump tracking mechanism is working properly. While at it,

[PATCH net-next v6 08/11] ipv6: Dump route exceptions if requested

2019-06-19 Thread Stefano Brivio
Since commit 2b760fcf5cfb ("ipv6: hook up exception table to store dst cache"), route exceptions reside in a separate hash table, and won't be found by walking the FIB, so they won't be dumped to userspace on a RTM_GETROUTE message. This causes 'ip -6 route list cache' and 'ip -6 route flush cache

[PATCH net-next v6 04/11] ipv4: Dump route exceptions if requested

2019-06-19 Thread Stefano Brivio
Since commit 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions."), cached exception routes are stored as a separate entity, so they are not dumped on a FIB dump, even if the RTM_F_CLONED flag is passed. This implies that the command 'ip route list cache' doesn't return any result anymore. If the RT

[PATCH net-next v6 10/11] selftests: pmtu: Introduce list_flush_ipv4_exception test case

2019-06-19 Thread Stefano Brivio
This test checks that route exceptions can be successfully listed and flushed using ip -6 route {list,flush} cache. v6: - Merge this patch into series including fix, as it's also targeted for net-next - Drop left-over print of 'ip route list cache | wc -l' Signed-off-by: Stefano Brivio -

[PATCH net-next v6 02/11] ipv4/fib_frontend: Allow RTM_F_CLONED flag to be used for filtering

2019-06-19 Thread Stefano Brivio
This functionally reverts the check introduced by commit e8ba330ac0c5 ("rtnetlink: Update fib dumps for strict data checking") as modified by commit e4e92fb160d7 ("net/ipv4: Bail early if user only wants prefix entries"). As we are preparing to fix listing of IPv4 cached routes, we need to give us

[PATCH net-next v6 01/11] fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_F_CLONED

2019-06-19 Thread Stefano Brivio
The following patches add back the ability to dump IPv4 and IPv6 exception routes, and we need to allow selection of regular routes or exceptions. Use RTM_F_CLONED as filter to decide whether to dump routes or exceptions: iproute2 passes it in dump requests (except for IPv6 cache flush requests, t

[PATCH net-next v6 03/11] ipv4/route: Allow NULL flowinfo in rt_fill_info()

2019-06-19 Thread Stefano Brivio
In the next patch, we're going to use rt_fill_info() to dump exception routes upon RTM_GETROUTE with NLM_F_ROOT, meaning userspace is requesting a dump and not a specific route selection, which in turn implies the input interface is not relevant. Update rt_fill_info() to handle a NULL flowinfo. Su

[PATCH net-next v6 09/11] ip6_fib: Don't discard nodes with valid routing information in fib6_locate_1()

2019-06-19 Thread Stefano Brivio
When we perform an inexact match on FIB nodes via fib6_locate_1(), longer prefixes will be preferred to shorter ones. However, it might happen that a node, with higher fn_bit value than some other, has no valid routing information. In this case, we'll pick that node, but it will be discarded by th

[PATCH net-next v6 05/11] Revert "net/ipv6: Bail early if user only wants cloned entries"

2019-06-19 Thread Stefano Brivio
This reverts commit 08e814c9e8eb5a982cbd1e8f6bd255d97c51026f: as we are preparing to fix listing and dumping of IPv6 cached routes, we need to allow RTM_F_CLONED as a flag to match routes against while dumping them. Signed-off-by: Stefano Brivio Reviewed-by: David Ahern --- v6: No changes v5: N

[PATCH net-next v6 07/11] ipv6/route: Change return code of rt6_dump_route() for partial node dumps

2019-06-19 Thread Stefano Brivio
In the next patch, we are going to add optional dump of exceptions to rt6_dump_route(). Change the return code of rt6_dump_route() to accomodate partial node dumps: we might dump multiple routes per node, and might be able to dump only a given number of them, so fib6_dump_node() will need to know

[PATCH net-next v6 06/11] ipv6/route: Don't match on fc_nh_id if not set in ip6_route_del()

2019-06-19 Thread Stefano Brivio
If fc_nh_id isn't set, we shouldn't try to match against it. This actually matters just for the RTF_CACHE case below (where this is already handled): if iproute2 gets a route exception and tries to delete it, it won't reference its fc_nh_id, even if a nexthop object might be associated to the origi

[PATCH net-next v6 00/11] Fix listing (IPv4, IPv6) and flushing (IPv6) of cached route exceptions

2019-06-19 Thread Stefano Brivio
For IPv6 cached routes, the commands 'ip -6 route list cache' and 'ip -6 route flush cache' don't work at all after route exceptions have been moved to a separate hash table in commit 2b760fcf5cfb ("ipv6: hook up exception table to store dst cache"). For IPv4 cached routes, the command 'ip route l

Re: [PATCH net v5 5/6] ipv6: Dump route exceptions if requested

2019-06-19 Thread Stefano Brivio
On Tue, 18 Jun 2019 09:19:53 -0600 David Ahern wrote: > On 6/18/19 7:20 AM, Stefano Brivio wrote: > > diff --git a/net/ipv6/route.c b/net/ipv6/route.c > > index 0f60eb3a2873..7375f3b7d310 100644 > > --- a/net/ipv6/route.c > > +++ b/net/ipv6/route.c > > @@ -4854,33 +4854,94 @@ static bool fib6_inf

Re: [PATCH net v5 3/6] ipv4: Dump route exceptions if requested

2019-06-19 Thread Stefano Brivio
On Tue, 18 Jun 2019 08:48:23 -0600 David Ahern wrote: > > +++ b/net/ipv4/fib_trie.c > > @@ -2000,28 +2000,92 @@ void fib_free_table(struct fib_table *tb) > > call_rcu(&tb->rcu, __trie_free_rcu); > > } > > > > +static int fib_dump_fnhe_from_leaf(struct fib_alias *fa, struct sk_buff > > *sk

Re: [PATCH v2 net-next 5/5] ipv6: convert major tx path to use RT6_LOOKUP_F_DST_NOREF

2019-06-19 Thread Wei Wang
On Wed, Jun 19, 2019 at 4:21 PM David Ahern wrote: > > On 6/19/19 4:31 PM, Wei Wang wrote: > > diff --git a/include/net/l3mdev.h b/include/net/l3mdev.h > > index e942372b077b..d8c37317bb86 100644 > > --- a/include/net/l3mdev.h > > +++ b/include/net/l3mdev.h > > @@ -31,8 +31,9 @@ struct l3mdev_ops

Re: [PATCH v2 net-next 3/5] ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic

2019-06-19 Thread Wei Wang
On Wed, Jun 19, 2019 at 4:12 PM David Ahern wrote: > > On 6/19/19 4:31 PM, Wei Wang wrote: > > diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c > > index bcfae13409b5..d22b6c140f23 100644 > > --- a/net/ipv6/fib6_rules.c > > +++ b/net/ipv6/fib6_rules.c > > @@ -113,14 +113,15 @@ struct dst

Re: [PATCH v2 net-next 5/5] ipv6: convert major tx path to use RT6_LOOKUP_F_DST_NOREF

2019-06-19 Thread David Ahern
On 6/19/19 4:31 PM, Wei Wang wrote: > diff --git a/include/net/l3mdev.h b/include/net/l3mdev.h > index e942372b077b..d8c37317bb86 100644 > --- a/include/net/l3mdev.h > +++ b/include/net/l3mdev.h > @@ -31,8 +31,9 @@ struct l3mdev_ops { > u16 proto); > >

Re: [PATCH v2 net-next 3/5] ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic

2019-06-19 Thread David Ahern
On 6/19/19 4:31 PM, Wei Wang wrote: > diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c > index bcfae13409b5..d22b6c140f23 100644 > --- a/net/ipv6/fib6_rules.c > +++ b/net/ipv6/fib6_rules.c > @@ -113,14 +113,15 @@ struct dst_entry *fib6_rule_lookup(struct net *net, > struct flowi6 *fl6, >

[PATCH v2 net-next 0/5] ipv6: avoid taking refcnt on dst during route lookup

2019-06-19 Thread Wei Wang
From: Wei Wang Ipv6 route lookup code always grabs refcnt on the dst for the caller. But for certain cases, grabbing refcnt is not always necessary if the call path is rcu protected and the caller does not cache the dst. Another issue in the route lookup logic is: When there are multiple custom r

[PATCH v2 net-next 5/5] ipv6: convert major tx path to use RT6_LOOKUP_F_DST_NOREF

2019-06-19 Thread Wei Wang
From: Wei Wang For tx path, in most cases, we still have to take refcnt on the dst cause the caller is caching the dst somewhere. But it still is beneficial to make use of RT6_LOOKUP_F_DST_NOREF flag while doing the route lookup. It is cause this flag prevents manipulating refcnt on net->ipv6.ip6

[PATCH v2 net-next 1/5] ipv6: introduce RT6_LOOKUP_F_DST_NOREF flag in ip6_pol_route()

2019-06-19 Thread Wei Wang
From: Wei Wang This new flag is to instruct the route lookup function to not take refcnt on the dst entry. The user which does route lookup with this flag must properly use rcu protection. ip6_pol_route() is the major route lookup function for both tx and rx path. In this function: Do not take re

[PATCH v2 net-next 3/5] ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic

2019-06-19 Thread Wei Wang
From: Wei Wang This patch specifically converts the rule lookup logic to honor this flag and not release refcnt when traversing each rule and calling lookup() on each routing table. Similar to previous patch, we also need some special handling of dst entries in uncached list because there is alwa

[PATCH v2 net-next 2/5] ipv6: initialize rt6->rt6i_uncached in all pre-allocated dst entries

2019-06-19 Thread Wei Wang
From: Wei Wang Initialize rt6->rt6i_uncached on the following pre-allocated dsts: net->ipv6.ip6_null_entry net->ipv6.ip6_prohibit_entry net->ipv6.ip6_blk_hole_entry This is a preparation patch for later commits to be able to distinguish dst entries in uncached list by doing: !list_empty(rt6->rt6

[PATCH v2 net-next 4/5] ipv6: convert rx data path to not take refcnt on dst

2019-06-19 Thread Wei Wang
From: Wei Wang ip6_route_input() is the key function to do the route lookup in the rx data path. All the callers to this function are already holding rcu lock. So it is fairly easy to convert it to not take refcnt on the dst: We pass in flag RT6_LOOKUP_F_DST_NOREF and do skb_dst_set_noref(). This

Re: [PATCH bpf-next v7 1/9] bpf: implement getsockopt and setsockopt hooks

2019-06-19 Thread Stanislav Fomichev
On 06/19, Andrii Nakryiko wrote: > On Wed, Jun 19, 2019 at 1:17 PM Stanislav Fomichev wrote: > > > > On 06/19, Andrii Nakryiko wrote: > > > On Wed, Jun 19, 2019 at 10:00 AM Stanislav Fomichev > > > wrote: > > > > > > > > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and > > > > BPF_CGR

[PATCH] page_pool: fix compile warning when CONFIG_PAGE_POOL is disabled

2019-06-19 Thread Jesper Dangaard Brouer
Kbuild test robot reported compile warning: warning: no return statement in function returning non-void in function page_pool_request_shutdown, when CONFIG_PAGE_POOL is disabled. The fix makes the code a little more verbose, with a descriptive variable. Fixes: 99c07c43c4ea ("xdp: tracking page_p

Re: network unstable on odroid-c1/meson8b.

2019-06-19 Thread Heiner Kallweit
On 19.06.2019 22:18, Aymeric wrote: > Hello all, > > I've an ODROID-C1 board (a meson8b/S805) and I've some network > unstablity with current mainline kernel; as time of writting, tested > 5.0.y, 5.1.y, 5.2-rc4 and didn't try with any others versions. > > After a few talks on linux-amlogic mailin

Re: [PATCH net] net/sched: flower: fix infinite loop in fl_walk()

2019-06-19 Thread Cong Wang
On Wed, Jun 19, 2019 at 2:10 PM Davide Caratti wrote: > > on some CPUs (e.g. i686), tcf_walker.cookie has the same size as the IDR. > In this situation, the following script: > > # tc filter add dev eth0 ingress handle 0x flower action ok > # tc filter show dev eth0 ingress > > results i

Re: [PATCH net] inet: clear num_timeout reqsk_alloc()

2019-06-19 Thread David Miller
From: Eric Dumazet Date: Wed, 19 Jun 2019 09:38:38 -0700 > KMSAN caught uninit-value in tcp_create_openreq_child() [1] > This is caused by a recent change, combined by the fact > that TCP cleared num_timeout, num_retrans and sk fields only > when a request socket was about to be queued. > > Unde

Re: [PATCH bpf-next v7 1/9] bpf: implement getsockopt and setsockopt hooks

2019-06-19 Thread Andrii Nakryiko
On Wed, Jun 19, 2019 at 1:17 PM Stanislav Fomichev wrote: > > On 06/19, Andrii Nakryiko wrote: > > On Wed, Jun 19, 2019 at 10:00 AM Stanislav Fomichev wrote: > > > > > > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and > > > BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks. > > > > > > BPF_CGROU

Re: [PATCH net-next] selftests/net: make udpgso_bench skip unsupported testcases

2019-06-19 Thread David Miller
From: Willem de Bruijn Date: Tue, 18 Jun 2019 16:03:04 -0400 > From: Willem de Bruijn > > Kselftest can be run against older kernels. Instead of failing hard > when a feature is unsupported, return the KSFT_SKIP exit code. > > Specifically, do not fail hard on missing udp zerocopy. > > The ud

Re: [PATCH net-next 1/2] PCI: let pci_disable_link_state propagate errors

2019-06-19 Thread Bjorn Helgaas
On Tue, Jun 18, 2019 at 11:13:48PM +0200, Heiner Kallweit wrote: > Drivers may rely on pci_disable_link_state() having disabled certain > ASPM link states. If OS can't control ASPM then pci_disable_link_state() > turns into a no-op w/o informing the caller. The driver therefore may > falsely assume

Re: [PATCH net-next 0/2] PCI: let pci_disable_link_state propagate errors

2019-06-19 Thread David Miller
From: Heiner Kallweit Date: Tue, 18 Jun 2019 23:12:56 +0200 > Drivers like r8169 rely on pci_disable_link_state() having disabled > certain ASPM link states. If OS can't control ASPM then > pci_disable_link_state() turns into a no-op w/o informing the caller. > The driver therefore may falsely as

Re: [PATCH net] ipv6: Default fib6_type to RTN_UNICAST when not set

2019-06-19 Thread David Miller
From: David Ahern Date: Wed, 19 Jun 2019 10:50:24 -0700 > From: David Ahern > > A user reported that routes are getting installed with type 0 (RTN_UNSPEC) > where before the routes were RTN_UNICAST. One example is from accel-ppp > which apparently still uses the ioctl interface and does not set

Re: [PATCH net-next] net: sched: act_ctinfo: tidy UAPI definition

2019-06-19 Thread David Miller
From: Kevin Darbyshire-Bryant Date: Wed, 19 Jun 2019 18:41:10 +0100 > Remove some enums from the UAPI definition that were only used > internally and are NOT part of the UAPI. > > Signed-off-by: Kevin Darbyshire-Bryant Yeah, this is definitely the right thing to do. Applied, thanks.

[PATCH net] net/sched: flower: fix infinite loop in fl_walk()

2019-06-19 Thread Davide Caratti
on some CPUs (e.g. i686), tcf_walker.cookie has the same size as the IDR. In this situation, the following script: # tc filter add dev eth0 ingress handle 0x flower action ok # tc filter show dev eth0 ingress results in an infinite loop. It happened also on other CPUs (e.g x86_64), befo

Re: [PATCH] bpf: optimize constant blinding

2019-06-19 Thread Jiong Wang
Edward Cree writes: > On 17/06/2019 21:40, Jiong Wang wrote: >> Now if we don't split patch when patch an insn inside patch, instead, if we >> replace the patched insn using what you suggested, then the logic looks to >> me becomes even more complex, something like >> >>for (idx = 0; idx < i

Re: [PATCH v3 06/16] dt-bindings: net: sun4i-emac: Convert the binding to a schemas

2019-06-19 Thread Rob Herring
On Wed, Jun 19, 2019 at 8:46 AM Rob Herring wrote: > > On Wed, Jun 19, 2019 at 3:48 AM Maxime Ripard > wrote: > > > > Switch our Allwinner A10 EMAC controller binding to a YAML schema to enable > > the DT validation. > > > > Signed-off-by: Maxime Ripard > > > > --- > > > > Changes from v2: > >

[net-next:master 1066/1074] include/net/page_pool.h:165:1: warning: no return statement in function returning non-void

2019-06-19 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master head: 6c9bef32c6e742e847fc28c9bf7721cbfa003fa6 commit: 99c07c43c4ea0bc101331401a0fabfc51933c6a3 [1066/1074] xdp: tracking page_pool resources and safe removal config: xtensa-common_defconfig (attached as .config)

network unstable on odroid-c1/meson8b.

2019-06-19 Thread Aymeric
Hello all, I've an ODROID-C1 board (a meson8b/S805) and I've some network unstablity with current mainline kernel; as time of writting, tested 5.0.y, 5.1.y, 5.2-rc4 and didn't try with any others versions. After a few talks on linux-amlogic mailing list, I've been pointed here to find and, hoppef

Re: [PATCH net 0/3] net/af_iucv: fixes 2019-06-18

2019-06-19 Thread David Miller
From: Julian Wiedmann Date: Tue, 18 Jun 2019 20:42:58 +0200 > I spent a few cycles on transmit problems for af_iucv over regular > netdevices - please apply the following fixes to -net. > > The first patch allows for skb allocations outside of GFP_DMA, while the > second patch respects that driv

[PATCH net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET

2019-06-19 Thread Neil Horman
When an application is run that: a) Sets its scheduler to be SCHED_FIFO and b) Opens a memory mapped AF_PACKET socket, and sends frames with the MSG_DONTWAIT flag cleared, its possible for the application to hang forever in the kernel. This occurs because when waiting, the code in tpacket_snd call

Re: [PATCH bpf-next v7 1/9] bpf: implement getsockopt and setsockopt hooks

2019-06-19 Thread Stanislav Fomichev
On 06/19, Andrii Nakryiko wrote: > On Wed, Jun 19, 2019 at 10:00 AM Stanislav Fomichev wrote: > > > > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and > > BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks. > > > > BPF_CGROUP_SETSOCKOPT get a read-only view of the setsockopt arguments. > > BPF_CGRO

Re: [PATCH net-next] ipv6: Check if route exists before notifying it

2019-06-19 Thread David Ahern
On 6/19/19 1:40 PM, Ido Schimmel wrote: > On Wed, Jun 19, 2019 at 01:10:08PM -0600, David Ahern wrote: >> On 6/19/19 11:55 AM, Ido Schimmel wrote: >>> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c >>> index 1d16a01eccf5..241a0e9a07c3 100644 >>> --- a/net/ipv6/ip6_fib.c >>> +++ b/net/ipv6/ip6

Re: [PATCH net-next] ipv6: Check if route exists before notifying it

2019-06-19 Thread Ido Schimmel
On Wed, Jun 19, 2019 at 01:10:08PM -0600, David Ahern wrote: > On 6/19/19 11:55 AM, Ido Schimmel wrote: > > diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c > > index 1d16a01eccf5..241a0e9a07c3 100644 > > --- a/net/ipv6/ip6_fib.c > > +++ b/net/ipv6/ip6_fib.c > > @@ -393,6 +393,8 @@ int call_fib

Re: [PATCH bpf-next v7 1/9] bpf: implement getsockopt and setsockopt hooks

2019-06-19 Thread Andrii Nakryiko
On Wed, Jun 19, 2019 at 10:00 AM Stanislav Fomichev wrote: > > Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and > BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks. > > BPF_CGROUP_SETSOCKOPT get a read-only view of the setsockopt arguments. > BPF_CGROUP_GETSOCKOPT can modify the supplied buffer. >

Re: [PATCH iproute2 v2 2/2] uapi: update if_link.h

2019-06-19 Thread David Ahern
On 6/19/19 11:47 AM, Stephen Hemminger wrote: > On Wed, 19 Jun 2019 16:14:14 +0200 > Denis Kirjanov wrote: > >> update if_link.h to commit 75345f888f700c4ab2448287e35d48c760b202e6 >> ("ipoib: show VF broadcast address") >> >> Signed-off-by: Denis Kirjanov > > This is only on net-next so the pat

Re: [PATCH net-next] ipv6: Check if route exists before notifying it

2019-06-19 Thread David Ahern
On 6/19/19 11:55 AM, Ido Schimmel wrote: > diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c > index 1d16a01eccf5..241a0e9a07c3 100644 > --- a/net/ipv6/ip6_fib.c > +++ b/net/ipv6/ip6_fib.c > @@ -393,6 +393,8 @@ int call_fib6_multipath_entry_notifiers(struct net *net, > .nsiblings =

Re: [PATCH bpf] bpf: fix NULL deref in btf_type_is_resolve_source_only

2019-06-19 Thread Andrii Nakryiko
On Wed, Jun 19, 2019 at 12:01 PM Stanislav Fomichev wrote: > > Commit 1dc92851849c ("bpf: kernel side support for BTF Var and DataSec") > added invocations of btf_type_is_resolve_source_only before > btf_type_nosize_or_null which checks for the NULL pointer. > Swap the order of btf_type_nosize_or_

[PATCH bpf] bpf: fix NULL deref in btf_type_is_resolve_source_only

2019-06-19 Thread Stanislav Fomichev
Commit 1dc92851849c ("bpf: kernel side support for BTF Var and DataSec") added invocations of btf_type_is_resolve_source_only before btf_type_nosize_or_null which checks for the NULL pointer. Swap the order of btf_type_nosize_or_null and btf_type_is_resolve_source_only to make sure the do the NULL

Re: [PATCH net-next 1/3] net/sched: Introduce action ct

2019-06-19 Thread Marcelo Ricardo Leitner
On Tue, Jun 11, 2019 at 04:28:31PM +0300, Paul Blakey wrote: ... > +static int tcf_ct_fill_params_nat(struct tcf_ct_params *p, > + struct tc_ct *parm, > + struct nlattr **tb, > + struct netlink_ext_ack *extack

Re: [PATCH RESEND nf-next] netfilter: add support for matching IPv4 options

2019-06-19 Thread Pablo Neira Ayuso
On Wed, Jun 19, 2019 at 01:58:02PM -0400, Stephen Suryaputra wrote: > On Wed, Jun 19, 2019 at 07:18:32PM +0200, Pablo Neira Ayuso wrote: > > > > Rules with this options will load fine: > > > > ip option eol type 1 > > ip option noop type 1 > > ip option sec type 1 > > ip option timestamp type 1 >

Re: [PATCH RESEND nf-next] netfilter: add support for matching IPv4 options

2019-06-19 Thread Stephen Suryaputra
On Wed, Jun 19, 2019 at 07:18:32PM +0200, Pablo Neira Ayuso wrote: > > Rules with this options will load fine: > > ip option eol type 1 > ip option noop type 1 > ip option sec type 1 > ip option timestamp type 1 > ip option rr type 1 > ip option sid type 1 > > However, they will not ever match I

[PATCH net-next] ipv6: Check if route exists before notifying it

2019-06-19 Thread Ido Schimmel
From: Ido Schimmel When user space sends invalid information in RTA_MULTIPATH, the nexthop list in ip6_route_multipath_add() is empty and there is no route to notify. The code that emits the netlink notifications correctly checks if the route is not NULL, but I missed that for the in-kernel noti

Re: [PATCH mlx5-next 11/15] RDMA/mlx5: Add vport metadata matching for IB representors

2019-06-19 Thread Mark Bloch
On 6/19/19 1:12 AM, Leon Romanovsky wrote: > On Wed, Jun 19, 2019 at 07:58:51AM +, Mark Bloch wrote: >> >> >> On 6/19/2019 00:43, Leon Romanovsky wrote: >>> On Wed, Jun 19, 2019 at 07:26:54AM +, Mark Bloch wrote: On 6/18/2019 23:51, Leon Romanovsky wrote: > On Wed, Jun

[PATCH net] ipv6: Default fib6_type to RTN_UNICAST when not set

2019-06-19 Thread David Ahern
From: David Ahern A user reported that routes are getting installed with type 0 (RTN_UNSPEC) where before the routes were RTN_UNICAST. One example is from accel-ppp which apparently still uses the ioctl interface and does not set rtmsg_type. Another is the netlink interface where ipv6 does not re

Re: [PATCH iproute2 v2 2/2] uapi: update if_link.h

2019-06-19 Thread Stephen Hemminger
On Wed, 19 Jun 2019 16:14:14 +0200 Denis Kirjanov wrote: > update if_link.h to commit 75345f888f700c4ab2448287e35d48c760b202e6 > ("ipoib: show VF broadcast address") > > Signed-off-by: Denis Kirjanov This is only on net-next so the patches should target iproute2-next. David can update from th

[PATCH net-next] net: sched: act_ctinfo: tidy UAPI definition

2019-06-19 Thread Kevin Darbyshire-Bryant
Remove some enums from the UAPI definition that were only used internally and are NOT part of the UAPI. Signed-off-by: Kevin Darbyshire-Bryant --- include/net/tc_act/tc_ctinfo.h| 5 + include/uapi/linux/tc_act/tc_ctinfo.h | 5 - 2 files changed, 5 insertions(+), 5 deletions(-) d

[PATCH net-next v4 7/7] taprio: Adjust timestamps for TCP packets

2019-06-19 Thread Vedang Patel
When the taprio qdisc is running in "txtime offload" mode, it will set the launchtime value (in skb->tstamp) for all the packets which do not have the SO_TXTIME socket option. But, the TCP packets already have this value set and it indicates the earliest departure time represented in CLOCK_MONOTONI

[PATCH net-next v4 2/7] etf: Add skip_sock_check

2019-06-19 Thread Vedang Patel
Currently, etf expects a socket with SO_TXTIME option set for each packet it encounters. So, it will drop all other packets. But, in the future commits we are planning to add functionality which where tstamp value will be set by another qdisc. Also, some packets which are generated from within the

[PATCH net-next v4 4/7] taprio: Remove inline directive

2019-06-19 Thread Vedang Patel
Remove inline directive from length_to_duration(). We will let the compiler make the decisions. Signed-off-by: Vedang Patel --- net/sched/sch_taprio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c index a41d7d4434ee..6ef0cc03f

[PATCH net-next v4 6/7] taprio: make clock reference conversions easier

2019-06-19 Thread Vedang Patel
Later in this series we will need to transform from CLOCK_MONOTONIC (used in TCP) to the clock reference used in TAPRIO. Signed-off-by: Vinicius Costa Gomes Signed-off-by: Vedang Patel --- net/sched/sch_taprio.c | 30 ++ 1 file changed, 22 insertions(+), 8 deletions(

[PATCH net-next v4 5/7] taprio: Add support for txtime-assist mode

2019-06-19 Thread Vedang Patel
Currently, we are seeing non-critical packets being transmitted outside of their timeslice. We can confirm that the packets are being dequeued at the right time. So, the delay is induced in the hardware side. The most likely reason is the hardware queues are starving the lower priority queues. In

[PATCH net-next v4 3/7] taprio: calculate cycle_time when schedule is installed

2019-06-19 Thread Vedang Patel
cycle time for a particular schedule is calculated only when it is first installed. So, it makes sense to just calculate it once right after the 'cycle_time' parameter has been parsed and store it in cycle_time. Signed-off-by: Vedang Patel --- net/sched/sch_taprio.c | 29 +++-

[PATCH net-next v4 1/7] igb: clear out tstamp after sending the packet

2019-06-19 Thread Vedang Patel
skb->tstamp is being used at multiple places. On the transmit side, it is used to determine the launchtime of the packet. It is also used to determine the software timestamp after the packet has been transmitted. So, clear out the tstamp value after it has been read so that we do not report false

[PATCH net-next v4 0/7] net/sched: Add txtime-assist support for taprio.

2019-06-19 Thread Vedang Patel
Changes in v4: - Remove inline directive from functions in foo.c. - Fix spacing in pkt_sched.h (for etf patch). Changes in v3: - Simplify implementation for taprio flags. - txtime_delay can only be set if txtime-assist mode is enabled. - txtime_delay and flags will only be visible in tc output if

Re: [PATCH RESEND nf-next] netfilter: add support for matching IPv4 options

2019-06-19 Thread Pablo Neira Ayuso
On Tue, Jun 11, 2019 at 08:09:12AM -0400, Stephen Suryaputra wrote: [...] > diff --git a/net/netfilter/nft_exthdr.c b/net/netfilter/nft_exthdr.c > index a940c9fd9045..4155a32fade7 100644 > --- a/net/netfilter/nft_exthdr.c > +++ b/net/netfilter/nft_exthdr.c [...] > +static int ipv4_find_option(struc

[PATCH net-next] br_netfilter: prevent UAF in brnf_exit_net()

2019-06-19 Thread Christian Brauner
Prevent a UAF in brnf_exit_net(). When unregister_net_sysctl_table() is called the ctl_hdr pointer will obviously be freed and so accessing it righter after is invalid. Fix this by stashing a pointer to the table we want to free before we unregister the sysctl header. Note that syzkaller falsely

Re: [PATCH 2/2 nf-next] netfilter: nft_meta: Add NFT_META_BRI_VLAN support

2019-06-19 Thread Pablo Neira Ayuso
On Wed, Jun 19, 2019 at 03:16:25PM +0800, we...@ucloud.cn wrote: > From: wenxu > > nft add table bridge firewall > nft add chain bridge firewall zones { type filter hook prerouting priority - > 300 \; } > nft add rule bridge firewall zones counter ct zone set vlan id map { 100 : 1, > 200 : 2 }

Re: [PATCH 1/2 nf-next] netfilter: nft_meta: add NFT_META_BRI_PVID support

2019-06-19 Thread Pablo Neira Ayuso
On Wed, Jun 19, 2019 at 03:16:24PM +0800, we...@ucloud.cn wrote: > From: wenxu > > nft add table bridge firewall > nft add chain bridge firewall zones { type filter hook prerouting priority - > 300 \; } > nft add rule bridge firewall zones counter ct zone set vlan id map { 100 : 1, > 200 : 2 }

[PATCH bpf-next v7 9/9] bpftool: support cgroup sockopt

2019-06-19 Thread Stanislav Fomichev
Support sockopt prog type and cgroup hooks in the bpftool. Cc: Martin Lau Acked-by: Jakub Kicinski Signed-off-by: Stanislav Fomichev --- tools/bpf/bpftool/Documentation/bpftool-cgroup.rst | 7 +-- tools/bpf/bpftool/Documentation/bpftool-prog.rst | 2 +- tools/bpf/bpftool/bash-completion/

[PATCH bpf-next v7 8/9] bpf: add sockopt documentation

2019-06-19 Thread Stanislav Fomichev
Provide user documentation about sockopt prog type and cgroup hooks. v7: * add description for retval=0 and optlen=-1 v6: * describe cgroup chaining, add example v2: * use return code 2 for kernel bypass Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- Documentation/bpf/index.rst

[PATCH bpf-next v7 5/9] selftests/bpf: add sockopt test

2019-06-19 Thread Stanislav Fomichev
Add sockopt selftests: * require proper expected_attach_type * enforce context field read/write access * test bpf_sockopt_handled handler * test EPERM * test limiting optlen from getsockopt * test out-of-bounds access v7: * remove return 2; test retval=0 and optlen=-1 v3: * use DW for optval{,_en

[PATCH bpf-next v7 4/9] selftests/bpf: test sockopt section name

2019-06-19 Thread Stanislav Fomichev
Add tests that make sure libbpf section detection works. Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- tools/testing/selftests/bpf/test_section_names.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tools/testing/selftests/bpf/test_section_names.c b/tools/testing/selfte

[PATCH bpf-next v7 7/9] selftests/bpf: add sockopt test that exercises BPF_F_ALLOW_MULTI

2019-06-19 Thread Stanislav Fomichev
sockopt test that verifies chaining behavior. v7: * rework the test to verify cgroup getsockopt chaining Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- tools/testing/selftests/bpf/.gitignore| 1 + tools/testing/selftests/bpf/Makefile | 4 +- .../selftests/bpf/progs/s

[PATCH bpf-next v7 6/9] selftests/bpf: add sockopt test that exercises sk helpers

2019-06-19 Thread Stanislav Fomichev
socktop test that introduces new SOL_CUSTOM sockopt level and stores whatever users sets in sk storage. Whenever getsockopt is called, the original value is retrieved. v7: * use retval=0 and optlen-1 v6: * test 'ret=1' use-case as well (Alexei Starovoitov) v4: * don't call bpf_sk_fullsock helper

[PATCH bpf-next v7 3/9] libbpf: support sockopt hooks

2019-06-19 Thread Stanislav Fomichev
Make libbpf aware of new sockopt hooks so it can derive prog type and hook point from the section names. Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- tools/lib/bpf/libbpf.c| 5 + tools/lib/bpf/libbpf_probes.c | 1 + 2 files changed, 6 insertions(+) diff --git a/tools/lib/bp

[PATCH bpf-next v7 2/9] bpf: sync bpf.h to tools/

2019-06-19 Thread Stanislav Fomichev
Export new prog type and hook points to the libbpf. Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- tools/include/uapi/linux/bpf.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index d0a23476f887..67059b4

[PATCH bpf-next v7 1/9] bpf: implement getsockopt and setsockopt hooks

2019-06-19 Thread Stanislav Fomichev
Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks. BPF_CGROUP_SETSOCKOPT get a read-only view of the setsockopt arguments. BPF_CGROUP_GETSOCKOPT can modify the supplied buffer. Both of them reuse existing PTR_TO_PACKET{,_END} infrastructure. The bu

[PATCH bpf-next v7 0/9] bpf: getsockopt and setsockopt hooks

2019-06-19 Thread Stanislav Fomichev
This series implements two new per-cgroup hooks: getsockopt and setsockopt along with a new sockopt program type. The idea is pretty similar to recently introduced cgroup sysctl hooks, but implementation is simpler (no need to convert to/from strings). What this can be applied to: * move business

Re: [PATCH net] inet: clear num_timeout reqsk_alloc()

2019-06-19 Thread Yuchung Cheng
On Wed, Jun 19, 2019 at 9:46 AM Soheil Hassas Yeganeh wrote: > > On Wed, Jun 19, 2019 at 12:38 PM Eric Dumazet wrote: > > > > KMSAN caught uninit-value in tcp_create_openreq_child() [1] > > This is caused by a recent change, combined by the fact > > that TCP cleared num_timeout, num_retrans and s

Re: [PATCH net-next v3 2/6] etf: Add skip_sock_check

2019-06-19 Thread Patel, Vedang
Thanks Sergei for the input. > On Jun 18, 2019, at 2:28 AM, Sergei Shtylyov > wrote: > > Hello! > > On 17.06.2019 22:31, Vedang Patel wrote: > >> Currently, etf expects a socket with SO_TXTIME option set for each packet >> it encounters. So, it will drop all other packets. But, in the future

Re: [PATCH net-next v3 4/6] taprio: Add support for txtime-assist mode.

2019-06-19 Thread Patel, Vedang
Thanks for the input David. > On Jun 17, 2019, at 4:22 PM, David Miller wrote: > > From: Vedang Patel > Date: Mon, 17 Jun 2019 12:31:08 -0700 > >> diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c >> index a41d7d4434ee..ab6080013666 100644 >> --- a/net/sched/sch_taprio.c >> +++ b/

Re: [PATCH net-next 3/5] ipv6: honor RT6_LOOKUP_F_DST_NOREF in rule lookup logic

2019-06-19 Thread Wei Wang
On Wed, Jun 19, 2019 at 9:07 AM David Miller wrote: > > From: Wei Wang > Date: Tue, 18 Jun 2019 11:25:41 -0700 > > > @@ -237,13 +240,16 @@ static int __fib6_rule_action(struct fib_rule *rule, > > struct flowi *flp, > > goto out; > > } > > again: > > - ip6_rt_put(

Re: [PATCH RESEND nf-next] netfilter: add support for matching IPv4 options

2019-06-19 Thread Pablo Neira Ayuso
On Tue, Jun 18, 2019 at 10:13:55AM -0400, Stephen Suryaputra wrote: > On Tue, Jun 18, 2019 at 05:31:12PM +0200, Pablo Neira Ayuso wrote: > > > +{ > > > + unsigned char optbuf[sizeof(struct ip_options) + 41]; > > > > In other parts of the kernel this is + 40: > > > > net/ipv4/cipso_ipv4.c: unsign

  1   2   >