[PATCH net v2 2/3] ibmvnic: Revert to previous mtu when unsupported value requested

2018-01-18 Thread John Allen
tu to some completely different value most of the time. This patch fixes the issue by logging in with the previously used mtu value and printing an error message saying that the given mtu is unsupported. Signed-off-by: John Allen --- diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/driver

[PATCH net v2 3/3] ibmvnic: Allocate and request vpd in init_resources

2018-01-18 Thread John Allen
it will be symmetrically freed during release resources. Signed-off-by: John Allen --- diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index bb56460..f0dbb76 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -867,7

Re: [Patch net-next 1/3] net: introduce helper dev_change_tx_queue_len()

2018-01-20 Thread John Fastabend
the original code doesn't make sense, > we should propagate the errno from notifiers. > > Cc: John Fastabend > Signed-off-by: Cong Wang > --- [...] > static ssize_t tx_queue_len_store(struct device *dev, > struct device_attribute *a

Re: [Patch net-next 1/3] net: introduce helper dev_change_tx_queue_len()

2018-01-21 Thread John Fastabend
the original code doesn't make sense, > we should propagate the errno from notifiers. > > Cc: John Fastabend > Signed-off-by: Cong Wang > --- Acked-by: John Fastabend

Re: [Patch net-next 2/3] net_sched: plug in qdisc ops change_tx_queue_len

2018-01-21 Thread John Fastabend
e skb array > when we change dev->tx_queue_len. > > To avoid handling race conditions with TX BH, we need to > deactivate all TX queues before change the value and bring them > back after we are done, this also makes implementation easier. > > Cc: John Fastabend > S

Re: RCU callback crashes

2017-12-20 Thread John Fastabend
d to revert this, commit 752fbcc33405d6f8249465e4b2c4e420091bb825 Author: Cong Wang Date: Tue Sep 19 13:15:42 2017 -0700 net_sched: no need to free qdisc in RCU callback gen estimator has been rewritten in commit 1c0d32fde5bd ("net_sched: gen_estimator: complete rewrite of rate estimators"), the caller no longer needs to wait for a grace period. So this patch gets rid of it. Cc: Jamal Hadi Salim Cc: Eric Dumazet Signed-off-by: Cong Wang Acked-by: Eric Dumazet Signed-off-by: David S. Miller Thanks, John

[PATCH] net: Revert "net_sched: no need to free qdisc in RCU callback"

2017-12-20 Thread John Fastabend
to RCU callback. Otherwise we risk the datapath adding skbs during removal. Fixes: c5ad119fb6c09 ("net: sched: pfifo_fast use skb_array") Signed-off-by: John Fastabend --- include/net/sch_generic.h |1 + net/sched/sch_generic.c | 50 - 2 fil

Re: RCU callback crashes

2017-12-20 Thread John Fastabend
;kfree_rcu > > I assumed that since q is processed in rcu reader, it is also freed after > a grace period, but now looking at the code I don't see it happening > like that. > > So I think that change to miniq made the existing race window > a bit wider and easier to hit. > > I believe that calling kfree_rcu by call_rcu should resolve this. > Hi, Just sent a patch to complete qdisc_destroy from rcu callback. This is needed to resolve a race with the lockless qdisc patches. But I guess it should fix the miniq issue as well? Thanks, John

Re: RCU callback crashes

2017-12-20 Thread John Fastabend
g with the qdisc itself in: >> qdisc_destroy->qdisc_free >> >> Before miniq, tp was checked in the rcu reader path. In case it was not >> null, q was processed. In slow patch, tp is freed after rcu grace period: >> tcf_proto_destroy->kfree_rcu >> >> I assumed that sin

Re: RCU callback crashes

2017-12-20 Thread John Fastabend
On 12/20/2017 12:17 PM, Jakub Kicinski wrote: > On Wed, 20 Dec 2017 10:04:17 -0800, John Fastabend wrote: >> On 12/19/2017 10:34 PM, Jakub Kicinski wrote: >>> On Tue, 19 Dec 2017 22:22:27 -0800, Jakub Kicinski wrote: >>>>>> I get this: >>>&

Re: [PATCH] net: Revert "net_sched: no need to free qdisc in RCU callback"

2017-12-20 Thread John Fastabend
On 12/20/2017 02:41 PM, Cong Wang wrote: > On Wed, Dec 20, 2017 at 12:09 PM, John Fastabend > wrote: >> RCU grace period is needed for lockless qdiscs added in the commit >> c5ad119fb6c09 ("net: sched: pfifo_fast use skb_array"). >> >> It is needed now

Re: [PATCH] net: Revert "net_sched: no need to free qdisc in RCU callback"

2017-12-20 Thread John Fastabend
On 12/20/2017 03:23 PM, Cong Wang wrote: > On Wed, Dec 20, 2017 at 3:05 PM, John Fastabend > wrote: >> On 12/20/2017 02:41 PM, Cong Wang wrote: >>> On Wed, Dec 20, 2017 at 12:09 PM, John Fastabend >>> wrote: >>>> RCU grace period is need

