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

2019-08-13 Thread Jiri Pirko
Mon, Aug 12, 2019 at 05:28:02PM CEST, da...@davemloft.net wrote: >From: Jiri Pirko >Date: Mon, 12 Aug 2019 10:36:35 +0200 > >> I understand it with real devices, but dummy testing device, who's >> purpose is just to test API. Why? > >Because you'll break all of the wonderful testing infrastructure

Re: [patch net-next] netdevsim: implement support for devlink region and snapshots

2019-08-13 Thread Jiri Pirko
Tue, Aug 13, 2019 at 02:58:59AM CEST, jakub.kicin...@netronome.com wrote: >On Mon, 12 Aug 2019 12:16:20 +0200, Jiri Pirko wrote: >> From: Jiri Pirko >> >> Implement dummy region of size 32K and allow user to create snapshots >> or random data using debugfs file trigger. >> >> Signed-off-by: Jiri

[PATCH net-next v2 04/14] drop_monitor: Consider all monitoring states before performing configuration

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel The drop monitor configuration (e.g., alert mode) is global, but user will be able to enable monitoring of only software or hardware drops. Therefore, ensure that monitoring of both software and hardware drops are disabled before allowing drop monitor configuration to take pla

[PATCH net-next v2 02/14] drop_monitor: Initialize hardware per-CPU data

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Like software drops, hardware drops also need the same type of per-CPU data. Therefore, initialize it during module initialization and de-initialize it during module exit. Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- net/core/drop_monitor.c | 25

[PATCH net-next v2 06/14] drop_monitor: Add support for summary alert mode for hardware drops

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel In summary alert mode a notification is sent with a list of recent drop reasons and a count of how many packets were dropped due to this reason. To avoid expensive operations in the context in which packets are dropped, each CPU holds an array whose number of entries is the ma

[PATCH net-next v2 07/14] drop_monitor: Allow user to start monitoring hardware drops

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Drop monitor has start and stop commands, but so far these were only used to start and stop monitoring of software drops. Now that drop monitor can also monitor hardware drops, we should allow the user to control these as well. Do that by adding SW and HW flags to these comma

[PATCH net-next v2 09/14] devlink: Add generic packet traps and groups

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Add generic packet traps and groups that can report dropped packets as well as exceptions such as TTL error. Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- include/net/devlink.h | 40 net/core/devlink.c| 12 2

[PATCH net-next v2 08/14] devlink: Add packet trap infrastructure

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Add the basic packet trap infrastructure that allows device drivers to register their supported packet traps and trap groups with devlink. Each driver is expected to provide basic information about each supported trap, such as name and ID, but also the supported metadata types

[PATCH net-next v2 03/14] drop_monitor: Add basic infrastructure for hardware drops

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Export a function that can be invoked in order to report packets that were dropped by the underlying hardware along with metadata. Subsequent patches will add support for the different alert modes. Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- MAINTAINERS

[PATCH net-next v2 00/14] Add drop monitor for offloaded data paths

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Users have several ways to debug the kernel and understand why a packet was dropped. For example, using drop monitor and perf. Both utilities trace kfree_skb(), which is the function called when a packet is freed as part of a failure. The information provided by these tools is

[PATCH net-next v2 01/14] drop_monitor: Move per-CPU data init/fini to separate functions

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Currently drop monitor only reports software drops to user space, but subsequent patches are going to add support for hardware drops. Like software drops, the per-CPU data of hardware drops needs to be initialized and de-initialized upon module initialization and exit. To avoi

[PATCH net-next v2 05/14] drop_monitor: Add support for packet alert mode for hardware drops

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel In a similar fashion to software drops, extend drop monitor to send netlink events when packets are dropped by the underlying hardware. The main difference is that instead of encoding the program counter (PC) from which kfree_skb() was called in the netlink message, we encode

[PATCH net-next v2 11/14] netdevsim: Add devlink-trap support

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Have netdevsim register its trap groups and traps with devlink during initialization and periodically report trapped packets to devlink core. Since netdevsim is not a real device, the trapped packets are emulated using a workqueue that periodically reports a UDP packet with a

[PATCH net-next v2 13/14] selftests: devlink_trap: Add test cases for devlink-trap

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Add test cases for devlink-trap on top of the netdevsim implementation. The tests focus on the devlink-trap core infrastructure and user space API. They test both good and bad flows and also dismantle of the netdev and devlink device used to report trapped packets. This allow

[PATCH net-next v2 12/14] Documentation: Add description of netdevsim traps

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- .../networking/devlink-trap-netdevsim.rst | 20 +++ Documentation/networking/devlink-trap.rst | 11 ++ Documentation/networking/index.rst| 1 + drivers/net/netdevsim/dev.c

[PATCH net-next v2 14/14] Documentation: Add a section for devlink-trap testing

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- Documentation/networking/devlink-trap.rst | 9 + 1 file changed, 9 insertions(+) diff --git a/Documentation/networking/devlink-trap.rst b/Documentation/networking/devlink-trap.rst index fe4f6e149623..7b07442b3ec3

[PATCH net-next v2 10/14] Documentation: Add devlink-trap documentation

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Add initial documentation of the devlink-trap mechanism, explaining the background, motivation and the semantics of the interface. Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- Documentation/networking/devlink-trap.rst | 187 ++ Documentation/netw

