Re: [PATCH bpf v2 1/2] libbpf: remove likely/unlikely in xsk.h

2019-04-10 Thread Magnus Karlsson
On Wed, Apr 10, 2019 at 9:08 PM Y Song wrote: > > On Wed, Apr 10, 2019 at 12:21 AM Magnus Karlsson > wrote: > > > > This patch removes the use of likely and unlikely in xsk.h since they > > create a dependency on Linux headers as reported by several > > users. There have also been reports that th

Re: [PATCH/RFC v2 bpf-next 05/19] bpf: split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32

2019-04-10 Thread Jiong Wang
> On 11 Apr 2019, at 03:52, Jakub Kicinski wrote: > > On Wed, 10 Apr 2019 20:50:19 +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. >> >> Thi

Re: [PATCH/RFC v2 bpf-next 06/19] bpf: mark lo32 writes that should be zero extended into hi32

2019-04-10 Thread Jiong Wang
> On 11 Apr 2019, at 04:13, Jakub Kicinski wrote: > > On Wed, 10 Apr 2019 20:50:20 +0100, Jiong Wang wrote: >> @@ -2169,6 +2188,12 @@ static int check_mem_access(struct bpf_verifier_env >> *env, int insn_idx, u32 regn >> value_regno); >>

Re: [PATCH v4 1/2] net: phy: mscc: add support for VSC8514 PHY

2019-04-10 Thread Heiner Kallweit
On 10.04.2019 13:32, kavyasree.kotag...@microchip.com wrote: > 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 M

Re: [PATCH bpf-next 5/5] bpf: cpumap memory prefetchw optimizations for struct page

2019-04-10 Thread Ilias Apalodimas
On Wed, Apr 10, 2019 at 01:43:58PM +0200, Jesper Dangaard Brouer wrote: > A lot of the performance gain comes from this patch. > > While analysing performance overhead it was found that the largest CPU > stalls were caused when touching the struct page area. It is first read with > a READ_ONCE fro

Re: [PATCH net-next] fou: correct spelling of encapsulation

2019-04-10 Thread David Miller
From: Simon Horman Date: Tue, 9 Apr 2019 09:59:07 +0200 > Correct spelling of encapsulation. > Found by inspection. > > Signed-off-by: Simon Horman Applied, thanks Simon.

Re: [PATCH net] net/tls: prevent bad memory access in tls_is_sk_tx_device_offloaded()

2019-04-10 Thread David Miller
From: Jakub Kicinski Date: Mon, 8 Apr 2019 17:59:50 -0700 > Unlike '&&' operator, the '&' does not have short-circuit > evaluation semantics. IOW both sides of the operator always > get evaluated. Fix the wrong operator in > tls_is_sk_tx_device_offloaded(), which would lead to > out-of-bounds

Re: [PATCH bpf-next 3/5] net: core: introduce build_skb_around

2019-04-10 Thread Ilias Apalodimas
On Wed, Apr 10, 2019 at 01:43:47PM +0200, Jesper Dangaard Brouer wrote: > The function build_skb() also have the responsibility to allocate and clear > the SKB structure. Introduce a new function build_skb_around(), that moves > the responsibility of allocation and clearing to the caller. This allo

Re: [PATCH bpf-next] selftests: bpf: add VRF test cases to lwt_ip_encap test.

2019-04-10 Thread David Ahern
On 4/10/19 9:38 PM, Peter Oskolkov wrote: >> >> Notice the "No route to host" errors. > > "No route to host" is OK: there are negative tests, as you requested a > couple of months ago... :), and these tests correctly trigger "no > route to host". > > This output basically tell me that the test pa

Re: [PATCH net-next 10/10] ipv6: Refactor __ip6_route_redirect

