[RFC PATCH v2 net-next 03/12] net: core: unwrap skb list receive slightly further

2018-06-26 Thread Edward Cree
Adds iterator skb_queue_for_each() to run over a list without modifying it. Signed-off-by: Edward Cree --- include/linux/skbuff.h | 16 include/trace/events/net.h | 7 +++ net/core/dev.c | 4 +++- 3 files changed, 26 insertions(+), 1 deletion(-) diff

[RFC PATCH v2 net-next 04/12] net: core: Another step of skb receive list processing

2018-06-26 Thread Edward Cree
netif_receive_skb_list_internal() now processes a list and hands it on to the next function. Signed-off-by: Edward Cree --- net/core/dev.c | 73 ++ 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/net/core/dev.c b/net/core

[RFC PATCH v2 net-next 05/12] net: core: another layer of lists, around PF_MEMALLOC skb handling

2018-06-26 Thread Edward Cree
First example of a layer splitting the list (rather than merely taking individual packets off it). Signed-off-by: Edward Cree --- net/core/dev.c | 46 ++ 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c

[RFC PATCH v2 net-next 06/12] net: core: propagate SKB lists through packet_type lookup

2018-06-26 Thread Edward Cree
e one ptype found in ptype_base[hash of skb->protocol]. Signed-off-by: Edward Cree --- include/trace/events/net.h | 7 +++ net/core/dev.c | 138 - 2 files changed, 105 insertions(+), 40 deletions(-) diff --git a/include/trace/events/net.h

[RFC PATCH v2 net-next 07/12] net: ipv4: listified version of ip_rcv

2018-06-26 Thread Edward Cree
ccept to cause out-of-order receives, so presumably this is considered OK. Signed-off-by: Edward Cree --- include/linux/netdevice.h | 3 ++ include/linux/netfilter.h | 27 + include/net/ip.h | 2 ++ net/core/dev.c| 11 +-- net/ipv4/af_inet.c

[RFC PATCH v2 net-next 08/12] net: ipv4: listify ip_rcv_finish

2018-06-26 Thread Edward Cree
ing on protocol changes). Signed-off-by: Edward Cree --- net/ipv4/ip_input.c | 58 - 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 7a8af8ff3f07..63d4dfdb1766 100644 --- a/ne

[RFC PATCH v2 net-next 09/12] net: don't bother calling list RX functions on empty lists

2018-06-26 Thread Edward Cree
Generally the check should be very cheap, as the sk_buff_head is in cache. Signed-off-by: Edward Cree --- net/core/dev.c | 8 ++-- net/ipv4/ip_input.c | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index f0eb00e9fb57..11f80d4502b9

[RFC PATCH v2 net-next 10/12] net: listify Generic XDP processing, part 1

2018-06-26 Thread Edward Cree
Deals with all the pre- and post-amble to the BPF program itself, which is still called one packet at a time. Involves some fiddly percpu variables to cope with XDP_REDIRECT handling. Signed-off-by: Edward Cree --- include/linux/filter.h | 10 +++ net/core/dev.c | 165

[RFC PATCH v2 net-next 11/12] net: listify Generic XDP processing, part 2

2018-06-26 Thread Edward Cree
extra indirect calls. Signed-off-by: Edward Cree --- include/linux/filter.h | 38 +- kernel/bpf/core.c | 26 ++ net/core/dev.c | 19 --- 3 files changed, 63 insertions(+), 20 deletions(-) diff --git a

[RFC PATCH v2 net-next 12/12] net: listify jited Generic XDP processing on x86_64

2018-06-26 Thread Edward Cree
list_func as a parameter instead of calculating it inside the loop. This is safe because BPF execution is not preemptible, so the percpu variable can't get moved while we're using it. Signed-off-by: Edward Cree --- arch/x86/net/bpf_jit_comp.c | 164 +

Re: [RFC PATCH v2 net-next 01/12] net: core: trivial netif_receive_skb_list() entry point

2018-06-27 Thread Edward Cree
On 27/06/18 01:06, Eric Dumazet wrote: > On 06/26/2018 11:17 AM, Edward Cree wrote: >> Just calls netif_receive_skb() in a loop. > ... > >> +void netif_receive_skb_list(struct sk_buff_head *list) > > Please use a standard list_head and standard list operators. > >

Re: [RFC PATCH v2 net-next 06/12] net: core: propagate SKB lists through packet_type lookup

2018-06-27 Thread Edward Cree
On 27/06/18 15:36, Willem de Bruijn wrote: > On Tue, Jun 26, 2018 at 8:19 PM Edward Cree wrote: >> __netif_receive_skb_taps() does a depressingly large amount of per-packet >> work that can't easily be listified, because the another_round looping >> makes it nontrivia

Re: [RFC PATCH v2 net-next 06/12] net: core: propagate SKB lists through packet_type lookup

2018-06-27 Thread Edward Cree
On 27/06/18 17:00, Willem de Bruijn wrote: > On Wed, Jun 27, 2018 at 10:49 AM Edward Cree wrote: >> On 27/06/18 15:36, Willem de Bruijn wrote: >>> Also, this function does more than just process network taps. >> This is true, but naming things is hard, and I couldn't

