Re: [PATCH net 2/2] IB/ipoib: Fix netlink support in IPoIB

2017-12-31 Thread Leon Romanovsky
On Sun, Dec 31, 2017 at 01:23:08PM -0700, Jason Gunthorpe wrote: > On Sun, Dec 31, 2017 at 01:16:23PM +0200, Denis Drozdov wrote: > > IPoIB netlink support was broken by commit cd565b4b51e5 > > ("IB/IPoIB: Support acceleration options callbacks"), > > that added flow which allocates netdev rdma

[PATCHv5 3/3] MAINTAINERS: Add entry for Socionext ethernet driver

2017-12-31 Thread jassisinghbrar
From: Jassi Brar Add entry for the Socionext Netsec controller driver and DT bindings. Acked-by: Ard Biesheuvel Signed-off-by: Jassi Brar --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff

[PATCHv5 2/3] net: socionext: Add Synquacer NetSec driver

2017-12-31 Thread jassisinghbrar
From: Jassi Brar This driver adds support for Socionext "netsec" IP Gigabit Ethernet + PHY IP used in the Synquacer SC2A11 SoC. Signed-off-by: Ard Biesheuvel Signed-off-by: Jassi Brar ---

[PATCHv5 1/3] dt-bindings: net: Add DT bindings for Socionext Netsec

2017-12-31 Thread jassisinghbrar
From: Jassi Brar This patch adds documentation for Device-Tree bindings for the Socionext NetSec Controller driver. Signed-off-by: Jassi Brar Signed-off-by: Ard Biesheuvel ---

[PATCHv5 0/3] Socionext Synquacer NETSEC driver

2017-12-31 Thread jassisinghbrar
From: Jassi Brar Hi, Changes since v4 # Fixed ucode indexing as a word, instead of byte # Removed redundant clocks, keep only phy rate reference clock and expect it to be 'phy_ref_clk' Changes since v3 # Discard

Re: [PATCH net-next 2/2] tuntap: XDP transmission