2019-04-10 Thread David Ahern
On 4/10/19 1:45 PM, Martin Lau wrote: > On Wed, Apr 10, 2019 at 11:45:04AM -0700, David Ahern wrote: @@ -2420,7 +2449,7 @@ static struct rt6_info *__ip6_route_redirect(struct net *net, int flags) { struct ip6rd_flowi *rdfl = (str

Re: [PATCH bpf-next] selftests: bpf: add VRF test cases to lwt_ip_encap test.

2019-04-10 Thread Peter Oskolkov
Your test output tells me that everything is OK - see below. On Wed, Apr 10, 2019 at 9:17 PM David Ahern wrote: > > On 4/10/19 6:26 PM, Peter Oskolkov wrote: > > On Wed, Apr 10, 2019 at 6:19 PM David Ahern wrote: > >> > >> On 4/3/19 8:43 AM, Peter Oskolkov wrote: > >>> This patch adds tests vali

Re: [PATCH bpf-next] libbpf: Fix build with gcc-8

2019-04-10 Thread Yonghong Song
On 4/10/19 6:36 PM, Andrey Ignatov wrote: > Reported in [1]. > > With gcc 8.3.0 the following error is issued: > >cc -Ibpf@sta -I. -I.. -I.././include -I.././include/uapi >-fdiagnostics-color=always -fsanitize=address,undefined > -fno-omit-frame-pointer >-pipe -D_FILE_OFFSET_BITS=6

Re: [PATCH bpf-next] selftests: bpf: add VRF test cases to lwt_ip_encap test.

2019-04-10 Thread David Ahern
On 4/10/19 6:26 PM, Peter Oskolkov wrote: > On Wed, Apr 10, 2019 at 6:19 PM David Ahern wrote: >> >> On 4/3/19 8:43 AM, Peter Oskolkov wrote: >>> This patch adds tests validating that VRF and BPF-LWT >>> encap work together well, as requested by David Ahern. >>> >>> Signed-off-by: Peter Oskolkov

Re: cellular modem driver APIs

2019-04-10 Thread Subash Abhinov Kasiviswanathan
OK. But it means that you have a very specific encapsulation mode on top of the "netdev". I'm still not convinced we should actually make that a netdev, but I'll elaborate elsewhere. I recall Daniele also managed to get rmnet working with qmi_wwan (with an additional patch in which I had made q

Re: [PATCH/RFC v2 bpf-next 11/19] libbpf: new global variable "libbpf_test_mode"

2019-04-10 Thread Jakub Kicinski
On Wed, 10 Apr 2019 20:50:25 +0100, Jiong Wang wrote: > Enable BPF_F_TEST_RND_HI32 for all existing bpf selftests or other > independent tests could involve quite a few changes to make sure all bpf > prog load places has BPF_F_TEST_RND_HI32 set. > > Given most of the tests are using libbpf, this p

Re: [PATCH/RFC v2 bpf-next 06/19] bpf: mark lo32 writes that should be zero extended into hi32

2019-04-10 Thread Jakub Kicinski
On Wed, 10 Apr 2019 20:50:20 +0100, Jiong Wang wrote: > @@ -2169,6 +2188,12 @@ static int check_mem_access(struct bpf_verifier_env > *env, int insn_idx, u32 regn > value_regno); > if (reg_type_may_be_null(reg_type)) >

Re: [PATCH net-next V6 1/2] net/sched: taprio: fix picos_per_byte miscalculation

2019-04-10 Thread kbuild test robot
Hi Leandro, 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/Leandro-Dorileo/net-sched-taprio-fix-picos_per_byte-miscalculation/20190410-083853 config: i386-randconfig-m3-201914 (attached as .config

Re: [PATCH/RFC v2 bpf-next 05/19] bpf: split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32

2019-04-10 Thread Jakub Kicinski
On Wed, 10 Apr 2019 20:50:19 +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: [PATCH/RFC v2 bpf-next 04/19] bpf: refactor "check_reg_arg" to eliminate code redundancy

2019-04-10 Thread Jakub Kicinski
On Wed, 10 Apr 2019 20:50:18 +0100, Jiong Wang wrote: > There are a few "regs[regno]" here are there across "check_reg_arg", this > patch factor it out into a simple "reg" pointer. The intention is to > simplify code indentation and make the later patches in this set look > cleaner. > > Signed-off

Re: [oss-drivers] [PATCH/RFC v2 bpf-next 03/19] bpf: factor out reg and stack slot propagation into "propagate_liveness_reg"

2019-04-10 Thread Jakub Kicinski
On Wed, 10 Apr 2019 20:50:17 +0100, Jiong Wang wrote: > After code refactor in previous patches, the propagation logic inside the > for loop in "propagate_liveness" becomes clear that they are good enough to > be factored out into a common function "propagate_liveness_reg". > > Signed-off-by: Jion

Re: [oss-drivers] [PATCH/RFC v2 bpf-next 02/19] bpf: refactor propagate_liveness to eliminate code redundance

2019-04-10 Thread Jakub Kicinski
On Wed, 10 Apr 2019 20:50:16 +0100, Jiong Wang wrote: > Access to reg states were not factored out, the consequence is long code > for dereferencing them which made the indentation not good for reading. > > This patch factor out these code so the core code in the loop could be > easier to follow.

Re: [PATCH net v2 0/2] Fix thunderx MTU with XDP

2019-04-10 Thread David Miller
From: David Miller Date: Wed, 10 Apr 2019 19:35:16 -0700 (PDT) > From: Matteo Croce > Date: Mon, 8 Apr 2019 23:06:45 +0200 > >> The thunderx driver can't use XDP with all MTU values. >> This patches sets the right MTU values, and add a check to avoid setting >> a wrong value which will not fun

Re: [PATCH net v2 0/2] Fix thunderx MTU with XDP

2019-04-10 Thread David Miller
From: Matteo Croce Date: Mon, 8 Apr 2019 23:06:45 +0200 > The thunderx driver can't use XDP with all MTU values. > This patches sets the right MTU values, and add a check to avoid setting > a wrong value which will not function. Series applied and queued up for -stable.

Re: [PATCH net-next V6 0/2] net/sched: taprio: fix picos_per_byte miscalculation

2019-04-10 Thread David Miller
From: Leandro Dorileo Date: Mon, 8 Apr 2019 10:12:16 -0700 > This set fixes miscalculations based on invalid link speed values. ... Series applied to net-next, thank you.

Re: [PATCHv2 net] team: set slave to promisc if team is already in promisc mode

2019-04-10 Thread David Miller
From: Hangbin Liu Date: Mon, 8 Apr 2019 16:45:17 +0800 > After adding a team interface to bridge, the team interface will enter > promisc mode. Then if we add a new slave to team0, the slave will keep > promisc off. Fix it by setting slave to promisc on if team master is > already in promisc mod

[PATCH bpf-next] libbpf: Fix build with gcc-8

2019-04-10 Thread Andrey Ignatov
Reported in [1]. With gcc 8.3.0 the following error is issued: cc -Ibpf@sta -I. -I.. -I.././include -I.././include/uapi -fdiagnostics-color=always -fsanitize=address,undefined -fno-omit-frame-pointer -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -g -fPIC -g -O2 -Werror -Wall -

Re: [PATCH bpf-next] selftests: bpf: add VRF test cases to lwt_ip_encap test.

2019-04-10 Thread Peter Oskolkov
On Wed, Apr 10, 2019 at 6:19 PM David Ahern wrote: > > On 4/3/19 8:43 AM, Peter Oskolkov wrote: > > This patch adds tests validating that VRF and BPF-LWT > > encap work together well, as requested by David Ahern. > > > > Signed-off-by: Peter Oskolkov > > --- > > .../selftests/bpf/test_lwt_ip_enc

Re: [PATCH bpf-next] selftests: bpf: add VRF test cases to lwt_ip_encap test.

2019-04-10 Thread David Ahern
On 4/3/19 8:43 AM, Peter Oskolkov wrote: > This patch adds tests validating that VRF and BPF-LWT > encap work together well, as requested by David Ahern. > > Signed-off-by: Peter Oskolkov > --- > .../selftests/bpf/test_lwt_ip_encap.sh| 134 +++--- > 1 file changed, 86 inserti

Re: [PATCH net] net/tls: fix build without CONFIG_TLS_DEVICE

2019-04-10 Thread David Miller
From: Jakub Kicinski Date: Wed, 10 Apr 2019 16:23:39 -0700 > buildbot noticed that TLS_HW is not defined if CONFIG_TLS_DEVICE=n. > Wrap the cleanup branch into an ifdef, tls_device_free_resources_tx() > wouldn't be compiled either in this case. > > Fixes: 35b71a34ada6 ("net/tls: don't leak parti

Re: [PATCH bpf-next 0/5] Bulk optimization for XDP cpumap redirect

2019-04-10 Thread Song Liu
On Wed, Apr 10, 2019 at 6:00 AM Jesper Dangaard Brouer wrote: > > This patchset utilize a number of different kernel bulk APIs for optimizing > the performance for the XDP cpumap redirect feature. Could you please share some numbers about the optimization? Thanks, Song > > Patch-1: ptr_ring bat

Re: [PATCH bpf-next 5/5] bpf: cpumap memory prefetchw optimizations for struct page

2019-04-10 Thread Song Liu
On Wed, Apr 10, 2019 at 6:02 AM Jesper Dangaard Brouer wrote: > > A lot of the performance gain comes from this patch. > > While analysing performance overhead it was found that the largest CPU > stalls were caused when touching the struct page area. It is first read with > a READ_ONCE from build_

Re: [PATCH bpf-next 3/5] net: core: introduce build_skb_around

2019-04-10 Thread Song Liu
On Wed, Apr 10, 2019 at 6:02 AM Jesper Dangaard Brouer wrote: > > The function build_skb() also have the responsibility to allocate and clear > the SKB structure. Introduce a new function build_skb_around(), that moves > the responsibility of allocation and clearing to the caller. This allows > ca

Re: [PATCH bpf-next 4/5] bpf: cpumap do bulk allocation of SKBs

2019-04-10 Thread Song Liu
On Wed, Apr 10, 2019 at 6:02 AM Jesper Dangaard Brouer wrote: > > As cpumap now batch consume xdp_frame's from the ptr_ring, it knows how many > SKBs it need to allocate. Thus, lets bulk allocate these SKBs via > kmem_cache_alloc_bulk() API, and use the previously introduced function > build_skb_a

Re: [PATCH bpf-next 1/5] bpf: cpumap use ptr_ring_consume_batched

2019-04-10 Thread Song Liu
On Wed, Apr 10, 2019 at 6:03 AM Jesper Dangaard Brouer wrote: > > Move ptr_ring dequeue outside loop, that allocate SKBs and calls network > stack, as these operations that can take some time. The ptr_ring is a > communication channel between CPUs, where we want to reduce/limit any > cacheline bou

[PATCH net] net/tls: fix build without CONFIG_TLS_DEVICE

2019-04-10 Thread Jakub Kicinski
buildbot noticed that TLS_HW is not defined if CONFIG_TLS_DEVICE=n. Wrap the cleanup branch into an ifdef, tls_device_free_resources_tx() wouldn't be compiled either in this case. Fixes: 35b71a34ada6 ("net/tls: don't leak partially sent record in device mode") Signed-off-by: Jakub Kicinski --- n

[net:master 28/30] net//tls/tls_main.c:290:29: error: 'TLS_HW' undeclared; did you mean 'TLS_SW'?

2019-04-10 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master head: 44f5e0480752b356f577aef90a5813299c3c60b1 commit: 35b71a34ada62c9573847a324bf06a133fe11b11 [28/30] net/tls: don't leak partially sent record in device mode config: i386-randconfig-x008-201914 (attached as .config)

[PATCH 5/5] sctp: Pass sk_buff_head explicitly to sctp_ulpq_tail_event().

2019-04-10 Thread David Miller
Now the SKB list implementation assumption can be removed. And now that we know that the list head is always non-NULL we can remove the code blocks dealing with that as well. Signed-off-by: David S. Miller --- include/net/sctp/ulpqueue.h | 2 +- net/sctp/stream_interleave.c | 2 +- net/sct

[PATCH v5 4/5] sctp: Make sctp_enqueue_event tak an skb list.

2019-04-10 Thread David Miller
Pass this, instead of an event. Then everything trickles down and we always have events a non-empty list. Then we needs a list creating stub to place into .enqueue_event for sctp_stream_interleave_1. Signed-off-by: David S. Miller --- net/sctp/stream_interleave.c | 49 ++

[PATCH v5 1/5] sctp: Remove superfluous test in sctp_ulpq_reasm_drain().

2019-04-10 Thread David Miller
Inside the loop, we always start with event non-NULL. Signed-off-by: David S. Miller --- net/sctp/ulpqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c index 5dde92101743..0fecc1fb4ab7 100644 --- a/net/sctp/ulpqueue.c +++ b/net

[PATCH v5 3/5] sctp: Use helper for sctp_ulpq_tail_event() when hooked up to ->enqueue_event

2019-04-10 Thread David Miller
This way we can make sure events sent this way to sctp_ulpq_tail_event() are on a list as well. Now all such code paths are fully covered. Signed-off-by: David S. Miller --- net/sctp/stream_interleave.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/net/sctp/s

[PATCH v5 2/5] sctp: Always pass skbs on a list to sctp_ulpq_tail_event().

2019-04-10 Thread David Miller
This way we can simplify the logic and remove assumptions about the implementation of skb lists. Signed-off-by: David S. Miller --- net/sctp/ulpqueue.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c index 0fecc1fb

[PATCH v5 0/5] SCTP: Event skb list overhaul.

2019-04-10 Thread David Miller
This patch series eliminates the explicit reference to the skb list implementation via skb->prev dereferences. The approach used is to pass a non-empty skb list around instead of an event skb object which may or may not be on a list. I'd like to thank Marcelo Leitner, Xin Long, and Neil Horman

Re: [PATCH net-next] net: strparser: fix comment

2019-04-10 Thread David Miller
From: Jakub Kicinski Date: Wed, 10 Apr 2019 13:18:57 -0700 > Fix comment. > > Signed-off-by: Jakub Kicinski Applied.

Re: [PATCH net-next 10/10] ipv6: Refactor __ip6_route_redirect

2019-04-10 Thread Martin Lau
On Wed, Apr 10, 2019 at 11:45:04AM -0700, David Ahern wrote: > >> @@ -2420,7 +2449,7 @@ static struct rt6_info *__ip6_route_redirect(struct > >> net *net, > >> int flags) > >> { > >>struct ip6rd_flowi *rdfl = (struct ip6rd_flowi *)fl6; > >> - struct rt

[PATCH v5 bpf-next 2/3] bpf: sync kernel uapi headers

2019-04-10 Thread Javier Honduvilla Coto
Sync kernel uapi headers. Signed-off-by: Javier Honduvilla Coto --- tools/include/uapi/linux/bpf.h | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index af1cbd951f26..f707b286c21d 100644 --- a/tools/inc

[PATCH v5 bpf-next 0/3] bpf: add bpf_descendant_of helper

2019-04-10 Thread Javier Honduvilla Coto
Hi all, This patch adds the bpf_descendant_of helper which accepts a PID and returns 1 if the PID of the process currently being executed is a descendant of it or if it's itself. Returns 0 otherwise. This is very useful in tracing programs when we want to filter by a given PID and all the childre

[PATCH v5 bpf-next 3/3] bpf: add tests for bpf_descendant_of

2019-04-10 Thread Javier Honduvilla Coto
Adding the following test cases: - bpf_descendant_of(current->pid) == 1 - bpf_descendant_of(current->real_parent->pid) == 1 - bpf_descendant_of(1) == 1 - bpf_descendant_of(0) == 1 - bpf_descendant_of(-1) == 0 - bpf_descendant_of(current->children[0]->pid) == 0 Signed-off-by: Javier Honduvilla Co

[PATCH v5 bpf-next 1/3] bpf: add bpf_descendant_of helper

2019-04-10 Thread Javier Honduvilla Coto
This patch adds the bpf_descendant_of helper which accepts a PID and returns 1 if the PID of the process currently being executed is a descendant of it or if it's itself. Returns 0 otherwise. This is very useful in tracing programs when we want to filter by a given PID and all the children it migh

[PATCH net-next] net: strparser: fix comment

2019-04-10 Thread Jakub Kicinski
Fix comment. Signed-off-by: Jakub Kicinski --- net/strparser/strparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c index fa6c977b4c41..0ba363624339 100644 --- a/net/strparser/strparser.c +++ b/net/strparser/strparser

Re: [PATCH net 0/3] net: tls: fix memory leaks and freeing skbs

2019-04-10 Thread David Miller
From: Jakub Kicinski Date: Wed, 10 Apr 2019 11:04:29 -0700 > This series fixes two memory issues and a stack overflow. > First two patches are fairly simple leaks. Third patch > partially reverts an optimization made to the strparser > which causes creation of skb->frag_list->skb->frag_list... >

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

2019-04-10 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/RFC v2 bpf-next 19/19] nfp: bpf: eliminate zero extension code-gen

2019-04-10 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/RFC v2 bpf-next 07/19] bpf: reduce false alarm by refining helper call arg types

2019-04-10 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/RFC v2 bpf-next 14/19] powerpc: bpf: eliminate zero extension code-gen

2019-04-10 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/RFC v2 bpf-next 06/19] bpf: mark lo32 writes that should be zero extended into hi32

2019-04-10 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/RFC v2 bpf-next 11/19] libbpf: new global variable "libbpf_test_mode"