Re: [PATCH] net: Revert "net_sched: no need to free qdisc in RCU callback"

2017-12-20 Thread John Fastabend
On 12/20/2017 01:59 PM, Jakub Kicinski wrote: > On Wed, 20 Dec 2017 12:09:19 -0800, John Fastabend wrote: >> RCU grace period is needed for lockless qdiscs added in the commit >> c5ad119fb6c09 ("net: sched: pfifo_fast use skb_array"). >> >> It is needed now tha

Re: RCU callback crashes

2017-12-21 Thread John Fastabend
stats_cpu_backlog_dec(qdisc, skb); >>631 qdisc_bstats_cpu_update(qdisc, skb); >>632 qdisc_qstats_cpu_qlen_dec(qdisc); >>633 } >>634 >>635 return skb; >>636 } > > Yeah, this one is c

Re: [Patch net-next] net_sched: remove the unsafe __skb_array_empty()

2017-12-21 Thread John Fastabend
Fixes: c5ad119fb6c0 ("net: sched: pfifo_fast use skb_array") > Reported-by: Jakub Kicinski > Cc: John Fastabend > Signed-off-by: Cong Wang > --- > net/sched/sch_generic.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/net/sched/sch_generic.c b/net/s

Re: [Patch net-next] net_sched: call qdisc_reset() with qdisc lock

2017-12-21 Thread John Fastabend
n't help. And it is only a local_bh_disable. > Fixes: 7bbde83b1860 ("net: sched: drop qdisc_reset from dev_graft_qdisc") > Reported-by: Jakub Kicinski > Cc: John Fastabend > Signed-off-by: Cong Wang > --- > net/sched/sch_generic.c | 5 - > 1 file chang

Re: [Patch net-next] net_sched: remove the unsafe __skb_array_empty()

2017-12-23 Thread John Fastabend
On 12/22/2017 12:31 PM, Cong Wang wrote: > On Thu, Dec 21, 2017 at 7:06 PM, John Fastabend > wrote: >> On 12/21/2017 04:03 PM, Cong Wang wrote: >>> __skb_array_empty() is only safe if array is never resized. >>> pfifo_fast_dequeue() is called in TX BH context and w

Re: [PATCH net-next v2] net: sched: fix skb leak in dev_requeue_skb()

2017-12-26 Thread John Fastabend
On 12/24/2017 07:49 PM, Wei Yongjun wrote: > When dev_requeue_skb() is called with bluked skb list, only the > first skb of the list will be requeued to qdisc layer, and leak > the others without free them. > > TCP is broken due to skb leak since no free skb will be considered > as still in the ho

Re: [Patch net-next] net_sched: remove the unsafe __skb_array_empty()

2017-12-27 Thread John Fastabend
On 12/27/2017 10:29 AM, Cong Wang wrote: > On Sat, Dec 23, 2017 at 10:57 PM, John Fastabend > wrote: >> On 12/22/2017 12:31 PM, Cong Wang wrote: >>> I understand why you had it, but it is just not safe. You don't want >>> to achieve performance gain by crash

[net-next PATCH] net: ptr_ring: otherwise safe empty checks can overrun array bounds

2017-12-27 Thread John Fastabend
e normal case checks would suffer some so best to just allocate an extra pointer. Reported-by: Jakub Kicinski Fixes: c5ad119fb6c09 ("net: sched: pfifo_fast use skb_array") Signed-off-by: John Fastabend --- include/linux/ptr_ring.h |7 ++- 1 file changed, 6 insertions(+), 1 delet

Re: [net-next PATCH] net: ptr_ring: otherwise safe empty checks can overrun array bounds

2018-01-02 Thread John Fastabend
On 01/02/2018 09:17 AM, Michael S. Tsirkin wrote: > On Tue, Jan 02, 2018 at 07:01:33PM +0200, Michael S. Tsirkin wrote: >> On Tue, Jan 02, 2018 at 11:52:19AM -0500, David Miller wrote: >>> From: John Fastabend >>> Date: Wed, 27 Dec 2017 19:50:25 -0800 >>&g

Re: [PATCH net-next v3] net: sched: fix skb leak in dev_requeue_skb()

2018-01-02 Thread John Fastabend
On 01/02/2018 10:49 AM, David Miller wrote: > From: Wei Yongjun > Date: Wed, 27 Dec 2017 17:05:52 +0800 > >> When dev_requeue_skb() is called with bluked skb list, only the > ^^ > > "bulked" > >> first skb of the list will be requeued to qdisc layer,

Re: [net-next PATCH] net: ptr_ring: otherwise safe empty checks can overrun array bounds

2018-01-02 Thread John Fastabend
On 01/02/2018 03:12 PM, Michael S. Tsirkin wrote: > On Tue, Jan 02, 2018 at 01:27:23PM -0800, John Fastabend wrote: >> On 01/02/2018 09:17 AM, Michael S. Tsirkin wrote: >>> On Tue, Jan 02, 2018 at 07:01:33PM +0200, Michael S. Tsirkin wrote: >>>> On Tue, Jan 02, 2