[PATCH v3 net-next 0/9] Handle multiple received packets at each stage

2018-06-29 Thread Edward Cree
istified Generic XDP handling (patches 10-12), though it doesn't seem to help (see above). * Extended testing to cover software firewalls / netfilter etc. [1] http://vger.kernel.org/netconf2018_files/DavidMiller_netconf2018.pdf [2] http://vger.kernel.org/netconf2018_files/EdwardCree_netcon

[PATCH v3 net-next 1/9] net: core: trivial netif_receive_skb_list() entry point

2018-06-29 Thread Edward Cree
Just calls netif_receive_skb() in a loop. Signed-off-by: Edward Cree --- include/linux/netdevice.h | 1 + net/core/dev.c| 19 +++ 2 files changed, 20 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c6b377a15869..e104b2e4a735

[PATCH v3 net-next 2/9] sfc: batch up RX delivery

2018-06-29 Thread Edward Cree
Improves packet rate of 1-byte UDP receives by up to 10%. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/efx.c| 12 drivers/net/ethernet/sfc/net_driver.h | 3 +++ drivers/net/ethernet/sfc/rx.c | 7 ++- 3 files changed, 21 insertions(+), 1 deletion

[PATCH v3 net-next 3/9] net: core: unwrap skb list receive slightly further

2018-06-29 Thread Edward Cree
Signed-off-by: Edward Cree --- include/trace/events/net.h | 7 +++ net/core/dev.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/trace/events/net.h b/include/trace/events/net.h index 9c886739246a..00aa72ce0e7c 100644 --- a/include/trace/events

[PATCH v3 net-next 4/9] net: core: Another step of skb receive list processing

2018-06-29 Thread Edward Cree
netif_receive_skb_list_internal() now processes a list and hands it on to the next function. Signed-off-by: Edward Cree --- net/core/dev.c | 61 +- 1 file changed, 56 insertions(+), 5 deletions(-) diff --git a/net/core/dev.c b/net/core

[PATCH v3 net-next 5/9] net: core: another layer of lists, around PF_MEMALLOC skb handling

2018-06-29 Thread Edward Cree
First example of a layer splitting the list (rather than merely taking individual packets off it). Involves new list.h function, list_cut_before(), like list_cut_position() but cuts on the other side of the given entry. Signed-off-by: Edward Cree --- include/linux/list.h | 30

[PATCH v3 net-next 7/9] net: ipv4: listified version of ip_rcv

2018-06-29 Thread Edward Cree
ccept to cause out-of-order receives, so presumably this is considered OK. Signed-off-by: Edward Cree --- include/linux/netdevice.h | 3 +++ include/linux/netfilter.h | 25 + include/net/ip.h | 2 ++ net/core/dev.c| 8 +++--- net/ipv4/af_inet.c

[PATCH v3 net-next 8/9] net: ipv4: listify ip_rcv_finish

2018-06-29 Thread Edward Cree
ing on protocol changes). Signed-off-by: Edward Cree --- net/ipv4/ip_input.c | 54 +++-- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 914240830bdf..24b9b0210aeb 100644 --- a/ne

[PATCH v3 net-next 6/9] net: core: propagate SKB lists through packet_type lookup

2018-06-29 Thread Edward Cree
e one ptype found in ptype_base[hash of skb->protocol]. Signed-off-by: Edward Cree --- net/core/dev.c | 72 +++--- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index d2454678bc82..edd67b1f1e12 1006

[PATCH v3 net-next 9/9] net: don't bother calling list RX functions on empty lists

2018-06-29 Thread Edward Cree
Generally the check should be very cheap, as the sk_buff_head is in cache. Signed-off-by: Edward Cree --- net/core/dev.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index 4c5ebfab9bc8..d6084b0cd9ce 100644 --- a/net/core/dev.c +++ b

Re: [PATCH v3 net-next 7/9] net: ipv4: listified version of ip_rcv

2018-07-02 Thread Edward Cree
On 29/06/18 23:08, kbuild test robot wrote: >net//ipv4/ip_input.c: In function 'ip_sublist_rcv': >>> net//ipv4/ip_input.c:524:14: warning: passing argument 6 of 'NF_HOOK_LIST' >>> from incompatible pointer type >head, dev, NULL, ip_rcv_finish); > ^ >In file inc

[PATCH v4 net-next 0/9] Handle multiple received packets at each stage

2018-07-02 Thread Edward Cree
_files/DavidMiller_netconf2018.pdf [2] http://vger.kernel.org/netconf2018_files/EdwardCree_netconf2018.pdf Edward Cree (9): net: core: trivial netif_receive_skb_list() entry point sfc: batch up RX delivery net: core: unwrap skb list receive slightly further net: core: Another step of skb receive list proces

[PATCH v4 net-next 1/9] net: core: trivial netif_receive_skb_list() entry point