2019-04-10 Thread Jiong Wang
Enable BPF_F_TEST_RND_HI32 for all existing bpf selftests or other independent tests could involve quite a few changes to make sure all bpf prog load places has BPF_F_TEST_RND_HI32 set. Given most of the tests are using libbpf, this patch introduces a new global variable "libbpf_test_mode" into li

[PATCH/RFC v2 bpf-next 09/19] bpf: introduce new bpf prog load flags "BPF_F_TEST_RND_HI32"

2019-04-10 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/RFC v2 bpf-next 00/19] bpf: eliminate zero extensions for sub-register writes

2019-04-10 Thread Jiong Wang
v2 changes: - rebased on top of bpf-next master. - added comments for what is sub-register def index. (Edward, Alexei) - removed patch 1 which turns bit mask from enum to macro. (Alexei) - removed sysctl/bpf_jit_32bit_opt. (Alexei) - merged sub-register def insn index into reg state. (Ale

[PATCH/RFC v2 bpf-next 18/19] riscv: bpf: eliminate zero extension code-gen

2019-04-10 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/RFC v2 bpf-next 10/19] bpf: randomize high 32-bit when BPF_F_TEST_RND_HI32 is set

2019-04-10 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/RFC v2 bpf-next 15/19] s390: bpf: eliminate zero extension code-gen