[bpf PATCH] bpf: sockmap missing NULL psock check

2018-01-02 Thread John Fastabend
obvious in my opinion. Signed-off-by: John Fastabend --- kernel/bpf/sockmap.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c index 5ee2e41..dfbbde2 100644 --- a/kernel/bpf/sockmap.c +++ b/kernel/bpf/sockmap.c @@ -591,6 +591,13 @@ static

Re: [net-next PATCH] net: ptr_ring: otherwise safe empty checks can overrun array bounds

2018-01-03 Thread John Fastabend
On 01/03/2018 07:50 AM, Michael S. Tsirkin wrote: > On Tue, Jan 02, 2018 at 04:25:03PM -0800, John Fastabend wrote: >>> >>> More generally, what makes this usage safe? >>> Is there a way to formalize it at the API level? >>> >> >> Right I think

Re: "lockless" qdisc breaks tx_queue_len change too?

2018-01-03 Thread John Fastabend
On 01/02/2018 08:41 PM, Cong Wang wrote: > Hi, John > > While reviewing your ptr_ring fix again today, it looks like your > "lockless" qdisc patchset breaks dev->tx_queue_len behavior. > > Before your patchset, dev->tx_queue_len is merely an integer to read, &g

[net-next PATCH 2/2] bpf: only build sockmap with CONFIG_INET

2018-01-03 Thread John Fastabend
The sockmap infrastructure is only aware of TCP sockets at the moment. In the future we plan to add UDP. In both cases CONFIG_NET should be built-in. So lets only build sockmap if CONFIG_INET is enabled. Signed-off-by: John Fastabend --- include/linux/bpf.h |2 +- include/linux

[net-next PATCH 1/2] bpf: sockmap remove unused function

2018-01-03 Thread John Fastabend
This was added for some work that was eventually factored out but the helper call was missed. Remove it now and add it back later if needed. Signed-off-by: John Fastabend --- kernel/bpf/sockmap.c |8 1 file changed, 8 deletions(-) diff --git a/kernel/bpf/sockmap.c b/kernel/bpf

Re: "lockless" qdisc breaks tx_queue_len change too?

2018-01-03 Thread John Fastabend
On 01/03/2018 03:41 PM, Cong Wang wrote: > On Wed, Jan 3, 2018 at 10:09 AM, John Fastabend > wrote: >> On 01/02/2018 08:41 PM, Cong Wang wrote: >>> Hi, John >>> >>> While reviewing your ptr_ring fix again today, it looks like your >>> "lockl

[bpf-net PATCH v2] bpf: sockmap missing NULL psock check

2018-01-04 Thread John Fastabend
obvious in my opinion. Signed-off-by: John Fastabend --- kernel/bpf/sockmap.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c index 5ee2e41..1712d31 100644 --- a/kernel/bpf/sockmap.c +++ b/kernel/bpf/sockmap.c @@ -591,8

Re: [Intel-wired-lan] [bpf-next V4 PATCH 04/14] ixgbe: setup xdp_rxq_info

2018-01-04 Thread John Fastabend
> > Cc: intel-wired-...@lists.osuosl.org > Cc: Jeff Kirsher > Cc: Alexander Duyck > Signed-off-by: Jesper Dangaard Brouer > --- Looked a bit for reset paths that might be missed but didn't find any. LGTM. Acked-by: John Fastabend

Re: [Intel-wired-lan] [bpf-next V4 PATCH 03/14] i40e: setup xdp_rxq_info

2018-01-04 Thread John Fastabend
t; Cc: intel-wired-...@lists.osuosl.org > Cc: Björn Töpel > Cc: Jeff Kirsher > Cc: Paul Menzel > Signed-off-by: Jesper Dangaard Brouer > Reviewed-by: Paul Menzel > --- Same here. LGTM. Acked-by: John Fastabend

Re: [bpf-next V4 PATCH 13/14] bpf: finally expose xdp_rxq_info to XDP bpf-programs

2018-01-04 Thread John Fastabend
igned-off-by: Jesper Dangaard Brouer > Acked-by: Alexei Starovoitov > --- LGTM Acked-by: John Fastabend

Re: [bpf-next V4 PATCH 01/14] xdp: base API for new XDP rx-queue info concept

2018-01-04 Thread John Fastabend
On 01/03/2018 02:25 AM, Jesper Dangaard Brouer wrote: > This patch only introduce the core data structures and API functions. > All XDP enabled drivers must use the API before this info can used. > > There is a need for XDP to know more about the RX-queue a given XDP > frames have arrived on. For

Re: [PATCH v2 bpf] bpf: prevent out-of-bounds speculation

2018-01-05 Thread John Fastabend
f-by: Alexei Starovoitov > --- LGTM, I'll drop it on my test systems and start running with it. Although I don't have any Variant 1 code to test, but seems that is being covered by others. Thanks! Acked-by: John Fastabend

[bpf-next PATCH 1/7] bpf: refactor sockmap sample program update for arg parsing

