Re: [PATCH bpf] libbpf: fix XDP program load regression for old kernels

2020-09-24 Thread Alexei Starovoitov
On Thu, Sep 24, 2020 at 10:18 AM Andrii Nakryiko wrote: > > Fix regression in libbpf, introduced by XDP link change, which causes XDP > programs to fail to be loaded into kernel due to specified BPF_XDP > expected_attach_type. While kernel doesn't enforce expected_attach_type for > BPF_PROG_TYPE_X

Re: [PATCH bpf] libbpf: fix XDP program load regression for old kernels

2020-09-24 Thread Andrii Nakryiko
On Thu, Sep 24, 2020 at 10:34 AM Alexei Starovoitov wrote: > > On Thu, Sep 24, 2020 at 10:18 AM Andrii Nakryiko wrote: > > > > Fix regression in libbpf, introduced by XDP link change, which causes XDP > > programs to fail to be loaded into kernel due to specified BPF_XDP > > expected_attach_type.

[PATCH ethtool v2 2/2] Update link mode tables for fiber

2020-09-24 Thread Dan Murphy
Update the link mode tables to include 100base Fx Full and Half duplex modes. Signed-off-by: Dan Murphy --- ethtool.c | 6 ++ netlink/settings.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/ethtool.c b/ethtool.c index ab9b4577cbce..2f71fa92bb09 100644 --- a/ethtool.c +++ b

[PATCH ethtool v2 1/2] update UAPI header copies

2020-09-24 Thread Dan Murphy
Update to kernel commit 55f13311785c Signed-off-by: Dan Murphy --- uapi/linux/ethtool.h | 2 ++ uapi/linux/ethtool_netlink.h | 19 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/uapi/linux/ethtool.h b/uapi/linux/ethtool.h index 847ccd0b1fce..052689bcc

Re: [PATCH] Revert "net: linkwatch: add check for netdevice being present to linkwatch_do_dev"

2020-09-24 Thread Saeed Mahameed
On Thu, 2020-09-24 at 09:03 -0700, Jakub Kicinski wrote: > On Wed, 23 Sep 2020 22:49:37 -0700 Saeed Mahameed wrote: > > 2) Another problematic scenario which i see is repeated in many > > drivers: > > > > shutdown/suspend() > > rtnl_lock() > > netif_device_detach()//Mark !present; > >

[PATCH bpf-next 2/6] bpf, net: rework cookie generator as per-cpu one

2020-09-24 Thread Daniel Borkmann
With its use in BPF the cookie generator can be called very frequently in particular when used out of cgroup v2 hooks (e.g. connect / sendmsg) and attached to the root cgroup, for example, when used in v1/v2 mixed environments. In particular when there's a high churn on sockets in the system there

[PATCH bpf-next 3/6] bpf: add redirect_neigh helper as redirect drop-in

2020-09-24 Thread Daniel Borkmann
Add a redirect_neigh() helper as redirect() drop-in replacement for the xmit side. Main idea for the helper is to be very similar in semantics to the latter just that the skb gets injected into the neighboring subsystem in order to let the stack do the work it knows best anyway to populate the L2 a

[PATCH bpf-next 1/6] bpf: add classid helper only based on skb->sk

2020-09-24 Thread Daniel Borkmann
Similarly to 5a52ae4e32a6 ("bpf: Allow to retrieve cgroup v1 classid from v2 hooks"), add a helper to retrieve cgroup v1 classid solely based on the skb->sk, so it can be used as key as part of BPF map lookups out of tc from host ns, in particular given the skb->sk is retained these days when cross

[PATCH bpf-next 0/6] Various BPF helper improvements

2020-09-24 Thread Daniel Borkmann
This series adds two BPF helpers, that is, one for retrieving the classid of an skb and another one to redirect via the neigh subsystem, and improves also the cookie helpers by removing the atomic counter. I've also added the bpf_tail_call_static() helper to the libbpf API that we've been using in

[PATCH bpf-next 5/6] bpf, selftests: use bpf_tail_call_static where appropriate

2020-09-24 Thread Daniel Borkmann
For those locations where we use an immediate tail call map index use the newly added bpf_tail_call_static() helper. Signed-off-by: Daniel Borkmann --- tools/testing/selftests/bpf/progs/bpf_flow.c | 12 tools/testing/selftests/bpf/progs/tailcall1.c | 28 +-- tools/testi

[PATCH bpf-next 6/6] bpf, selftests: add redirect_neigh selftest

2020-09-24 Thread Daniel Borkmann
Add a small test that excercises the new redirect_neigh() helper for the IPv4 and IPv6 case. Signed-off-by: Daniel Borkmann --- .../selftests/bpf/progs/test_tc_neigh.c | 144 +++ tools/testing/selftests/bpf/test_tc_neigh.sh | 168 ++ 2 files changed, 312 insert

[PATCH bpf-next 4/6] bpf, libbpf: add bpf_tail_call_static helper for bpf programs

2020-09-24 Thread Daniel Borkmann
Port of tail_call_static() helper function from Cilium's BPF code base [0] to libbpf, so others can easily consume it as well. We've been using this in production code for some time now. The main idea is that we guarantee that the kernel's BPF infrastructure and JIT (here: x86_64) can patch the JIT

[bpf-next PATCH 2/2] bpf: Add AND verifier test case where 32bit and 64bit bounds differ

2020-09-24 Thread John Fastabend
If we AND two values together that are known in the 32bit subregs, but not known in the 64bit registers we rely on the tnum value to report the 32bit subreg is known. And do not use mark_reg_known() directly from scalar32_min_max_and() Add an AND test to cover the case with known 32bit subreg, but

[bpf-next PATCH 1/2] bpf, verifier: Remove redundant var_off.value ops in scalar known reg cases