Re: tun: mark small packets as owned by the tap sock

2019-08-13 Thread Jack Wang
Dave Jones 于2019年8月13日周二 上午1:05写道: > > On Wed, Aug 07, 2019 at 12:30:07AM +, Linux Kernel wrote: > > Commit: 4b663366246be1d1d4b1b8b01245b2e88ad9e706 > > Parent: 16b2084a8afa1432d14ba72b7c97d7908e178178 > > Web: > https://git.kernel.org/torvalds/c/4b663366246be1d1d4b1b8b0124

[PATCH net-next] net/mvpp2: Replace tasklet with softirq hrtimer

2019-08-13 Thread Sebastian Andrzej Siewior
From: Thomas Gleixner The tx_done_tasklet tasklet is used in invoke the hrtimer (mvpp2_hr_timer_cb) in softirq context. This can be also achieved without the tasklet but with HRTIMER_MODE_SOFT as hrtimer mode. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- drivers

Re: [PATCH net-next] net: openvswitch: Set OvS recirc_id from tc chain index

2019-08-13 Thread Paul Blakey
On 8/12/2019 7:18 PM, Pravin Shelar wrote: > On Sun, Aug 11, 2019 at 3:46 AM Paul Blakey wrote: >> >> On 8/8/2019 11:53 PM, Pravin Shelar wrote: >>> On Wed, Aug 7, 2019 at 5:08 AM Paul Blakey wrote: Offloaded OvS datapath rules are translated one to one to tc rules, for example the fol

[PATCH iproute2-next v2 0/4] Add devlink-trap support

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel This patchset adds devlink-trap support in iproute2. Patch #1 increases the number of options devlink can handle. Patches #2-#3 gradually add support for all devlink-trap commands. Patch #4 adds a man page for devlink-trap. See individual commit messages for example usage a

[PATCH iproute2-next v2 2/4] devlink: Add devlink trap set and show commands

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel The trap set command allows the user to set the action of an individual trap. Example: # devlink trap set netdevsim/netdevsim10 trap blackhole_route action trap The trap show command allows the user to get the current status of an individual trap or a dump of all traps in cas

[PATCH iproute2-next v2 1/4] devlink: Increase number of supported options

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Currently, the number of supported options is capped at 32 which is a problem given we are about to add a few more and go over the limit. Increase the limit to 64 options. Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- devlink/devlink.c | 24

[PATCH iproute2-next v2 3/4] devlink: Add devlink trap group set and show commands

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel These commands are similar to the trap set and show commands, but operate on a trap group and not individual traps. Example: # devlink trap group set netdevsim/netdevsim10 group l3_drops action trap # devlink -jps trap group show netdevsim/netdevsim10 group l3_drops { "tra

[PATCH iproute2-next v2 4/4] devlink: Add man page for devlink-trap

2019-08-13 Thread Ido Schimmel
From: Ido Schimmel Signed-off-by: Ido Schimmel --- man/man8/devlink-monitor.8 | 3 +- man/man8/devlink-trap.8| 138 + man/man8/devlink.8 | 11 ++- 3 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 man/man8/devlink-trap.8 d

Re: tun: mark small packets as owned by the tap sock

2019-08-13 Thread Jason Wang
On 2019/8/13 上午6:19, Dave Jones wrote: On Wed, Aug 07, 2019 at 12:30:07AM +, Linux Kernel wrote: > Commit: 4b663366246be1d1d4b1b8b01245b2e88ad9e706 > Parent: 16b2084a8afa1432d14ba72b7c97d7908e178178 > Web: https://git.kernel.org/torvalds/c/4b663366246be1d1d4b1b8b01245b

Re: [PATCH iproute2-next v2 2/4] devlink: Add devlink trap set and show commands

2019-08-13 Thread Jiri Pirko
Tue, Aug 13, 2019 at 10:31:41AM CEST, ido...@idosch.org wrote: >From: Ido Schimmel > >The trap set command allows the user to set the action of an individual >trap. Example: > ># devlink trap set netdevsim/netdevsim10 trap blackhole_route action trap > >The trap show command allows the user to get

Re: [PATCH v3 11/17] qca: no need to check return value of debugfs_create functions

2019-08-13 Thread Stefan Wahren
On 10.08.19 12:17, Greg Kroah-Hartman wrote: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Cc: "David S. Miller" > Cc: Stefan Wahren > Cc: Michael Heim

Re: [PATCH net-next v1 0/8] netfilter: header compilation fixes

2019-08-13 Thread Pablo Neira Ayuso
On Wed, Aug 07, 2019 at 03:16:57PM +0100, Jeremy Sowden wrote: > A number of netfilter header files are on the header-test blacklist > becuse they cannot be compiled stand-alone. There are two main reasons > for this: missing inclusions of other headers, and missing conditionals > checking for CO

Re: [PATCH net-next v1 0/8] netfilter: header compilation fixes

2019-08-13 Thread Jeremy Sowden
On 2019-08-13, at 11:55:29 +0200, Pablo Neira Ayuso wrote: > On Wed, Aug 07, 2019 at 03:16:57PM +0100, Jeremy Sowden wrote: > > A number of netfilter header files are on the header-test blacklist > > becuse they cannot be compiled stand-alone. There are two main > > reasons for this: missing incl