2018-01-08 Thread John Fastabend
future. Signed-off-by: John Fastabend --- samples/sockmap/sockmap_user.c | 142 +--- 1 file changed, 103 insertions(+), 39 deletions(-) diff --git a/samples/sockmap/sockmap_user.c b/samples/sockmap/sockmap_user.c index 7cc9d22..5cbe7a5 100644 --- a/samples/sockmap

[bpf-next PATCH 0/7] sockmap sample updates

2018-01-08 Thread John Fastabend
seful, the reporting could be better, etc. But, IMO lets push this now rather than sit on it for weeks until I get time to do the above improvements. --- John Fastabend (7): bpf: refactor sockmap sample program update for arg parsing bpf: add sendmsg option for testing BPF programs

[bpf-next PATCH 2/7] bpf: add sendmsg option for testing BPF programs

2018-01-08 Thread John Fastabend
supported, but more can be added as needed. The new help argument gives the following, Usage: ./sockmap --cgroup options: --help -h --cgroup -c --rate -r --verbose -v --iov_count-i --length -l --test -t Signed-off-by: John Fastabend

[bpf-next PATCH 3/7] bpf: sockmap sample, use fork() for send and recv

2018-01-08 Thread John Fastabend
get many GBps of data which helps exercise the sockmap code. Signed-off-by: John Fastabend --- samples/sockmap/sockmap_user. |0 samples/sockmap/sockmap_user.c | 55 2 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 samples

[bpf-next PATCH 6/7] bpf: sockmap put client sockets in blocking mode

2018-01-08 Thread John Fastabend
-by: John Fastabend --- samples/sockmap/sockmap_user.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/sockmap/sockmap_user.c b/samples/sockmap/sockmap_user.c index bae85f8..0d8950f 100644 --- a/samples/sockmap/sockmap_user.c +++ b/samples/sockmap/sockmap_user.c

[bpf-next PATCH 5/7] bpf: sockmap sample add base test without any BPF for comparison

2018-01-08 Thread John Fastabend
Add a base test that does not use BPF hooks to test baseline case. Signed-off-by: John Fastabend --- samples/sockmap/sockmap_user.c | 26 +- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/samples/sockmap/sockmap_user.c b/samples/sockmap/sockmap_user.c

[bpf-next PATCH 4/7] bpf: sockmap sample, report bytes/sec

2018-01-08 Thread John Fastabend
Report bytes/sec sent as well as total bytes. Useful to get rough idea how different configurations and usage patterns perform with sockmap. Signed-off-by: John Fastabend --- samples/sockmap/sockmap_user.c | 37 - 1 file changed, 32 insertions(+), 5

[bpf-next PATCH 7/7] bpf: sockmap set rlimit

2018-01-08 Thread John Fastabend
Avoid extra step of setting limit from cmdline and do it directly in the program. Signed-off-by: John Fastabend --- samples/sockmap/sockmap_user.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/samples/sockmap/sockmap_user.c b/samples/sockmap/sockmap_user.c index 0d8950f..2afbefd

[bpf-next PATCH v4 0/7] Series short description

2018-01-22 Thread John Fastabend
CKs along with fixes to 2/7 iov free also pointed out by Martin. Thanks Daniel and Martin for the reviews! --- John Fastabend (7): bpf: refactor sockmap sample program update for arg parsing bpf: add sendmsg option for testing BPF programs bpf: sockmap sample, use fork() fo

[bpf-next PATCH v4 1/7] bpf: refactor sockmap sample program update for arg parsing

2018-01-22 Thread John Fastabend
future. Signed-off-by: John Fastabend Acked-by: Martin KaFai Lau --- samples/sockmap/sockmap_user.c | 165 1 file changed, 114 insertions(+), 51 deletions(-) diff --git a/samples/sockmap/sockmap_user.c b/samples/sockmap/sockmap_user.c index 7cc9d22..ffd1d12

[bpf-next PATCH v4 3/7] bpf: sockmap sample, use fork() for send and recv

2018-01-22 Thread John Fastabend
get many GBps of data which helps exercise the sockmap code. Signed-off-by: John Fastabend Acked-by: Martin KaFai Lau --- samples/sockmap/sockmap_user.c | 55 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/samples/sockmap/sockmap_user.c

[bpf-next PATCH v4 2/7] bpf: add sendmsg option for testing BPF programs

2018-01-22 Thread John Fastabend
supported, but more can be added as needed. The new help argument gives the following, Usage: ./sockmap --cgroup options: --help -h --cgroup -c --rate -r --verbose -v --iov_count-i --length -l --test -t Signed-off-by: John Fastabend

[bpf-next PATCH v4 4/7] bpf: sockmap sample, report bytes/sec

2018-01-22 Thread John Fastabend
Report bytes/sec sent as well as total bytes. Useful to get rough idea how different configurations and usage patterns perform with sockmap. Signed-off-by: John Fastabend Acked-by: Martin KaFai Lau --- samples/sockmap/sockmap_user.c | 47 1 file