2018-07-02 Thread Edward Cree
Just calls netif_receive_skb() in a loop. Signed-off-by: Edward Cree --- include/linux/netdevice.h | 1 + net/core/dev.c| 19 +++ 2 files changed, 20 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c6b377a15869..e104b2e4a735

[PATCH v4 net-next 3/9] net: core: unwrap skb list receive slightly further

2018-07-02 Thread Edward Cree
Signed-off-by: Edward Cree --- include/trace/events/net.h | 7 +++ net/core/dev.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/trace/events/net.h b/include/trace/events/net.h index 9c886739246a..00aa72ce0e7c 100644 --- a/include/trace/events

[PATCH v4 net-next 5/9] net: core: another layer of lists, around PF_MEMALLOC skb handling

2018-07-02 Thread Edward Cree
First example of a layer splitting the list (rather than merely taking individual packets off it). Involves new list.h function, list_cut_before(), like list_cut_position() but cuts on the other side of the given entry. Signed-off-by: Edward Cree --- include/linux/list.h | 30

[PATCH v4 net-next 2/9] sfc: batch up RX delivery

2018-07-02 Thread Edward Cree
Improves packet rate of 1-byte UDP receives by up to 10%. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/efx.c| 12 drivers/net/ethernet/sfc/net_driver.h | 3 +++ drivers/net/ethernet/sfc/rx.c | 7 ++- 3 files changed, 21 insertions(+), 1 deletion

[PATCH v4 net-next 4/9] net: core: Another step of skb receive list processing

2018-07-02 Thread Edward Cree
netif_receive_skb_list_internal() now processes a list and hands it on to the next function. Signed-off-by: Edward Cree --- net/core/dev.c | 61 +- 1 file changed, 56 insertions(+), 5 deletions(-) diff --git a/net/core/dev.c b/net/core

[PATCH v4 net-next 6/9] net: core: propagate SKB lists through packet_type lookup

2018-07-02 Thread Edward Cree
e one ptype found in ptype_base[hash of skb->protocol]. Signed-off-by: Edward Cree --- net/core/dev.c | 72 +++--- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index d2454678bc82..edd67b1f1e12 1006

[PATCH v4 net-next 7/9] net: ipv4: listified version of ip_rcv

2018-07-02 Thread Edward Cree
ccept to cause out-of-order receives, so presumably this is considered OK. Signed-off-by: Edward Cree --- include/linux/netdevice.h | 3 +++ include/linux/netfilter.h | 22 +++ include/net/ip.h | 2 ++ net/core/dev.c| 8 +++--- net/ipv4/af_inet.c| 1 +

[PATCH v4 net-next 9/9] net: don't bother calling list RX functions on empty lists

2018-07-02 Thread Edward Cree
Generally the check should be very cheap, as the sk_buff_head is in cache. Signed-off-by: Edward Cree --- net/core/dev.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index 4c5ebfab9bc8..d6084b0cd9ce 100644 --- a/net/core/dev.c +++ b

[PATCH v4 net-next 8/9] net: ipv4: listify ip_rcv_finish

2018-07-02 Thread Edward Cree
ing on protocol changes). Signed-off-by: Edward Cree --- net/ipv4/ip_input.c | 54 +++-- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 914240830bdf..24b9b0210aeb 100644 --- a/ne

Re: [PATCH v4 net-next 0/9] Handle multiple received packets at each stage

2018-07-02 Thread Edward Cree
On 02/07/18 16:40, David Ahern wrote: > Nice work. Have you looked at IPv6 support yet? I hadn't looked at it yet, no.  After a quick glance at ip6_rcv() and  ip6_rcv_finish(), it looks like it'd be basically the same as the IPv4  code in patches 7 and 8.  I'll probably add it in a followup when (

Re: [PATCH v4 net-next 7/9] net: ipv4: listified version of ip_rcv