2019-04-10 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/RFC v2 bpf-next 05/19] bpf: split read liveness into REG_LIVE_READ64 and REG_LIVE_READ32

2019-04-10 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/RFC v2 bpf-next 12/19] selftests: enable hi32 randomization for "test_progs" and "test_verifier"

2019-04-10 Thread Jiong Wang
"test_progs" contains a couple of C based tests, so is a very good assurance on the pass correctness for this patch set. After this patch, BPF_F_TEST_RND_HI32 will be set for all of them and high 32-bit are randomized when possible. This could deliver quite stressful tests on x86_64. hi32 randomi

[PATCH/RFC v2 bpf-next 16/19] sparc: bpf: eliminate zero extension code-gen

2019-04-10 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/RFC v2 bpf-next 13/19] arm: bpf: eliminate zero extension code-gen

2019-04-10 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/RFC v2 bpf-next 17/19] x32: bpf: eliminate zero extension code-gen

2019-04-10 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/RFC v2 bpf-next 03/19] bpf: factor out reg and stack slot propagation into "propagate_liveness_reg"

2019-04-10 Thread Jiong Wang
After code refactor in previous patches, the propagation logic inside the for loop in "propagate_liveness" becomes clear that they are good enough to be factored out into a common function "propagate_liveness_reg". Signed-off-by: Jiong Wang --- kernel/bpf/verifier.c | 30