[bpf-next PATCH v4 5/7] bpf: sockmap sample add base test without any BPF for comparison

2018-01-22 Thread John Fastabend
Add a base test that does not use BPF hooks to test baseline case. Signed-off-by: John Fastabend Acked-by: Martin KaFai Lau --- samples/sockmap/sockmap_user.c | 26 +- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/samples/sockmap/sockmap_user.c b

[bpf-next PATCH v4 7/7] bpf: sockmap set rlimit

2018-01-22 Thread John Fastabend
Avoid extra step of setting limit from cmdline and do it directly in the program. Signed-off-by: John Fastabend Acked-by: Martin KaFai Lau --- samples/sockmap/sockmap_user.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/samples/sockmap/sockmap_user.c b/samples/sockmap

[bpf-next PATCH v4 6/7] bpf: sockmap put client sockets in blocking mode

2018-01-22 Thread John Fastabend
-by: John Fastabend Acked-by: Martin KaFai Lau --- samples/sockmap/sockmap_user.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/sockmap/sockmap_user.c b/samples/sockmap/sockmap_user.c index f9d3785..fe943c9 100644 --- a/samples/sockmap/sockmap_user.c +++ b/samples

Re: [PATCH bpf] bpf: test_maps: cleanup sockmaps when test ends

2018-01-22 Thread John Fastabend
rgeted to -bpf-next and without fixes tag? > > No need. It's fine. > Also I'm looking over sockmap code now for the bug, should have something shortly. Agree this is a nice cleanup of the test code though. On the other hand I should add some explicit tests for this case (deleting map with elements) as well though. .John

Re: [Patch net-next 2/3] net_sched: plug in qdisc ops change_tx_queue_len

2018-01-23 Thread John Fastabend
other patch set can cleanup the bigger issue of rollback. Thanks, .John

Re: [Patch net-next 2/3] net_sched: plug in qdisc ops change_tx_queue_len

2018-01-23 Thread John Fastabend
other patch set can cleanup the bigger issue of rollback. Thanks, .John

Re: [PATCH bpf] bpf: test_maps: cleanup sockmaps when test ends

2018-01-24 Thread John Fastabend
On 01/23/2018 10:16 AM, Daniel Borkmann wrote: > On 01/23/2018 06:18 AM, John Fastabend wrote: >> On 01/22/2018 09:01 PM, Alexei Starovoitov wrote: >>> On Tue, Jan 23, 2018 at 01:55:30PM +0900, Prashant Bhole wrote: >>>> On 1/23/2018 1:38 PM, Alexei Starovoitov wrote:

Re: [Patch net-next v2 2/3] net_sched: plug in qdisc ops change_tx_queue_len

2018-01-24 Thread John Fastabend
e skb array > when we change dev->tx_queue_len. > > To avoid handling race conditions with TX BH, we need to > deactivate all TX queues before change the value and bring them > back after we are done, this also makes implementation easier. > > Cc: John Fastabend > S

Re: [PATCH net-next 01/12] ptr_ring: keep consumer_head valid at all times

2018-01-25 Thread John Fastabend
- > 1 file changed, 16 insertions(+), 9 deletions(-) > Thanks for fixing this up. Acked-by: John Fastabend

Re: [PATCH net-next 06/12] Revert "net: ptr_ring: otherwise safe empty checks can overrun array bounds"

2018-01-25 Thread John Fastabend
ssed to kmalloc(). > > kmalloc then returns ZERO_SIZE_PTR with a subsequent crash. > > Reported-by: syzbot+87678bcf753b44c39...@syzkaller.appspotmail.com > Cc: John Fastabend > Signed-off-by: Michael S. Tsirkin > --- Dang, I missed this case. Thanks. Acked-by: John Fastabe

[bpf PATCH 0/3] bpf sockmap fixes