2018-07-04 Thread Edward Cree
On 02/07/18 16:14, Edward Cree wrote: > +/* Receive a list of IP packets */ > +void ip_list_rcv(struct list_head *head, struct packet_type *pt, > + struct net_device *orig_dev) > +{ > + struct net_device *curr_dev = NULL; > + struct net *curr_net = NULL; >

[PATCH net-next] net: ipv4: fix drop handling in ip_list_rcv() and ip_list_rcv_finish()

2018-07-04 Thread Edward Cree
ource list before processing, and add it to the sublist afterwards if it wasn't freed or stolen. Fixes: 5fa12739a53d net: ipv4: listify ip_rcv_finish Fixes: 17266ee93984 net: ipv4: listified version of ip_rcv Signed-off-by: Edward Cree --- net/ipv4/ip_input.c | 16 +++- 1 file

[PATCH net-next 0/2] IP listification follow-ups

2018-07-05 Thread Edward Cree
While working on IPv6 list processing, I found another bug in the IPv4 version. So this patch series has that fix, and the IPv6 version with both fixes incorporated. Edward Cree (2): net: ipv4: fix list processing on L3 slave devices net: ipv6: listify ipv6_rcv() and ip6_rcv_finish

[PATCH net-next 1/2] net: ipv4: fix list processing on L3 slave devices

2018-07-05 Thread Edward Cree
l can be different in the single packet path (return NET_RX_SUCCESS) and the list path (forget this packet and continue). Fixes: 5fa12739a53d net: ipv4: listify ip_rcv_finish Signed-off-by: Edward Cree --- net/ipv4/ip_input.c | 23 +++ 1 file changed, 15 insertions(+), 8 dele

[PATCH net-next 2/2] net: ipv6: listify ipv6_rcv() and ip6_rcv_finish()

2018-07-05 Thread Edward Cree
Essentially the same as the ipv4 equivalents. Signed-off-by: Edward Cree --- include/net/ipv6.h | 2 + net/ipv6/af_inet6.c | 1 + net/ipv6/ip6_input.c | 131 --- 3 files changed, 118 insertions(+), 16 deletions(-) diff --git a/include/net

[PATCH net-next 0/3] fix use-after-free bugs in skb list processing

2018-07-06 Thread Edward Cree
adds a list.h helper macro to refactor code using the dequeue-enqueue model. Edward Cree (3): net: core: fix uses-after-free in list processing netfilter: fix use-after-free in NF_HOOK_LIST net: refactor dequeue-model list processing include/linux/list.h | 15 +++ include

[PATCH net-next 2/3] netfilter: fix use-after-free in NF_HOOK_LIST

2018-07-06 Thread Edward Cree
nf_hook() can free the skb, so we need to remove it from the list before calling, and add passed skbs to a sublist afterwards. Fixes: 17266ee93984 ("net: ipv4: listified version of ip_rcv") Reported-by: Dan Carpenter Signed-off-by: Edward Cree --- include/linux/netfilter.h | 10 +++

[PATCH net-next 3/3] net: refactor dequeue-model list processing

2018-07-06 Thread Edward Cree
New macro list_for_each_entry_dequeue loops over a list by popping entries from the head, allowing a more concise expression of the dequeue-enqueue model of list processing and avoiding the need for a 'next' pointer (as used in list_for_each_entry_safe). Signed-off-by: E

[PATCH net-next 1/3] net: core: fix uses-after-free in list processing

2018-07-06 Thread Edward Cree
afterwards. In the case of enqueue_to_backlog() we have already decided not to pass when we call the function, so we do not need a sublist. Fixes: 7da517a3bc52 ("net: core: Another step of skb receive list processing") Reported-by: Dan Carpenter Signed-off-by: Edward Cree --- net/core/

[PATCH v2 net-next 0/2] fix use-after-free bugs in skb list processing

2018-07-09 Thread Edward Cree
patch #3 (new list.h helper), per DaveM's request. Edward Cree (2): net: core: fix uses-after-free in list processing netfilter: fix use-after-free in NF_HOOK_LIST include/linux/netfilter.h | 10 +++--- net/core/dev.c| 21 + 2 files changed, 20 inser

[PATCH v2 net-next 1/2] net: core: fix uses-after-free in list processing

2018-07-09 Thread Edward Cree
afterwards. In the case of enqueue_to_backlog() we have already decided not to pass when we call the function, so we do not need a sublist. Fixes: 7da517a3bc52 ("net: core: Another step of skb receive list processing") Reported-by: Dan Carpenter Signed-off-by: Edward Cree --- net/core/

[PATCH v2 net-next 2/2] netfilter: fix use-after-free in NF_HOOK_LIST

2018-07-09 Thread Edward Cree
nf_hook() can free the skb, so we need to remove it from the list before calling, and add passed skbs to a sublist afterwards. Fixes: 17266ee93984 ("net: ipv4: listified version of ip_rcv") Reported-by: Dan Carpenter Signed-off-by: Edward Cree --- include/linux/netfilter.h | 10 +++

[PATCH v3 net-next 0/3] fix use-after-free bugs in skb list processing

2018-07-09 Thread Edward Cree
another similar bug in __netif_receive_skb_list_core(). v2: dropped patch #3 (new list.h helper), per DaveM's request. Edward Cree (3): net: core: fix uses-after-free in list processing netfilter: fix use-after-free in NF_HOOK_LIST net: core: fix use-after-free in __netif_receive_skb_list

[PATCH v3 net-next 1/3] net: core: fix uses-after-free in list processing

2018-07-09 Thread Edward Cree
afterwards. In the case of enqueue_to_backlog() we have already decided not to pass when we call the function, so we do not need a sublist. Fixes: 7da517a3bc52 ("net: core: Another step of skb receive list processing") Reported-by: Dan Carpenter Signed-off-by: Edward Cree --- net/core/

[PATCH v3 net-next 2/3] netfilter: fix use-after-free in NF_HOOK_LIST

2018-07-09 Thread Edward Cree
nf_hook() can free the skb, so we need to remove it from the list before calling, and add passed skbs to a sublist afterwards. Fixes: 17266ee93984 ("net: ipv4: listified version of ip_rcv") Reported-by: Dan Carpenter Signed-off-by: Edward Cree --- include/linux/netfilter.h | 10 +++

[PATCH v3 net-next 3/3] net: core: fix use-after-free in __netif_receive_skb_list_core

2018-07-09 Thread Edward Cree
__netif_receive_skb_core can free the skb, so we have to use the dequeue- enqueue model when calling it from __netif_receive_skb_list_core. Fixes: 88eb1944e18c ("net: core: propagate SKB lists through packet_type lookup") Signed-off-by: Edward Cree --- net/core/dev.c | 9 +++

Re: [net-next PATCH] net: ipv4: fix listify ip_rcv_finish in case of forwarding

2018-07-11 Thread Edward Cree
o ip_forward. > > Fixes: 5fa12739a53d ("net: ipv4: listify ip_rcv_finish") > Signed-off-by: Jesper Dangaard Brouer Acked-by: Edward Cree But it feels weird and asymmetric to only NULL skb->next (not ->prev), and  to have to do this by hand rather than e.g. being able to use  list

Re: [net-next PATCH] net: ipv4: fix listify ip_rcv_finish in case of forwarding

2018-07-13 Thread Edward Cree
On 12/07/18 21:10, Or Gerlitz wrote: > On Wed, Jul 11, 2018 at 11:06 PM, Jesper Dangaard Brouer > wrote: >> One reason I didn't "just" send a patch, is that Edward so-fare only >> implemented netif_receive_skb_list() and not napi_gro_receive_list(). > sfc does't support gro?! doesn't make sense..

[PATCH v2 net-next 0/2] ntuple filters with RSS

2018-03-08 Thread Edward Cree
ntext with an equal-weight [0,1] indirection table could be used to target all three containers by setting ring_cookie to 1, 3 and 6 on the respective filters. v2: Initialised ctx in efx_ef10_filter_insert() to avoid (false positive) gcc warning. Edward Cree (2): net: ethtool: extend RXNFC A

[PATCH v2 net-next 1/2] net: ethtool: extend RXNFC API to support RSS spreading of filter matches

2018-03-08 Thread Edward Cree
-off-by: Edward Cree --- include/linux/ethtool.h | 5 include/uapi/linux/ethtool.h | 32 +- net/core/ethtool.c | 64 +--- 3 files changed, 80 insertions(+), 21 deletions(-) diff --git a/include/linux/ethtool.h b

[PATCH v2 net-next 2/2] sfc: support RSS spreading of ethtool ntuple filters

2018-03-08 Thread Edward Cree
Use a linked list to associate user-facing context IDs with FW-facing context IDs (since the latter can change after an MC reset). Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/ef10.c | 273 ++ drivers/net/ethernet/sfc/efx.c| 65

[PATCH ethtool 0/3] RSS ntuple filters

2018-03-09 Thread Edward Cree
This series adds support for the management of extra RSS contexts and RSS spreading of ntuple/NFC filters introduced in kernel commit 84a1d9c48200 ("net: ethtool: extend RXNFC API to support RSS spreading of filter matches"). Edward Cree (3): ethtool-copy.h: sync with net-next et

[PATCH ethtool 1/3] ethtool-copy.h: sync with net-next

2018-03-09 Thread Edward Cree
This covers kernel changes up to commit 84a1d9c48200, net: ethtool: extend RXNFC API to support RSS spreading of filter matches Signed-off-by: Edward Cree --- ethtool-copy.h | 32 ++-- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/ethtool-copy.h

[PATCH ethtool 3/3] ethtool.8: Document RSS context control and RSS filters

2018-03-09 Thread Edward Cree
Signed-off-by: Edward Cree --- ethtool.8.in | 28 1 file changed, 28 insertions(+) diff --git a/ethtool.8.in b/ethtool.8.in index 690e55e..99ac62f 100644 --- a/ethtool.8.in +++ b/ethtool.8.in @@ -274,6 +274,7 @@ ethtool \- query or control network driver and

[PATCH ethtool 2/3] ethtool: add support for extra RSS contexts and RSS steering filters

2018-03-09 Thread Edward Cree
RSS contexts can be created on a device with -X ... context new, modified with -X ... context N, and deleted with -X ... context N delete. N-tuple filters can be directed at those contexts with -N ... context N. Signed-off-by: Edward Cree --- ethtool.c | 141

Re: [PATCH net-next] modules: allow modprobe load regular elf binaries

2018-03-12 Thread Edward Cree
On 09/03/18 18:58, Alexei Starovoitov wrote: > It's not waiting for the whole thing, because once bpfilter starts it > stays running/sleeping because it's stateful. So, this has been bugging me a bit. If bpfilter takes a signal and crashes, all that state goes away. Does that mean your iptables/net

[PATCH net-next 0/2] sfc: support FEC configuration

2018-03-14 Thread Edward Cree
Implements the ethtool get & set fecparam operations. Edward Cree (2): sfc: update MCDI protocol headers sfc: support FEC configuration through ethtool drivers/net/ethernet/sfc/ethtool.c| 32 + drivers/net/ethernet/sfc/mcdi_pcol.h | 2822 + drivers

[PATCH net-next 2/2] sfc: support FEC configuration through ethtool

2018-03-14 Thread Edward Cree
le or link partner doesn't support it. rs|baser (with or without auto bit) means prefer FEC even where auto wouldn't use it, but let FW choose which encoding to use. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/ethtool.c| 32 drivers/net/ethernet/sfc/mcdi_port

[PATCH ethtool] ethtool: don't fall back to grxfhindir when context was specified

2018-03-19 Thread Edward Cree
In do_grfxh(), if rss_context is non-zero, we must not fall back to do_grxfhindir() if ETHTOOL_GRSSH fails, for that reads the default RSS context and not the one specified. Fixes: f5d55b967e0c ("ethtool: add support for extra RSS contexts and RSS steering filters") Signed-off-by: E

[PATCH v2 bpf-next 0/3] bpf/verifier: subprog/func_call simplifications

2018-03-29 Thread Edward Cree
iveness marking either. Edward Cree (3): bpf/verifier: validate func_calls by marking at do_check() time bpf/verifier: update selftests bpf/verifier: per-register parent pointers include/linux/bpf_verifier.h| 32 +- kernel/bpf/verifier.c

[PATCH v2 bpf-next 2/3] bpf/verifier: update selftests

2018-03-29 Thread Edward Cree
re determined). Signed-off-by: Edward Cree --- tools/testing/selftests/bpf/test_verifier.c | 51 ++--- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c index 3e7718b1a9ae..c