[PATCH/RFC v2 bpf-next 04/19] bpf: refactor "check_reg_arg" to eliminate code redundancy

2019-04-10 Thread Jiong Wang
There are a few "regs[regno]" here are there across "check_reg_arg", this patch factor it out into a simple "reg" pointer. The intention is to simplify code indentation and make the later patches in this set look cleaner. Signed-off-by: Jiong Wang --- kernel/bpf/verifier.c | 14 -- 1

[PATCH/RFC v2 bpf-next 01/19] bpf: refactor propagate_liveness to eliminate duplicated for loop

2019-04-10 Thread Jiong Wang
Propagation for register and stack slot are finished in separate for loop, while they are perfect to be put into a single loop. This could also let them share some common variables in later patches. Signed-off-by: Jiong Wang --- kernel/bpf/verifier.c | 4 +--- 1 file changed, 1 insertion(+), 3

[PATCH/RFC v2 bpf-next 02/19] bpf: refactor propagate_liveness to eliminate code redundance

2019-04-10 Thread Jiong Wang
Access to reg states were not factored out, the consequence is long code for dereferencing them which made the indentation not good for reading. This patch factor out these code so the core code in the loop could be easier to follow. Signed-off-by: Jiong Wang --- kernel/bpf/verifier.c | 34

Re: [PATCH net-next] ipv4: Handle RTA_GATEWAY set to 0