Re: [PATCH rdma-next 0/4] Add XRQ and SRQ support to DEVX interface

2019-08-13 Thread Leon Romanovsky
On Mon, Aug 12, 2019 at 11:43:58AM -0400, Doug Ledford wrote: > On Thu, 2019-08-08 at 10:11 +, Leon Romanovsky wrote: > > On Thu, Aug 08, 2019 at 11:43:54AM +0300, Leon Romanovsky wrote: > > > From: Leon Romanovsky > > > > > > Hi, > > > > > > This small series extends DEVX interface with SRQ a

Re: [PATCH net-next v1 0/8] netfilter: header compilation fixes

2019-08-13 Thread Pablo Neira Ayuso
On Tue, Aug 13, 2019 at 11:04:24AM +0100, Jeremy Sowden wrote: > On 2019-08-13, at 11:55:29 +0200, Pablo Neira Ayuso wrote: > > On Wed, Aug 07, 2019 at 03:16:57PM +0100, Jeremy Sowden wrote: > > > A number of netfilter header files are on the header-test blacklist > > > becuse they cannot be compil

Re: [PATCH iproute2-next v2 3/4] devlink: Add devlink trap group set and show commands

2019-08-13 Thread Jiri Pirko
Tue, Aug 13, 2019 at 10:31:42AM CEST, ido...@idosch.org wrote: >From: Ido Schimmel > >These commands are similar to the trap set and show commands, but >operate on a trap group and not individual traps. Example: > ># devlink trap group set netdevsim/netdevsim10 group l3_drops action trap ># devlin

Re: [PATCH iproute2-next v2 4/4] devlink: Add man page for devlink-trap

2019-08-13 Thread Jiri Pirko
Tue, Aug 13, 2019 at 10:31:43AM CEST, ido...@idosch.org wrote: >From: Ido Schimmel > >Signed-off-by: Ido Schimmel >--- > man/man8/devlink-monitor.8 | 3 +- > man/man8/devlink-trap.8| 138 + > man/man8/devlink.8 | 11 ++- > 3 files changed, 150 inser

Re: [PATCH iproute2-next v2 4/4] devlink: Add man page for devlink-trap

2019-08-13 Thread Ido Schimmel
On Tue, Aug 13, 2019 at 12:20:37PM +0200, Jiri Pirko wrote: > Tue, Aug 13, 2019 at 10:31:43AM CEST, ido...@idosch.org wrote: > >From: Ido Schimmel > > > >Signed-off-by: Ido Schimmel > >--- > > man/man8/devlink-monitor.8 | 3 +- > > man/man8/devlink-trap.8| 138 +++

Re: [PATCH iproute2-next v2 4/4] devlink: Add man page for devlink-trap

2019-08-13 Thread Jiri Pirko
Tue, Aug 13, 2019 at 12:39:04PM CEST, ido...@idosch.org wrote: >On Tue, Aug 13, 2019 at 12:20:37PM +0200, Jiri Pirko wrote: >> Tue, Aug 13, 2019 at 10:31:43AM CEST, ido...@idosch.org wrote: >> >From: Ido Schimmel >> > >> >Signed-off-by: Ido Schimmel >> >--- >> > man/man8/devlink-monitor.8 | 3 +

tc - mirred ingress not supported at the moment