2018-01-25 Thread John Fastabend
sample or preferably a selftest for this case as well (assuming I didn't miss one). @Dave Watson can you take a quick look to verify the changes are good on TLS ULP side. --- John Fastabend (3): net: add a UID to use for ULP socket assignment bpf: sockmap, add sock close() hook

[bpf PATCH 2/3] bpf: sockmap, add sock close() hook to remove socks

2018-01-25 Thread John Fastabend
() handler. This fixes the above case. Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support") Reported-by: Prashant Bhole Signed-off-by: John Fastabend --- include/net/tcp.h|2 + kernel/bpf/sockmap.c | 145 +++--- 2 files c

[bpf PATCH 3/3] bpf: sockmap, fix leaking maps with attached but not detached progs

2018-01-25 Thread John Fastabend
("bpf: sockmap with sk redirect support") Signed-off-by: John Fastabend --- kernel/bpf/sockmap.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c index b85a79c..a8cd1b7 100644 --- a/kernel/bpf/sockmap.c +

[bpf PATCH 1/3] net: add a UID to use for ULP socket assignment

2018-01-25 Thread John Fastabend
error code back and should check that rather than rely on logs. Signed-off-by: John Fastabend --- include/net/tcp.h |6 ++ net/ipv4/tcp_ulp.c | 53 +++- net/tls/tls_main.c |2 ++ 3 files changed, 56 insertions(+), 5 deletions(-) diff --

Re: [bpf PATCH 0/3] bpf sockmap fixes

2018-01-25 Thread John Fastabend
On 01/25/2018 04:26 PM, John Fastabend wrote: > A set of fixes for sockmap to resolve map/prog not being cleaned > up when maps are not cleaned up from the program side. > Well that first sentence is a bit confusing now that I read it again. Here is a better version, " A se

Re: [bpf PATCH 1/3] net: add a UID to use for ULP socket assignment

2018-01-26 Thread John Fastabend
On 01/26/2018 07:52 AM, Dave Watson wrote: > On 01/25/18 04:27 PM, John Fastabend wrote: >> I did not however retest TLS with the small change to ULP layer. >> Mostly because I don't have a TLS setup. I plan/hope to get around >> to writing either a sample or preferabl

[bpf PATCH v2 0/3] Series short description

2018-01-26 Thread John Fastabend
The following series implements... --- John Fastabend (3): net: add a UID to use for ULP socket assignment bpf: sockmap, add sock close() hook to remove socks bpf: sockmap, fix leaking maps with attached but not detached progs include/net/tcp.h|8 ++ kernel/bpf

Re: [bpf PATCH v2 0/3] Series short description

2018-01-26 Thread John Fastabend
On 01/26/2018 09:43 AM, John Fastabend wrote: > The following series implements... > > --- > Sorry random noise on my side fat-fingered some keys. Please just ignore it. :/

[bpf-next PATCH v2 0/3] bpf: sockmap fixes

2018-01-26 Thread John Fastabend
avoid any reader confusion. --- John Fastabend (3): net: add a UID to use for ULP socket assignment bpf: sockmap, add sock close() hook to remove socks bpf: sockmap, fix leaking maps with attached but not detached progs include/net/tcp.h|8 ++ kernel/bpf/sockmap.c |

[bpf-next PATCH v2 1/3] net: add a UID to use for ULP socket assignment

2018-01-26 Thread John Fastabend
error code back and should check that rather than rely on logs. Signed-off-by: John Fastabend --- include/net/tcp.h |6 + net/ipv4/tcp_ulp.c | 57 +++- net/tls/tls_main.c |2 ++ 3 files changed, 60 insertions(+), 5 deletions(-) diff --

[bpf-next PATCH v2 3/3] bpf: sockmap, fix leaking maps with attached but not detached progs

2018-01-26 Thread John Fastabend
("bpf: sockmap with sk redirect support") Signed-off-by: John Fastabend --- kernel/bpf/sockmap.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c index 4e7ba37..a30449d 100644 --- a/kernel/bpf/sockmap.c +

[bpf-next PATCH v2 2/3] bpf: sockmap, add sock close() hook to remove socks

2018-01-26 Thread John Fastabend
() handler. This fixes the above case. Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support") Reported-by: Prashant Bhole Signed-off-by: John Fastabend --- include/net/tcp.h|2 + kernel/bpf/sockmap.c | 146 +++--- 2 files c

Re: [bpf-next PATCH v2 2/3] bpf: sockmap, add sock close() hook to remove socks

2018-01-26 Thread John Fastabend
On 01/26/2018 10:14 AM, John Fastabend wrote: > The selftests test_maps program was leaving dangling BPF sockmap > programs around because not all psock elements were removed from > the map. The elements in turn hold a reference on the BPF program > they are attached to causing BPF

Re: [Patch net-next v3 0/3] net_sched: reflect tx_queue_len change for pfifo_fast

2018-01-28 Thread John Fastabend
net-next) so lets do the complete fix rather than this series IMO. .John > --- > v3: use skb_array_resize_multiple() > v2: handle error case for ->change_tx_queue_len() > > Cong Wang (3): > net: introduce helper dev_change_tx_queue_len() > net_sched: plug in qdisc

Re: [Patch net-next v3 0/3] net_sched: reflect tx_queue_len change for pfifo_fast

2018-01-28 Thread John Fastabend
On 01/28/2018 09:57 PM, Cong Wang wrote: > On Sun, Jan 28, 2018 at 9:35 PM, John Fastabend > wrote: >> On 01/25/2018 06:26 PM, Cong Wang wrote: >>> This pathcset restores the pfifo_fast qdisc behavior of dropping >>> packets based on latest dev->tx_queue_len

[bpf-next PATCH v3 1/3] net: add a UID to use for ULP socket assignment

2018-01-29 Thread John Fastabend
error code back and should check that rather than rely on logs. Signed-off-by: John Fastabend --- include/net/tcp.h |6 + net/ipv4/tcp_ulp.c | 57 +++- net/tls/tls_main.c |2 ++ 3 files changed, 60 insertions(+), 5 deletions(-) diff --

[bpf-next PATCH v3 0/3] bpf: sockmap fixes