2019-04-10 Thread Govindarajulu Varadarajan
On Wed, Apr 10, 2019 at 12:03 PM David Ahern wrote: > > From: David Ahern > > Govindarajulu reported a regression with Network Manager which sends an > RTA_GATEWAY attribute with the address set to 0. Fixup the handling of > RTA_GATEWAY to only set fc_gw_family if the gateway address is actually

Re: [PATCH net 3/3] net: strparser: partially revert "strparser: Call skb_unclone conditionally"

2019-04-10 Thread Eric Dumazet
On 04/10/2019 11:04 AM, Jakub Kicinski wrote: > This reverts the first part of commit 4e485d06bb8c ("strparser: Call > skb_unclone conditionally"). To build a message with multiple > fragments we need our own root of frag_list. We can't simply > use the frag_list of orig_skb, because it will l

Re: [PATCH net-next] ipv4: Handle RTA_GATEWAY set to 0

2019-04-10 Thread David Miller
From: David Ahern Date: Wed, 10 Apr 2019 10:05:51 -0700 > From: David Ahern > > Govindarajulu reported a regression with Network Manager which sends an > RTA_GATEWAY attribute with the address set to 0. Fixup the handling of > RTA_GATEWAY to only set fc_gw_family if the gateway address is actua

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

2019-04-10 Thread Florian Fainelli
On 4/10/2019 12:31 PM, Heiner Kallweit wrote: > On 09.04.2019 22:59, David Miller wrote: >> From: Heiner Kallweit >> Date: Sun, 7 Apr 2019 11:57:13 +0200 >> >>> Recently genphy_read_abilities() has been added that dynamically detects >>> clause 22 PHY abilities. I *think* this detection should

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

2019-04-10 Thread Heiner Kallweit
On 09.04.2019 22:59, David Miller wrote: > From: Heiner Kallweit > Date: Sun, 7 Apr 2019 11:57:13 +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

Re: [PATCH net 0/2] ibmvnic: Fix netdev features settings on reset

2019-04-10 Thread David Miller
From: Thomas Falcon Date: Wed, 10 Apr 2019 11:06:58 -0500 > In its current state, a driver reset clobbers any feature settings > a user may have toggled and will disable GRO as it is not explicitly > enabled in the driver. This patch set enables GRO and tries to retain > user settings after a res

Re: [PATCH net-next v2 0/5] net: sched: move back qlen to per CPU accounting

2019-04-10 Thread David Miller
From: Paolo Abeni Date: Wed, 10 Apr 2019 14:32:36 +0200 > The commit 46b1c18f9deb ("net: sched: put back q.qlen into a single location") > introduced some measurable regression in the contended scenarios for > lock qdisc. > > As Eric suggested we could replace q.qlen access with calls to > qdis

Re: [PATCH net 0/7] mlxsw: Various fixes

