Re: [RFC PATCH 3/3] bpf, riscv: added eBPF JIT for RV64G

2019-01-15 Thread Björn Töpel
Den ons 16 jan. 2019 kl 00:50 skrev Daniel Borkmann : > > On 01/15/2019 09:35 AM, Björn Töpel wrote: > > This commit adds eBPF JIT for RV64G. > > > > Codewise, it needs some refactoring. Currently there's a bit too much > > copy-and-paste going on, and I know some places where I could optimize > >

Re: [PATCH net-next] mlxsw: spectrum_nve: Use struct_size() in kzalloc()

2019-01-15 Thread Ido Schimmel
On Tue, Jan 15, 2019 at 05:14:29PM -0600, Gustavo A. R. Silva wrote: > One of the more common cases of allocation size calculations is finding > the size of a structure that has a zero-sized array at the end, along > with memory for some number of elements for that array. For example: > > struct f

[PATCH v2 net-next] net: phy: check return code when requesting PHY driver module

2019-01-15 Thread Heiner Kallweit
When requesting the PHY driver module fails we'll bind the genphy driver later. This isn't obvious to the user and may cause, depending on the PHY, different types of issues. Therefore check the return code of request_module(). Note that we only check for failures in loading the module, not whether

Re: Question on ptr_ring linux header

2019-01-15 Thread fei phung
Hi, > https://gist.github.com/promach/65e9331d55a43a2815239430a28e29c6#file-circ_ring-c-L62 > racy if there are multiple consumers. > just call ptr_ring_consume_any. If I modify pop_circ_queue() below to directly use ptr_ring_consume_any() without ptr_ring_empty_any() , I am afraid I am running i

[PATCH net-next 1/1] tls: Fix recvmsg() to be able to peek across multiple records

2019-01-15 Thread Vakul Garg
This fixes recvmsg() to be able to peek across multiple tls records. Without this patch, the tls's selftests test case 'recv_peek_large_buf_mult_recs' fails. Each tls receive context now maintains a 'rx_list' to retain incoming skb carrying tls records. If a tls record needs to be retained e.g. for

Re: [PATCH v2] dt-bindings: net: dsa: ksz9477: fix indentation for switch spi bindings

2019-01-15 Thread David Miller
From: Sergio Paracuellos Date: Sun, 13 Jan 2019 09:56:48 +0100 > Switch bindings for spi managed mode are using spaces instead of tabs. > Fix them to get a file with a proper kernel indentation style. > > Reviewed-by: Florian Fainelli > Signed-off-by: Sergio Paracuellos > --- > Changes in v2:

Re: [PATCH bpf-next 8/9] libbpf: introduce bpf_map_lookup_elem_flags()

2019-01-15 Thread Alexei Starovoitov
On Wed, Jan 16, 2019 at 06:18:30AM +, Yonghong Song wrote: > > > On 1/15/19 9:08 PM, Alexei Starovoitov wrote: > > Introduce > > int bpf_map_lookup_elem_flags(int fd, const void *key, void *value, __u64 > > flags) > > helper to lookup array/hash/cgroup_local_storage elements with BPF_F_LOCK

Re: [PATCH net] net: phy: meson-gxl: Use the genphy_soft_reset callback