[PATCH v2 bpf-next 1/3] bpf/verifier: validate func_calls by marking at do_check() time

2018-03-29 Thread Edward Cree
ck is now O(n) in the number of subprogs, rather than having to walk every insn of every possible call chain. Signed-off-by: Edward Cree --- include/linux/bpf_verifier.h | 24 ++- kernel/bpf/verifier.c| 451 --- 2 files changed, 267 insertions(+)

[PATCH v2 bpf-next 3/3] bpf/verifier: per-register parent pointers

2018-03-29 Thread Edward Cree
(r1-r5 into the callee as args, and r0 out as the return value) they also copy the parent pointer. Signed-off-by: Edward Cree --- include/linux/bpf_verifier.h | 8 +- kernel/bpf/verifier.c| 180 ++- 2 files changed, 45 insertions(+), 143 dele

Re: [PATCH v2 bpf-next 0/3] bpf/verifier: subprog/func_call simplifications

2018-03-29 Thread Edward Cree
On 29/03/18 23:44, Edward Cree wrote: > By storing subprog boundaries as a subprogno mark on each insn, rather than > a start (and implicit end) for each subprog, we collect a number of gains: > * More efficient determination of which subprog contains a given insn, and > thus of

Re: [PATCH v2 bpf-next 0/3] bpf/verifier: subprog/func_call simplifications