2019-04-10 Thread David Miller
From: Ido Schimmel Date: Wed, 10 Apr 2019 06:58:10 + > This patchset contains various small fixes for mlxsw. > > Patch #1 fixes a warning generated by switchdev core when the driver > fails to insert an MDB entry in the commit phase. > > Patches #2-#4 fix a warning in check_flush_dependency

Re: [PATCH bpf-next 2/5] bpf: cpumap use netif_receive_skb_list

2019-04-10 Thread Edward Cree
On 10/04/2019 12:43, Jesper Dangaard Brouer wrote: > Reduce BH-disable period further by moving cpu_map_build_skb() > outside/before invoking the network stack. And build up a > skb_list that is used for netif_receive_skb_list. This is also > an I-cache optimization. > > When injecting packets int

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

2019-04-10 Thread David Ahern
On 4/5/19 8:57 PM, Antony Antony wrote: > 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+). >>> >>>

Re: [PATCH net-next 10/10] ipv6: Refactor __ip6_route_redirect

2019-04-10 Thread David Ahern
On 4/10/19 10:36 AM, Martin Lau wrote: >> diff --git a/net/ipv6/route.c b/net/ipv6/route.c >> index 0e8becb1e455..d555edaaff13 100644 >> --- a/net/ipv6/route.c >> +++ b/net/ipv6/route.c >> @@ -2407,6 +2407,35 @@ void ip6_sk_dst_store_flow(struct sock *sk, struct >> dst_entry *dst, >>

Re: [PATCH bpf v2 2/2] libbpf: remove dependency on barrier.h in xsk.h

2019-04-10 Thread Y Song
On Wed, Apr 10, 2019 at 12:21 AM Magnus Karlsson wrote: > > The use of smp_rmb() and smp_wmb() creates a Linux header dependency > on barrier.h that is uneccessary in most parts. This patch implements > the two small defines that are needed from barrier.h. As a bonus, the > new implementations are

Re: [PATCH rdma-next 00/12] Move IB representors to single IB device multiple ports

2019-04-10 Thread Jason Gunthorpe
On Wed, Apr 10, 2019 at 09:48:40AM +0300, Leon Romanovsky wrote: > > > > Mark Bloch (12): > > > > net/mlx5: E-Switch, don't use hardcoded values for FDB prios > > > > net/mlx5: E-Switch, add a new prio to be used by the RDMA side > > > > RDMA/mlx5: Move netdev info into the port struct > > >

[PATCH net 3/3] net: strparser: partially revert "strparser: Call skb_unclone conditionally"

2019-04-10 Thread Jakub Kicinski
This reverts the first part of commit 4e485d06bb8c ("strparser: Call skb_unclone conditionally"). To build a message with multiple fragments we need our own root of frag_list. We can't simply use the frag_list of orig_skb, because it will lead to linking all orig_skbs together creating very long

[PATCH net 2/3] net/tls: don't leak partially sent record in device mode

2019-04-10 Thread Jakub Kicinski
David reports that tls triggers warnings related to sk->sk_forward_alloc not being zero at destruction time: WARNING: CPU: 5 PID: 6831 at net/core/stream.c:206 sk_stream_kill_queues+0x103/0x110 WARNING: CPU: 5 PID: 6831 at net/ipv4/af_inet.c:160 inet_sock_destruct+0x15b/0x170 When sender fills

[PATCH net 0/3] net: tls: fix memory leaks and freeing skbs

2019-04-10 Thread Jakub Kicinski
Hi! This series fixes two memory issues and a stack overflow. First two patches are fairly simple leaks. Third patch partially reverts an optimization made to the strparser which causes creation of skb->frag_list->skb->frag_list... chains of 100s of skbs, leading to recursive kfree_skb() filling

[PATCH net 1/3] net/tls: fix the IV leaks

2019-04-10 Thread Jakub Kicinski
Commit f66de3ee2c16 ("net/tls: Split conf to rx + tx") made freeing of IV and record sequence number conditional to SW path only, but commit e8f69799810c ("net/tls: Add generic NIC offload infrastructure") also allocates that state for the device offload configuration. Remember to free it. Fixes:

Re: [PATCH bpf v2 1/2] libbpf: remove likely/unlikely in xsk.h

2019-04-10 Thread Y Song
On Wed, Apr 10, 2019 at 12:21 AM Magnus Karlsson wrote: > > This patch removes the use of likely and unlikely in xsk.h since they > create a dependency on Linux headers as reported by several > users. There have also been reports that the use of these decreases > performance as the compiler puts t

Re: [PATCH net-next 10/10] ipv6: Refactor __ip6_route_redirect

2019-04-10 Thread Martin Lau
On Tue, Apr 09, 2019 at 02:41:19PM -0700, David Ahern wrote: > From: David Ahern > > Move the nexthop evaluation of a fib entry to a helper that can be > leveraged for each fib6_nh in a multipath nexthop object. > > In the move, 'continue' statements means the helper returns false > (loop should

Re: [PATCH bpf-next v2] libbpf: fix crash in XDP socket part with new larger BPF_LOG_BUF_SIZE

2019-04-10 Thread Y Song
On Tue, Apr 9, 2019 at 11:55 PM Magnus Karlsson wrote: > > In commit da11b417583e ("libbpf: teach libbpf about log_level bit 2"), > the BPF_LOG_BUF_SIZE was increased to 16M. The XDP socket part of > libbpf allocated the log_buf on the stack, but for the new 16M buffer > size this is not going to

[PATCH net-next] ipv4: Handle RTA_GATEWAY set to 0

2019-04-10 Thread David Ahern
From: David Ahern Govindarajulu reported a regression with Network Manager which sends an RTA_GATEWAY attribute with the address set to 0. Fixup the handling of RTA_GATEWAY to only set fc_gw_family if the gateway address is actually set. Fixes: f35b794b3b405 ("ipv4: Prepare fib_config for IPv6 g

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

2019-04-10 Thread Jakub Kicinski
On Wed, 10 Apr 2019 16:26:38 +, Vlad Buslov wrote: > >> Actually, I intended to modify fl_reoffload() to ignore filters with > >> 'deleted' flag set when adding, but I guess reusing 'reoffload_count' to > >> retry fl_hw_destroy_filter() would also work. > > > > Yeah, I don't see how you can i

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

2019-04-10 Thread Vlad Buslov
On Wed 10 Apr 2019 at 19:09, Jakub Kicinski wrote: > On Wed, 10 Apr 2019 16:02:17 +, Vlad Buslov wrote: >> On Wed 10 Apr 2019 at 18:48, Jakub Kicinski >> wrote: >> > On Wed, 10 Apr 2019 14:53:53 +, Vlad Buslov wrote: >> >> >> For my next patch set that unlocks the offloads API I implem

Re: [PATCH bpf-next] [tools/bpf] fix a few ubsan warning

2019-04-10 Thread Yonghong Song
On 4/10/19 12:58 AM, Daniel Borkmann wrote: > On 04/10/2019 02:37 AM, Yonghong Song wrote: >> The issue is reported at https://github.com/libbpf/libbpf/issues/28. >> >> Basically, per C standard, for >>void *memcpy(void *dest, const void *src, size_t n) >> if "dest" or "src" is NULL, regardle

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

2019-04-10 Thread Jakub Kicinski
On Wed, 10 Apr 2019 16:02:17 +, Vlad Buslov wrote: > On Wed 10 Apr 2019 at 18:48, Jakub Kicinski > wrote: > > On Wed, 10 Apr 2019 14:53:53 +, Vlad Buslov wrote: > >> >> For my next patch set that unlocks the offloads API I implemented the > >> >> algorithm to track reoffload count for e

[PATCH net 0/2] ibmvnic: Fix netdev features settings on reset

2019-04-10 Thread Thomas Falcon
In its current state, a driver reset clobbers any feature settings a user may have toggled and will disable GRO as it is not explicitly enabled in the driver. This patch set enables GRO and tries to retain user settings after a reset. If the underlying carrier changes, however, the driver will disa

[PATCH net 1/2] ibmvnic: Enable GRO

2019-04-10 Thread Thomas Falcon
Enable Generic Receive Offload in the ibmvnic driver. Signed-off-by: Thomas Falcon --- drivers/net/ethernet/ibm/ibmvnic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 5ecbb1a..59362ed 100644 ---

[PATCH net 2/2] ibmvnic: Fix netdev feature clobbering during a reset

2019-04-10 Thread Thomas Falcon
While determining offload capabilities of backing hardware during a device reset, the driver is clobbering current feature settings. Update hw_features on reset instead of features unless a feature is enabled that is no longer supported on the current backing device. Also enable features that were

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

2019-04-10 Thread Vlad Buslov
On Wed 10 Apr 2019 at 18:48, Jakub Kicinski wrote: > On Wed, 10 Apr 2019 14:53:53 +, Vlad Buslov wrote: >> >> For my next patch set that unlocks the offloads API I implemented the >> >> algorithm to track reoffload count for each tp that works like this: >> >> >> >> 1. struct tcf_proto is ex

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

2019-04-10 Thread Jakub Kicinski
On Wed, 10 Apr 2019 14:53:53 +, Vlad Buslov wrote: > >> For my next patch set that unlocks the offloads API I implemented the > >> algorithm to track reoffload count for each tp that works like this: > >> > >> 1. struct tcf_proto is extended with reoffload_count counter that > >>incremented

  1   2   >