2019-01-15 Thread David Miller
From: Timotej Lazar Date: Sun, 13 Jan 2019 01:22:55 +0100 > Since the referenced commit, Ethernet fails to come up at boot on the > board meson-gxl-s905x-libretech-cc. Fix this by re-enabling the > genphy_soft_reset callback for the Amlogic Meson GXL PHY driver. > > Fixes: 6e2d85ec0559 ("net: ph

Re: [PATCH bpf-next 8/9] libbpf: introduce bpf_map_lookup_elem_flags()

2019-01-15 Thread Yonghong Song
On 1/15/19 9:08 PM, Alexei Starovoitov wrote: > Introduce > int bpf_map_lookup_elem_flags(int fd, const void *key, void *value, __u64 > flags) > helper to lookup array/hash/cgroup_local_storage elements with BPF_F_LOCK > flag. > > Signed-off-by: Alexei Starovoitov > --- > tools/lib/bpf/bpf.

Re: [PATCH net-next] net: phy: check return code when requesting PHY driver module

2019-01-15 Thread Heiner Kallweit
On 15.01.2019 23:32, Florian Fainelli wrote: > On 1/15/19 12:33 PM, Heiner Kallweit wrote: >> When requesting the PHY driver module fails we'll bind the genphy >> driver later. This isn't obvious to the user and may cause, depending >> on the PHY, different types of issues. Therefore check the retu

Re: [PATCH net] add document for several snmp counters

2019-01-15 Thread David Miller
From: yupeng Date: Fri, 11 Jan 2019 15:07:24 -0800 > add document for below counters: > TcpEstabResets > TcpAttemptFails > TcpOutRsts > TcpExtTCPSACKDiscard > TcpExtTCPDSACKIgnoredOld > TcpExtTCPDSACKIgnoredNoUndo > TcpExtTCPSackShifted > TcpExtTCPSackMerged > TcpExtTCPSackShiftFallback > TcpExtT

Re: [PATCH v2 net] fou, fou6: do not assume linear skbs

2019-01-15 Thread David Miller
From: Eric Dumazet Date: Fri, 11 Jan 2019 06:27:35 -0800 > Both gue_err() and gue6_err() incorrectly assume > linear skbs. Fix them to use pskb_may_pull(). ... > Fixes: b8a51b38e4d4 ("fou, fou6: ICMP error handlers for FoU and GUE") > Signed-off-by: Eric Dumazet > Reported-by: syzbot Applied.

Re: [PATCH net] selftests: tc-testing: fix tunnel_key failure if dst_port is unspecified

2019-01-15 Thread David Miller
From: Davide Caratti Date: Fri, 11 Jan 2019 15:08:23 +0100 > After commit 1c25324caf82 ("net/sched: act_tunnel_key: Don't dump dst port > if it wasn't set"), act_tunnel_key doesn't dump anymore the destination > port, unless it was explicitly configured. This caused systematic failures > in the f

Re: [PATCH net] selftests: tc-testing: drop test on missing tunnel key id

2019-01-15 Thread David Miller
From: Davide Caratti Date: Fri, 11 Jan 2019 11:49:58 +0100 > After merge of commit 80ef0f22ceda ("net/sched: act_tunnel_key: Allow > key-less tunnels"), act_tunnel_key does not reject anymore requests to > install 'set' rules where the key id is missing. Therefore, drop the > following TDC testca

Re: [PATCH net] net: phy: marvell: Fix deadlock from wrong locking

2019-01-15 Thread David Miller
From: Andrew Lunn Date: Fri, 11 Jan 2019 00:15:21 +0100 > m88e1318_set_wol() takes the lock as part of phy_select_page(). Don't > take the lock again with phy_read(), use the unlocked __phy_read(). > > Fixes: 424ca4c55121 ("net: phy: marvell: fix paged access races") > Reported-by: Åke Rehnman

Re: [PATCH net] net: phy: marvell: Errata for mv88e6390 internal PHYs

2019-01-15 Thread David Miller
From: Andrew Lunn Date: Thu, 10 Jan 2019 22:48:36 +0100 > The VOD can be out of spec, unless some magic value is poked into an > undocumented register in an undocumented page. > > Fixes: e4cf8a38fc0d ("net: phy: Marvell: Add mv88e6390 internal PHY") > Signed-off-by: Andrew Lunn Applied and que

Re: [PATCH] IN_BADCLASS: fix macro to actually work

2019-01-15 Thread David Miller
From: Greg Kroah-Hartman Date: Thu, 10 Jan 2019 21:24:13 +0100 > Commit 65cab850f0ee ("net: Allow class-e address assignment via ifconfig > ioctl") modified the IN_BADCLASS macro a bit, but unfortunatly one too > many '(' characters were added to the line, making any code that used > it, not buil

Re: [PATCH net] tcp: allow MSG_ZEROCOPY transmission also in CLOSE_WAIT state

2019-01-15 Thread David Miller
From: Willem de Bruijn Date: Thu, 10 Jan 2019 14:40:33 -0500 > From: Willem de Bruijn > > TCP transmission with MSG_ZEROCOPY fails if the peer closes its end of > the connection and so transitions this socket to CLOSE_WAIT state. > > Transmission in close wait state is acceptable. Other simila

Re: [PATCH net] net: phy: micrel: set soft_reset callback to genphy_soft_reset for KSZ9031

2019-01-15 Thread David Miller
From: Heiner Kallweit Date: Thu, 10 Jan 2019 20:22:26 +0100 > So far genphy_soft_reset was used automatically if the PHY driver > didn't implement the soft_reset callback. This changed with the > mentioned commit and broke KSZ9031. To fix this configure the > KSZ9031 PHY driver to use genphy_soft

Re: [PATCH net] net/sched: act_tunnel_key: fix memory leak in case of action replace

2019-01-15 Thread David Miller
From: Davide Caratti Date: Thu, 10 Jan 2019 20:21:02 +0100 > running the following TDC test cases: > > 7afc - Replace tunnel_key set action with all parameters > 364d - Replace tunnel_key set action with all parameters and cookie > > it's possible to trigger kmemleak warnings like: ... > whe

Re: [PATCH net] Revert "rxrpc: Allow failed client calls to be retried"

2019-01-15 Thread David Miller
From: David Howells Date: Thu, 10 Jan 2019 16:59:13 + > The changes introduced to allow rxrpc calls to be retried creates an issue > when it comes to refcounting afs_call structs. The problem is that when > rxrpc_send_data() queues the last packet for an asynchronous call, the > following se

[RFC net-next v2 5/6] nfp: nsp: add support for versions command

2019-01-15 Thread Jakub Kicinski
Retrieve the FW versions with the new command. Signed-off-by: Jakub Kicinski --- .../ethernet/netronome/nfp/nfpcore/nfp_nsp.c | 53 +++ .../ethernet/netronome/nfp/nfpcore/nfp_nsp.h | 14 + 2 files changed, 67 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/nf

[RFC net-next v2 3/6] nfp: devlink: report driver name and serial number

2019-01-15 Thread Jakub Kicinski
Report the basic info through new devlink info API. RFCv2: - add driver name; - align serial to core changes. Signed-off-by: Jakub Kicinski --- .../net/ethernet/netronome/nfp/nfp_devlink.c | 24 +++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/ethernet/netronome

[RFC net-next v2 6/6] nfp: devlink: report the running and flashed versions

2019-01-15 Thread Jakub Kicinski
Report versions of firmware components using the new NSP command. Signed-off-by: Jakub Kicinski --- .../net/ethernet/netronome/nfp/nfp_devlink.c | 73 +++ include/net/devlink.h | 7 ++ 2 files changed, 80 insertions(+) diff --git a/drivers/net/ethernet/

[RFC iproute2 v2] devlink: add info subcommand

2019-01-15 Thread Jakub Kicinski
Add support for reading the device serial number and versions from the kernel. RFCv2: - make info subcommand of dev. Signed-off-by: Jakub Kicinski --- devlink/devlink.c | 207 + man/man8/devlink-dev.8 | 36 +++ 2 files changed, 243 insertions(+

[RFC net-next v2 0/6] devlink: add device (driver) information API

2019-01-15 Thread Jakub Kicinski
Hi! fw_version field in ethtool -i does not suit modern needs with 31 characters being quite limiting on more complex systems. There is also no distinction between the running and flashed versions of the firmware. Since the driver information pertains to the entire device, rather than a particul

[RFC net-next v2 4/6] nfp: devlink: report fixed versions

2019-01-15 Thread Jakub Kicinski
Report information about the hardware. RFCv2: - add defines for board IDs which are likely to be reusable for other drivers (Jiri). Signed-off-by: Jakub Kicinski --- .../net/ethernet/netronome/nfp/nfp_devlink.c | 37 ++- include/net/devlink.h | 5 ++

[RFC net-next v2 2/6] devlink: add version reporting to devlink info API

2019-01-15 Thread Jakub Kicinski
ethtool -i has a few fixed-size fields which can be used to report firmware version and expansion ROM version. Unfortunately, modern hardware has more firmware components. There is usually some datapath microcode, management controller, PXE drivers, and a CPLD load. Running ethtool -i on modern

[RFC net-next v2 1/6] devlink: add device information API

2019-01-15 Thread Jakub Kicinski
ethtool -i has served us well for a long time, but its showing its limitations more and more. The device information should also be reported per device not per-netdev. Lay foundation for a simple devlink-based way of reading device info. Add driver name and device serial number as initial pieces

[PATCH bpf-next 8/9] libbpf: introduce bpf_map_lookup_elem_flags()

2019-01-15 Thread Alexei Starovoitov
Introduce int bpf_map_lookup_elem_flags(int fd, const void *key, void *value, __u64 flags) helper to lookup array/hash/cgroup_local_storage elements with BPF_F_LOCK flag. Signed-off-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c | 13 ++ tools/lib/bpf/bpf.h | 2 + tools/lib/bpf/libb

[PATCH bpf-next 9/9] selftests/bpf: test for BPF_F_LOCK

2019-01-15 Thread Alexei Starovoitov
Add C based test that runs 4 bpf programs in parallel that update the same hash and array maps. And another 2 threads that read from these two maps via lookup(key, value, BPF_F_LOCK) api to make sure the user space sees consistent value in both hash and array elements while user space races with ke

[PATCH bpf-next 0/9] introduce bpf_spin_lock

2019-01-15 Thread Alexei Starovoitov
Many algorithms need to read and modify several variables atomically. Until now it was hard to impossible to implement such algorithms in BPF. Hence introduce support for bpf_spin_lock. The api consists of 'struct bpf_spin_lock' that should be placed inside hash/array/cgroup_local_storage element

[PATCH bpf-next 3/9] tools/bpf: sync include/uapi/linux/bpf.h

2019-01-15 Thread Alexei Starovoitov
sync bpf.h Signed-off-by: Alexei Starovoitov --- tools/include/uapi/linux/bpf.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 91c43884f295..30f9dfd40f13 100644 --- a/tools/include/uapi/linux/bpf.h +

[PATCH bpf-next 4/9] selftests/bpf: add bpf_spin_lock tests

2019-01-15 Thread Alexei Starovoitov
add bpf_spin_lock tests to test_verifier.c that don't require latest llvm with BTF support Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/test_verifier.c | 429 +++- 1 file changed, 428 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test

[PATCH bpf-next 5/9] selftests/bpf: add bpf_spin_lock C test

2019-01-15 Thread Alexei Starovoitov
add bpf_spin_lock C based test that requires latest llvm with BTF support Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/bpf_helpers.h| 4 + tools/testing/selftests/bpf/test_progs.c | 43 +++- tools/testing/

[PATCH bpf-next 2/9] bpf: add support for bpf_spin_lock to cgroup local storage

2019-01-15 Thread Alexei Starovoitov
Allow 'struct bpf_spin_lock' to reside inside cgroup local storage. Signed-off-by: Alexei Starovoitov --- kernel/bpf/local_storage.c | 2 ++ kernel/bpf/syscall.c | 3 ++- kernel/bpf/verifier.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/bpf/local_stora

[PATCH bpf-next 1/9] bpf: introduce bpf_spin_lock

2019-01-15 Thread Alexei Starovoitov
Introduce 'struct bpf_spin_lock' and bpf_spin_lock/unlock() helpers to let bpf program serialize access to other variables. Example: struct hash_elem { int cnt; struct bpf_spin_lock lock; }; struct hash_elem * val = bpf_map_lookup_elem(&hash_map, &key); if (val) { bpf_spin_lock(&val->l

Re: [PATCH] Fix ERROR:do not initialise statics to 0 in af_vsock.c

2019-01-15 Thread David Miller
From: Lepton Wu Date: Wed, 9 Jan 2019 15:45:41 -0800 > Found by scripts/checkpatch.pl I applied this and pushed out but didn't catch in time that you didn't provide a properly Signed-off-by: Please do that next time.

Re: [PATCH 0/3] doc: networking: integrate scaling document into doc tree

2019-01-15 Thread David Miller
From: Otto Sabart Date: Wed, 9 Jan 2019 20:57:01 +0100 > These patches integrate scaling document into documentation tree. > > There are no semantic changes. Jon, I assume this is another series you will take in. Again, I expect no major conflicts with the networking tree.

Re: [net 0/6] tipc: fix uninit-value issues reported by syzbot

2019-01-15 Thread David Miller
From: Ying Xue Date: Mon, 14 Jan 2019 17:22:23 +0800 > Recently, syzbot complained that TIPC module exits several issues > associated with uninit-value type. So, in this series, we try to > fix them as many as possible. Series applied, thanks Ying.

Re: [PATCH v2 0/3] sched: Fix qdisc interactions exposed by using sch_cake as a leaf qdisc

2019-01-15 Thread David Miller
From: Toke Høiland-Jørgensen Date: Wed, 9 Jan 2019 17:09:40 +0100 > This series fixes a couple of issues exposed by running sch_cake as a > leaf qdisc in an HFSC tree, which were discovered and reported by Pete > Heist. The interaction between CAKE's GSO splitting and the parent > qdisc's notion

Re: [PATCH net v2] ipv6: route: place a warning with duplicated string with correct extack

2019-01-15 Thread David Ahern
On 1/14/19 11:52 AM, Jakub Kicinski wrote: > "IPv6: " prefix is already added by pr_fmt, no need to include > it again in the pr_warn() format. The message predates extack > support, we can replace the whole thing with an extack message. > > Suggested-by: David Ahern > Signed-off-by: Jakub Kicin

[PATCH net-next 5/9] nfp: flower: remove list infastructure from MAC offload

2019-01-15 Thread Jakub Kicinski
From: John Hurley Potential MAC destination addresses for tunnel end-points are offloaded to firmware. This was done by building a list of such MACs and writing to firmware as blocks of addresses. Simplify this code by removing the list format and sending a new message for each offloaded MAC. T

[PATCH net-next 7/9] nfp: flower: add infastructure for non-repr priv data

2019-01-15 Thread Jakub Kicinski
From: John Hurley NFP repr netdevs contain private data that can store per port information. In certain cases, the NFP driver offloads information from non-repr ports (e.g. tunnel ports). As the driver does not have control over non-repr netdevs, it cannot add/track private data directly to the n

[PATCH net-next 4/9] nfp: flower: ignore offload of VF and PF repr MAC addresses

2019-01-15 Thread Jakub Kicinski
From: John Hurley Currently MAC addresses of all repr netdevs, along with selected non-NFP controlled netdevs, are offloaded to FW as potential tunnel end-points. However, the addresses of VF and PF reprs are meaningless outside of internal communication and it is only those of physical port repr

[PATCH net-next 3/9] nfp: flower: tidy tunnel related private data

2019-01-15 Thread Jakub Kicinski
From: John Hurley Recent additions to the flower app private data have grouped the variables of a given feature into a struct and added that struct to the main private data struct. In keeping with this, move all tunnel related private data to their own struct. This has no affect on functionality

[PATCH net-next 6/9] nfp: flower: ensure deletion of old offloaded MACs

2019-01-15 Thread Jakub Kicinski
From: John Hurley When a potential tunnel end point goes down then its MAC address should not be matchable on the NFP. Implement a delete message for offloaded MACs and call this on net device down. While at it, remove the actions on register and unregister netdev events. A MAC should only be of

[PATCH net-next 8/9] nfp: flower: ensure MAC cleanup on address change

2019-01-15 Thread Jakub Kicinski
From: John Hurley It is possible to receive a MAC address change notification without the net device being down (e.g. when an OvS bridge is assigned the same MAC as a port added to it). This means that an offloaded MAC address may not be removed if its device gets a new address. Maintain a recor

[PATCH net-next 2/9] nfp: flower: support multiple memory units for filter offloads

2019-01-15 Thread Jakub Kicinski
From: Pieter Jansen van Vuuren Adds support for multiple memory units which are used for filter offloads. Each filter is assigned a stats id, the MSBs of the id are used to determine which memory unit the filter should be offloaded to. The number of available memory units that could be used for f

[PATCH net-next 1/9] nfp: flower: increase cmesg reply timeout

2019-01-15 Thread Jakub Kicinski
From: Fred Lotter QA tests report occasional timeouts on REIFY message replies. Profiling of the two cmesg reply types under burst conditions, with a 12-core host under heavy cpu and io load (stress --cpu 12 --io 12), show both PHY MTU change and REIFY replies can exceed the 10ms timeout. The max

[PATCH net-next 0/9] nfp: flower: improve flower resilience

2019-01-15 Thread Jakub Kicinski
Hi! This series contains mostly changes which improve nfp flower offload's resilience, but are too large or risky to push into net. Fred makes the driver waits for flower FW responses uninterruptible, and a little longer (~40ms). Pieter adds support for cards with multiple rule memories. John r

[PATCH net-next 9/9] nfp: flower: enable MAC address sharing for offloadable devs

2019-01-15 Thread Jakub Kicinski
From: John Hurley A MAC address is not necessarily a unique identifier for a netdev. Drivers such as Linux bonds, for example, can apply the same MAC address to the upper layer device and all lower layer devices. NFP MAC offload for tunnel decap includes port verification for reprs but also supp

Re: [PATCH net 1/1] bonding: fix PACKET_ORIGDEV regression on bonding masters

2019-01-15 Thread Michal Soltys
On 19/01/15 03:19, Mahesh Bandewar (महेश बंडेवार) wrote: On Mon, Jan 14, 2019 at 12:00 AM Vincent Bernat wrote: ❦ 13 janvier 2019 18:01 -08, Maciej Żenczykowski : > But I seem to recall that the core problem we were trying to solve was > that a daemon listening > on an AF_PACKET ethertype 88

Re: [PATCH iproute2] xfrm: add option to hide keys in state output

2019-01-15 Thread Benedict Wong
Friendly ping for review. If there are no concerns, I think this would be useful especially in the logging/bugreport use cases. On Mon, Jan 7, 2019 at 3:10 PM Benedict Wong wrote: > > (Accidentally sent previously as direct reply. Re-sending as reply-all) > > > ... would not it be better to not r

[PATCH net-next] net/tls: remove unused function tls_sw_sendpage_locked

2019-01-15 Thread YueHaibing
There are no in-tree callers. Signed-off-by: YueHaibing --- net/tls/tls_sw.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 11cdc8f..c475538 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -1143,16 +1143,6 @@ int tls_sw_do_sendpag

[PATCH net-next] net/tls: Make function tls_sw_do_sendpage static

2019-01-15 Thread YueHaibing
Fixes the following sparse warning: net/tls/tls_sw.c:1023:5: warning: symbol 'tls_sw_do_sendpage' was not declared. Should it be static? Signed-off-by: YueHaibing --- net/tls/tls_sw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c i

Re: [PATCH net 1/1] bonding: fix PACKET_ORIGDEV regression on bonding masters

2019-01-15 Thread Michal Soltys
On 19/01/14 03:01, Maciej Żenczykowski wrote: So I don't remember the specifics... (note I'm writing this all from memory without looking it up/testing it - I may be utterly wrong or dreaming) But I seem to recall that the core problem we were trying to solve was that a daemon listening on an A

Re: [PATCH bpf-next 0/6] bpftool: support queue and stack

2019-01-15 Thread Jakub Kicinski
On Tue, 15 Jan 2019 15:22:46 -0800, Stanislav Fomichev wrote: > This patch series add support for queue/stack manipulations. > > It goes like this: > > #1 and #2 add support for queue/stack in existing 'update' and 'lookup' > commands by permitting empty keys. > #3 make sure we don't print empty

Re: [PATCH bpf-next 6/6] bpftool: add pop and dequeue commands

2019-01-15 Thread Jakub Kicinski
On Tue, 15 Jan 2019 15:22:52 -0800, Stanislav Fomichev wrote: > +static int do_pop_dequeue(int argc, char **argv) > +{ > + struct bpf_map_info info = {}; > + __u32 len = sizeof(info); > + void *key, *value; > + int err; > + int fd; > + > + if (argc < 2) > + usage

[PATCH 1/1] net-next/hinic: replace disable_irq_nosync/enable_irq

2019-01-15 Thread Xue Chaojing
In order to avoid frequent system interrupts when sending and receiving packets. we replace disable_irq_nosync/enable_irq with hinic_set_msix_state(), hinic_set_msix_state is used to access memory mapped hinic devices. Signed-off-by: Xue Chaojing --- .../net/ethernet/huawei/hinic/hinic_hw_dev.c

[RESEND PATCH net-next] Optimize sk_msg_clone() by data merge to end dst sg entry

2019-01-15 Thread Vakul Garg
Function sk_msg_clone has been modified to merge the data from source sg entry to destination sg entry if the cloned data resides in same page and is contiguous to the end entry of destination sk_msg. This improves kernel tls throughput to the tune of 10%. When the user space tls application calls

Re: [PATCH net 1/2] bpf: Fix bpf_redirect to an ipip/ip6tnl dev

2019-01-15 Thread Willem de Bruijn
On Thu, Jan 10, 2019 at 5:44 PM Willem de Bruijn wrote: > > On Thu, Jan 10, 2019 at 5:22 PM Daniel Borkmann wrote: > > > > On 01/10/2019 09:41 PM, Willem de Bruijn wrote: > > > On Wed, Nov 9, 2016 at 6:57 PM Martin KaFai Lau wrote: > > >> > > >> If the bpf program calls bpf_redirect(dev, 0) and

[PATCH net-next] net: hns: Use struct_size() in devm_kzalloc()

2019-01-15 Thread Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; struct boo entry[]; }; instance = devm_kzalloc(dev, si

[PATCH net] bpf: in __bpf_redirect_no_mac pull mac only if present

2019-01-15 Thread Willem de Bruijn
From: Willem de Bruijn Syzkaller was able to construct a packet of negative length by redirecting from bpf_prog_test_run_skb with BPF_PROG_TYPE_LWT_XMIT: BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:345 [inline] BUG: KASAN: slab-out-of-bounds in skb_copy_from_linear_da

[PATCH bpf-next 5/5] tools/bpf: support __int128 in bpftool map pretty dumper

2019-01-15 Thread Yonghong Song
For formatted output, currently when json is enabled, the decimal number is required. Similar to kernel bpffs printout, for int128 numbers, only hex numbers are dumped, which are quoted as strings. The below is an example to show plain and json pretty print based on the map in test_btf pretty prin

[PATCH bpf-next 0/5] bpf: support __int128 in BTF

2019-01-15 Thread Yonghong Song
Previous maximum supported integer bit width is 64. But the __int128 type has been supported by most (if not all) 64bit architectures including bpf for both gcc and clang. The kernel itself uses __int128 for x64 and arm64. Some bcc tools are using __int128 in bpf programs to describe ipv6 addresse

[PATCH bpf-next 1/5] bpf: btf: support 128 bit integer type

2019-01-15 Thread Yonghong Song
Currently, btf only supports up to 64-bit integer. On the other hand, 128bit support for gcc and clang has existed for a long time. For example, both gcc 4.8 and llvm 3.7 supports types "__int128" and "unsigned __int128" for virtually all 64bit architectures including bpf. The requirement for __in

[PATCH bpf-next 3/5] tools/bpf: refactor test_btf pretty printing for multiple map value formats

2019-01-15 Thread Yonghong Song
The test_btf pretty print is refactored in order to easily support multiple map value formats. The next patch will add __int128 type tests which needs macro guard __SIZEOF_INT128__. There is no functionality change with this patch. Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song --- too

[PATCH bpf-next 2/5] tools/bpf: add int128 raw test in test_btf

2019-01-15 Thread Yonghong Song
Several int128 raw type tests are added to test_btf. Currently these tests are enabled only for x64 and arm64 for which kernel has CONFIG_ARCH_SUPPORTS_INT128 set. $ test_btf .. BTF raw test[106] (128-bit int): OK BTF raw test[107] (struct, 128-bit int member): OK BTF raw test[108] (

[PATCH bpf-next 4/5] tools/bpf: add bpffs pretty print test for int128

2019-01-15 Thread Yonghong Song
The bpffs pretty print test is extended to cover int128 types. Tested on an x64 machine. $ test_btf -p .. BTF pretty print array(#3)..OK PASS:9 SKIP:0 FAIL:0 Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song --- tools/testing/selftests/bpf/test_btf.c | 79 +

[PATCH bpf-next] bpf: btf: add btf documentation

2019-01-15 Thread Yonghong Song
This patch added documentation for BTF (BPF Debug Format). The document is placed under linux:Documentation/bpf directory. Signed-off-by: Yonghong Song --- Documentation/bpf/btf.rst | 787 Documentation/bpf/index.rst | 7 + 2 files changed, 794 insertions

[PATCH v9 perf, bpf-next 8/9] perf top: Synthesize BPF events for pre-existing loaded BPF programs

2019-01-15 Thread Song Liu
From: Arnaldo Carvalho de Melo So that we can resolve symbols and map names. Cc: Song Liu Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: David Ahern Cc: Peter Zijlstra Cc: kernel-t...@fb.com Cc: netdev@vger.kernel.org Link: https://lkml.kernel.org/n/tip-h3loibff6htedj43q7uin...@git.kernel.o

[PATCH v9 perf, bpf-next 7/9] perf tools: synthesize PERF_RECORD_* for loaded BPF programs

2019-01-15 Thread Song Liu
This patch synthesize PERF_RECORD_KSYMBOL and PERF_RECORD_BPF_EVENT for BPF programs loaded before perf-record. This is achieved by gathering information about all BPF programs via sys_bpf. Signed-off-by: Song Liu --- tools/perf/builtin-record.c | 6 ++ tools/perf/util/bpf-event.c | 206 ++

[PATCH v9 perf, bpf-next 0/9] reveal invisible bpf programs

2019-01-15 Thread Song Liu
This set catches symbol for all bpf programs loaded/unloaded before/during/after perf-record run PERF_RECORD_KSYMBOL and PERF_RECORD_BPF_EVENT. PERF_RECORD_KSYMBOL and PERF_RECORD_BPF_EVENT includes key information of a bpf program load and unload. They are sent through perf ringbuffer, and stored

[PATCH v9 perf, bpf-next 2/9] sync tools/include/uapi/linux/perf_event.h

2019-01-15 Thread Song Liu
sync changes for PERF_RECORD_KSYMBOL Signed-off-by: Song Liu --- tools/include/uapi/linux/perf_event.h | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index 9de8780ac8d9.

[PATCH v9 perf, bpf-next 6/9] perf util: handle PERF_RECORD_BPF_EVENT

2019-01-15 Thread Song Liu
This patch adds basic handling of PERF_RECORD_BPF_EVENT. Tracking of PERF_RECORD_BPF_EVENT is OFF by default. Option --bpf-event is added to turn it on. Signed-off-by: Song Liu --- tools/perf/builtin-record.c | 1 + tools/perf/perf.h | 1 + tools/perf/util/Build | 2 ++ tools/

[PATCH v9 perf, bpf-next 5/9] perf util: handle PERF_RECORD_KSYMBOL

2019-01-15 Thread Song Liu
This patch handles PERF_RECORD_KSYMBOL in perf record/report. Specifically, map and symbol are created for ksymbol register, and removed for ksymbol unregister. This patch also set perf_event_attr.ksymbol properly. The flag is ON by default. Signed-off-by: Song Liu --- tools/perf/util/event.c

[PATCH v9 perf, bpf-next 3/9] perf, bpf: introduce PERF_RECORD_BPF_EVENT

2019-01-15 Thread Song Liu
For better performance analysis of BPF programs, this patch introduces PERF_RECORD_BPF_EVENT, a new perf_event_type that exposes BPF program load/unload information to user space. Each BPF program may contain up to BPF_MAX_SUBPROGS (256) sub programs. The following example shows kernel symbols for

[PATCH v9 perf, bpf-next 1/9] perf, bpf: Introduce PERF_RECORD_KSYMBOL

2019-01-15 Thread Song Liu
For better performance analysis of dynamically JITed and loaded kernel functions, such as BPF programs, this patch introduces PERF_RECORD_KSYMBOL, a new perf_event_type that exposes kernel symbol register/unregister information to user space. The following data structure is used for PERF_RECORD_KS

[PATCH v9 perf, bpf-next 4/9] sync tools/include/uapi/linux/perf_event.h

2019-01-15 Thread Song Liu
sync for PERF_RECORD_BPF_EVENT Signed-off-by: Song Liu --- tools/include/uapi/linux/perf_event.h | 29 ++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index 68c4da0227c5..8bd7

[PATCH v9 perf, bpf-next 9/9] bpf: add module name [bpf] to ksymbols for bpf programs

2019-01-15 Thread Song Liu
With this patch, /proc/kallsyms will show BPF programs as t bpf_prog__ [bpf] Signed-off-by: Song Liu --- kernel/kallsyms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index f3a04994e063..14934afa9e68 100644 --- a/kernel/kallsyms.c

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

2019-01-15 Thread David Miller
From: Jeff Kirsher Date: Tue, 15 Jan 2019 13:56:36 -0800 > This series contains updates to the ice driver only. Pulled, thanks Jeff.

Re: [PATCH bpf v3] tools/bpf: properly account for libbfd variations

2019-01-15 Thread Daniel Borkmann
On 01/15/2019 11:03 PM, Stanislav Fomichev wrote: > On some platforms, in order to link against libbfd, we need to > link against liberty and even possibly libz. Account for that > in the bpftool Makefile. We now have proper feature detection > for each case, so handle each one separately. > > See

[PATCH v3] netfilter: nft_meta: Add NFT_META_I/OIFKIND meta type

2019-01-15 Thread wenxu
From: wenxu In the ip_rcv the skb go through the PREROUTING hook first, Then jump in vrf device go through the same hook again. When conntrack dnat work with vrf, there will be some conflict for rules. Because the package go through the hook twice with different nf status ip link add user1 type

Re: [RFC net-next 0/6] devlink: add device (driver) information API

2019-01-15 Thread Jiri Pirko
Tue, Jan 15, 2019 at 10:06:42PM CET, jakub.kicin...@netronome.com wrote: >On Tue, 15 Jan 2019 11:30:10 -0800, Jonathan Lemon wrote: >> On 14 Jan 2019, at 16:50, Jakub Kicinski wrote: >> >> > Hi! >> > >> > For quite some time now the ethtool -i API has been showing its age. >> > The driver version

Re: [RFC PATCH 3/3] bpf, riscv: added eBPF JIT for RV64G

2019-01-15 Thread Daniel Borkmann
On 01/15/2019 09:35 AM, Björn Töpel wrote: > This commit adds eBPF JIT for RV64G. > > Codewise, it needs some refactoring. Currently there's a bit too much > copy-and-paste going on, and I know some places where I could optimize > the code generation a bit (mostly BPF_K type of instructions, deali

[PATCH bpf-next 5/6] bpftool: add push and enqueue commands

2019-01-15 Thread Stanislav Fomichev
This is intended to be used with queues and stacks and be more user-friendly than 'update' without the key. Example: bpftool map create /sys/fs/bpf/q type queue value 4 entries 10 name q bpftool map push pinned /sys/fs/bpf/q value 0 1 2 3 bpftool map peek pinned /sys/fs/bpf/q value: 00 01 02 03 b

[PATCH bpf-next 0/6] bpftool: support queue and stack

2019-01-15 Thread Stanislav Fomichev
This patch series add support for queue/stack manipulations. It goes like this: #1 and #2 add support for queue/stack in existing 'update' and 'lookup' commands by permitting empty keys. #3 make sure we don't print empty keys for queue/stack. #4 adds peek command, it's essentially an alias for 'l

[PATCH bpf-next 4/6] bpftool: add peek command

2019-01-15 Thread Stanislav Fomichev
This is intended to be used with queues and stacks and be more user-friendly than 'lookup' without key/value. Example: bpftool map create /sys/fs/bpf/q type queue value 4 entries 10 name q bpftool map update pinned /sys/fs/bpf/q value 0 1 2 3 bpftool map peek pinned /sys/fs/bpf/q value: 00 01 02 0

[PATCH bpf-next 2/6] bpftool: make key optional in lookup command

2019-01-15 Thread Stanislav Fomichev
Bpftool expects key for 'lookup' operations. For some map types, key should not be specified. Support looking up those map types. Before: bpftool map create /sys/fs/bpf/q type queue value 4 entries 10 name q bpftool map update pinned /sys/fs/bpf/q value 0 1 2 3 bpftool map lookup pinned /sys/fs/bp

[PATCH bpf-next 3/6] bpftool: don't print empty key/value for maps

2019-01-15 Thread Stanislav Fomichev
When doing dump or lookup, don't print key if key_size == 0 or value if value_size == 0. The initial usecase is queue and stack, where we have only values. This is for regular output only, json still has all the fields. Before: bpftool map create /sys/fs/bpf/q type queue value 4 entries 10 name q

[PATCH bpf-next 6/6] bpftool: add pop and dequeue commands

2019-01-15 Thread Stanislav Fomichev
This is intended to be used with queues and stacks, it pops and prints the last element via bpf_map_lookup_and_delete_elem. Example: bpftool map create /sys/fs/bpf/q type queue value 4 entries 10 name q bpftool map push pinned /sys/fs/bpf/q value 0 1 2 3 bpftool map pop pinned /sys/fs/bpf/q value

[PATCH bpf-next 1/6] bpftool: make key and value optional in update command

2019-01-15 Thread Stanislav Fomichev
Bpftool expects both key and value for 'update' operations. For some map types, key should not be specified. Support updating those map types. Before: bpftool map create /sys/fs/bpf/q type queue value 4 entries 10 name q bpftool map update pinned /sys/fs/bpf/q value 0 1 2 3 Error: did not find key

[PATCH net-next] mlxsw: spectrum_nve: Use struct_size() in kzalloc()

2019-01-15 Thread Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; struct boo entry[]; }; instance = kzalloc(sizeof(struc

[PATCH net-next] net: phy: Add helpers to determine if PHY driver is generic

2019-01-15 Thread Florian Fainelli
We are already checking in phy_detach() that the PHY driver is of generic kind (1G or 10G) and we are going to make use of that in the SFP layer as well for 1000BaseT SFP modules, so expose helper functions to return that information. Signed-off-by: Florian Fainelli --- drivers/net/phy/phy_devic

[PATCH net-next 1/3] net: dsa: Split platform data to header file

2019-01-15 Thread Florian Fainelli
Instead of having net/dsa.h contain both the internal switch tree/driver structures, split the relevant platform_data parts into include/linux/platform_data/dsa.h and make that header be included by net/dsa.h in order not to break any setup. A subsequent set of patches will update code including ne

[PATCH net-next 2/3] ARM: orion5x: Include platform_data/dsa.h

2019-01-15 Thread Florian Fainelli
Now that we have split the DSA platform data structures from the main net/dsa.h header file, include only the relevant header file. Signed-off-by: Florian Fainelli --- arch/arm/mach-orion5x/common.c | 2 +- arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c | 2 +- arch/arm/mach-orion5x/

[PATCH net-next 3/3] net: dsa: Include platform_data header file

2019-01-15 Thread Florian Fainelli
b53 and mv88e6xxx support passing platform_data, and now that we have split the platform_data portion from the main net/dsa.h header file, include only the relevant parts. Signed-off-by: Florian Fainelli --- include/linux/platform_data/b53.h | 2 +- include/linux/platform_data/mv88e6xxx.h

[PATCH net-next 0/3] net: dsa: Split platform data to header file

2019-01-15 Thread Florian Fainelli
Hi all, This patch series decouples the DSA platform data structures from net/dsa.h which was getting used for all sorts of DSA related structures. It would probably make sense for this series to go via David's net-next tree to avoid conflicts on the ARM part, since we cannot obviously include a

[PATCH net-next] mlxsw: spectrum_acl_bloom_filter: use struct_size() in kzalloc()

2019-01-15 Thread Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; void *entry[]; }; instance = kzalloc(sizeof(struct foo

  1   2   3   >