2017-12-31 Thread kbuild test robot
Hi Jason, I love your patch! Yet something to improve: [auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Jason-Wang/XDP-transmission-for-tuntap/20180101-105946 config: i386-randconfig-s1-201800 (attached as .config) compiler: gcc-6 (Debian 6.4.0-9)

Re: [PATCH net-next 2/2] tuntap: XDP transmission

2017-12-31 Thread Joe Perches
On Mon, 2018-01-01 at 11:48 +0800, kbuild test robot wrote: > Hi Jason, > > I love your patch! Perhaps something to improve: > > [auto build test WARNING on net-next/master] > > url: > https://github.com/0day-ci/linux/commits/Jason-Wang/XDP-transmission-for-tuntap/20180101-105946 > config:

Re: [PATCH for-4.14.y 0/5] e1000e: Upstream fixes for linux-4.14.y

2017-12-31 Thread Benjamin Poirier
On 2017/12/19 15:27, Jeff Kirsher wrote: > On Tue, 2017-12-19 at 10:10 +0900, Benjamin Poirier wrote: > > On 2017/12/18 12:59, Greg KH wrote: > > > On Mon, Dec 11, 2017 at 10:58:10PM +0100, Christian Hesse wrote: > > > > Greg KH on Tue, 2017/12/05 08:35: > > > > > On

Re: [PATCH net-next 2/2] tuntap: XDP transmission

2017-12-31 Thread kbuild test robot
Hi Jason, I love your patch! Perhaps something to improve: [auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/Jason-Wang/XDP-transmission-for-tuntap/20180101-105946 config: i386-randconfig-x072-201800 (attached as .config) compiler: gcc-7 (Debian

Re: [PATCH] rds: fix use-after-free read in rds_find_bound

2017-12-31 Thread santosh.shilim...@oracle.com
On 12/31/17 4:33 AM, Sowmini Varadhan wrote: On (12/30/17 21:09), santosh.shilim...@oracle.com wrote: Right. This was loop transport in action so xmit will just flip the direction with receive. And rds_recv_incoming() can race with socket_release. rds_find_bound() is suppose to add ref count on

[PATCH] ppp: Delete an error message for a failed memory allocation in three functions

2017-12-31 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 31 Dec 2017 22:27:23 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH] smsc95xx: Delete an error message for a failed memory allocation in smsc95xx_suspend()

2017-12-31 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 31 Dec 2017 22:06:49 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

Re: [PATCH net 2/2] IB/ipoib: Fix netlink support in IPoIB

2017-12-31 Thread Jason Gunthorpe
On Sun, Dec 31, 2017 at 01:16:23PM +0200, Denis Drozdov wrote: > IPoIB netlink support was broken by commit cd565b4b51e5 > ("IB/IPoIB: Support acceleration options callbacks"), > that added flow which allocates netdev rdma structures > after netlink object is already created. Such situation leads

Re: [net-next: PATCH v2 5/5] net: mvpp2: enable ACPI support in the driver

2017-12-31 Thread Andrew Lunn
> * Modify way of obtaining interrupts - with ACPI they are resources > bound to struct platform_device and it's not possible to obtain > them directly from the child node. Hence a formula is used, depending > on the port_id and number of possible CPUs. Hi Marcin I know nothing about ACPI.

Re: [net-next: PATCH v2 4/5] net: mvpp2: use device_*/fwnode_* APIs instead of of_*

2017-12-31 Thread Andrew Lunn
On Sun, Dec 31, 2017 at 12:58:39PM +0100, Marcin Wojtas wrote: Hi Marcin > Because there is no equivalent for for_each_available_child_of_node(), > use device_for_each_child_node() and check the port availability > inside the mvpp2_port_probe() routine. Could device_each_available_child_node()

[PATCH 1/2] ravb: kill redundant check in the probe() method

2017-12-31 Thread Sergei Shtylyov
Browsing thru the driver diassembly, I noticed that gcc was able to figure out that the 'ndev' pointer is always non-NULL when calling free_netdev() on the probe() method's error path and thus skip that redundant NULL check... gcc is smart, be like gcc! :-) Signed-off-by: Sergei Shtylyov

[PATCH 0/2] Kill redundant checks in the Renesas Ethernet drivers

2017-12-31 Thread Sergei Shtylyov
Hello! Here's a set of 2 patches against DaveM's 'net-next.git' repo removing redundant checks in the driver probe() methods. [1/2] ravb: kill redundant check in the probe() method [2/2] sh_eth: kill redundant check in the probe() method MBR, Sergei

[PATCH 2/2] sh_eth: kill redundant check in the probe() method

2017-12-31 Thread Sergei Shtylyov
Browsing thru the driver diassembly, I noticed that gcc was able to figure out that the 'ndev' pointer is always non-NULL when calling free_netdev() on the probe() method's error path and thus skip that redundant NULL check... gcc is smart, be like gcc! :-) Signed-off-by: Sergei Shtylyov

[PATCH v3 bpf-next 07/11] bpf: Add support for reading sk_state and more

2017-12-31 Thread Lawrence Brakmo
Add support for reading many more tcp_sock fields state,same as sk->sk_state rtt_min same as sk->rtt_min.s[0].v (current rtt_min) snd_ssthresh rcv_nxt snd_nxt snd_una mss_cache ecn_flags rate_delivered rate_interval_us packets_out retrans_out total_retrans

[PATCH v3 bpf-next 11/11] bpf: add selftest for tcpbpf

2017-12-31 Thread Lawrence Brakmo
Added a selftest for tcpbpf (sock_ops) that checks that the appropriate callbacks occured and that it can access tcp_sock fields and that their values are correct. Run with command: ./test_tcpbpf_user Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h

[PATCH v3 bpf-next 09/11] bpf: Add BPF_SOCK_OPS_RETRANS_CB

2017-12-31 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a retransmission. Two arguments are used; one for the sequence number and other for the number of segments retransmitted. Does not include syn-ack retransmissions. New op: BPF_SOCK_OPS_RETRANS_CB. Signed-off-by: Lawrence Brakmo

[PATCH v3 bpf-next 05/11] bpf: Adds field bpf_sock_ops_flags to tcp_sock

2017-12-31 Thread Lawrence Brakmo
Adds field bpf_sock_ops_flags to tcp_sock and bpf_sock_ops. Its primary use is to determine if there should be calls to sock_ops bpf program at various points in the TCP code. The field is initialized to zero, disabling the calls. A sock_ops BPF program can set, per connection and as necessary,

[PATCH v3 bpf-next 08/11] bpf: Add sock_ops R/W access to tclass & sk_txhash

2017-12-31 Thread Lawrence Brakmo
Adds direct R/W access to sk_txhash and access to tclass for ipv6 flows through getsockopt and setsockopt. Sample usage for tclass: bpf_getsockopt(skops, SOL_IPV6, IPV6_TCLASS, , sizeof(v)) where skops is a pointer to the ctx (struct bpf_sock_ops). Signed-off-by: Lawrence Brakmo

[PATCH v3 bpf-next 06/11] bpf: Add sock_ops RTO callback

2017-12-31 Thread Lawrence Brakmo
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 5 +

[PATCH v3 bpf-next 01/11] bpf: Make SOCK_OPS_GET_TCP size independent

2017-12-31 Thread Lawrence Brakmo
Make SOCK_OPS_GET_TCP helper macro size independent (before only worked with 4-byte fields. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index

[PATCH v3 bpf-next 02/11] bpf: Make SOCK_OPS_GET_TCP struct independent

2017-12-31 Thread Lawrence Brakmo
Changed SOCK_OPS_GET_TCP to SOCK_OPS_GET_FIELD and added 2 arguments so now it can also work with struct sock fields. The first argument is the name of the field in the bpf_sock_ops struct, the 2nd argument is the name of the field in the OBJ struct. Previous: SOCK_OPS_GET_TCP(FIELD_NAME) New:

[PATCH v3 bpf-next 00/11] bpf: More sock_ops callbacks

2017-12-31 Thread Lawrence Brakmo
This patchset adds support for: - direct R or R/W access to many tcp_sock fields - passing up to 4 arguments to sock_ops BPF functions - tcp_sock field bpf_sock_ops_flags for controlling callbacks - optionally calling sock_ops BPF program when RTO fires - optionally calling sock_ops BPF program

[PATCH v3 bpf-next 10/11] bpf: Add BPF_SOCK_OPS_STATE_CB

2017-12-31 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a TCP state change. Two arguments are used; one for the old state and another for the new state. There is a new enum in include/uapi/linux/bpf.h that exports the TCP states that prepends BPF_ to the current TCP state names. If it is ever

[PATCH v3 bpf-next 04/11] bpf: Support passing args to sock_ops bpf function

2017-12-31 Thread Lawrence Brakmo
Adds support for passing up to 4 arguments to sock_ops bpf functions. It reusues the reply union, so the bpf_sock_ops structures are not increased in size. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 1 + include/net/tcp.h| 64

[PATCH v3 bpf-next 03/11] bpf: Add write access to tcp_sock and sock fields

2017-12-31 Thread Lawrence Brakmo
This patch adds a macro, SOCK_OPS_SET_FIELD, for writing to struct tcp_sock or struct sock fields. This required adding a new field "temp" to struct bpf_sock_ops_kern for temporary storage that is used by sock_ops_convert_ctx_access. It is used to store and recover the contents of a register, so

[RFC PATCH net-next 02/19] ipv6: Mark dead nexthops with appropriate flags

2017-12-31 Thread Ido Schimmel
When a netdev is put administratively down or unregistered all the nexthops using it as their nexthop device should be marked with the 'dead' and 'linkdown' flags. Currently, when a route is dumped its nexthop device is tested and the flags are set accordingly. A similar check is performed during

[RFC PATCH net-next 06/19] ipv6: Set nexthop flags during route creation

2017-12-31 Thread Ido Schimmel
It is valid to install routes with a nexthop device that does not have a carrier, so we need to make sure they're marked accordingly. As explained in the previous patch, host and anycast routes are never marked with the 'linkdown' flag. Note that reject routes are unaffected, as these use the

[RFC PATCH net-next 07/19] ipv6: Check nexthop flags during route lookup instead of carrier

2017-12-31 Thread Ido Schimmel
Now that the RTNH_F_LINKDOWN flag is set in nexthops, we can avoid the need to dereference the nexthop device and check its carrier and instead check for the presence of the flag. Signed-off-by: Ido Schimmel --- net/ipv6/route.c | 7 +++ 1 file changed, 3 insertions(+),

[RFC PATCH net-next 05/19] ipv6: Set nexthop flags upon carrier change

2017-12-31 Thread Ido Schimmel
Similar to IPv4, when the carrier of a netdev changes we should toggle the 'linkdown' flag on all the nexthops using it as their nexthop device. This will later allow us to test for the presence of this flag during route lookup and dump. Up until commit 4832c30d5458 ("net: ipv6: put host and

[RFC PATCH net-next 11/19] ipv6: Add explicit flush indication to routes

2017-12-31 Thread Ido Schimmel
When routes that are a part of a multipath route are evaluated by fib6_ifdown() in response to NETDEV_DOWN and NETDEV_UNREGISTER events the state of their sibling routes is not considered. This will change in subsequent patches in order to align IPv6 with IPv4's behavior. For example, when the

[RFC PATCH net-next 16/19] ipv6: Flush multipath routes when all siblings are dead

2017-12-31 Thread Ido Schimmel
By default, IPv6 deletes nexthops from a multipath route when the nexthop device is put administratively down. This differs from IPv4 where the nexthops are kept, but marked with the RTNH_F_DEAD flag. A multipath route is flushed when all of its nexthops become dead. Align IPv6 with IPv4 and have

[RFC PATCH net-next 15/19] ipv6: Take table lock outside of sernum update function

2017-12-31 Thread Ido Schimmel
The next patch is going to allow dead routes to remain in the FIB tree in certain situations. When this happens we need to be sure to bump the sernum of the nodes where these are stored so that potential copies cached in sockets are invalidated. The function that performs this update assumes the

[RFC PATCH net-next 09/19] ipv6: Ignore dead routes during lookup

2017-12-31 Thread Ido Schimmel
Currently, dead routes are only present in the routing tables in case the 'ignore_routes_with_linkdown' sysctl is set. Otherwise, they are flushed. Subsequent patches are going to remove the reliance on this sysctl and make IPv6 more consistent with IPv4. Before this is done, we need to make

[RFC PATCH net-next 12/19] ipv6: Teach tree walker to skip multipath routes

2017-12-31 Thread Ido Schimmel
As explained in previous patch, fib6_ifdown() needs to consider the state of all the sibling routes when a multipath route is traversed. This is done by evaluating all the siblings when the first sibling in a multipath route is traversed. If the multipath route does not need to be flushed (e.g.,

[RFC PATCH net-next 14/19] ipv6: Export sernum update function

2017-12-31 Thread Ido Schimmel
We are going to allow dead routes to stay in the FIB tree (e.g., when they are part of a multipath route, directly connected route with no carrier) and revive them when their nexthop device gains carrier or when it is put administratively up. This is equivalent to the addition of the route to the

[RFC PATCH net-next 19/19] selftests: fib_tests: Add test cases for netdev carrier change

2017-12-31 Thread Ido Schimmel
Check that IPv4 and IPv6 react the same when the carrier of a netdev is toggled. Local routes should not be affected by this, whereas unicast routes should. Signed-off-by: Ido Schimmel --- tools/testing/selftests/net/fib_tests.sh | 142 +++ 1

[RFC PATCH net-next 17/19] selftests: fib_tests: Add test cases for IPv4/IPv6 FIB

2017-12-31 Thread Ido Schimmel
Add test cases to check that IPv4 and IPv6 react the same when a netdev is being unregistered. Signed-off-by: Ido Schimmel --- tools/testing/selftests/net/Makefile | 1 + tools/testing/selftests/net/fib_tests.sh | 145 +++ 2 files changed,

[RFC PATCH net-next 18/19] selftests: fib_tests: Add test cases for netdev down

2017-12-31 Thread Ido Schimmel
Check that IPv4 and IPv6 react the same when a netdev is being put administratively down. Signed-off-by: Ido Schimmel --- tools/testing/selftests/net/fib_tests.sh | 141 +++ 1 file changed, 141 insertions(+) diff --git

[RFC PATCH net-next 08/19] ipv6: Check nexthop flags in route dump instead of carrier

2017-12-31 Thread Ido Schimmel
Similar to previous patch, there is no need to check for the carrier of the nexthop device when dumping the route and we can instead check for the presence of the RTNH_F_LINKDOWN flag. Signed-off-by: Ido Schimmel --- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+),

[RFC PATCH net-next 13/19] ipv6: Flush all sibling routes upon NETDEV_UNREGISTER

2017-12-31 Thread Ido Schimmel
IPv4 and IPv6 react differently to a netdev being unregistered. In IPv4, in case the netdev is used as a nexthop device in a multipath route, the entire route is flushed. However, IPv6 only removes the nexthops associated with the unregistered netdev. Align IPv4 and IPv6 and flush all the

[RFC PATCH net-next 03/19] ipv6: Clear nexthop flags upon netdev up

2017-12-31 Thread Ido Schimmel
Previous patch marked nexthops with the 'dead' and 'linkdown' flags. Clear these flags when the netdev comes back up. Signed-off-by: Ido Schimmel --- include/net/ip6_route.h | 1 + net/ipv6/addrconf.c | 3 +++ net/ipv6/route.c| 29 +

[RFC PATCH net-next 01/19] ipv6: Remove redundant route flushing during namespace dismantle

2017-12-31 Thread Ido Schimmel
By the time fib6_net_exit() is executed all the netdevs in the namespace have been either unregistered or pushed back to the default namespace. That is because pernet subsys operations are always ordered before pernet device operations and therefore invoked after them during namespace dismantle.

[RFC PATCH net-next 00/19] ipv6: Align nexthop behaviour with IPv4

2017-12-31 Thread Ido Schimmel
This set tries to eliminate some differences between IPv4's and IPv6's treatment of nexthops. These differences are most likely a side effect of IPv6's data structures (specifically 'rt6_info') that incorporate both the route and the nexthop and the late addition of ECMP support in commit

[RFC PATCH net-next 04/19] ipv6: Prepare to handle multiple netdev events

2017-12-31 Thread Ido Schimmel
To make IPv6 more in line with IPv4 we need to be able to respond differently to different netdev events. For example, when a netdev is unregistered all the routes using it as their nexthop device should be flushed, whereas when the netdev's carrier changes only the 'linkdown' flag should be

[RFC PATCH net-next 10/19] ipv6: Report dead flag during route dump

2017-12-31 Thread Ido Schimmel
Up until now the RTNH_F_DEAD flag was only reported in route dump when the 'ignore_routes_with_linkdown' sysctl was set. This is expected as dead routes were flushed otherwise. The reliance on this sysctl is going to be removed, so we need to report the flag regardless of the sysctl's value.

Re: [PATCH ipsec] xfrm: fix rcu usage in xfrm_get_type_offload

2017-12-31 Thread Steffen Klassert
On Sun, Dec 31, 2017 at 04:18:56PM +0100, Sabrina Dubroca wrote: > request_module can sleep, thus we cannot hold rcu_read_lock() while > calling it. The function also jumps back and takes rcu_read_lock() > again (in xfrm_state_get_afinfo()), resulting in an imbalance. > > This codepath is

Re: [PATCH bpf-next v3 0/9] bpf: offload: report device back to user space (take 2)

2017-12-31 Thread Daniel Borkmann
On 12/28/2017 03:39 AM, Jakub Kicinski wrote: > Hi! > > This series is a redo of reporting offload device information to > user space after the first attempt did not take into account name > spaces. As requested by Kirill offloads are now protected by an > r/w sem. This allows us to remove the

Re: [patch net-next v2 00/10] Add support for resource abstraction

2017-12-31 Thread David Ahern
On 12/31/17 3:52 AM, Arkadi Sharshevsky wrote: >> [1] This is allowed by the current patch set and perhaps it should not be: >> >> $ ip ro ls vrf vrf1101 >> unreachable default metric 8192 >> 11.2.51.0/24 dev swp1s0.51 proto kernel scope link src 11.2.51.1 offload >> 11.3.51.0/24 dev swp1s1.51

[PATCH ipsec] xfrm: fix rcu usage in xfrm_get_type_offload

2017-12-31 Thread Sabrina Dubroca
request_module can sleep, thus we cannot hold rcu_read_lock() while calling it. The function also jumps back and takes rcu_read_lock() again (in xfrm_state_get_afinfo()), resulting in an imbalance. This codepath is triggered whenever a new offloaded state is created. Fixes: ffdb5211da1c ("xfrm:

Re: [PATCH] rds: fix use-after-free read in rds_find_bound

2017-12-31 Thread Sowmini Varadhan
On (12/30/17 21:09), santosh.shilim...@oracle.com wrote: > Right. This was loop transport in action so xmit will just flip > the direction with receive. And rds_recv_incoming() can race with > socket_release. rds_find_bound() is suppose to add ref count on > socket for rds_recv_incoming() but by

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

2017-12-31 Thread Paul Menzel
Dear Jesper, Just some nits. In the description, the verb *set up* is written with a space. Am 31.12.2017 um 12:01 schrieb Jesper Dangaard Brouer: The i40e driver have a special "FDIR" RX-ring (I40E_VSI_FDIR) which is s/have/has/ a sideband channel for configuring/updating the flow

Re: [PATCH net 0/2] IB/ipoib: ip link support

2017-12-31 Thread Or Gerlitz
On Sun, Dec 31, 2017 at 1:16 PM, Denis Drozdov wrote: > IP link was broken due to the changes in IPoIB for the rdma_netdev > support after commit cd565b4b51e5 > ("IB/IPoIB: Support acceleration options callbacks"). you are approaching stable kernels, right? lets make sure

[PATCH] liquidio: Use zeroing memory allocator than allocator/memset

2017-12-31 Thread Himanshu Jha
Use vzalloc for allocating zeroed memory and remove unnecessary memset function. Done using Coccinelle. Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci 0-day tested with no failures. Suggested-by: Luis R. Rodriguez Signed-off-by: Himanshu Jha

Re: [PATCH] brcmfmac: Use zeroing memory allocator than allocator/memset

2017-12-31 Thread Andy Shevchenko
On Sat, Dec 30, 2017 at 5:51 PM, Himanshu Jha wrote: > Use dma_zalloc_coherent for allocating zeroed > memory and remove unnecessary memset function. > > Done using Coccinelle. > Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci > 0-day tested with no

[net-next: PATCH v2 0/5] Armada 7k/8k PP2 ACPI support

2017-12-31 Thread Marcin Wojtas
Hi, This a second version of a patchset, which introduces ACPI support in mvpp2 driver. Comparing to the initial one, all patches touching generic ACPI MDIO bus / PHY handling were removed and after some modifications will be resend separately. They may require a longer discussion in terms of

[net-next: PATCH v2 5/5] net: mvpp2: enable ACPI support in the driver

2017-12-31 Thread Marcin Wojtas
This patch introduces an alternative way of obtaining resources - via ACPI tables provided by firmware. Enabling coexistence with the DT support, in addition to the OF_*->device_*/fwnode_* API replacement, required following steps to be taken: * Add mvpp2_acpi_match table * Omit clock

[net-next: PATCH v2 3/5] net: mvpp2: simplify maintaining enabled ports' list

2017-12-31 Thread Marcin Wojtas
'port_count' field of the mvpp2 structure holds an overall amount of available ports, based on DT nodes status. In order to be prepared to support other HW description, obtain the value by incrementing it upon each successful port initialization. This allowed for simplifying port indexing in the

[net-next: PATCH v2 4/5] net: mvpp2: use device_*/fwnode_* APIs instead of of_*

2017-12-31 Thread Marcin Wojtas
OF functions can be used only for the driver using DT. As a preparation for introducing ACPI support in mvpp2 driver, use struct fwnode_handle in order to obtain properties from the hardware description. Because there is no equivalent for for_each_available_child_of_node(), use

[net-next: PATCH v2 2/5] device property: Introduce fwnode_get_phy_mode()

2017-12-31 Thread Marcin Wojtas
Until now there were two almost identical functions for obtaining network PHY mode - of_get_phy_mode() and, more generic, device_get_phy_mode(). However it is not uncommon, that the network interface is represented as a child of the actual controller, hence it is not associated directly to any

[net-next: PATCH v2 1/5] device property: Introduce fwnode_get_mac_address()

2017-12-31 Thread Marcin Wojtas
Until now there were two almost identical functions for obtaining MAC address - of_get_mac_address() and, more generic, device_get_mac_address(). However it is not uncommon, that the network interface is represented as a child of the actual controller, hence it is not associated directly to any

Re: [PATCH v2 bpf-next 06/11] bpf: Add sock_ops RTO callback

2017-12-31 Thread Lawrence Brakmo
On 12/28/17, 9:58 AM, "Yuchung Cheng" wrote: On Thu, Dec 21, 2017 at 5:20 PM, Lawrence Brakmo wrote: > > Adds an optional call to sock_ops BPF program based on whether the > BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. > The BPF

Re: [PATCH bpf-next v4 2/3] libbpf: add error reporting in XDP

2017-12-31 Thread Philippe Ombredanne
On Sat, Dec 30, 2017 at 9:41 PM, Eric Leblond wrote: > Parse netlink ext attribute to get the error message returned by > the card. Code is partially take from libnl. > > Signed-off-by: Eric Leblond > Acked-by: Alexei Starovoitov > ---

[PATCH net 2/2] IB/ipoib: Fix netlink support in IPoIB

2017-12-31 Thread Denis Drozdov
IPoIB netlink support was broken by commit cd565b4b51e5 ("IB/IPoIB: Support acceleration options callbacks"), that added flow which allocates netdev rdma structures after netlink object is already created. Such situation leads to crash in __ipoib_device_add, once trying to reuse netlink device.

[PATCH net 0/2] IB/ipoib: ip link support

2017-12-31 Thread Denis Drozdov
IP link was broken due to the changes in IPoIB for the rdma_netdev support after commit cd565b4b51e5 ("IB/IPoIB: Support acceleration options callbacks"). This patchset restores IPoIB pkey creation and removal using rtnetlink. The first patch introduces changes in the rtnetlink code in order to

[PATCH net 1/2] rtnl: device allocation/free via rtnl_link_ops

2017-12-31 Thread Denis Drozdov
Introduced new rtnl_link_ops callbacks: alloc_link() to allocate multi-queue netdev and free_link() to release the netdevice. free_link() appoints to free_netdev by default and could be reassigned. These calls should be used by IB ULP code to allocate and release both enhanced and non-enhanced IB

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

2017-12-31 Thread Jesper Dangaard Brouer
Now all XDP driver have been updated to setup xdp_rxq_info and assign this to xdp_buff->rxq. Thus, it is now safe to enable access to some of the xdp_rxq_info struct members. This patch extend xdp_md and expose UAPI to userspace for ingress_ifindex and rx_queue_index. Access happens via bpf

[bpf-next V3 PATCH 10/14] tun: setup xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
Driver hook points for xdp_rxq_info: * reg : tun_attach * unreg: __tun_detach I've done some manual testing of this tun driver, but I would appriciate good review and someone else running their use-case tests, as I'm not 100% sure I understand the tfile->detached semantics. V2: Removed the

[bpf-next V3 PATCH 11/14] virtio_net: setup xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
The virtio_net driver doesn't dynamically change the RX-ring queue layout and backing pages, but instead reject XDP setup if all the conditions for XDP is not meet. Thus, the xdp_rxq_info also remains fairly static. This allow us to simply add the reg/unreg to net_device open/close functions.

[bpf-next V3 PATCH 14/14] samples/bpf: program demonstrating access to xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
This sample program can be used for monitoring and reporting how many packets per sec (pps) are received per NIC RX queue index and which CPU processed the packet. In itself it is a useful tool for quickly identifying RSS imbalance issues, see below. The default XDP action is XDP_PASS in-order to

[bpf-next V3 PATCH 12/14] xdp: generic XDP handling of xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
Hook points for xdp_rxq_info: * reg : netif_alloc_rx_queues * unreg: netif_free_rx_queues The net_device have some members (num_rx_queues + real_num_rx_queues) and data-area (dev->_rx with struct netdev_rx_queue's) that were primarily used for exporting information about RPS (CONFIG_RPS)

[bpf-next V3 PATCH 07/14] bnxt_en: setup xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
Driver hook points for xdp_rxq_info: * reg : bnxt_alloc_rx_rings * unreg: bnxt_free_rx_rings This driver should be updated to re-register when changing allocation mode of RX rings. Tested on actual hardware. Cc: Andy Gospodarek Cc: Michael Chan

[bpf-next V3 PATCH 09/14] thunderx: setup xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
This driver uses a bool scheme for "enable"/"disable" when setting up different resources. Thus, the hook points for xdp_rxq_info is done in the same function call nicvf_rcv_queue_config(). This is activated through enable/disable via nicvf_config_data_transfer(), which is tied into

[bpf-next V3 PATCH 08/14] nfp: setup xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
Driver hook points for xdp_rxq_info: * reg : nfp_net_rx_ring_alloc * unreg: nfp_net_rx_ring_free In struct nfp_net_rx_ring moved member @size into a hole on 64-bit. Thus, the size remaines the same after adding member @xdp_rxq. Cc: oss-driv...@netronome.com Cc: Jakub Kicinski

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

2017-12-31 Thread Jesper Dangaard Brouer
This patch only introduce the core data structures and API functions. All XDP enabled drivers must use the API before this info can used. There is a need for XDP to know more about the RX-queue a given XDP frames have arrived on. For both the XDP bpf-prog and kernel side. Instead of extending

[bpf-next V3 PATCH 03/14] i40e: setup xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
The i40e driver have a special "FDIR" RX-ring (I40E_VSI_FDIR) which is a sideband channel for configuring/updating the flow director tables. This (i40e_vsi_)type does not invoke XDP-ebpf code. Thus, mark this type as a XDP RX-queue type RXQ_TYPE_SINK. Driver hook points for xdp_rxq_info: * reg

[bpf-next V3 PATCH 06/14] mlx4: setup xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
Driver hook points for xdp_rxq_info: * reg : mlx4_en_create_rx_ring * unreg: mlx4_en_destroy_rx_ring Tested on actual hardware. Cc: Tariq Toukan Signed-off-by: Jesper Dangaard Brouer --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c |3 ++-

[bpf-next V3 PATCH 04/14] ixgbe: setup xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
Driver hook points for xdp_rxq_info: * reg : ixgbe_setup_rx_resources() * unreg: ixgbe_free_rx_resources() Tested on actual hardware. V2: Fix ixgbe_set_ringparam, clear xdp_rxq_info in temp_ring Cc: intel-wired-...@lists.osuosl.org Cc: Jeff Kirsher Cc: Alexander

[bpf-next V3 PATCH 00/14] xdp: new XDP rx-queue info concept

2017-12-31 Thread Jesper Dangaard Brouer
V3: * Fixed bug in virtio_net driver * Remove export of xdp_rxq_info_init() V2: * Changed API exposed to drivers - Removed invocation of "init" in drivers, and only call "reg" (Suggested by Saeed) - Allow "reg" to fail and handle this in drivers (Suggested by David Ahern) * Removed

[bpf-next V3 PATCH 05/14] xdp/qede: setup xdp_rxq_info and intro xdp_rxq_info_is_reg

2017-12-31 Thread Jesper Dangaard Brouer
The driver code qede_free_fp_array() depend on kfree() can be called with a NULL pointer. This stems from the qede_alloc_fp_array() function which either (kz)alloc memory for fp->txq or fp->rxq. This also simplifies error handling code in case of memory allocation failures, but xdp_rxq_info_unreg

[bpf-next V3 PATCH 02/14] xdp/mlx5: setup xdp_rxq_info

2017-12-31 Thread Jesper Dangaard Brouer
The mlx5 driver have a special drop-RQ queue (one per interface) that simply drops all incoming traffic. It helps driver keep other HW objects (flow steering) alive upon down/up operations. It is temporarily pointed by flow steering objects during the interface setup, and when interface is down.

Re: [patch net-next v2 00/10] Add support for resource abstraction

2017-12-31 Thread Arkadi Sharshevsky
On 12/30/2017 11:15 PM, David Ahern wrote: > On 12/28/17 1:21 AM, Yuval Mintz wrote: >> I think it goes the other way around. The dpipe tables are the ones that >> can be translated to functionality; The resources are internal and >> HW-specific >> representing the possible internal division of

Re: [PATCH net-next 2/2] tun: allow to attach ebpf socket filter

2017-12-31 Thread Willem de Bruijn
On Fri, Dec 29, 2017 at 3:44 AM, Jason Wang wrote: > This patch allows userspace to attach eBPF filter to tun. This will > allow to implement VM dataplane filtering in a more efficient way > compared to cBPF filter. Is the idea to allow the trusted hypervisor to install

Re: [PATCH net-next 4/7] net: phy: add paged phy register accessors

2017-12-31 Thread Russell King - ARM Linux
On Sun, Dec 31, 2017 at 09:10:39AM +0100, Andrew Lunn wrote: > > +/** > > + * phy_save_page() - take the bus lock and save the current page > > + * @phydev: a pointer to a phy_device > > + * > > + * Take the MDIO bus lock, and return the current page number. On error, > > + * returns a negative

Re: general protection fault in skb_segment

2017-12-31 Thread Willem de Bruijn
> It seems virtio_net could use more sanity checks. When PACKET_VNET_HDR > is used, it will end up calling: > tpacket_rcv() { > ... > if (do_vnet) { > if (virtio_net_hdr_from_skb(skb, h.raw + macoff - > sizeof(struct

Re: general protection fault in skb_segment

2017-12-31 Thread Willem de Bruijn
>> and with the reproducer, got: >> [ 54.255469] Bogus gso_type: 7 >> [ 54.258801] Bogus gso_size: 63464 >> [ 54.262532] [ cut here ] >> [ 54.267703] syz0: caps=(0x080058c1, 0x) len=32 >> data_len=0 gso_size=63464 gso_type=7 ip_summed0 >> [

Re: general protection fault in skb_segment

2017-12-31 Thread Xin Long
On Sun, Dec 31, 2017 at 10:25 AM, Marcelo Ricardo Leitner wrote: > On Sat, Dec 30, 2017 at 10:52:20PM -0200, Marcelo Ricardo Leitner wrote: >> On Sat, Dec 30, 2017 at 08:42:41AM +0100, Willem de Bruijn wrote: > [...] >> > Somewhat tangential, but any PF_PACKET socket

Re: [PATCH net-next 0/4] mlx4 misc for 4.16

2017-12-31 Thread Tariq Toukan
On 28/12/2017 7:28 PM, David Miller wrote: From: Tariq Toukan Date: Thu, 28 Dec 2017 16:26:07 +0200 This patchset contains misc cleanups and improvements to the mlx4 Core and Eth drivers. In patches 1 and 2 I reduce and reorder the branches in the RX csum flow. In

Re: [PATCH net-next 4/7] net: phy: add paged phy register accessors

2017-12-31 Thread Andrew Lunn
> +/** > + * phy_save_page() - take the bus lock and save the current page > + * @phydev: a pointer to a phy_device > + * > + * Take the MDIO bus lock, and return the current page number. On error, > + * returns a negative errno. phy_restore_page() must be called after this > + * to release the