2019-08-13 Thread Martin Olsson
Two questions regarding tc-mirred: 1) The manual ( https://www.linux.org/docs/man8/tc-mirred.html ) states: OPTIONS ingress egress Specify the direction in which the packet shall appear on the destination interface. Currently only egress is implemented. I verify to see if t

Re: [PATCH net] netlink: Fix nlmsg_parse as a wrapper for strict message parsing

2019-08-13 Thread Eric Dumazet
On 8/12/19 10:07 PM, David Ahern wrote: > From: David Ahern > > Eric reported a syzbot warning: > > > The root cause is nlmsg_parse calling __nla_parse which means the > header struct size is not checked. > > nlmsg_parse should be a wrapper around __nlmsg_parse with > NL_VALIDATE_STRICT for

Re: [PATCH net-next v1 0/8] netfilter: header compilation fixes

2019-08-13 Thread Jeremy Sowden
On 2019-08-13, at 12:14:03 +0200, Pablo Neira Ayuso wrote: > On Tue, Aug 13, 2019 at 11:04:24AM +0100, Jeremy Sowden wrote: > > On 2019-08-13, at 11:55:29 +0200, Pablo Neira Ayuso wrote: > > > Would you mind if - before pushing this out - I do this string > > > replacement for the patch subject? >

[RFC PATCH bpf-next 00/14] xdp_flow: Flow offload to XDP

2019-08-13 Thread Toshiaki Makita
This is a rough PoC for an idea to offload TC flower to XDP. * Motivation The purpose is to speed up software TC flower by using XDP. I chose TC flower because my current interest is in OVS. OVS uses TC to offload flow tables to hardware, so if TC can offload flows to XDP, OVS also can be offlo

[RFC PATCH bpf-next 01/14] xdp_flow: Add skeleton of XDP based TC offload driver

2019-08-13 Thread Toshiaki Makita
Add TC offload driver, xdp_flow_core.c, and skeleton of UMH handling mechanism. The driver is not called from anywhere yet. xdp_flow_setup_block() in xdp_flow_core.c is meant to be called when ingress qdisc is added. It loads xdp_flow kernel module and the kmod provides some callbacks for setup ph

[RFC PATCH bpf-next 04/14] xdp_flow: Attach bpf prog to XDP in kernel after UMH loaded program

2019-08-13 Thread Toshiaki Makita
As UMH runs under RTNL, it cannot attach XDP from userspace. Thus the kernel, xdp_flow module, installs the XDP program. NOTE: As an RFC, XDP-related logic is emulating dev_change_xdp_fd(). I'm thinking I should factor out the logic from dev_change_xdp_fd() and export it instead. Signed-off-by: T

[RFC PATCH bpf-next 02/14] xdp_flow: Add skeleton bpf program for XDP

2019-08-13 Thread Toshiaki Makita
The program is meant to be loaded when a device is bound to an ingress TC block and should be attached to XDP on the device. Typically it should be loaded when TC ingress or clsact qdisc is added. The program is prebuilt and embedded in the UMH, instead of generated dynamically. This is because TC

[RFC PATCH bpf-next 05/14] xdp_flow: Prepare flow tables in bpf

2019-08-13 Thread Toshiaki Makita
Add maps for flow tables in bpf. TC flower has hash tables for each flow mask ordered by priority. To do the same thing, prepare hashmap-in-arraymap. As bpf does not provide ordered list, we emulate it by an array. Each array entry has one-byte next index field to implement a list. Also prepare a o

[RFC PATCH bpf-next 08/14] xdp_flow: Implement flow replacement/deletion logic in xdp_flow kmod

2019-08-13 Thread Toshiaki Makita
As struct flow_rule has descrete storages for flow_dissector and key/mask containers, we need to serialize them in some way to pass them to UMH. Convert flow_rule into flow key form used in xdp_flow bpf prog and pass it. Signed-off-by: Toshiaki Makita --- net/xdp_flow/xdp_flow_kern_mod.c | 334

[RFC PATCH bpf-next 07/14] xdp_flow: Add flow handling and basic actions in bpf prog

2019-08-13 Thread Toshiaki Makita
BPF prog for XDP parses the packet and extracts the flow key. Then find an entry from flow tables. Only "accept" and "drop" actions are implemented at this point. Signed-off-by: Toshiaki Makita --- net/xdp_flow/xdp_flow_kern_bpf.c | 297 ++- 1 file changed, 29

[RFC PATCH bpf-next 03/14] bpf: Add API to get program from id

2019-08-13 Thread Toshiaki Makita
Factor out the logic in bpf_prog_get_fd_by_id() and add bpf_prog_get_by_id(). Also export bpf_prog_get_ok(). They are used by the next commit to get bpf prog from its id. Signed-off-by: Toshiaki Makita --- include/linux/bpf.h | 6 ++ kernel/bpf/syscall.c | 26 ++ 2

[RFC PATCH bpf-next 06/14] xdp_flow: Add flow entry insertion/deletion logic in UMH

2019-08-13 Thread Toshiaki Makita
This logic will be used when xdp_flow kmod requests flow insertion/deleteion. On insertion, find a free entry and populate it, then update next index pointer of its previous entry. On deletion, set the next index pointer of the prev entry to the next index of the entry to be deleted. Signed-off-b

[RFC PATCH bpf-next 09/14] xdp_flow: Add netdev feature for enabling TC flower offload to XDP

2019-08-13 Thread Toshiaki Makita
The usage would be like this: $ ethtool -K eth0 tc-offload-xdp on $ tc qdisc add dev eth0 clsact $ tc filter add dev eth0 ingress protocol ip flower skip_sw ... Then the filters offloaded to XDP are marked as "in_hw". If the tc flow block is created when tc-offload-xdp is enabled on the devic

[RFC PATCH bpf-next 14/14] bpf, hashtab: Compare keys in long

2019-08-13 Thread Toshiaki Makita
memcmp() is generally slow. Compare keys in long if possible. This improves xdp_flow performance. This is included in this series just to demonstrate to what extent xdp_flow performance can increase. Signed-off-by: Toshiaki Makita --- kernel/bpf/hashtab.c | 27 +-- 1 file

[RFC PATCH bpf-next 12/14] bpf, selftest: Add test for xdp_flow

2019-08-13 Thread Toshiaki Makita
Check if TC flower offloading to XDP works. Signed-off-by: Toshiaki Makita --- tools/testing/selftests/bpf/Makefile | 1 + tools/testing/selftests/bpf/test_xdp_flow.sh | 103 +++ 2 files changed, 104 insertions(+) create mode 100755 tools/testing/selftests/bpf/

[RFC PATCH bpf-next 13/14] i40e: prefetch xdp->data before running XDP prog

2019-08-13 Thread Toshiaki Makita
XDP progs are likely to read/write xdp->data. This improves the performance of xdp_flow. This is included in this series just to demonstrate to what extent xdp_flow performance can increase. Signed-off-by: Toshiaki Makita --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 1 + 1 file changed, 1 i

[RFC PATCH bpf-next 11/14] xdp_flow: Implement vlan_push action

2019-08-13 Thread Toshiaki Makita
This is another example action. Signed-off-by: Toshiaki Makita --- net/xdp_flow/xdp_flow_kern_bpf.c | 23 +-- net/xdp_flow/xdp_flow_kern_mod.c | 5 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/net/xdp_flow/xdp_flow_kern_bpf.c b/net/xdp_flow/xdp_flow_

[RFC PATCH bpf-next 10/14] xdp_flow: Implement redirect action

2019-08-13 Thread Toshiaki Makita
Add a devmap for XDP_REDIRECT and use it for redirect action. Signed-off-by: Toshiaki Makita --- net/xdp_flow/umh_bpf.h | 1 + net/xdp_flow/xdp_flow_kern_bpf.c | 14 +++- net/xdp_flow/xdp_flow_kern_mod.c | 3 + net/xdp_flow/xdp_flow_umh.c | 164 +++

Re: [PATCH 00/16] treewide: prefer __section from compiler_attributes.h

2019-08-13 Thread Miguel Ojeda
On Mon, Aug 12, 2019 at 11:53 PM Nick Desaulniers wrote: > > GCC unescapes escaped string section names while Clang does not. Because > __section uses the `#` stringification operator for the section name, it > doesn't need to be escaped. Thanks a lot Nick, this takes a weight off my mind. One __

[patch net-next] selftests: netdevsim: add devlink params tests

2019-08-13 Thread Jiri Pirko
From: Jiri Pirko Test recently added netdevsim devlink param implementation. Signed-off-by: Jiri Pirko --- .../drivers/net/netdevsim/devlink.sh | 62 ++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/netdevsim/devlink

Re: [PATCH] net: ethernet: mediatek: Add MT7628/88 SoC support

2019-08-13 Thread Stefan Roese
On 17.07.19 14:15, Daniel Golle wrote: On Wed, Jul 17, 2019 at 01:02:43PM +0200, Stefan Roese wrote: This patch adds support for the MediaTek MT7628/88 SoCs to the common MediaTek ethernet driver. Some minor changes are needed for this and a bigger change, as the MT7628 does not support QDMA (on

[RFC bpf-next 0/3] tools: bpftool: add subcommand to count map entries

2019-08-13 Thread Quentin Monnet
This series adds a "bpftool map count" subcommand to count the number of entries present in a BPF map. This results from a customer request for a tool to count the number of entries in BPF maps used in production (for example, to know how many free entries are left in a given map). The first two c

[RFC bpf-next 2/3] tools: bpftool: make comment more explicit for count of dumped entries

2019-08-13 Thread Quentin Monnet
The counter printed at the end of plain map dump does not reflect the exact number of entries in the map, but the number of entries bpftool managed to dump (some of them could not be read, or made no sense to dump (map-in-map...)). Edit slightly the message to make this more explicit. Signed-off-

[RFC bpf-next 3/3] tools: bpftool: add "bpftool map count" to count entries in map

2019-08-13 Thread Quentin Monnet
Add a "map count" subcommand for counting the number of entries in a map. Because of the variety of BPF map types, it is not entirely clear what counts as an "entry" to dump. We could count all entries for which we have keys; but then for all array derivatives, it would simply come down to printin

[RFC bpf-next 1/3] tools: bpftool: clean up dump_map_elem() return value

2019-08-13 Thread Quentin Monnet
The code for dumping a map entry (as part of a full map dump) was moved to a specific function dump_map_elem() in commit 18a781daa93e ("tools/bpf: bpftool, split the function do_dump()"). The "num_elems" variable was moved in that function, incremented on success, and returned to be immediately add

Re: [PATCH 3/3] ocelot_ace: fix action of trap

2019-08-13 Thread Andrew Lunn
On Tue, Aug 13, 2019 at 02:12:47AM +, Y.b. Lu wrote: > Hi Allan, > > > -Original Message- > > From: Allan W. Nielsen > > Sent: Monday, August 12, 2019 8:32 PM > > To: Y.b. Lu > > Cc: netdev@vger.kernel.org; David S . Miller ; > > Alexandre Belloni ; Microchip Linux Driver > > Support

[PATCH net] ipv6/addrconf: allow adding multicast addr if IFA_F_MCAUTOJOIN is set

2019-08-13 Thread Hangbin Liu
The ip address autojoin is not working for IPv6 as ipv6_add_addr() will return -EADDRNOTAVAIL when adding a multicast address. Reported-by: Jianlin Shi Fixes: 93a714d6b53d ("multicast: Extend ip address command to enable multicast group join/leave on") Signed-off-by: Hangbin Liu --- net/ipv6/a

[PATCH] sctp: fix memleak in sctp_send_reset_streams

2019-08-13 Thread zhengbin
If the stream outq is not empty, need to kfree nstr_list. Fixes: d570a59c5b5f ("sctp: only allow the out stream reset when the stream outq is empty") Reported-by: Hulk Robot Signed-off-by: zhengbin --- net/sctp/stream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sctp/stream.c b/ne

Re: tun: mark small packets as owned by the tap sock

2019-08-13 Thread Dave Jones
On Tue, Aug 13, 2019 at 04:33:59PM +0800, Jason Wang wrote: > > On 2019/8/13 上午6:19, Dave Jones wrote: > > On Wed, Aug 07, 2019 at 12:30:07AM +, Linux Kernel wrote: > > > Commit: 4b663366246be1d1d4b1b8b01245b2e88ad9e706 > > > Parent: 16b2084a8afa1432d14ba72b7c97d7908e178178 >

Re: [RESEND][PATCH v3 bpf-next] btf: expose BTF info through sysfs

2019-08-13 Thread Daniel Borkmann
On 8/12/19 8:39 PM, Andrii Nakryiko wrote: Make .BTF section allocated and expose its contents through sysfs. /sys/kernel/btf directory is created to contain all the BTFs present inside kernel. Currently there is only kernel's main BTF, represented as /sys/kernel/btf/kernel file. Once kernel mod

Re: [PATCH] tools: bpftool: add feature check for zlib

2019-08-13 Thread Daniel Borkmann
On 8/13/19 2:38 AM, Peter Wu wrote: bpftool requires libelf, and zlib for decompressing /proc/config.gz. zlib is a transitive dependency via libelf, and became mandatory since elfutils 0.165 (Jan 2016). The feature check of libelf is already done in the elfdep target of tools/lib/bpf/Makefile, pu

Re: [bpf-next] selftests/bpf: fix race in flow dissector tests

2019-08-13 Thread Daniel Borkmann
On 8/13/19 1:30 AM, Petar Penkov wrote: From: Petar Penkov Since the "last_dissection" map holds only the flow keys for the most recent packet, there is a small race in the skb-less flow dissector tests if a new packet comes between transmitting the test packet, and reading its keys from the ma

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

2019-08-13 Thread David Ahern
On 8/13/19 1:14 AM, Jiri Pirko wrote: > Mon, Aug 12, 2019 at 05:28:02PM CEST, da...@davemloft.net wrote: >> From: Jiri Pirko >> Date: Mon, 12 Aug 2019 10:36:35 +0200 >> >>> I understand it with real devices, but dummy testing device, who's >>> purpose is just to test API. Why? >> >> Because you'll

[patch net-next v2 2/2] selftests: netdevsim: add devlink regions tests

2019-08-13 Thread Jiri Pirko
From: Jiri Pirko Test netdevsim devlink region implementation. Signed-off-by: Jiri Pirko --- v1->v2: - new patch --- .../drivers/net/netdevsim/devlink.sh | 54 ++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/netdevs

[patch net-next v2 1/2] netdevsim: implement support for devlink region and snapshots

2019-08-13 Thread Jiri Pirko
From: Jiri Pirko Implement dummy region of size 32K and allow user to create snapshots or random data using debugfs file trigger. Signed-off-by: Jiri Pirko --- drivers/net/netdevsim/dev.c | 66 ++- drivers/net/netdevsim/netdevsim.h | 1 + 2 files changed, 66

[patch net-next v2 0/2] netdevsim: implement support for devlink region and snapshots

2019-08-13 Thread Jiri Pirko
From: Jiri Pirko Implement devlink region support for netdevsim and test it. --- Note the selftest patch depends on "[patch net-next] selftests: netdevsim: add devlink params tests" patch sent earlier today. Jiri Pirko (2): netdevsim: implement support for devlink region and snapshots selft

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

2019-08-13 Thread Jiri Pirko
Tue, Aug 13, 2019 at 04:41:18PM CEST, dsah...@gmail.com wrote: >On 8/13/19 1:14 AM, Jiri Pirko wrote: >> Mon, Aug 12, 2019 at 05:28:02PM CEST, da...@davemloft.net wrote: >>> From: Jiri Pirko >>> Date: Mon, 12 Aug 2019 10:36:35 +0200 >>> I understand it with real devices, but dummy testing dev

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-13 Thread Marek Behún
Hi Andrew, > We should read the switch registers. I think you can set the defaults > using strapping pins. And in general, the driver always reads state > from the hardware rather than caching it. hmm. The cmode is cached for each port, though. For example mv88e6390x_port_set_cmode compares the n

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-13 Thread Marek Behún
On Tue, 13 Aug 2019 17:44:16 +0200 Marek Behún wrote: > Hi Andrew, > > > We should read the switch registers. I think you can set the > > defaults using strapping pins. And in general, the driver always > > reads state from the hardware rather than caching it. > > hmm. The cmode is cached for

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: fix RGMII-ID port setup

2019-08-13 Thread Andrew Lunn
On Tue, Aug 13, 2019 at 05:44:16PM +0200, Marek Behún wrote: > Hi Andrew, > > > We should read the switch registers. I think you can set the defaults > > using strapping pins. And in general, the driver always reads state > > from the hardware rather than caching it. > > hmm. The cmode is cached

[PATCH bpf-next v3 2/4] bpf: support cloning sk storage on accept()

2019-08-13 Thread Stanislav Fomichev
Add new helper bpf_sk_storage_clone which optionally clones sk storage and call it from sk_clone_lock. Cc: Martin KaFai Lau Cc: Yonghong Song Acked-by: Yonghong Song Signed-off-by: Stanislav Fomichev --- include/net/bpf_sk_storage.h | 10 include/uapi/linux/bpf.h | 3 + net/core/b

[PATCH bpf-next v3 4/4] selftests/bpf: add sockopt clone/inheritance test

2019-08-13 Thread Stanislav Fomichev
Add a test that calls setsockopt on the listener socket which triggers BPF program. This BPF program writes to the sk storage and sets clone flag. Make sure that sk storage is cloned for a newly accepted connection. We have two cloned maps in the tests to make sure we hit both cases in bpf_sk_stor

[PATCH bpf-next v3 0/4] bpf: support cloning sk storage on accept()

2019-08-13 Thread Stanislav Fomichev
Currently there is no way to propagate sk storage from the listener socket to a newly accepted one. Consider the following use case: fd = socket(); setsockopt(fd, SOL_IP, IP_TOS,...); /* ^^^ setsockopt BPF program triggers here and saves something * into sk storage

[PATCH bpf-next v3 1/4] bpf: export bpf_map_inc_not_zero

2019-08-13 Thread Stanislav Fomichev
Rename existing bpf_map_inc_not_zero to __bpf_map_inc_not_zero to indicate that it's caller's responsibility to do proper locking. Create and export bpf_map_inc_not_zero wrapper that properly locks map_idr_lock. Will be used in the next commit to hold a map while cloning a socket. Cc: Martin KaFai

[PATCH bpf-next v3 3/4] bpf: sync bpf.h to tools/

2019-08-13 Thread Stanislav Fomichev
Sync new sk storage clone flag. Cc: Martin KaFai Lau Cc: Yonghong Song Acked-by: Yonghong Song Signed-off-by: Stanislav Fomichev --- tools/include/uapi/linux/bpf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 4393

Re: [PATCH net] sctp: fix the transport error_count check

2019-08-13 Thread Marcelo Ricardo Leitner
On Mon, Aug 12, 2019 at 08:49:12PM +0800, Xin Long wrote: > As the annotation says in sctp_do_8_2_transport_strike(): > > "If the transport error count is greater than the pf_retrans >threshold, and less than pathmaxrtx ..." > > It should be transport->error_count checked with pathmaxrxt, >

Re: [PATCH rdma-next 0/4] Add XRQ and SRQ support to DEVX interface

2019-08-13 Thread Doug Ledford
On Tue, 2019-08-13 at 10:06 +, Leon Romanovsky wrote: > On Mon, Aug 12, 2019 at 11:43:58AM -0400, Doug Ledford wrote: > > On Thu, 2019-08-08 at 10:11 +, Leon Romanovsky wrote: > > > On Thu, Aug 08, 2019 at 11:43:54AM +0300, Leon Romanovsky wrote: > > > > From: Leon Romanovsky > > > > > >

Re: [PATCH] sctp: fix memleak in sctp_send_reset_streams

2019-08-13 Thread Marcelo Ricardo Leitner
On Tue, Aug 13, 2019 at 10:05:50PM +0800, zhengbin wrote: > If the stream outq is not empty, need to kfree nstr_list. > > Fixes: d570a59c5b5f ("sctp: only allow the out stream reset when the stream > outq is empty") > Reported-by: Hulk Robot > Signed-off-by: zhengbin Acked-by: Marcelo Ricardo

Re: tc - mirred ingress not supported at the moment

2019-08-13 Thread Cong Wang
On Tue, Aug 13, 2019 at 4:05 AM Martin Olsson wrote: > Q1: Why was 'ingress' not implemented at the same time as 'egress'? Because you are using an old iproute2. ingress support is added by: https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=5eca0a3701223619a513c7209f7d9335c

Re: [PATCH bpf-next v3 2/4] bpf: support cloning sk storage on accept()

2019-08-13 Thread Yonghong Song
On 8/13/19 9:26 AM, Stanislav Fomichev wrote: > Add new helper bpf_sk_storage_clone which optionally clones sk storage > and call it from sk_clone_lock. > > Cc: Martin KaFai Lau > Cc: Yonghong Song > Acked-by: Yonghong Song > Signed-off-by: Stanislav Fomichev > --- > include/net/bpf_sk_sto

Re: [patch net-next v3 1/3] net: devlink: allow to change namespaces

2019-08-13 Thread Jakub Kicinski
On Tue, 13 Aug 2019 08:13:55 +0200, Jiri Pirko wrote: > Tue, Aug 13, 2019 at 03:21:22AM CEST, jakub.kicin...@netronome.com wrote: > >On Mon, 12 Aug 2019 15:47:49 +0200, Jiri Pirko wrote: > >> @@ -6953,9 +7089,33 @@ int devlink_compat_switch_id_get(struct net_device > >> *dev, > >>return 0; >

[PATCH net-next] net: dsa: mv88e6xxx: check for mode change in port_setup_mac

2019-08-13 Thread Marek Behún
The mv88e6xxx_port_setup_mac checks if the requested MAC settings are different from the current ones, and if not, does nothing (since chaning them requires putting the link down). In this check it only looks if the triplet [link, speed, duplex] is being changed. This patch adds support to also c

Re: [PATCH bpf-next v3 2/4] bpf: support cloning sk storage on accept()

2019-08-13 Thread Stanislav Fomichev
On 08/13, Yonghong Song wrote: > > > On 8/13/19 9:26 AM, Stanislav Fomichev wrote: > > Add new helper bpf_sk_storage_clone which optionally clones sk storage > > and call it from sk_clone_lock. > > > > Cc: Martin KaFai Lau > > Cc: Yonghong Song > > Acked-by: Yonghong Song > > Signed-off-by: S

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

2019-08-13 Thread David Miller
From: Jiri Pirko Date: Tue, 13 Aug 2019 09:14:45 +0200 > Mon, Aug 12, 2019 at 05:28:02PM CEST, da...@davemloft.net wrote: >>From: Jiri Pirko >>Date: Mon, 12 Aug 2019 10:36:35 +0200 >> >>> I understand it with real devices, but dummy testing device, who's >>> purpose is just to test API. Why? >>

Re: [patch net-next v3 0/3] net: devlink: Finish network namespace support

2019-08-13 Thread Jakub Kicinski
On Mon, 12 Aug 2019 19:46:57 -0600, David Ahern wrote: > On 8/12/19 7:11 PM, Jakub Kicinski wrote: > > If the devlink instance just disappeared - that'd be a very very strange > > thing. Only software objects disappear with the namespace. > > Netdevices without ->rtnl_link_ops go back to init_net.

[PATCH net-next] page_pool: fix logic in __page_pool_get_cached

2019-08-13 Thread Jonathan Lemon
__page_pool_get_cached() will return NULL when the ring is empty, even if there are pages present in the lookaside cache. It is also possible to refill the cache, and then return a NULL page. Restructure the logic so eliminate both cases. Signed-off-by: Jonathan Lemon --- net/core/page_pool.c

Re: [RESEND][PATCH v3 bpf-next] btf: expose BTF info through sysfs

2019-08-13 Thread Andrii Nakryiko
On Tue, Aug 13, 2019 at 7:20 AM Daniel Borkmann wrote: > > On 8/12/19 8:39 PM, Andrii Nakryiko wrote: > > Make .BTF section allocated and expose its contents through sysfs. > > > > /sys/kernel/btf directory is created to contain all the BTFs present > > inside kernel. Currently there is only kerne

[PATCH net-next 0/5] net/rds: Fixes from internal Oracle repo

2019-08-13 Thread Gerd Rausch
This is the first set of (mostly old) patches from our internal repository in an effort to synchronize what Oracle had been using internally with what is shipped with the Linux kernel. Andy Grover (2): RDS: Re-add pf/sol access via sysctl rds: check for excessive looping in rds_send_xmit Chri

[PATCH net-next 2/5] RDS: limit the number of times we loop in rds_send_xmit

2019-08-13 Thread Gerd Rausch
From: Chris Mason Date: Fri, 3 Feb 2012 11:07:54 -0500 This will kick the RDS worker thread if we have been looping too long. Original commit from 2012 updated to include a change by Venkat Venkatsubra that triggers "must_wake" if "rds_ib_recv_refill_one" fails. Signed-off-by: Gerd Rausch ---

[PATCH net-next 1/5] RDS: Re-add pf/sol access via sysctl

2019-08-13 Thread Gerd Rausch
From: Andy Grover Date: Tue, 24 Nov 2009 15:35:51 -0800 Although RDS has an official PF_RDS value now, existing software expects to look for rds sysctls to determine it. We need to maintain these for now, for backwards compatibility. Signed-off-by: Andy Grover Signed-off-by: Gerd Rausch --- n

[PATCH net-next 4/5] net/rds: Add a few missing rds_stat_names entries

2019-08-13 Thread Gerd Rausch
Date: Thu, 11 Jul 2019 12:15:50 -0700 In a previous commit, fields were added to "struct rds_statistics" but array "rds_stat_names" was not updated accordingly. Please note the inconsistent naming of the string representations that is done in the name of compatibility with the Oracle internal cod

[PATCH net-next 5/5] rds: check for excessive looping in rds_send_xmit

2019-08-13 Thread Gerd Rausch
From: Andy Grover Date: Thu, 13 Jan 2011 11:40:31 -0800 Original commit from 2011 updated to include a change by Yuval Shaia that adds a new statistic counter "send_stuck_rm" to capture the messages looping exessively in the send path. Signed-off-by: Gerd Rausch --- net/rds/rds.h | 2 +- n

[PATCH net-next 3/5] RDS: don't use GFP_ATOMIC for sk_alloc in rds_create

2019-08-13 Thread Gerd Rausch
From: Chris Mason Date: Fri, 3 Feb 2012 11:08:51 -0500 Signed-off-by: Chris Mason Signed-off-by: Bang Nguyen Signed-off-by: Gerd Rausch Signed-off-by: Somasundaram Krishnasamy --- net/rds/af_rds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rds/af_rds.c b/net/rds/

[PATCH 01/17] netfilter: synproxy: rename mss synproxy_options field

2019-08-13 Thread Pablo Neira Ayuso
From: Fernando Fernandez Mancera After introduce "mss_encode" field in the synproxy_options struct the field "mss" is a little confusing. It has been renamed to "mss_option". Signed-off-by: Fernando Fernandez Mancera Signed-off-by: Pablo Neira Ayuso --- include/net/netfilter/nf_conntrack_synp

  1   2   >