Re: auto-split of commit. Was: [PATCH bpf-next 04/10] tools/bpf: add libbpf_prog_type_(from|to)_str helpers

2019-08-28 Thread Greg Kroah-Hartman
On Wed, Aug 28, 2019 at 04:46:28PM -0700, Alexei Starovoitov wrote: > On Wed, Aug 28, 2019 at 04:34:22PM -0700, Jakub Kicinski wrote: > > > > Greg, Thomas, libbpf is extracted from the kernel sources and > > maintained in a clone repo on GitHub for ease of packaging. > > > > IIUC Alexei's concern

[PATCH bpf-next 03/13] bpf: refactor map_delete_elem()

2019-08-28 Thread Yonghong Song
Refactor function map_delete_elem() with a new helper bpf_map_delete_elem(), which will be used later for batched lookup_and_delete and delete operations. Signed-off-by: Yonghong Song --- kernel/bpf/syscall.c | 33 - 1 file changed, 20 insertions(+), 13 deletions(

[PATCH bpf-next 11/13] tools/bpf: add test for bpf_map_delete_batch()

2019-08-28 Thread Yonghong Song
Test bpf_map_delete_batch() functionality. $ ./test_maps ... test_map_delete_batch:PASS ... --- .../bpf/map_tests/map_delete_batch.c | 139 ++ 1 file changed, 139 insertions(+) create mode 100644 tools/testing/selftests/bpf/map_tests/map_delete_batch.c diff --git

[PATCH bpf-next 10/13] tools/bpf: add test for bpf_map_lookup_and_delete_batch()

2019-08-28 Thread Yonghong Song
Test bpf_map_lookup_and_delete_batch() functionality. $ ./test_maps ... test_map_lookup_and_delete_batch:PASS ... Signed-off-by: Yonghong Song --- .../map_tests/map_lookup_and_delete_batch.c | 164 ++ 1 file changed, 164 insertions(+) create mode 100644 tools/testing/

[PATCH bpf-next 08/13] tools/bpf: add test for bpf_map_update_batch()

2019-08-28 Thread Yonghong Song
Add tests for bpf_map_update_batch(). $ ./test_maps ... test_map_update_batch:PASS ... --- .../bpf/map_tests/map_update_batch.c | 115 ++ 1 file changed, 115 insertions(+) create mode 100644 tools/testing/selftests/bpf/map_tests/map_update_batch.c diff --git a/to

[PATCH bpf-next 12/13] tools/bpf: add a multithreaded test for map batch operations

2019-08-28 Thread Yonghong Song
A multithreaded test is added. Three threads repeatedly did: - batch update - batch lookup_and_delete - batch delete It is totally possible each batch element operation in kernel may find that the key, retrieved from bpf_map_get_next_key(), may fail lookup and/or delete as some other threads

[PATCH bpf-next 06/13] tools/bpf: sync uapi header bpf.h

2019-08-28 Thread Yonghong Song
sync uapi header include/uapi/linux/bpf.h to tools/include/uapi/linux/bpf.h. Signed-off-by: Yonghong Song --- tools/include/uapi/linux/bpf.h | 27 +++ 1 file changed, 27 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 5d2f

[PATCH bpf-next 04/13] bpf: refactor map_get_next_key()

2019-08-28 Thread Yonghong Song
Refactor function map_get_next_key() with a new helper bpf_map_get_next_key(), which will be used later for batched map lookup/lookup_and_delete/delete operations. Signed-off-by: Yonghong Song --- kernel/bpf/syscall.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-

[PATCH bpf-next 07/13] tools/bpf: implement libbpf API functions for map batch operations

2019-08-28 Thread Yonghong Song
Added four libbpf API functions to support map batch operations: . int bpf_map_delete_batch( ... ) . int bpf_map_lookup_batch( ... ) . int bpf_map_lookup_and_delete_batch( ... ) . int bpf_map_update_batch( ... ) Signed-off-by: Yonghong Song --- tools/lib/bpf/bpf.c | 67 +

[PATCH bpf-next 13/13] tools/bpf: measure map batching perf

2019-08-28 Thread Yonghong Song
The test program run result: $ ./test_maps ... measure_lookup: max_entries 100, batch 10, time 342 measure_lookup: max_entries 100, batch 1000, time 295 measure_lookup: max_entries 100, batch 100, time 270 measure_lookup: max_entries 100, no batching, time 1346 mea

[PATCH bpf-next 05/13] bpf: adding map batch processing support

2019-08-28 Thread Yonghong Song
Brian Vazquez has proposed BPF_MAP_DUMP command to look up more than one map entries per syscall. https://lore.kernel.org/bpf/cabcgpau3xxx6cmmxd+1knapivtc2jlbhysdxw-0e9bqel0q...@mail.gmail.com/T/#t During discussion, we found more use cases can be supported in a similar map operation batching f

[PATCH bpf-next 09/13] tools/bpf: add test for bpf_map_lookup_batch()

2019-08-28 Thread Yonghong Song
Test bpf_map_lookup_batch() functionality. $ ./test_maps ... test_map_lookup_batch:PASS ... Signed-off-by: Yonghong Song --- .../bpf/map_tests/map_lookup_batch.c | 166 ++ 1 file changed, 166 insertions(+) create mode 100644 tools/testing/selftests/bpf/map_tests

[PATCH bpf-next 00/13] bpf: adding map batch processing support

2019-08-28 Thread Yonghong Song
Brian Vazquez has proposed BPF_MAP_DUMP command to look up more than one map entries per syscall. https://lore.kernel.org/bpf/cabcgpau3xxx6cmmxd+1knapivtc2jlbhysdxw-0e9bqel0q...@mail.gmail.com/T/#t During discussion, we found more use cases can be supported in a similar map operation batching f

[PATCH bpf-next 02/13] bpf: refactor map_update_elem()

2019-08-28 Thread Yonghong Song
Refactor function map_update_elem() by creating a helper function bpf_map_update_elem() which will be used later by batched map update operation. Also reuse function bpf_map_value_size() in map_update_elem(). Signed-off-by: Yonghong Song --- kernel/bpf/syscall.c | 113 ++

[PATCH bpf-next 01/13] bpf: add bpf_map_value_size and bp_map_copy_value helper functions

2019-08-28 Thread Yonghong Song
From: Brian Vazquez Move reusable code from map_lookup_elem to helper functions to avoid code duplication in kernel/bpf/syscall.c Suggested-by: Stanislav Fomichev Signed-off-by: Brian Vazquez --- kernel/bpf/syscall.c | 134 +++ 1 file changed, 73 insert

Re: [PATCH net] netdevsim: Restore per-network namespace accounting for fib entries

2019-08-28 Thread Jiri Pirko
Wed, Aug 28, 2019 at 11:26:03PM CEST, dsah...@gmail.com wrote: >On 8/28/19 4:37 AM, Jiri Pirko wrote: >> Tue, Aug 06, 2019 at 09:15:17PM CEST, dsah...@kernel.org wrote: >>> From: David Ahern >>> >>> Prior to the commit in the fixes tag, the resource controller in netdevsim >>> tracked fib entries

Re: [PATCH v2 bpf-next 3/3] perf: implement CAP_TRACING

2019-08-28 Thread Song Liu
> On Aug 28, 2019, at 10:12 PM, Alexei Starovoitov wrote: > > Implement permissions as stated in uapi/linux/capability.h > > Similar to CAP_BPF it's highly unlikely that s/CAP_SYS_ADMIN/CAP_TRACING/ > replacement will cause user breakage. > > Signed-off-by: Alexei Starovoitov Acked-by: Son

Re: [PATCH v2 bpf-next 2/3] bpf: implement CAP_BPF

2019-08-28 Thread Song Liu
> On Aug 28, 2019, at 10:12 PM, Alexei Starovoitov wrote: > [...] > diff --git a/tools/testing/selftests/bpf/test_verifier.c > b/tools/testing/selftests/bpf/test_verifier.c > index 44e2d640b088..91a7f25512ca 100644 > --- a/tools/testing/selftests/bpf/test_verifier.c > +++ b/tools/testing/se

Re: [PATCH v2 bpf-next 1/3] capability: introduce CAP_BPF and CAP_TRACING

2019-08-28 Thread Song Liu
> On Aug 28, 2019, at 10:12 PM, Alexei Starovoitov wrote: > [...] > - Creation of [ku][ret]probe > - Accessing arbitrary kernel memory via kprobe + probe_kernel_read > - Attach tracing bpf programs to perf events > - Access to kallsyms > > Signed-off-by: Alexei Starovoitov Acked-by: Song L

[PATCH v4 1/1] ixgbe: sync the first fragment unconditionally

2019-08-28 Thread Firo Yang
In Xen environment, if Xen-swiotlb is enabled, ixgbe driver could possibly allocate a page, DMA memory buffer, for the first fragment which is not suitable for Xen-swiotlb to do DMA operations. Xen-swiotlb have to internally allocate another page for doing DMA operations. This mechanism requires sy

Re: [patch net-next rfc 3/7] net: rtnetlink: add commands to add and delete alternative ifnames

2019-08-28 Thread Michal Kubecek
On Wed, Aug 28, 2019 at 09:36:41PM -0700, Roopa Prabhu wrote: > > yes, correct. I mentioned that because I was wondering if we can > think along the same lines for this API. > eg > (a) RTM_NEWLINK always replaces the list attribute > (b) RTM_SETLINK with NLM_F_APPEND always appends to the list at

[PATCH v2 bpf-next 1/3] capability: introduce CAP_BPF and CAP_TRACING

2019-08-28 Thread Alexei Starovoitov
CAP_BPF allows the following BPF operations: - Loading all types of BPF programs - Creating all types of BPF maps except: - stackmap that needs CAP_TRACING - devmap that needs CAP_NET_ADMIN - cpumap that needs CAP_SYS_ADMIN - Advanced verifier features - Indirect variable access - Boun

[PATCH v2 bpf-next 3/3] perf: implement CAP_TRACING

2019-08-28 Thread Alexei Starovoitov
Implement permissions as stated in uapi/linux/capability.h Similar to CAP_BPF it's highly unlikely that s/CAP_SYS_ADMIN/CAP_TRACING/ replacement will cause user breakage. Signed-off-by: Alexei Starovoitov --- arch/powerpc/perf/core-book3s.c | 4 ++-- arch/x86/events/intel/bts.c | 2 +- ar

Re: [PATCH net-next] net: dsa: mv88e6xxx: fix freeing unused SERDES IRQ

2019-08-28 Thread Marek Behun
On Wed, 28 Aug 2019 14:55:11 -0400 Vivien Didelot wrote: > Now mv88e6xxx does not enable its ports at setup itself and let > the DSA core handle this, unused ports are disabled without being > powered on first. While that is expected, the SERDES powering code > was assuming that a port was alread

Re: [patch net-next rfc 3/7] net: rtnetlink: add commands to add and delete alternative ifnames

2019-08-28 Thread Roopa Prabhu
On Wed, Aug 28, 2019 at 12:07 AM Jiri Pirko wrote: > > Tue, Aug 27, 2019 at 05:14:49PM CEST, ro...@cumulusnetworks.com wrote: > >On Tue, Aug 27, 2019 at 2:35 AM Jiri Pirko wrote: > >> > >> Tue, Aug 27, 2019 at 10:22:42AM CEST, da...@davemloft.net wrote: > >> >From: Jiri Pirko > >> >Date: Tue, 27

Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

2019-08-28 Thread Alexei Starovoitov
On Wed, Aug 28, 2019 at 05:45:47PM -0700, Andy Lutomirski wrote: > > > >> It seems like you are specifically trying to add a new switch to turn > >> as much of BPF as possible on and off. Why? > > > > Didn't I explain it several times already with multiple examples > > from systemd, daemons, bpf

Re: [PATCH net-next 0/4] mlxsw: Various updates

2019-08-28 Thread David Miller
From: Ido Schimmel Date: Wed, 28 Aug 2019 18:54:33 +0300 > From: Ido Schimmel > > Patch #1 from Amit removes 56G speed support. The reasons for this are > detailed in the commit message. > > Patch #2 from Shalom ensures that the hardware does not auto negotiate > the number of used lanes. For

Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

2019-08-28 Thread Andy Lutomirski
> On Aug 28, 2019, at 4:38 PM, Alexei Starovoitov > wrote: > >> On Tue, Aug 27, 2019 at 11:20:19PM -0700, Andy Lutomirski wrote: >> On Tue, Aug 27, 2019 at 9:49 PM Alexei Starovoitov >> wrote: >>> On Tue, Aug 27, 2019 at 07:00:40PM -0700, Andy Lutomirski wrote: Let me put th

Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

2019-08-28 Thread Andy Lutomirski
> On Aug 28, 2019, at 5:45 PM, Andy Lutomirski wrote: > > >>> On Aug 28, 2019, at 3:55 PM, Alexei Starovoitov >>> wrote: >>> >>> On Tue, Aug 27, 2019 at 11:12:29PM -0700, Andy Lutomirski wrote: > > > From the previous discussion, you want to make progress toward solving >

Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

2019-08-28 Thread Andy Lutomirski
> On Aug 28, 2019, at 3:55 PM, Alexei Starovoitov > wrote: > >> On Tue, Aug 27, 2019 at 11:12:29PM -0700, Andy Lutomirski wrote: From the previous discussion, you want to make progress toward solving a lot of problems with CAP_BPF. One of them was making BPF firewal

Re: [PATCH net-next v2 6/9] r8169: don't use bit LastFrag in tx descriptor after send

2019-08-28 Thread Jakub Kicinski
On Wed, 28 Aug 2019 22:27:30 +0200, Heiner Kallweit wrote: > On RTL8125 this bit is always cleared after send. Therefore check for > tx_skb->skb being set what is functionally equivalent. > > Signed-off-by: Heiner Kallweit > --- > drivers/net/ethernet/realtek/r8169_main.c | 2 +- > 1 file change

Re: [pull request][net-next v2 0/8] Mellanox, mlx5 updates 2019-08-22

2019-08-28 Thread Jakub Kicinski
On Wed, 28 Aug 2019 18:57:39 +, Saeed Mahameed wrote: > This series provides some misc updates to mlx5 driver. > For more information please see tag log below. > > Please pull and let me know if there is any problem. > > Please note that the series starts with a merge of mlx5-next branch, > t

Re: [PATCH V3 net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments

2019-08-28 Thread Gregory Rose
On 8/28/2019 2:54 PM, David Miller wrote: From: Greg Rose Date: Tue, 27 Aug 2019 07:58:09 -0700 When IP fragments are reassembled before being sent to conntrack, the key from the last fragment is used. Unless there are reordering issues, the last fragment received will not contain the L4 port

auto-split of commit. Was: [PATCH bpf-next 04/10] tools/bpf: add libbpf_prog_type_(from|to)_str helpers

2019-08-28 Thread Alexei Starovoitov
On Wed, Aug 28, 2019 at 04:34:22PM -0700, Jakub Kicinski wrote: > > Greg, Thomas, libbpf is extracted from the kernel sources and > maintained in a clone repo on GitHub for ease of packaging. > > IIUC Alexei's concern is that since we are moving the commits from > the kernel repo to the GitHub on

Re: [PATCH net-next 0/4] mlxsw: Various updates

2019-08-28 Thread Jakub Kicinski
On Wed, 28 Aug 2019 18:54:33 +0300, Ido Schimmel wrote: > From: Ido Schimmel > > Patch #1 from Amit removes 56G speed support. The reasons for this are > detailed in the commit message. > > Patch #2 from Shalom ensures that the hardware does not auto negotiate > the number of used lanes. For exa

Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

2019-08-28 Thread Alexei Starovoitov
On Tue, Aug 27, 2019 at 11:20:19PM -0700, Andy Lutomirski wrote: > On Tue, Aug 27, 2019 at 9:49 PM Alexei Starovoitov > wrote: > > > > On Tue, Aug 27, 2019 at 07:00:40PM -0700, Andy Lutomirski wrote: > > > > > > Let me put this a bit differently. Part of the point is that > > > CAP_TRACING should

Re: [PATCH bpf-next 04/10] tools/bpf: add libbpf_prog_type_(from|to)_str helpers

2019-08-28 Thread Jakub Kicinski
On Wed, 28 Aug 2019 14:03:07 -0700, Julia Kartseva wrote: > Standardize string representation of prog types by putting commonly used > names to libbpf. > The prog_type to string mapping is taken from bpftool: > tools/bpf/bpftool/main.h > > Signed-off-by: Julia Kartseva This "libbpf patches have

Re: [PATCH net-next] net: phy: force phy suspend when calling phy_stop

2019-08-28 Thread David Miller
From: Jian Shen Date: Wed, 28 Aug 2019 09:34:47 +0800 > Some ethernet drivers may call phy_start() and phy_stop() from > ndo_open() and ndo_close() respectively. > > When network cable is unconnected, and operate like below: > step 1: ifconfig ethX up -> ndo_open -> phy_start ->start > autoneg,

Re: [PATCH net 0/2] nfp: flower: fix bugs in merge tunnel encap code

2019-08-28 Thread David Miller
From: Jakub Kicinski Date: Tue, 27 Aug 2019 22:56:28 -0700 > John says: > > There are few bugs in the merge encap code that have come to light with > recent driver changes. Effectively, flow bind callbacks were being > registered twice when using internal ports (new 'busy' code triggers > this).

Re: [PATCH net] net/sched: pfifo_fast: fix wrong dereference in pfifo_fast_enqueue

2019-08-28 Thread David Miller
From: Davide Caratti Date: Tue, 27 Aug 2019 23:18:53 +0200 > Now that 'TCQ_F_CPUSTATS' bit can be cleared, depending on the value of > 'TCQ_F_NOLOCK' bit in the parent qdisc, we can't assume anymore that > per-cpu counters are there in the error path of skb_array_produce(). > Otherwise, the follo

Re: [PATCH net-next 05/15] net: sgi: ioc3-eth: allocate space for desc rings only once

2019-08-28 Thread Jakub Kicinski
On Wed, 28 Aug 2019 16:03:04 +0200, Thomas Bogendoerfer wrote: > Memory for descriptor rings are allocated/freed, when interface is > brought up/down. Since the size of the rings is not changeable by > hardware, we now allocate rings now during probe and free it, when > device is removed. > > Sign

Re: [PATCH net] tcp: inherit timestamp on mtu probe

2019-08-28 Thread David Miller
From: Willem de Bruijn Date: Tue, 27 Aug 2019 15:09:33 -0400 > From: Willem de Bruijn > > TCP associates tx timestamp requests with a byte in the bytestream. > If merging skbs in tcp_mtu_probe, migrate the tstamp request. > > Similar to MSG_EOR, do not allow moving a timestamp from any segment

Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

2019-08-28 Thread Alexei Starovoitov
On Tue, Aug 27, 2019 at 11:12:29PM -0700, Andy Lutomirski wrote: > > > > > > > > From the previous discussion, you want to make progress toward solving > > > a lot of problems with CAP_BPF. One of them was making BPF > > > firewalling more generally useful. By making CAP_BPF grant the ability > >

Re: [PATCH net] net: sched: act_sample: fix psample group handling on overwrite

2019-08-28 Thread David Miller
From: Vlad Buslov Date: Tue, 27 Aug 2019 21:49:38 +0300 > Action sample doesn't properly handle psample_group pointer in overwrite > case. Following issues need to be fixed: > > - In tcf_sample_init() function RCU_INIT_POINTER() is used to set > s->psample_group, even though we neither setting

Re: [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2019-08-26

2019-08-28 Thread David Miller
From: Jeff Kirsher Date: Tue, 27 Aug 2019 09:38:17 -0700 > This series contains updates to ice driver only. Pulled, but I have to agree with Jakub that using CPP ifdefs to control the "static"'ness of a function is pushing the boundaries of good taste at best.

Re: [net-next 13/15] ixgbe: sync the first fragment unconditionally

2019-08-28 Thread Jakub Kicinski
On Tue, 27 Aug 2019 23:44:05 -0700, Jeff Kirsher wrote: > Fixes: f3213d932173 ("ixgbe: Update driver to make use of DMA > attributes in Rx path") wrapped tag

Re: [net-next 11/15] i40e: Implement debug macro hw_dbg using pr_debug

2019-08-28 Thread Jakub Kicinski
On Tue, 27 Aug 2019 23:44:03 -0700, Jeff Kirsher wrote: > diff --git a/drivers/net/ethernet/intel/i40e/i40e_osdep.h > b/drivers/net/ethernet/intel/i40e/i40e_osdep.h > index a07574bff550..c0c9ce3eab23 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_osdep.h > +++ b/drivers/net/ethernet/intel/i40

Re: [net-next 10/15] i40e: fix hw_dbg usage in i40e_hmc_get_object_va

2019-08-28 Thread Jakub Kicinski
On Tue, 27 Aug 2019 23:44:02 -0700, Jeff Kirsher wrote: > @@ -982,6 +983,7 @@ i40e_status i40e_hmc_get_object_va(struct i40e_hmc_info > *hmc_info, > struct i40e_hmc_sd_entry *sd_entry; > struct i40e_hmc_pd_entry *pd_entry; > u32 pd_idx, pd_lmt, rel_pd_idx; > + struct i40e_hmc

Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

2019-08-28 Thread Alexei Starovoitov
On Wed, Aug 28, 2019 at 09:14:21AM +0200, Peter Zijlstra wrote: > On Tue, Aug 27, 2019 at 04:01:08PM -0700, Andy Lutomirski wrote: > > > > Tracing: > > > > > > CAP_BPF and perf_paranoid_tracepoint_raw() (which is > > > kernel.perf_event_paranoid == -1) > > > are necessary to: > > That's not trac

Re: [PATCH V3 net 1/2] openvswitch: Properly set L4 keys on "later" IP fragments

2019-08-28 Thread David Miller
From: Greg Rose Date: Tue, 27 Aug 2019 07:58:09 -0700 > When IP fragments are reassembled before being sent to conntrack, the > key from the last fragment is used. Unless there are reordering > issues, the last fragment received will not contain the L4 ports, so the > key for the reassembled dat

Re: [PATCH V3 net 2/2] openvswitch: Clear the L4 portion of the key for "later" fragments.

2019-08-28 Thread David Miller
From: Greg Rose Date: Tue, 27 Aug 2019 07:58:10 -0700 > From: Justin Pettit > > Only the first fragment in a datagram contains the L4 headers. When the > Open vSwitch module parses a packet, it always sets the IP protocol > field in the key, but can only set the L4 fields on the first fragment

Re: [PATCH net] mld: fix memory leak in mld_del_delrec()

2019-08-28 Thread David Miller
From: Eric Dumazet Date: Tue, 27 Aug 2019 03:33:12 -0700 > Similar to the fix done for IPv4 in commit e5b1c6c6277d > ("igmp: fix memory leak in igmpv3_del_delrec()"), we need to > make sure mca_tomb and mca_sources are not blindly overwritten. > > Using swap() then a call to ip6_mc_clear_src() w

Re: [PATCH net v2] net/sched: pfifo_fast: fix wrong dereference when qdisc is reset

2019-08-28 Thread David Miller
From: Davide Caratti Date: Tue, 27 Aug 2019 12:29:09 +0200 > Now that 'TCQ_F_CPUSTATS' bit can be cleared, depending on the value of > 'TCQ_F_NOLOCK' bit in the parent qdisc, we need to be sure that per-cpu > counters are present when 'reset()' is called for pfifo_fast qdiscs. > Otherwise, the fo

Re: [PATCH net-next] ipv6: shrink struct ipv6_mc_socklist

2019-08-28 Thread David Miller
From: Eric Dumazet Date: Tue, 27 Aug 2019 00:08:12 -0700 > Remove two holes on 64bit arches, to bring the size > to one cache line exactly. > > Signed-off-by: Eric Dumazet Applied.

Re: [PATCH bpf-next 01/10] bpf: introduce __MAX_BPF_PROG_TYPE and __MAX_BPF_MAP_TYPE enum values

2019-08-28 Thread Alexei Starovoitov
On Wed, Aug 28, 2019 at 02:03:04PM -0700, Julia Kartseva wrote: > Similar to __MAX_BPF_ATTACH_TYPE identifying the number of elements in > bpf_attach_type enum, add tailing enum values __MAX_BPF_PROG_TYPE > and __MAX_BPF_MAP_TYPE to simplify e.g. iteration over enums values in > the case when new v

Re: [PATCH net] netdevsim: Restore per-network namespace accounting for fib entries

2019-08-28 Thread David Ahern
On 8/28/19 4:37 AM, Jiri Pirko wrote: > Tue, Aug 06, 2019 at 09:15:17PM CEST, dsah...@kernel.org wrote: >> From: David Ahern >> >> Prior to the commit in the fixes tag, the resource controller in netdevsim >> tracked fib entries and rules per network namespace. Restore that behavior. > > David, p

Re: [PATCH bpf-next 03/10] tools/bpf: handle __MAX_BPF_(PROG|MAP)_TYPE in switch statements

2019-08-28 Thread Arnaldo Carvalho de Melo
Em Wed, Aug 28, 2019 at 02:03:06PM -0700, Julia Kartseva escreveu: > Add cases to switch statements in probe_load, bpf_prog_type__needs_kver > bpf_probe_map_type to fix enumeration value not handled in switch > compilation error. > prog_type_name array in bpftool/main.h doesn't have __MAX_BPF_PROG_

[PATCH bpf-next 09/10] tools/bpftool: use libbpf_(prog|map)_type_to_str helpers

2019-08-28 Thread Julia Kartseva
Replace lookup in (prog|map)_type_name arrays with libbpf_(prog|map)_type_to_str helpers. Use __MAX_BPF_(PROG|MAP)_TYPE enum values as loop bounds. Signed-off-by: Julia Kartseva --- tools/bpf/bpftool/feature.c | 47 ++ tools/bpf/bpftool/main.h| 33 --- tools/b

[PATCH bpf-next 06/10] tools/bpf: add libbpf_attach_type_(from|to)_str

2019-08-28 Thread Julia Kartseva
Standardize string representation of attach types by putting commonly used names to libbpf. The attach_type to string mapping is taken from bpftool: tools/bpf/bpftool/cgroup.c tools/bpf/bpftool/prog.c Signed-off-by: Julia Kartseva --- tools/lib/bpf/libbpf.c | 50 +++

[PATCH bpf-next 05/10] tools/bpf: add libbpf_map_type_(from|to)_str helpers

2019-08-28 Thread Julia Kartseva
Similar to prog_type to string mapping, standardize string representation of map types by putting commonly used names to libbpf. The map_type to string mapping is taken from bpftool: tools/bpf/bpftool/map.c Signed-off-by: Julia Kartseva --- tools/lib/bpf/libbpf.c | 51 +

[PATCH bpf-next 04/10] tools/bpf: add libbpf_prog_type_(from|to)_str helpers

2019-08-28 Thread Julia Kartseva
Standardize string representation of prog types by putting commonly used names to libbpf. The prog_type to string mapping is taken from bpftool: tools/bpf/bpftool/main.h Signed-off-by: Julia Kartseva --- tools/lib/bpf/libbpf.c | 51 tools/lib/bpf/libbpf

[PATCH bpf-next 00/10] bpf: bpf_(prog|map|attach)_type_(from|to)_str helpers

2019-08-28 Thread Julia Kartseva
Standardize commonly used bpf enum names by introducing helper methods to libbpf. When applications require enum to string mapping the related code is copy-pasted from bpftool. It hardens maintenance, e.g. when new enum values are added. Patches 0001-0003 introduce __MAX_BPF_PROG_TYPE and __MAX_BP

[PATCH bpf-next 02/10] tools/bpf: sync bpf.h to tools/

2019-08-28 Thread Julia Kartseva
Introduce __MAX_BPF_MAP_TYPE and __MAX_BPF_MAP_TYPE enum values. Signed-off-by: Julia Kartseva --- tools/include/uapi/linux/bpf.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 5d2fb183ee2d..9b681bb82211 100644 ---

[PATCH bpf-next 03/10] tools/bpf: handle __MAX_BPF_(PROG|MAP)_TYPE in switch statements

2019-08-28 Thread Julia Kartseva
Add cases to switch statements in probe_load, bpf_prog_type__needs_kver bpf_probe_map_type to fix enumeration value not handled in switch compilation error. prog_type_name array in bpftool/main.h doesn't have __MAX_BPF_PROG_TYPE entity, same for map, so probe won't be called. Signed-off-by: Julia

[PATCH bpf-next 08/10] selftests/bpf: rename test_section_names to test_section_and_type_names

2019-08-28 Thread Julia Kartseva
Change the test name after extending it with enum stringification helpers. Signed-off-by: Julia Kartseva --- tools/testing/selftests/bpf/Makefile | 2 +- .../bpf/test_section_and_type_names.c | 378 ++ .../selftests/bpf/test_section_names.c| 378 ---

[PATCH bpf-next 10/10] tools/bpftool: use libbpf_attach_type_to_str helper

2019-08-28 Thread Julia Kartseva
Replace lookup in `attach_type_strings` with libbpf_attach_type_to_str helper for cgroup (cgroup.c) and non-cgroup (prog.c) attach types. Signed-off-by: Julia Kartseva --- tools/bpf/bpftool/cgroup.c | 60 +- tools/bpf/bpftool/prog.c | 20 +++-- 2 fil

[PATCH bpf-next 07/10] selftests/bpf: extend test_section_names with type_(from|to)_str

2019-08-28 Thread Julia Kartseva
Test bpf enum stringification helpers: libbpf_(prog|map|attach)_type_(from|to)_str Signed-off-by: Julia Kartseva --- .../selftests/bpf/test_section_names.c| 149 +- 1 file changed, 147 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/test_section_na

Re: [PATCH bpf-next V9 1/3] bpf: new helper to obtain namespace data from current task

2019-08-28 Thread Carlos Antonio Neira Bustos
Thanks, I'll work on the net/netif_receive_skb selftest using this helper. I hope I could complete this work this week. Bests. On Wed, Aug 28, 2019 at 08:53:25PM +, Yonghong Song wrote: > > > On 8/28/19 1:39 PM, Carlos Antonio Neira Bustos wrote: > > Yonghong, > > > > Thanks for the pointe

[PATCH bpf-next 01/10] bpf: introduce __MAX_BPF_PROG_TYPE and __MAX_BPF_MAP_TYPE enum values

2019-08-28 Thread Julia Kartseva
Similar to __MAX_BPF_ATTACH_TYPE identifying the number of elements in bpf_attach_type enum, add tailing enum values __MAX_BPF_PROG_TYPE and __MAX_BPF_MAP_TYPE to simplify e.g. iteration over enums values in the case when new values are added. Signed-off-by: Julia Kartseva --- include/uapi/linux

Re: [PATCH bpf-next V9 1/3] bpf: new helper to obtain namespace data from current task

2019-08-28 Thread Yonghong Song
On 8/28/19 1:39 PM, Carlos Antonio Neira Bustos wrote: > Yonghong, > > Thanks for the pointer, I fixed this bug, but I found another one that's > triggered > now the test program I included in tools/testing/selftests/bpf/test_pidns. > It's seemed that fname was not correctly setup when passing

[PATCH 3/3] samples: pktgen: allow to specify destination IP range (CIDR)

2019-08-28 Thread Daniel T. Lee
Currently, kernel pktgen has the feature to specify destination address range for sending packet. (e.g. pgset "dst_min/dst_max") But on samples, each of them doesn't have any option to achieve this. The commit adds feature to specify destination address range with CIDR. -d : ($DEST_IP) des

[PATCH 1/3] samples: pktgen: make variable consistent with option

2019-08-28 Thread Daniel T. Lee
This commit changes variable names that can cause confusion. For example, variable DST_MIN is quite confusing since the keyword 'udp_dst_min' and keyword 'dst_min' is used with pg_ctrl. On the following commit, 'dst_min' will be used to set destination IP, and the existing variable name DST_MIN s

[PATCH 2/3] samples: pktgen: add helper functions for IP(v4/v6) CIDR parsing

2019-08-28 Thread Daniel T. Lee
This commit adds CIDR parsing and IP validate helper function to parse single IP or range of IP with CIDR. (e.g. 198.18.0.0/15) Helpers will be used in prior to set target address in samples/pktgen. Signed-off-by: Daniel T. Lee --- samples/pktgen/functions.sh | 134 +

Re: [RFC bpf-next 0/5] Convert iproute2 to use libbpf (WIP)

2019-08-28 Thread Andrii Nakryiko
On Fri, Aug 23, 2019 at 4:29 AM Toke Høiland-Jørgensen wrote: > > [ ... snip ...] > > > E.g., today's API is essentially three steps: > > > > 1. open and parse ELF: collect relos, programs, map definitions > > 2. load: create maps from collected defs, do program/global data/CO-RE > > relocs, load

Re: [PATCH bpf-next V9 1/3] bpf: new helper to obtain namespace data from current task

2019-08-28 Thread Carlos Antonio Neira Bustos
Yonghong, Thanks for the pointer, I fixed this bug, but I found another one that's triggered now the test program I included in tools/testing/selftests/bpf/test_pidns. It's seemed that fname was not correctly setup when passing it to filename_lookup. This is fixed now and I'm doing some more t

[PATCH net-next v2 4/9] r8169: move disabling interrupt coalescing to RTL8169/RTL8168 init

2019-08-28 Thread Heiner Kallweit
RTL8125 doesn't support the same coalescing registers, therefore move this initialization to the 8168/6169-specific init. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/

[PATCH net-next v2 7/9] r8169: add support for RTL8125

2019-08-28 Thread Heiner Kallweit
This adds support for 2.5Gbps chip RTL8125, it's partially based on the r8125 vendor driver. Tested with a Delock 89531 PCIe card against a Netgear GS110MX Multi-Gig switch. Firmware isn't strictly needed, but on some systems there may be compatibility issues w/o firmware. Firmware has been submitt

[PATCH net-next v2 9/9] r8169: add support for EEE on RTL8125

2019-08-28 Thread Heiner Kallweit
This adds EEE support for RTL8125 based on the vendor driver. Supported is EEE for 100Mbps and 1Gbps. Realtek recommended to not yet enable EEE for 2.5Gbps due to potential compatibility issues. Also ethtool doesn't support yet controlling EEE for 2.5Gbps and 5Gbps. Signed-off-by: Heiner Kallweit

[PATCH net-next v2 3/9] r8169: factor out reading MAC address from registers

2019-08-28 Thread Heiner Kallweit
For RTL8125 we will have to read the MAC address also from another register range, therefore create a small helper. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet

[PATCH net-next v2 8/9] r8169: add RTL8125 PHY initialization

2019-08-28 Thread Heiner Kallweit
This patch adds PHY initialization magic copied from the r8125 vendor driver. In addition it supports loading the firmware for chip version RTL_GIGA_MAC_VER_61. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 130 +- 1 file changed, 127 insertio

[PATCH net-next v2 1/9] r8169: change interrupt mask type to u32

2019-08-28 Thread Heiner Kallweit
RTL8125 uses a 32 bit interrupt mask even though only bits in the lower 16 bits are used. Change interrupt mask size to u32 to be prepared and reintroduce helper rtl_get_events. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 16 +++- 1 file changed, 11

[PATCH net-next v2 2/9] r8169: restrict rtl_is_8168evl_up to RTL8168 chip versions

2019-08-28 Thread Heiner Kallweit
Extend helper rtl_is_8168evl_up to properly work once we add mac version numbers >51 for RTL8125. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/driver

[PATCH net-next v2 5/9] r8169: read common register for PCI commit

2019-08-28 Thread Heiner Kallweit
RTL8125 uses a different register number for IntrMask. To net have side effects by reading a random register let's use a register that is the same on all supported chip families. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH net-next v2 6/9] r8169: don't use bit LastFrag in tx descriptor after send

2019-08-28 Thread Heiner Kallweit
On RTL8125 this bit is always cleared after send. Therefore check for tx_skb->skb being set what is functionally equivalent. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realt

Re: [RFC bpf-next 0/5] Convert iproute2 to use libbpf (WIP)

2019-08-28 Thread Andrii Nakryiko
On Fri, Aug 23, 2019 at 3:27 AM Jesper Dangaard Brouer wrote: > > On Wed, 21 Aug 2019 13:30:09 -0700 > Andrii Nakryiko wrote: > > > On Tue, Aug 20, 2019 at 4:47 AM Toke Høiland-Jørgensen > > wrote: > > > > > > iproute2 uses its own bpf loader to load eBPF programs, which has > > > evolved separ

[PATCH net-next v2 0/9] r8169: add support for RTL8125

2019-08-28 Thread Heiner Kallweit
This series adds support for the 2.5Gbps chip RTl8125. It can be found on PCIe network cards, and on an increasing number of consumer gaming mainboards. Series is partially based on the r8125 vendor driver. Tested with a Delock 89531 PCIe card against a Netgear GS110MX Multi-Gig switch. Firmware is

Re: [PATCH net-next v2 3/3] dpaa2-eth: Add pause frame support

2019-08-28 Thread David Miller
From: Andrew Lunn Date: Wed, 28 Aug 2019 13:52:50 +0200 >> Clearing the ASYM_PAUSE flag only means we tell the firmware we want >> both Rx and Tx pause to be enabled in the beginning. User can still set >> an asymmetric config (i.e. only Rx pause or only Tx pause to be enabled) >> if needed. >>

Re: [PATCH net-next v4 3/3] dt-bindings: net: ethernet: Update mt7622 docs and dts to reflect the new phylink API

2019-08-28 Thread David Miller
From: Matthias Brugger Date: Wed, 28 Aug 2019 11:29:45 +0200 > Thanks for taking this patch. For the next time, please make sure that dts[i] > patches are independent from the binding description, as dts[i] should go > through my tree. No problem for this round, just saying for the future. That'

Re: [bpf-next] bpf: fix error check in bpf_tcp_gen_syncookie

2019-08-28 Thread Song Liu
On Tue, Aug 27, 2019 at 4:46 PM Petar Penkov wrote: > > From: Petar Penkov > > If a SYN cookie is not issued by tcp_v#_gen_syncookie, then the return > value will be exactly 0, rather than <= 0. Let's change the check to > reflect that, especially since mss is an unsigned value and cannot be > ne

[net-next v2 7/8] net/mlx5e: Improve stateless offload capability check

2019-08-28 Thread Saeed Mahameed
From: Marina Varshaver Use generic function for checking tunnel stateless offload capability instead of separate macros. Signed-off-by: Marina Varshaver Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/fs.h | 3 +++ drivers/net/ethernet/me

[net-next v2 8/8] net/mlx5e: Support TSO and TX checksum offloads for IP-in-IP tunnels

2019-08-28 Thread Saeed Mahameed
From: Marina Varshaver Add TX offloads support for IP-in-IP tunneled packets by reporting the needed netdev features. Signed-off-by: Marina Varshaver Signed-off-by: Avihu Hagag Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 11 ++

[net-next v2 3/8] net/mlx5e: Support LAG TX port affinity distribution

2019-08-28 Thread Saeed Mahameed
From: Maxim Mikityanskiy When the VF LAG is in use, round-robin the TX affinity of channels among the different ports, if supported by the firmware. Create a set of TISes per port, while doing round-robin of the channels over the different sets. Let all SQs of a channel share the same set of TISe

[net-next v2 4/8] net/mlx5e: Add device out of buffer counter

2019-08-28 Thread Saeed Mahameed
From: Moshe Shemesh Added the following packets drop counter: Device out of buffer - counts packets which were dropped due to full device internal receive queue. This counter will be shown on ethtool as a new counter called dev_out_of_buffer. The counter is read from FW by command QUERY_VNIC_ENV.

[net-next v2 5/8] net/mlx5e: Change function's position to a more fitting file

2019-08-28 Thread Saeed Mahameed
From: Aya Levin Move function which indicates whether tunnel inner flow table is supported from en.h to en_fs.c. It fits better right after tunnel protocol rules definitions. Signed-off-by: Aya Levin Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/ml

[net-next v2 6/8] net/mlx5e: Support RSS for IP-in-IP and IPv6 tunneled packets

2019-08-28 Thread Saeed Mahameed
From: Aya Levin Add support for inner header RSS on IP-in-IP and IPv6 tunneled packets. Add rules to the steering table regarding outer IP header, with IPv4/6->IP-in-IP. Tunneled packets with protocol numbers: 0x4 (IP-in-IP) and 0x29 (IPv6) are RSS-ed on the inner IP header. Separate FW dependen

[pull request][net-next v2 0/8] Mellanox, mlx5 updates 2019-08-22

2019-08-28 Thread Saeed Mahameed
This series provides some misc updates to mlx5 driver. For more information please see tag log below. Please pull and let me know if there is any problem. Please note that the series starts with a merge of mlx5-next branch, to resolve and avoid dependency with rdma tree. v2: - Change statistic

[net-next v2 2/8] net/mlx5e: Expose new function for TIS destroy loop

2019-08-28 Thread Saeed Mahameed
From: Tariq Toukan For better modularity and code sharing. Function internal change to be introduced in the next patches. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 + drivers/net/ethernet/mellanox/mlx5/core/en_main.c |

[net-next v2 1/8] net/mlx5e: ethtool, Fix a typo in WOL function names

2019-08-28 Thread Saeed Mahameed
From: Erez Alfasi Fix a typo in 'mlx5e_refomrat_wol_mode_mlx5_to_linux' and 'mlx5e_refomrat_wol_mode_linux_to_mlx5' function names: "refomrat" -> "reformat". Fixes: 928cfe8745a6 ("net/mlx5e: Wake On LAN support") Signed-off-by: Erez Alfasi Signed-off-by: Saeed Mahameed --- drivers/net/etherne

[PATCH net-next] net: dsa: mv88e6xxx: fix freeing unused SERDES IRQ

2019-08-28 Thread Vivien Didelot
Now mv88e6xxx does not enable its ports at setup itself and let the DSA core handle this, unused ports are disabled without being powered on first. While that is expected, the SERDES powering code was assuming that a port was already set up before powering it down, resulting in freeing an unused IR

Re: [PATCH] igb: add rx drop enable attribute

2019-08-28 Thread Alexander Duyck
On Wed, Aug 28, 2019 at 10:40 AM Robert Beckett wrote: > > To allow userland to enable or disable dropping packets when descriptor > ring is exhausted, add an adapter rx_drop_en attribute. > > This can be used in conjunction with flow control to mitigate packet storms > (e.g. due to network loop o

  1   2   >