2018-01-29 Thread John Fastabend
that we should do a module put in case future users use this with another ULP other than sockmap. And module_put is a nop when owner = NULL (sockmap case) so no harm here and code is more robust. Patch 2/3 Be explicit and set user_visible to false just to avoid any reader confusion. --- John Fast

[bpf-next PATCH v3 3/3] bpf: sockmap, fix leaking maps with attached but not detached progs

2018-01-29 Thread John Fastabend
("bpf: sockmap with sk redirect support") Signed-off-by: John Fastabend --- kernel/bpf/sockmap.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c index 6c6c274..c8b25f1 100644 --- a/kernel/bpf/sockmap.c +

[bpf-next PATCH v3 2/3] bpf: sockmap, add sock close() hook to remove socks

2018-01-29 Thread John Fastabend
() handler. This fixes the above case. Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support") Reported-by: Prashant Bhole Signed-off-by: John Fastabend --- include/net/tcp.h|2 + kernel/bpf/sockmap.c | 156 +- 2 files c

[bpf PATCH v4 0/3] bpf: sockmap fixes

2018-02-05 Thread John Fastabend
For testing I ran both sample/sockmap and selftests bpf/test_maps.c. Dave Watson ran TLS test suite on v1 version of the patches without the put_module error path change. v4 fix missing rcu_unlock() v3 wrap psock reference in RCU v2 changes rebased onto bpf-next with small update adding module_put ---

[bpf PATCH v4 1/3] net: add a UID to use for ULP socket assignment

2018-02-05 Thread John Fastabend
error code back and should check that rather than rely on logs. Signed-off-by: John Fastabend --- include/net/tcp.h |6 + net/ipv4/tcp_ulp.c | 59 net/tls/tls_main.c |2 ++ 3 files changed, 62 insertions(+), 5 deletions(-) diff --

[bpf PATCH v4 2/3] bpf: sockmap, add sock close() hook to remove socks

2018-02-05 Thread John Fastabend
() handler. This fixes the above case. Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support") Reported-by: Prashant Bhole Signed-off-by: John Fastabend --- include/net/tcp.h|2 + kernel/bpf/sockmap.c | 168 ++ 2 files ch

[bpf PATCH v4 3/3] bpf: sockmap, fix leaking maps with attached but not detached progs

2018-02-05 Thread John Fastabend
("bpf: sockmap with sk redirect support") Signed-off-by: John Fastabend --- kernel/bpf/sockmap.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c index bd4a6d9..48c3341 100644 --- a/kernel/bpf/sockmap.c +

[PATCH net] ibmvnic: Fix rx queue cleanup for non-fatal resets

2018-02-06 Thread John Allen
we are, continues normal polling operation. Signed-off-by: John Allen --- diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 8c3058d5d191..2a26b2ece7fe 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -1831,7

Re: [RFC PATCH bpf-next 0/2] bpf/verifier: simplify subprog tracking

2018-02-12 Thread John Fastabend
On 02/12/2018 02:22 AM, Edward Cree wrote: > On 10/02/18 03:18, Alexei Starovoitov wrote: >> On Thu, Feb 08, 2018 at 07:31:55PM +, 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 nu

Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options

2018-04-26 Thread John Stoffel
;t even know that such an option exists. James> I may be an atypical developer but I'd rather have a root canal James> than browse through menuconfig options. The way to get people James> to learn about new debugging options is to blog about it (or James> write an lwn.net article) which google will find the next time James> I ask it how I debug XXX. Google (probably as a service to James> humanity) rarely turns up Kconfig options in response to a James> query. I agree with James here. Looking at the SLAB vs SLUB Kconfig entries tells me *nothing* about why I should pick one or the other, as an example. John

[bpf-next PATCH 2/3] bpf: sockmap, add hash map support

2018-04-27 Thread John Fastabend
may want to use the 5-tuple of the socket as the lookup key. To support this add hash support. Signed-off-by: John Fastabend --- tools/bpf/bpftool/map.c|1 + tools/include/uapi/linux/bpf.h |6 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/bpf.h

[bpf-next PATCH 1/3] bpf: sockmap, refactor sockmap routines to work with hashmap

2018-04-27 Thread John Fastabend
. This avoids storing the key in the metadata which will be useful when keys can be longer than 4 bytes. We rename the sk pointers to sk_redir at this point as well to avoid any confusion between the current sk pointer and the redirect pointer sk_redir. Signed-off-by: John Fastabend

[bpf-next PATCH 3/3] bpf: selftest additions for SOCKHASH

2018-04-27 Thread John Fastabend
This runs existing SOCKMAP tests with SOCKHASH map type. To do this we push programs into include file and build two BPF programs. One for SOCKHASH and one for SOCKMAP. We then run the entire test suite with each type. Signed-off-by: John Fastabend --- tools/testing/selftests/bpf/Makefile

[bpf-next PATCH 0/3] Hash support for sock

2018-04-27 Thread John Fastabend
type which reuses almost all the sockmap code except it needed a few special add/remove handlers. To test this we duplicate all the sockmap testing except swap out the sockmap with a sockhash. --- John Fastabend (3): bpf: sockmap, refactor sockmap routines to work with hashmap bpf