2020-09-24 Thread John Fastabend
In BPF_AND and BPF_OR alu cases we have this pattern when the src and dst tnum is a constant. 1 dst_reg->var_off = tnum_[op](dst_reg->var_off, src_reg.var_off) 2 scalar32_min_max_[op] 3 if (known) return 4 scalar_min_max_[op] 5 if (known) 6 __mark_reg_known(dst_reg,

Re: [PATCH bpf-next 2/6] bpf, net: rework cookie generator as per-cpu one

2020-09-24 Thread Eric Dumazet
On 9/24/20 8:21 PM, Daniel Borkmann wrote: > With its use in BPF the cookie generator can be called very frequently > in particular when used out of cgroup v2 hooks (e.g. connect / sendmsg) > and attached to the root cgroup, for example, when used in v1/v2 mixed > environments. In particular whe

Re: [PATCH net-next RFC v5 01/15] devlink: Add reload action option to devlink reload command

2020-09-24 Thread Moshe Shemesh
On 9/23/2020 9:25 PM, Jakub Kicinski wrote: On Fri, 18 Sep 2020 19:06:37 +0300 Moshe Shemesh wrote: Add devlink reload action to allow the user to request a specific reload action. The action parameter is optional, if not specified then devlink driver re-init action is used (backward compatib

Re: RTL8402 stops working after hibernate/resume

2020-09-24 Thread Petr Tesarik
On Wed, 23 Sep 2020 11:57:41 +0200 Heiner Kallweit wrote: > On 03.09.2020 10:41, Petr Tesarik wrote: > > Hi Heiner, > > > > this issue was on the back-burner for some time, but I've got some > > interesting news now. > > > > On Sat, 18 Jul 2020 14:07:50 +0200 > > Heiner Kallweit wrote: > >

[PATCH ethtool 1/2] netlink: return -ENOMEM when calloc fails

2020-09-24 Thread Ivan Vecera
Fixes: f2c17e107900 ("netlink: add netlink handler for gfeatures (-k)") Cc: Michal Kubecek Signed-off-by: Ivan Vecera --- netlink/features.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/netlink/features.c b/netlink/features.c index 3f1240437350..b2cf57eea660 1006

[PATCH ethtool 2/2] netlink: fix memory leak

2020-09-24 Thread Ivan Vecera
Potentially allocated memory allocated for mask is not freed when the allocation for value fails. Fixes: 81a30f416ec7 ("netlink: add bitset command line parser handlers") Cc: Michal Kubecek Signed-off-by: Ivan Vecera --- netlink/parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

Re: [PATCH net-next RFC v5 02/15] devlink: Add reload action limit level

2020-09-24 Thread Moshe Shemesh
On 9/23/2020 9:36 PM, Jakub Kicinski wrote: On Fri, 18 Sep 2020 19:06:38 +0300 Moshe Shemesh wrote: Add reload action limit level to demand restrictions on actions. Reload action limit levels supported: none (default): No constrains on actions. Driver implementation may includ

Re: [PATCH net-next RFC v5 03/15] devlink: Add reload action stats

2020-09-24 Thread Moshe Shemesh
On 9/23/2020 9:42 PM, Jakub Kicinski wrote: External email: Use caution opening links or attachments On Fri, 18 Sep 2020 19:06:39 +0300 Moshe Shemesh wrote: Add reload action stats to hold the history per reload action type and limit level. For example, the number of times fw_activate has b

Re: [PATCH bpf-next 5/6] bpf, selftests: use bpf_tail_call_static where appropriate

2020-09-24 Thread Maciej Fijalkowski
On Thu, Sep 24, 2020 at 08:21:26PM +0200, Daniel Borkmann wrote: > For those locations where we use an immediate tail call map index use the > newly added bpf_tail_call_static() helper. > > Signed-off-by: Daniel Borkmann > --- > tools/testing/selftests/bpf/progs/bpf_flow.c | 12 > tool

Re: [PATCH net-next RFC v5 04/15] devlink: Add reload actions stats to dev get

2020-09-24 Thread Moshe Shemesh
On 9/23/2020 9:50 PM, Jakub Kicinski wrote: On Fri, 18 Sep 2020 19:06:40 +0300 Moshe Shemesh wrote: Expose devlink reload actions stats to the user through devlink dev get command. Examples: $ devlink dev show pci/:82:00.0: stats: reload_action_stats: driver_reinit 2

Re: RTL8402 stops working after hibernate/resume

2020-09-24 Thread Heiner Kallweit
On 24.09.2020 21:14, Petr Tesarik wrote: > On Wed, 23 Sep 2020 11:57:41 +0200 > Heiner Kallweit wrote: > >> On 03.09.2020 10:41, Petr Tesarik wrote: >>> Hi Heiner, >>> >>> this issue was on the back-burner for some time, but I've got some >>> interesting news now. >>> >>> On Sat, 18 Jul 2020 14:0

Re: [PATCH v4 bpf-next 1/3] bpf: enable BPF_PROG_TEST_RUN for raw_tracepoint

2020-09-24 Thread Andrii Nakryiko
On Wed, Sep 23, 2020 at 6:46 PM Song Liu wrote: > > Add .test_run for raw_tracepoint. Also, introduce a new feature that runs > the target program on a specific CPU. This is achieved by a new flag in > bpf_attr.test, BPF_F_TEST_RUN_ON_CPU. When this flag is set, the program > is triggered on cpu w

Re: [PATCH v3] e1000e: Increase iteration on polling MDIC ready bit

2020-09-24 Thread Andrew Lunn
On Fri, Sep 25, 2020 at 12:45:42AM +0800, Kai-Heng Feng wrote: > We are seeing the following error after S3 resume: > [ 704.746874] e1000e :00:1f.6 eno1: Setting page 0x6020 > [ 704.844232] e1000e :00:1f.6 eno1: MDI Write did not complete > [ 704.902817] e1000e :00:1f.6 eno1: Setting

[bpf-next PATCH] bpf: Add comment to document BTF type PTR_TO_BTF_ID_OR_NULL

2020-09-24 Thread John Fastabend
The meaning of PTR_TO_BTF_ID_OR_NULL differs slightly from other types denoted with the *_OR_NULL type. For example the types PTR_TO_SOCKET and PTR_TO_SOCKET_OR_NULL can be used for branch analysis because the type PTR_TO_SOCKET is guaranteed to _not_ have a null value. In contrast PTR_TO_BTF_ID a

Re: [PATCH v4 bpf-next 2/3] libbpf: support test run of raw tracepoint programs

2020-09-24 Thread Andrii Nakryiko
On Wed, Sep 23, 2020 at 6:45 PM Song Liu wrote: > > Add bpf_prog_test_run_opts() with support of new fields in bpf_attr.test, > namely, flags and cpu. Also extend _opts operations to support outputs via > opts. > > Signed-off-by: Song Liu > --- > tools/lib/bpf/bpf.c | 31

Re: [PATCH v4 bpf-next 3/3] selftests/bpf: add raw_tp_test_run

2020-09-24 Thread Andrii Nakryiko
On Wed, Sep 23, 2020 at 6:55 PM Song Liu wrote: > > This test runs test_run for raw_tracepoint program. The test covers ctx > input, retval output, and running on correct cpu. > > Signed-off-by: Song Liu > --- > .../bpf/prog_tests/raw_tp_test_run.c | 79 +++ > .../bpf/pr

Re: RTL8402 stops working after hibernate/resume

2020-09-24 Thread Heiner Kallweit
On 24.09.2020 21:14, Petr Tesarik wrote: > On Wed, 23 Sep 2020 11:57:41 +0200 > Heiner Kallweit wrote: > >> On 03.09.2020 10:41, Petr Tesarik wrote: >>> Hi Heiner, >>> >>> this issue was on the back-burner for some time, but I've got some >>> interesting news now. >>> >>> On Sat, 18 Jul 2020 14:0

Re: [PATCH bpf-next v3 2/2] selftests/bpf: Verifying real time helper function

2020-09-24 Thread Andrii Nakryiko
On Wed, Sep 23, 2020 at 7:26 PM wrote: > > From: Bimmy Pujari > > Test xdping measures RTT from xdp using monotonic time helper. > Extending xdping test to use real time helper function in order > to verify this helper function. > > Signed-off-by: Bimmy Pujari > --- This is exactly the use of R

Re: [PATCH bpf-next 2/9] libbpf: remove assumption of single contiguous memory for BTF data

2020-09-24 Thread Andrii Nakryiko
On Thu, Sep 24, 2020 at 8:21 AM John Fastabend wrote: > > Andrii Nakryiko wrote: > > Refactor internals of struct btf to remove assumptions that BTF header, type > > data, and string data are layed out contiguously in a memory in a single > > memory allocation. Now we have three separate pointers

Re: [PATCH bpf-next 5/9] libbpf: allow modification of BTF and add btf__add_str API

2020-09-24 Thread Andrii Nakryiko
On Thu, Sep 24, 2020 at 8:56 AM John Fastabend wrote: > > Andrii Nakryiko wrote: > > Allow internal BTF representation to switch from default read-only mode, in > > which raw BTF data is a single non-modifiable block of memory with BTF > > header, > > types, and strings layed out sequentially and

Re: [PATCH net-next RFC v5 01/15] devlink: Add reload action option to devlink reload command

2020-09-24 Thread Jakub Kicinski
On Thu, 24 Sep 2020 22:01:42 +0300 Moshe Shemesh wrote: > On 9/23/2020 9:25 PM, Jakub Kicinski wrote: > >> Signed-off-by: Moshe Shemesh > >> @@ -3971,15 +3972,19 @@ static int mlx4_devlink_reload_up(struct devlink > >> *devlink, > >>int err; > >> > >>err = mlx4_restart_one_up(pers

Re: [PATCH bpf-next v8 04/11] bpf: move prog->aux->linked_prog and trampoline into bpf_link on attach

2020-09-24 Thread Andrii Nakryiko
On Thu, Sep 24, 2020 at 7:36 AM Toke Høiland-Jørgensen wrote: > > Alexei Starovoitov writes: > > > On Tue, Sep 22, 2020 at 08:38:38PM +0200, Toke Høiland-Jørgensen > > wrote: > >> @@ -746,7 +748,9 @@ struct bpf_prog_aux { > >> u32 max_rdonly_access; > >> u32 max_rdwr_access; > >>

Re: [PATCH ethtool-next 2/5] pause: add --json support

2020-09-24 Thread Jacob Keller
On 9/24/2020 8:36 AM, Jakub Kicinski wrote: > On Wed, 23 Sep 2020 17:10:30 -0700 Jacob Keller wrote: >>> - printf("RX negotiated: %s\nTX negotiated: %s\n", >>> - rx_status ? "on" : "off", tx_status ? "on" : "off"); >>> + >>> + if (is_json_context()) { >>> + open_json_objec

Re: [PATCH net-next RFC v5 02/15] devlink: Add reload action limit level

2020-09-24 Thread Jakub Kicinski
On Thu, 24 Sep 2020 22:29:55 +0300 Moshe Shemesh wrote: > >> @@ -3964,6 +3965,7 @@ static int mlx4_devlink_reload_down(struct devlink > >> *devlink, bool netns_change, > >> } > >> > >> static int mlx4_devlink_reload_up(struct devlink *devlink, enum > >> devlink_reload_action action, > >> +

Re: [PATCH v2 4/4] PCI: Limit pci_alloc_irq_vectors as per housekeeping CPUs

2020-09-24 Thread Bjorn Helgaas
Possible subject: PCI: Limit pci_alloc_irq_vectors() to housekeeping CPUs On Wed, Sep 23, 2020 at 02:11:26PM -0400, Nitesh Narayan Lal wrote: > This patch limits the pci_alloc_irq_vectors, max_vecs argument that is > passed on by the caller based on the housekeeping online CPUs (that are > mean

Re: [PATCH v2 1/4] sched/isolation: API to get housekeeping online CPUs

2020-09-24 Thread Bjorn Helgaas
On Wed, Sep 23, 2020 at 02:11:23PM -0400, Nitesh Narayan Lal wrote: > Introduce a new API hk_num_online_cpus(), that can be used to > retrieve the number of online housekeeping CPUs that are meant to handle > managed IRQ jobs. > > This API is introduced for the drivers that were previously relying

Re: [PATCH v4 bpf-next 1/3] bpf: enable BPF_PROG_TEST_RUN for raw_tracepoint

2020-09-24 Thread Song Liu
> On Sep 24, 2020, at 12:56 PM, Andrii Nakryiko > wrote: > > On Wed, Sep 23, 2020 at 6:46 PM Song Liu wrote: >> >> Add .test_run for raw_tracepoint. Also, introduce a new feature that runs >> the target program on a specific CPU. This is achieved by a new flag in >> bpf_attr.test, BPF_F_TES

Re: [PATCH bpf-next 4/6] bpf, libbpf: add bpf_tail_call_static helper for bpf programs

2020-09-24 Thread Andrii Nakryiko
On Thu, Sep 24, 2020 at 11:22 AM Daniel Borkmann wrote: > > Port of tail_call_static() helper function from Cilium's BPF code base [0] > to libbpf, so others can easily consume it as well. We've been using this > in production code for some time now. The main idea is that we guarantee > that the k

Re: [PATCH bpf-next v8 04/11] bpf: move prog->aux->linked_prog and trampoline into bpf_link on attach

2020-09-24 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Thu, Sep 24, 2020 at 7:36 AM Toke Høiland-Jørgensen > wrote: >> >> Alexei Starovoitov writes: >> >> > On Tue, Sep 22, 2020 at 08:38:38PM +0200, Toke Høiland-Jørgensen >> > wrote: >> >> @@ -746,7 +748,9 @@ struct bpf_prog_aux { >> >> u32 max_rdonly_acces

Re: [net-next v2 1/3] ch_ktls: Issue if connection offload fails

2020-09-24 Thread Jakub Kicinski
On Thu, 24 Sep 2020 12:06:37 +0530 Rohit Maheshwari wrote: > + if (chcr_setup_connection(sk, tx_info)) > + goto put_module; > + > + /* Wait for reply */ > + wait_for_completion_timeout(&tx_info->completion, 30 * HZ); > + if (tx_info->open_pending) > + goto pu

Re: [PATCH bpf-next v8 04/11] bpf: move prog->aux->linked_prog and trampoline into bpf_link on attach

2020-09-24 Thread Toke Høiland-Jørgensen
>> > I think I will just start marking patches as changes-requested when I see >> > that >> > they break tests without replying and without reviewing. >> > Please respect reviewer's time. >> >> That is completely fine if the tests are working in the first place. And >> even when they're not (lik

Re: [PATCH] net/tls: race causes kernel panic

2020-09-24 Thread Jakub Kicinski
On Thu, 24 Sep 2020 12:28:45 +0530 Rohit Maheshwari wrote: > BUG: kernel NULL pointer dereference, address: 00b8 > #PF: supervisor read access in kernel mode > #PF: error_code(0x) - not-present page > PGD 8008b6fef067 P4D 8008b6fef067 PUD 8b6fe6067 PMD 0 > Oops: [#1

Re: [PATCH v2 4/4] PCI: Limit pci_alloc_irq_vectors as per housekeeping CPUs

2020-09-24 Thread Nitesh Narayan Lal
On 9/24/20 4:45 PM, Bjorn Helgaas wrote: > Possible subject: > > PCI: Limit pci_alloc_irq_vectors() to housekeeping CPUs Will switch to this. > > On Wed, Sep 23, 2020 at 02:11:26PM -0400, Nitesh Narayan Lal wrote: >> This patch limits the pci_alloc_irq_vectors, max_vecs argument that is >> pas

Re: RTNETLINK answers: Permission denied

2020-09-24 Thread David Ahern
On 9/24/20 10:26 AM, Brian J. Murrell wrote: > On Thu, 2020-09-24 at 10:15 -0600, David Ahern wrote: >> >> check your routes for a prohibit entry: > > I don't have any prohibit entries > perf record -e fib6:* -g -- ip route get 2001:4860:4860::8844 perf script It's a config problem somewhere.

Re: [PATCH v2 1/4] sched/isolation: API to get housekeeping online CPUs

2020-09-24 Thread Nitesh Narayan Lal
On 9/24/20 4:47 PM, Bjorn Helgaas wrote: > On Wed, Sep 23, 2020 at 02:11:23PM -0400, Nitesh Narayan Lal wrote: >> Introduce a new API hk_num_online_cpus(), that can be used to >> retrieve the number of online housekeeping CPUs that are meant to handle >> managed IRQ jobs. >> >> This API is introdu

Re: [PATCH net] net/tls: sendfile fails with ktls offload

2020-09-24 Thread Jakub Kicinski
On Thu, 24 Sep 2020 13:20:25 +0530 Rohit Maheshwari wrote: > At first when sendpage gets called, if there is more data, 'more' in > tls_push_data() gets set which later sets pending_open_record_frags, but > when there is no more data in file left, and last time tls_push_data() > gets called, pendin

Re: [PATCH bpf-next v8 04/11] bpf: move prog->aux->linked_prog and trampoline into bpf_link on attach

2020-09-24 Thread Toke Høiland-Jørgensen
Alexei Starovoitov writes: >> +struct mutex tgt_mutex; /* protects tgt_* pointers below, *after* prog >> becomes visible */ >> +struct bpf_prog *tgt_prog; >> +struct bpf_trampoline *tgt_trampoline; >> bool verifier_zext; /* Zero extensions has been inserted by verifier. */ >>

Re: [PATCH bpf-next v8 04/11] bpf: move prog->aux->linked_prog and trampoline into bpf_link on attach

2020-09-24 Thread Andrii Nakryiko
On Thu, Sep 24, 2020 at 2:24 PM Toke Høiland-Jørgensen wrote: > > Andrii Nakryiko writes: > > > On Thu, Sep 24, 2020 at 7:36 AM Toke Høiland-Jørgensen > > wrote: > >> > >> Alexei Starovoitov writes: > >> > >> > On Tue, Sep 22, 2020 at 08:38:38PM +0200, Toke Høiland-Jørgensen > >> > wrot

Re: [PATCH bpf-next 2/6] bpf, net: rework cookie generator as per-cpu one

2020-09-24 Thread Daniel Borkmann
On 9/24/20 8:58 PM, Eric Dumazet wrote: On 9/24/20 8:21 PM, Daniel Borkmann wrote: [...] diff --git a/include/linux/cookie.h b/include/linux/cookie.h new file mode 100644 index ..2488203dc004 --- /dev/null +++ b/include/linux/cookie.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GP

Re: [PATCH bpf-next 5/6] bpf, selftests: use bpf_tail_call_static where appropriate

2020-09-24 Thread Daniel Borkmann
On 9/24/20 9:25 PM, Maciej Fijalkowski wrote: On Thu, Sep 24, 2020 at 08:21:26PM +0200, Daniel Borkmann wrote: For those locations where we use an immediate tail call map index use the newly added bpf_tail_call_static() helper. Signed-off-by: Daniel Borkmann --- tools/testing/selftests/bpf/p

[PATCH bpf-next v5] bpf: Add bpf_ktime_get_real_ns

2020-09-24 Thread bimmy . pujari
From: Bimmy Pujari The existing bpf helper functions to get timestamp return the time elapsed since system boot. This timestamp is not particularly useful where epoch timestamp is required or more than one server is involved and time sync is required. Instead, you want to use CLOCK_REALTIME, whic

Re: [PATCH bpf-next 3/6] bpf: add redirect_neigh helper as redirect drop-in

2020-09-24 Thread David Ahern
On 9/24/20 12:21 PM, Daniel Borkmann wrote: > diff --git a/net/core/filter.c b/net/core/filter.c > index 0f913755bcba..19caa2fc21e8 100644 > --- a/net/core/filter.c > +++ b/net/core/filter.c > @@ -2160,6 +2160,205 @@ static int __bpf_redirect(struct sk_buff *skb, struct > net_device *dev, >

Re: [PATCH bpf-next v5] bpf: Add bpf_ktime_get_real_ns

2020-09-24 Thread David Ahern
On 9/24/20 4:07 PM, bimmy.puj...@intel.com wrote: > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h > index a22812561064..198e69a6508d 100644 > --- a/include/uapi/linux/bpf.h > +++ b/include/uapi/linux/bpf.h > @@ -3586,6 +3586,13 @@ union bpf_attr { > * the data in *dst

Re: [PATCH bpf-next 4/6] bpf, libbpf: add bpf_tail_call_static helper for bpf programs

2020-09-24 Thread Daniel Borkmann
On 9/24/20 10:53 PM, Andrii Nakryiko wrote: On Thu, Sep 24, 2020 at 11:22 AM Daniel Borkmann wrote: Port of tail_call_static() helper function from Cilium's BPF code base [0] to libbpf, so others can easily consume it as well. We've been using this in production code for some time now. The mai

Re: [PATCH bpf-next 3/6] bpf: add redirect_neigh helper as redirect drop-in

2020-09-24 Thread Daniel Borkmann
On 9/25/20 12:12 AM, David Ahern wrote: On 9/24/20 12:21 PM, Daniel Borkmann wrote: diff --git a/net/core/filter.c b/net/core/filter.c index 0f913755bcba..19caa2fc21e8 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -2160,6 +2160,205 @@ static int __bpf_redirect(struct sk_buff *skb, st

Re: [PATCH bpf-next v8 04/11] bpf: move prog->aux->linked_prog and trampoline into bpf_link on attach

2020-09-24 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Thu, Sep 24, 2020 at 2:24 PM Toke Høiland-Jørgensen > wrote: >> >> Andrii Nakryiko writes: >> >> > On Thu, Sep 24, 2020 at 7:36 AM Toke Høiland-Jørgensen >> > wrote: >> >> >> >> Alexei Starovoitov writes: >> >> >> >> > On Tue, Sep 22, 2020 at 08:38:38PM +0200, T

[PATCH net] tcp: skip DSACKs with dubious sequence ranges

2020-09-24 Thread Priyaranjan Jha
From: Priyaranjan Jha Currently, we use length of DSACKed range to compute number of delivered packets. And if sequence range in DSACK is corrupted, we can get bogus dsacked/acked count, and bogus cwnd. This patch put bounds on DSACKed range to skip update of data delivery and spurious retransmi

Re: [Intel-wired-lan] [PATCH net-next v1 4/7] selftests: net: add a test for shared UDP tunnel info tables

2020-09-24 Thread Nguyen, Anthony L
On Mon, 2020-09-21 at 14:44 -0700, Jakub Kicinski wrote: > On Sat, 19 Sep 2020 07:23:58 + Brown, Aaron F wrote: > > > From: Intel-wired-lan On > > > Behalf Of Jakub > > > Kicinski > > > Sent: Tuesday, July 21, 2020 6:27 PM > > > To: da...@davemloft.net > > > Cc: netdev@vger.kernel.org; intel-w

Re: [PATCH bpf-next v5] bpf: Add bpf_ktime_get_real_ns

2020-09-24 Thread Daniel Borkmann
On 9/25/20 12:15 AM, David Ahern wrote: On 9/24/20 4:07 PM, bimmy.puj...@intel.com wrote: diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index a22812561064..198e69a6508d 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -3586,6 +3586,13 @@ union bpf_attr {

Re: [Intel-wired-lan] [PATCH net-next v1 4/7] selftests: net: add a test for shared UDP tunnel info tables

2020-09-24 Thread Jakub Kicinski
On Thu, 24 Sep 2020 22:25:46 + Nguyen, Anthony L wrote: > On Mon, 2020-09-21 at 14:44 -0700, Jakub Kicinski wrote: > > Ah, good catch, thanks! Please adjust in your tree or I can send a > > follow up with other patches I still have queued. > > Hi Jakub, > > It'd be great if you could adjust

Re: [PATCH bpf-next v8 04/11] bpf: move prog->aux->linked_prog and trampoline into bpf_link on attach

2020-09-24 Thread Andrii Nakryiko
On Thu, Sep 24, 2020 at 3:20 PM Toke Høiland-Jørgensen wrote: > > Andrii Nakryiko writes: > > > On Thu, Sep 24, 2020 at 2:24 PM Toke Høiland-Jørgensen > > wrote: > >> > >> Andrii Nakryiko writes: > >> > >> > On Thu, Sep 24, 2020 at 7:36 AM Toke Høiland-Jørgensen > >> > wrote: > >> >> > >> >>

Re: [PATCH net-next 4/5] bonding: make Kconfig toggle to disable legacy interfaces

2020-09-24 Thread Jay Vosburgh
Jarod Wilson wrote: >On Tue, Sep 22, 2020 at 8:01 PM Stephen Hemminger > wrote: >> >> On Tue, 22 Sep 2020 16:47:07 -0700 >> Jay Vosburgh wrote: >> >> > Stephen Hemminger wrote: >> > >> > >On Tue, 22 Sep 2020 09:37:30 -0400 >> > >Jarod Wilson wrote: >> > > >> > >> By default, enable retaining a

Re: [PATCH net-next v3 4/4] gve: Add support for raw addressing in the tx path

2020-09-24 Thread Jakub Kicinski
On Wed, 23 Sep 2020 18:01:04 -0700 David Awogbemila wrote: > + info->skb = skb; double space > + addr = dma_map_single(tx->dev, skb->data, len, DMA_TO_DEVICE); > + if (unlikely(dma_mapping_error(tx->dev, addr))) { > + priv->dma_mapping_error++; > + goto drop;

Re: [PATCH v2 4/4] PCI: Limit pci_alloc_irq_vectors as per housekeeping CPUs

2020-09-24 Thread Bjorn Helgaas
On Thu, Sep 24, 2020 at 05:39:07PM -0400, Nitesh Narayan Lal wrote: > > On 9/24/20 4:45 PM, Bjorn Helgaas wrote: > > Possible subject: > > > > PCI: Limit pci_alloc_irq_vectors() to housekeeping CPUs > > Will switch to this. > > > On Wed, Sep 23, 2020 at 02:11:26PM -0400, Nitesh Narayan Lal wro

Re: [PATCH net-next v3 3/4] gve: Rx Buffer Recycling

2020-09-24 Thread Jakub Kicinski
On Wed, 23 Sep 2020 18:01:03 -0700 David Awogbemila wrote: > This patch lets the driver reuse buffers that have been freed by the > networking stack. > > In the raw addressing case, this allows the driver avoid allocating new > buffers. > In the qpl case, the driver can avoid copies. > > Signed-o

[PATCH v5 bpf-next 1/3] bpf: enable BPF_PROG_TEST_RUN for raw_tracepoint

2020-09-24 Thread Song Liu
Add .test_run for raw_tracepoint. Also, introduce a new feature that runs the target program on a specific CPU. This is achieved by a new flag in bpf_attr.test, BPF_F_TEST_RUN_ON_CPU. When this flag is set, the program is triggered on cpu with id bpf_attr.test.cpu. This feature is needed for BPF pr

[PATCH v5 bpf-next 2/3] libbpf: support test run of raw tracepoint programs

2020-09-24 Thread Song Liu
Add bpf_prog_test_run_opts() with support of new fields in bpf_attr.test, namely, flags and cpu. Also extend _opts operations to support outputs via opts. Signed-off-by: Song Liu --- tools/lib/bpf/bpf.c | 31 +++ tools/lib/bpf/bpf.h | 26 ++

[PATCH v5 bpf-next 0/3] enable BPF_PROG_TEST_RUN for raw_tp

2020-09-24 Thread Song Liu
This set enables BPF_PROG_TEST_RUN for raw_tracepoint type programs. This set also enables running the raw_tp program on a specific CPU. This feature can be used by user space to trigger programs that access percpu resources, e.g. perf_event, percpu variables. Changes v4 => v5: 1.Fail test_run wit

[PATCH v5 bpf-next 3/3] selftests/bpf: add raw_tp_test_run

2020-09-24 Thread Song Liu
This test runs test_run for raw_tracepoint program. The test covers ctx input, retval output, and running on correct cpu. Signed-off-by: Song Liu --- .../bpf/prog_tests/raw_tp_test_run.c | 98 +++ .../bpf/progs/test_raw_tp_test_run.c | 24 + 2 files changed,

Re: [PATCH net-next v3 1/4] gve: Add support for raw addressing device option

2020-09-24 Thread Jakub Kicinski
On Wed, 23 Sep 2020 18:01:01 -0700 David Awogbemila wrote: > @@ -518,6 +521,49 @@ int gve_adminq_describe_device(struct gve_priv *priv) > priv->rx_desc_cnt = priv->rx_pages_per_qpl; > } > priv->default_num_queues = be16_to_cpu(descriptor->default_num_queues); > + dev_o

Re: [PATCH bpf-next v8 04/11] bpf: move prog->aux->linked_prog and trampoline into bpf_link on attach

2020-09-24 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: >> [root@(none) bpf]# ./test_progs -t map_in_map >> test_lookup_update:PASS:skel_open 0 nsec >> test_lookup_update:PASS:skel_attach 0 nsec >> test_lookup_update:PASS:inner1 0 nsec >> test_lookup_update:PASS:inner2 0 nsec >> test_lookup_update:PASS:inner1 0 nsec >> test_loo

Re: [PATCH bpf-next v8 11/11] selftests: Remove fmod_ret from benchmarks and test_overhead

2020-09-24 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Wed, Sep 23, 2020 at 6:08 PM Alexei Starovoitov > wrote: >> >> On Tue, Sep 22, 2020 at 08:38:45PM +0200, Toke Høiland-Jørgensen wrote: >> > -const struct bench bench_trig_fmodret = { >> > - .name = "trig-fmodret", >> > - .validate = trigger_validate, >> > -

[PATCH net-next] net: tcp: drop unused function argument from mptcp_incoming_options

2020-09-24 Thread Florian Westphal
Since commit cfde141ea3faa30e ("mptcp: move option parsing into mptcp_incoming_options()"), the 3rd function argument is no longer used. Signed-off-by: Florian Westphal --- include/net/mptcp.h | 6 ++ net/ipv4/tcp_input.c | 4 ++-- net/mptcp/options.c | 3 +-- 3 files changed, 5 insertions

Re: [PATCH net-next v3 1/2] net: mscc: ocelot: Add support for tcam

2020-09-24 Thread Vladimir Oltean
Hi Horatiu, On Thu, Apr 23, 2020 at 10:29:48AM +0200, Horatiu Vultur wrote: > > > +static const struct vcap_props vcap_is2 = { > > > + .name = "IS2", > > > + .tg_width = 2, > > > + .sw_count = 4, > > > + .entry_count = VCAP_IS2_CNT, > > > + .entry_words = BITS_TO_32BI

Re: [PATCH v2 4/4] PCI: Limit pci_alloc_irq_vectors as per housekeeping CPUs

2020-09-24 Thread Nitesh Narayan Lal
On 9/24/20 6:59 PM, Bjorn Helgaas wrote: > On Thu, Sep 24, 2020 at 05:39:07PM -0400, Nitesh Narayan Lal wrote: >> On 9/24/20 4:45 PM, Bjorn Helgaas wrote: >>> Possible subject: >>> >>> PCI: Limit pci_alloc_irq_vectors() to housekeeping CPUs >> Will switch to this. >> >>> On Wed, Sep 23, 2020 at

Re: [PATCH net-next] net: vlan: Avoid using BUG() in vlan_proto_idx()

2020-09-24 Thread Jakub Kicinski
On Wed, 23 Sep 2020 21:16:27 -0700 Florian Fainelli wrote: > While we should always make sure that we specify a valid VLAN protocol > to vlan_proto_idx(), killing the machine when an invalid value is > specified is too harsh and not helpful for debugging. All callers are > capable of dealing with a

Re: [PATCH] net: usb: ax88179_178a: add Toshiba usb 3.0 adapter

2020-09-24 Thread Jakub Kicinski
On Thu, 24 Sep 2020 08:27:22 +0200 Wilken Gottwalt wrote: > Reposted and added netdev as suggested by Jakub Kicinski. Thanks! > --- If you want to add a comment like the above you need to place it under the '---' which git generates. Git removes everything after those lines. With the patch as po

Re: [PATCH net-next] net: vlan: Avoid using BUG() in vlan_proto_idx()

2020-09-24 Thread Florian Fainelli
On 9/24/2020 4:46 PM, Jakub Kicinski wrote: On Wed, 23 Sep 2020 21:16:27 -0700 Florian Fainelli wrote: While we should always make sure that we specify a valid VLAN protocol to vlan_proto_idx(), killing the machine when an invalid value is specified is too harsh and not helpful for debugging.

[PATCH v4 bpf-next 00/13] bpf: Enable bpf_skc_to_* sock casting helper to networking prog type

2020-09-24 Thread Martin KaFai Lau
This set allows networking prog type to directly read fields from the in-kernel socket type, e.g. "struct tcp_sock". Patch 2 has the details on the use case. v3: - Pass arg_btf_id instead of fn into check_reg_type() in Patch 1 (Lorenz) - Move arg_btf_id from func_proto to struct bpf_reg_types in

[PATCH v4 bpf-next 01/13] bpf: Move the PTR_TO_BTF_ID check to check_reg_type()

2020-09-24 Thread Martin KaFai Lau
check_reg_type() checks whether a reg can be used as an arg of a func_proto. For PTR_TO_BTF_ID, the check is actually not completely done until the reg->btf_id is pointing to a kernel struct that is acceptable by the func_proto. Thus, this patch moves the btf_id check into check_reg_type(). "arg_

[PATCH v4 bpf-next 03/13] bpf: Change bpf_sk_release and bpf_sk_*cgroup_id to accept ARG_PTR_TO_BTF_ID_SOCK_COMMON

2020-09-24 Thread Martin KaFai Lau
The previous patch allows the networking bpf prog to use the bpf_skc_to_*() helpers to get a PTR_TO_BTF_ID socket pointer, e.g. "struct tcp_sock *". It allows the bpf prog to read all the fields of the tcp_sock. This patch changes the bpf_sk_release() and bpf_sk_*cgroup_id() to take ARG_PTR_TO_BT

[PATCH v4 bpf-next 02/13] bpf: Enable bpf_skc_to_* sock casting helper to networking prog type

2020-09-24 Thread Martin KaFai Lau
There is a constant need to add more fields into the bpf_tcp_sock for the bpf programs running at tc, sock_ops...etc. A current workaround could be to use bpf_probe_read_kernel(). However, other than making another helper call for reading each field and missing CO-RE, it is also not as intuitive

[PATCH v4 bpf-next 04/13] bpf: Change bpf_sk_storage_*() to accept ARG_PTR_TO_BTF_ID_SOCK_COMMON

2020-09-24 Thread Martin KaFai Lau
This patch changes the bpf_sk_storage_*() to take ARG_PTR_TO_BTF_ID_SOCK_COMMON such that they will work with the pointer returned by the bpf_skc_to_*() helpers also. A micro benchmark has been done on a "cgroup_skb/egress" bpf program which does a bpf_sk_storage_get(). It was driven by netperf d

[PATCH v4 bpf-next 07/13] bpf: selftest: Add ref_tracking verifier test for bpf_skc casting

2020-09-24 Thread Martin KaFai Lau
The patch tests for: 1. bpf_sk_release() can be called on a tcp_sock btf_id ptr. 2. Ensure the tcp_sock btf_id pointer cannot be used after bpf_sk_release(). Signed-off-by: Martin KaFai Lau --- .../selftests/bpf/verifier/ref_tracking.c | 47 +++ 1 file changed, 47 inserti

[PATCH v4 bpf-next 11/13] bpf: selftest: Use bpf_skc_to_tcp_sock() in the sock_fields test

2020-09-24 Thread Martin KaFai Lau
This test uses bpf_skc_to_tcp_sock() to get a kernel tcp_sock ptr "ktp". Access the ktp->lsndtime and also pass ktp to bpf_sk_storage_get(). It also exercises the bpf_sk_cgroup_id() and bpf_sk_ancestor_cgroup_id() with the "ktp". To do that, a parent cgroup and a child cgroup are created. The bp

[PATCH v4 bpf-next 05/13] bpf: Change bpf_tcp_*_syncookie to accept ARG_PTR_TO_BTF_ID_SOCK_COMMON

2020-09-24 Thread Martin KaFai Lau
This patch changes the bpf_tcp_*_syncookie() to take ARG_PTR_TO_BTF_ID_SOCK_COMMON such that they will work with the pointer returned by the bpf_skc_to_*() helpers also. Acked-by: Lorenz Bauer Signed-off-by: Martin KaFai Lau --- include/uapi/linux/bpf.h | 4 ++-- net/core/filter.c

[PATCH v4 bpf-next 10/13] bpf: selftest: Use network_helpers in the sock_fields test

2020-09-24 Thread Martin KaFai Lau
This patch uses start_server() and connect_to_fd() from network_helpers.h to remove the network testing boiler plate codes. epoll is no longer needed also since the timeout has already been taken care of also. Signed-off-by: Martin KaFai Lau --- .../selftests/bpf/prog_tests/sock_fields.c| 8

[PATCH v4 bpf-next 12/13] bpf: selftest: Remove enum tcp_ca_state from bpf_tcp_helpers.h

2020-09-24 Thread Martin KaFai Lau
The enum tcp_ca_state is available in . Remove it from the bpf_tcp_helpers.h to avoid conflict when the bpf prog needs to include both both and bpf_tcp_helpers.h. Modify the bpf_cubic.c and bpf_dctcp.c to use instead. The is needed by . Signed-off-by: Martin KaFai Lau --- tools/testing/selft

[PATCH v4 bpf-next 08/13] bpf: selftest: Move sock_fields test into test_progs

2020-09-24 Thread Martin KaFai Lau
This is a mechanical change to 1. move test_sock_fields.c to prog_tests/sock_fields.c 2. rename progs/test_sock_fields_kern.c to progs/test_sock_fields.c Minimal change is made to the code itself. Next patch will make changes to use new ways of writing test, e.g. use skel and global variables. S

[PATCH v4 bpf-next 13/13] bpf: selftest: Add test_btf_skc_cls_ingress

2020-09-24 Thread Martin KaFai Lau
This patch attaches a classifier prog to the ingress filter. It exercises the following helpers with different socket pointer types in different logical branches: 1. bpf_sk_release() 2. bpf_sk_assign() 3. bpf_skc_to_tcp_request_sock(), bpf_skc_to_tcp_sock() 4. bpf_tcp_gen_syncookie, bpf_tcp_check_s

[PATCH v4 bpf-next 09/13] bpf: selftest: Adapt sock_fields test to use skel and global variables

2020-09-24 Thread Martin KaFai Lau
skel is used. Global variables are used to store the result from bpf prog. addr_map, sock_result_map, and tcp_sock_result_map are gone. Instead, global variables listen_tp, srv_sa6, cli_tp,, srv_tp, listen_sk, srv_sk, and cli_sk are added. Because of that, bpf_addr_array_idx and bpf_result_array_i

[PATCH v4 bpf-next 06/13] bpf: Change bpf_sk_assign to accept ARG_PTR_TO_BTF_ID_SOCK_COMMON

2020-09-24 Thread Martin KaFai Lau
This patch changes the bpf_sk_assign() to take ARG_PTR_TO_BTF_ID_SOCK_COMMON such that they will work with the pointer returned by the bpf_skc_to_*() helpers also. The bpf_sk_lookup_assign() is taking ARG_PTR_TO_SOCKET_"OR_NULL". Meaning it specifically takes a literal NULL. ARG_PTR_TO_BTF_ID_SO

Re: [MPTCP][PATCH net-next 01/16] mptcp: rename addr_signal and the related functions

2020-09-24 Thread Mat Martineau
On Thu, 24 Sep 2020, Geliang Tang wrote: This patch renamed addr_signal and the related functions with the explicit word "add". Suggested-by: Matthieu Baerts Suggested-by: Paolo Abeni Signed-off-by: Geliang Tang --- net/mptcp/options.c | 14 +++--- net/mptcp/pm.c | 12 ++---

Re: [MPTCP][PATCH net-next 02/16] mptcp: add the outgoing RM_ADDR support

2020-09-24 Thread Mat Martineau
On Thu, 24 Sep 2020, Geliang Tang wrote: This patch added a new signal named rm_addr_signal in PM. On outgoing path, we called mptcp_pm_should_rm_signal to check if rm_addr_signal has been set. If it has been, we sent out the RM_ADDR option. Suggested-by: Matthieu Baerts Suggested-by: Paolo Ab

Re: [MPTCP][PATCH net-next 03/16] mptcp: add the incoming RM_ADDR support

2020-09-24 Thread Mat Martineau
On Thu, 24 Sep 2020, Geliang Tang wrote: This patch added the RM_ADDR option parsing logic: We parsed the incoming options to find if the rm_addr option is received, and called mptcp_pm_rm_addr_received to schedule PM work to a new status, named MPTCP_PM_RM_ADDR_RECEIVED. PM work got this stat

Re: [MPTCP][PATCH net-next 08/16] mptcp: remove addr and subflow in PM netlink

2020-09-24 Thread Mat Martineau
On Thu, 24 Sep 2020, Geliang Tang wrote: This patch implements the remove announced addr and subflow logic in PM netlink. When the PM netlink removes an address, we traverse all the existing msk sockets to find the relevant sockets. We add a new list named anno_list in mptcp_pm_data, to record

Re: [MPTCP][PATCH net-next 10/16] mptcp: add RM_ADDR related mibs

2020-09-24 Thread Mat Martineau
On Thu, 24 Sep 2020, Geliang Tang wrote: This patch added two new mibs for RM_ADDR, named MPTCP_MIB_RMADDR and MPTCP_MIB_RMSUBFLOW, when the RM_ADDR suboption is received, increase the first mib counter, when the local subflow is removed, increase the second mib counter. Suggested-by: Matthieu

<    1   2   3   >