2018-04-03 Thread Edward Cree
On 03/04/18 02:08, Alexei Starovoitov wrote: > I like patch 3 and going to play with it. > How did you test it ? Just test_verifier and test_progs (the latter has a failure  "test_bpf_obj_id:FAIL:get-prog-info(fd) err 0 errno 2 i 0 type 1(1) info_len 80(40) jit_enabled 0 jited_prog_len 0 xlated_pr

Re: [PATCH v2 bpf-next 0/3] bpf/verifier: subprog/func_call simplifications

2018-04-04 Thread Edward Cree
On 04/04/18 00:37, Alexei Starovoitov wrote: > hmm. that doesn't fail for me and any other bots didn't complain. > Are you sure you're running the latest kernel and tests? Ah, test_progs isn't actually rebuilding because __NR_bpf is undeclared;  something must be going wrong with header files. Neve

Re: [PATCH v2 bpf-next 0/3] bpf/verifier: subprog/func_call simplifications

2018-04-05 Thread Edward Cree
On 05/04/18 06:28, Alexei Starovoitov wrote: > On Thu, Apr 05, 2018 at 12:58:46AM +0100, Edward Cree wrote: >> On 04/04/18 00:37, Alexei Starovoitov wrote: >>> hmm. that doesn't fail for me and any other bots didn't complain. >>> Are you sure you're

Re: [PATCH v2 bpf-next 0/3] bpf/verifier: subprog/func_call simplifications

2018-04-05 Thread Edward Cree
On 05/04/18 16:50, Jiong Wang wrote: > On 03/04/2018 02:08, Alexei Starovoitov wrote: >> Combining subprog pass with do_check is going into opposite direction >> of this long term work. Divide and conquer. Combining more things into >> do_check is the opposite of this programming principle. > > Agr

[RFC PATCH v3 bpf-next 0/5] bpf/verifier: subprog/func_call simplifications

2018-04-06 Thread Edward Cree
rogs, since that's no longer needed. Changes from v1->v2: * No longer allows non-contiguous subprogs. * No longer allows LD_ABS|IND and pseudo-calls in the same prog. Edward Cree (5): bpf/verifier: store subprog info in struct bpf_subprog_info bpf/verifier: rewrite subprog boundary dete

[RFC PATCH v3 bpf-next 3/5] bpf/verifier: update selftests

2018-04-06 Thread Edward Cree
ALL insns are unreachable. I've changed it so that they are now reachable, which causes static back-edges to be detected (since that, like insn reachability, is now tested before subprog boundaries are determined). Signed-off-by: Edward Cree --- tools/testing/self

[RFC PATCH v3 bpf-next 2/5] bpf/verifier: rewrite subprog boundary detection

2018-04-06 Thread Edward Cree
By storing a subprogno in each insn's aux data, we avoid the need to keep the list of subprog starts sorted or bsearch() it in find_subprog(). Also, get rid of the weird one-based indexing of subprog numbers. Signed-off-by: Edward Cree --- include/linux/bpf_verifier.h | 3 +- kerne

[RFC PATCH v3 bpf-next 1/5] bpf/verifier: store subprog info in struct bpf_subprog_info

2018-04-06 Thread Edward Cree
Per-subprog info is stored in env->subprog_info, an array of structs, rather than multiple arrays with a common index. Signed-off-by: Edward Cree --- include/linux/bpf_verifier.h | 9 +--- kernel/bpf/verifier.c| 49 +++- 2 files changed,

[RFC PATCH v3 bpf-next 5/5] bpf/verifier: per-register parent pointers

2018-04-06 Thread Edward Cree
(r1-r5 into the callee as args, and r0 out as the return value) they also copy the parent pointer. Signed-off-by: Edward Cree --- include/linux/bpf_verifier.h | 8 +- kernel/bpf/verifier.c| 180 ++- 2 files changed, 45 insertions(+), 143 dele

[RFC PATCH v3 bpf-next 4/5] bpf/verifier: use call graph to efficiently check max stack depth

2018-04-06 Thread Edward Cree
calculating the stack depth it implies for the subprog's callees. This is O(number of subprogs). The call graph is populated as part of the check_subprogs() pass. Signed-off-by: Edward Cree --- include/linux/bpf_verifier.h | 3 + kernel/bpf/verifier.c

[PATCH net 0/2] sfc: couple of ARFS fixes

2018-04-12 Thread Edward Cree
here's also the issue that we come up in the bad configuration by default, but that too is a problem for another time.) Edward Cree (2): sfc: insert ARFS filters with replace_equal=true sfc: limit ARFS workitems in flight per channel drivers/net/ethernet/sfc/net_driver.h | 25 +

[PATCH net 1/2] sfc: insert ARFS filters with replace_equal=true

2018-04-12 Thread Edward Cree
Necessary to allow redirecting a flow when the application moves. Fixes: 3af0f34290f6 ("sfc: replace asynchronous filter operations") Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/

[PATCH net 2/2] sfc: limit ARFS workitems in flight per channel

2018-04-12 Thread Edward Cree
-by: Edward Cree --- drivers/net/ethernet/sfc/net_driver.h | 25 +++ drivers/net/ethernet/sfc/rx.c | 58 ++- 2 files changed, 55 insertions(+), 28 deletions(-) diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc

Re: [PATCH net 2/2] sfc: limit ARFS workitems in flight per channel

2018-04-12 Thread Edward Cree
On 12/04/18 16:11, David Miller wrote: > From: Edward Cree > Date: Thu, 12 Apr 2018 15:02:50 +0100 > >> A misconfigured system (e.g. with all interrupts affinitised to all CPUs) >> may produce a storm of ARFS steering events. With the existing sfc ARFS >> implemen

Re: [PATCH net 2/2] sfc: limit ARFS workitems in flight per channel

2018-04-13 Thread Edward Cree
It turns out this may all be moot anyway: I figured out why I was seeing  ARFS storms and it wasn't the configuration issue I originally blamed. My current ndo_rx_flow_steer() implementation, efx_filter_rfs(), returns  0 for success, but the caller expects a filter ID to be returned (which  we can'

Re: [PATCH net 2/2] sfc: limit ARFS workitems in flight per channel

2018-04-13 Thread Edward Cree
On 13/04/18 13:36, Edward Cree wrote: > It turns out this may all be moot anyway: I figured out why I was seeing >  ARFS storms and it wasn't the configuration issue I originally blamed. Hmm, correction, while the fix I mentioned in my previous email is needed,  it doesn't prevent

Re: [PATCH net 2/2] sfc: limit ARFS workitems in flight per channel

2018-04-13 Thread Edward Cree
On 13/04/18 16:03, David Miller wrote: > Whilst you may not be able to program the filter into the hardware > synchronously, you should be able to allocate the ID and get all of > the software state setup. That's what we were doing before commit 3af0f34290f6 ("sfc: replace  asynchronous filter oper

Re: [PATCH net 2/2] sfc: limit ARFS workitems in flight per channel

2018-04-13 Thread Edward Cree
On 13/04/18 17:14, David Miller wrote: > Is the issue that you learn about the hardware reset asynchronously, > and therefore cannot determine if filter insertion programming > happened afterwards and thus is still in the chip? Yes, pretty much. > You must have a table of all the entries, so that

[PATCH v2 net 0/3] sfc: ARFS fixes

2018-04-13 Thread Edward Cree
'net' material. There's also the issue that we come up in the bad configuration that triggers #3 by default, but that too is a problem for another time. Edward Cree (3): sfc: insert ARFS filters with replace_equal=true sfc: pass the correctly bogus filter_id to rps_may_expi

[PATCH v2 net 1/3] sfc: insert ARFS filters with replace_equal=true

2018-04-13 Thread Edward Cree
Necessary to allow redirecting a flow when the application moves. Fixes: 3af0f34290f6 ("sfc: replace asynchronous filter operations") Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/

[PATCH v2 net 2/3] sfc: pass the correctly bogus filter_id to rps_may_expire_flow()

2018-04-13 Thread Edward Cree
f0f34290f6 ("sfc: replace asynchronous filter operations") Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/ef10.c | 3 +-- drivers/net/ethernet/sfc/farch.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ether

[PATCH v2 net 3/3] sfc: limit ARFS workitems in flight per channel

2018-04-13 Thread Edward Cree
should not negatively impact performance, because it is only likely to be hit in cases where ARFS will be ineffective anyway. Signed-off-by: Edward Cree --- drivers/net/ethernet/sfc/net_driver.h | 25 +++ drivers/net/ethernet/sfc/rx.c | 58

[RFC/PoC PATCH bpf-next 00/12] bounded loops for eBPF

2018-02-23 Thread Edward Cree
The main object of this patch series is to support verification of eBPF programs with bounded loops. Only bounds derived from JLT (unsigned <) with the taken branch in the loop are supported, but it should be clear how others could be added. Testing of these changes has consisted only of test_v

[RFC PATCH bpf-next 01/12] bpf/verifier: validate func_calls by marking at do_check() time

2018-02-23 Thread Edward Cree
Removes a couple of passes from the verifier, one to check subprogs don't overlap etc., and one to compute max stack depth (which now is done by topologically sorting the call graph). Signed-off-by: Edward Cree --- As noted in the cover letter, I haven't yet integrated the feedback

[RFC PATCH bpf-next 02/12] bpf/verifier: update selftests

2018-02-23 Thread Edward Cree
r than main()". I'm still not 100% sure that's right though. Signed-off-by: Edward Cree --- tools/testing/selftests/bpf/test_verifier.c | 46 ++--- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/tools/testing/selftests/bpf/test_verifier

[RFC PATCH bpf-next 03/12] bpf/verifier: per-register parent pointers

2018-02-23 Thread Edward Cree
(r1-r5 into the callee as args, and r0 out as the return value) they also copy the parent pointer. Signed-off-by: Edward Cree --- include/linux/bpf_verifier.h | 8 +- kernel/bpf/verifier.c| 180 ++- 2 files changed, 45 insertions(+), 143 dele

[RFC PATCH bpf-next 04/12] bpf/verifier: store insn_idx instead of callsite in bpf_func_state

2018-02-23 Thread Edward Cree
This means each entry in the parentage chain can have its insn identified, which will help to support bounded-loop handling later. Signed-off-by: Edward Cree --- include/linux/bpf_verifier.h | 6 -- kernel/bpf/verifier.c| 22 +++--- 2 files changed, 15 insertions

[RFC PATCH bpf-next 06/12] bpf/verifier: do not walk impossible branches

2018-02-23 Thread Edward Cree
ition is known to have been met. Signed-off-by: Edward Cree --- kernel/bpf/verifier.c | 53 ++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index e7d898f4fd29..7a8ae633d0c3 100644 ---

[RFC PATCH bpf-next 05/12] bpf/verifier: detect loops dynamically rather than statically

2018-02-23 Thread Edward Cree
walked before reaching the back-edge are valid. Signed-off-by: Edward Cree --- include/linux/bpf_verifier.h| 2 + kernel/bpf/verifier.c | 280 +--- tools/testing/selftests/bpf/test_verifier.c | 12 +- 3 files changed, 97 insertions

[RFC PATCH bpf-next 07/12] bpf/verifier: allow bounded loops with JLT/true back-edge

2018-02-23 Thread Edward Cree
hether the recursion was bounded. Signed-off-by: Edward Cree --- include/linux/bpf_verifier.h | 5 + kernel/bpf/verifier.c| 295 +++ 2 files changed, 244 insertions(+), 56 deletions(-) diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifi

[RFC PATCH bpf-next 08/12] bpf/verifier: selftests for bounded loops

2018-02-23 Thread Edward Cree
Mainly consists of tests that broke (or I expected to break) earlier versions of the bounded-loop handling. Also updated some existing tests to deal with changed error messages, programs now being accepted etc. Signed-off-by: Edward Cree --- tools/testing/selftests/bpf/test_verifier.c | 198

<    1   2   3   4   5   6   7   8   9   10   >