Re: [bpf-next PATCH 0/3] Hash support for sock

2018-04-27 Thread John Fastabend
On 04/27/2018 03:54 PM, Alexei Starovoitov wrote: > On Fri, Apr 27, 2018 at 10:51 PM, John Fastabend > wrote: >> In the original sockmap implementation we got away with using an >> array similar to devmap. However, unlike devmap where an ifindex >> has a nice 1:1 funct

[bpf-next PATCH 0/3] Hash support for sock

2018-04-27 Thread John Fastabend
type which reuses almost all the sockmap code except it needed a few special add/remove handlers. To test this we duplicate all the sockmap testing except swap out the sockmap with a sockhash. --- John Fastabend (3): bpf: sockmap, refactor sockmap routines to work with hashmap bpf

[bpf-next PATCH v2 3/3] bpf: selftest additions for SOCKHASH

2018-04-27 Thread John Fastabend
This runs existing SOCKMAP tests with SOCKHASH map type. To do this we push programs into include file and build two BPF programs. One for SOCKHASH and one for SOCKMAP. We then run the entire test suite with each type. Signed-off-by: John Fastabend --- tools/testing/selftests/bpf/Makefile

[bpf-next PATCH v2 1/3] bpf: sockmap, refactor sockmap routines to work with hashmap

2018-04-27 Thread John Fastabend
. This avoids storing the key in the metadata which will be useful when keys can be longer than 4 bytes. We rename the sk pointers to sk_redir at this point as well to avoid any confusion between the current sk pointer and the redirect pointer sk_redir. Signed-off-by: John Fastabend

[bpf-next PATCH v2 0/3] Hash support for sock

2018-04-27 Thread John Fastabend
something else tricky. To test this we duplicate all the sockmap testing except swap out the sockmap with a sockhash. v2: fix file stats and add v2 tag --- John Fastabend (3): bpf: sockmap, refactor sockmap routines to work with hashmap bpf: sockmap, add hash map support bpf: selftest

[bpf-next PATCH v2 2/3] bpf: sockmap, add hash map support

2018-04-27 Thread John Fastabend
may want to use the 5-tuple of the socket as the lookup key. To support this add hash support. Signed-off-by: John Fastabend --- include/linux/bpf.h|8 + include/linux/bpf_types.h |1 include/uapi/linux/bpf.h |6 kernel/bpf/core.c |1 kernel

[PATCH bpf-next v3 0/4] Hash support for sock

2018-04-28 Thread John Fastabend
provide only diffs +/- on that. John Fastabend (4): bpf: sockmap, refactor sockmap routines to work with hashmap bpf: sockmap, add hash map support bpf: bpftool, support for sockhash bpf: selftest additions for SOCKHASH include/linux/bpf.h| 8 + include/linux

[PATCH bpf-next v3 1/4] bpf: sockmap, refactor sockmap routines to work with hashmap

2018-04-28 Thread John Fastabend
. This avoids storing the key in the metadata which will be useful when keys can be longer than 4 bytes. We rename the sk pointers to sk_redir at this point as well to avoid any confusion between the current sk pointer and the redirect pointer sk_redir. Signed-off-by: John Fastabend

[PATCH bpf-next v3 2/4] bpf: sockmap, add hash map support

2018-04-28 Thread John Fastabend
may want to use the 5-tuple of the socket as the lookup key. To support this add hash support. Signed-off-by: John Fastabend --- include/linux/bpf.h | 8 + include/linux/bpf_types.h | 1 + include/uapi/linux/bpf.h | 6 +- kernel/bpf/core.c | 1 + kernel/bpf/sockmap.c

[PATCH bpf-next v3 3/4] bpf: selftest additions for SOCKHASH

2018-04-28 Thread John Fastabend
This runs existing SOCKMAP tests with SOCKHASH map type. To do this we push programs into include file and build two BPF programs. One for SOCKHASH and one for SOCKMAP. We then run the entire test suite with each type. Signed-off-by: John Fastabend --- tools/include/uapi/linux/bpf.h

[PATCH bpf-next v3 4/4] bpf: bpftool, support for sockhash

2018-04-28 Thread John Fastabend
This adds the SOCKHASH map type to bpftools so that we get correct pretty printing. Signed-off-by: John Fastabend --- tools/bpf/bpftool/map.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index a6cdb64..4420b1a 100644 --- a/tools/bpf

Re: [bpf-next PATCH v2 3/3] bpf: selftest additions for SOCKHASH

2018-04-28 Thread John Fastabend
On 04/27/2018 05:10 PM, Alexei Starovoitov wrote: > On Fri, Apr 27, 2018 at 04:24:43PM -0700, John Fastabend wrote: >> This runs existing SOCKMAP tests with SOCKHASH map type. To do this >> we push programs into include file and build two BPF programs. One >> for SOCKHAS

<    5   6   7   8   9   10   11   12   13   14   >