Re: [PATCH bpf] nfp: bpf: don't stop offload if replace failed

2018-06-24 Thread Song Liu
On Fri, Jun 22, 2018 at 11:56 AM, Jakub Kicinski wrote: > Stopping offload completely if replace of program failed dates > back to days of transparent offload. Back then we wanted to > silently fall back to the in-driver processing. Today we mark > programs for offload when they are loaded into

[PATCH net-next 4/7] net: sched: cls_matchall: implement offload tcf_proto_op

2018-06-24 Thread Jakub Kicinski
From: John Hurley Add the reoffload tcf_proto_op in matchall to generate an offload message for each filter in the given tcf_proto. Call the specified callback with this new offload message. The function only returns an error if the callback rejects adding a 'hardware only' rule. Ensure matchall

[PATCH net-next 2/7] net: sched: add tcf_proto_op to offload a rule

2018-06-24 Thread Jakub Kicinski
From: John Hurley Create a new tcf_proto_op called 'reoffload' that generates a new offload message for each node in a tcf_proto. Pointers to the tcf_proto and whether the offload request is to add or delete the node are included. Also included is a callback function to send the offload message t

[PATCH net-next 0/7] net: sched: support replay of filter offload when binding to block

2018-06-24 Thread Jakub Kicinski
Hi! This series from John adds the ability to replay filter offload requests when new offload callback is being registered on a TC block. This is most likely to take place for shared blocks today, when a block which already has rules is bound to another interface. Prior to this patch set if any

[PATCH net-next 6/7] net: sched: cls_bpf: implement offload tcf_proto_op

2018-06-24 Thread Jakub Kicinski
From: John Hurley Add the offload tcf_proto_op in cls_bpf to generate an offload message for each bpf prog in the given tcf_proto. Call the specified callback with this new offload message. The function only returns an error if the callback rejects adding a 'hardware only' prog. A prog contains

[PATCH net-next 3/7] net: sched: cls_flower: implement offload tcf_proto_op

2018-06-24 Thread Jakub Kicinski
From: John Hurley Add the reoffload tcf_proto_op in flower to generate an offload message for each filter in the given tcf_proto. Call the specified callback with this new offload message. The function only returns an error if the callback rejects adding a 'hardware only' rule. A filter contains

[PATCH net-next 7/7] net: sched: call reoffload op on block callback reg

2018-06-24 Thread Jakub Kicinski
From: John Hurley Call the reoffload tcf_proto_op on all tcf_proto nodes in all chains of a block when a callback tries to register to a block that already has offloaded rules. If all existing rules cannot be offloaded then the registration is rejected. This replaces the previous policy of reject

[PATCH net-next 5/7] net: sched: cls_u32: implement offload tcf_proto_op

2018-06-24 Thread Jakub Kicinski
From: John Hurley Add the offload tcf_proto_op in cls_u32 to generate an offload message for each filter and the hashtable in the given tcf_proto. Call the specified callback with this new offload message. The function only returns an error if the callback rejects adding a 'hardware only' rule.

[PATCH net-next 1/7] net: sched: pass extack pointer to block binds and cb registration

2018-06-24 Thread Jakub Kicinski
From: John Hurley Pass the extact struct from a tc qdisc add to the block bind function and, in turn, to the setup_tc ndo of binding device via the tc_block_offload struct. Pass this back to any block callback registrations to allow netlink logging of fails in the bind process. Signed-off-by: Jo

[PATCH bpf-next 2/7] lib: reciprocal_div: implement the improved algorithm on the paper mentioned

2018-06-24 Thread Jakub Kicinski
From: Jiong Wang The new added "reciprocal_value_adv" implements the advanced version of the algorithm described in Figure 4.2 of the paper except when dividend has MSB set which would require u128 divide on host and actually could be easily handled before calling the new "reciprocal_value_adv".

[PATCH bpf-next 4/7] nfp: bpf: copy range info for all operands of all ALU operations

2018-06-24 Thread Jakub Kicinski
From: Jiong Wang NFP verifier hook is coping range information of the shift amount for indirect shift operation so optimized shift sequences could be generated. We want to use range info to do more things. For example, to decide whether multiplication and divide are supported on the given range.

[PATCH bpf-next 6/7] nfp: bpf: support u32 divide using reciprocal_div.h

2018-06-24 Thread Jakub Kicinski
From: Jiong Wang NFP doesn't have integer divide instruction, this patch use reciprocal algorithm (the basic one, reciprocal_div) to emulate it. For each u32 divide, we would need 11 instructions to finish the operation. 7 (for multiplication) + 4 (various ALUs) = 11 Given NFP only supports

[PATCH bpf-next 1/7] nfp: bpf: allow source ptr type be map ptr in memcpy optimization

2018-06-24 Thread Jakub Kicinski
From: Jiong Wang Map read has been supported on NFP, this patch enables optimization for memcpy from map to packet. This patch also fixed one latent bug which will cause copying from unexpected address once memcpy for map pointer enabled. Reported-by: Mary Pham Reported-by: David Beckett Sign

[PATCH bpf-next 7/7] nfp: bpf: migrate to advanced reciprocal divide in reciprocal_div.h

2018-06-24 Thread Jakub Kicinski
From: Jiong Wang As we are doing JIT, we would want to use the advanced version of the reciprocal divide (reciprocal_value_adv) to trade performance with host. We could reduce the required ALU instructions from 4 to 2 or 1. Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski --- drivers/ne

[PATCH bpf-next 5/7] nfp: bpf: support u16 and u32 multiplications

2018-06-24 Thread Jakub Kicinski
From: Jiong Wang NFP supports u16 and u32 multiplication. Multiplication is done 8-bits per step, therefore we need 2 steps for u16 and 4 steps for u32. We also need one start instruction to initialize the sequence and one or two instructions to fetch the result depending on either you need the

[PATCH bpf-next 3/7] nfp: bpf: rename umin/umax to umin_src/umax_src

2018-06-24 Thread Jakub Kicinski
From: Jiong Wang The two fields are a copy of umin and umax info of bpf_insn->src_reg generated by verifier. Rename to make their meaning clear. Signed-off-by: Jiong Wang Reviewed-by: Jakub Kicinski --- drivers/net/ethernet/netronome/nfp/bpf/jit.c | 12 ++-- drivers/net/ethernet

[PATCH bpf-next 0/7] nfp: bpf: add multiplication, divide and memcpy from maps

2018-06-24 Thread Jakub Kicinski
Hi! This set enables memcpy optimization when the source is a map pointer. The rest adds multiplication and devide support with Jiong describes as follows: NFP supports u16 and u32 multiplication. Multiplication is done 8-bits per step, therefore we need 2 steps for u16 and 4 steps for u32. We a

Re: [patch net-next 2/3] nfp: handle cls_flower command default case

2018-06-24 Thread Jakub Kicinski
On Sun, 24 Jun 2018 10:38:38 +0200, Jiri Pirko wrote: > From: Jiri Pirko > > Currently the default case is not handled, which with future command > introductions would introduce a warning. So handle it. > > Signed-off-by: Jiri Pirko Acked-by: Jakub Kicinski

Re: [PATCH net-next] route: add support for directed broadcast forwarding

2018-06-24 Thread Xin Long
On Mon, Jun 25, 2018 at 10:45 AM, Xin Long wrote: > This patch implements the feature described in rfc1812#section-5.3.5.2 > and rfc2644. It allows the router to forward directed broadcast when > sysctl mc_forwarding is enabled. > > Note that this feature could be done by iptables -j TEE, but it w

[PATCH net-next] route: add support for directed broadcast forwarding

2018-06-24 Thread Xin Long
This patch implements the feature described in rfc1812#section-5.3.5.2 and rfc2644. It allows the router to forward directed broadcast when sysctl mc_forwarding is enabled. Note that this feature could be done by iptables -j TEE, but it would cause some problems: - target TEE's gateway param has

[PATCH net-next 4/5] sctp: add support for setting flowlabel when adding a transport

2018-06-24 Thread Xin Long
Struct sockaddr_in6 has the member sin6_flowinfo that includes the ipv6 flowlabel, it should also support for setting flowlabel when adding a transport whose ipaddr is from userspace. Note that addrinfo in sctp_sendmsg is using struct in6_addr for the secondary addrs, which doesn't contain sin6_fl

[PATCH net-next 5/5] sctp: check for ipv6_pinfo legal sndflow with flowlabel in sctp_v6_get_dst

2018-06-24 Thread Xin Long
The transport with illegal flowlabel should not be allowed to send packets. Other transport protocols already denies this. Signed-off-by: Xin Long --- net/sctp/ipv6.c | 9 + 1 file changed, 9 insertions(+) diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 772513d..d83ddc4 100644 ---

[PATCH net-next 3/5] sctp: add spp_ipv6_flowlabel and spp_dscp for sctp_paddrparams

2018-06-24 Thread Xin Long
spp_ipv6_flowlabel and spp_dscp are added in sctp_paddrparams in this patch so that users could set sctp_sock/asoc/transport dscp and flowlabel with spp_flags SPP_IPV6_FLOWLABEL or SPP_DSCP by SCTP_PEER_ADDR_PARAMS , as described section 8.1.12 in RFC6458. As said in last patch, it uses '| 0x1

[PATCH net-next 2/5] sctp: add support for dscp and flowlabel per transport

2018-06-24 Thread Xin Long
Like some other per transport params, flowlabel and dscp are added in transport, asoc and sctp_sock. By default, transport sets its value from asoc's, and asoc does it from sctp_sock. flowlabel only works for ipv6 transport. Other than that they need to be passed down in sctp_xmit, flow4/6 also ne

[PATCH net-next 1/5] ipv4: add __ip_queue_xmit() that supports tos param

2018-06-24 Thread Xin Long
This patch introduces __ip_queue_xmit(), through which the callers can pass tos param into it without having to set inet->tos. For ipv6, ip6_xmit() already allows passing tclass parameter. It's needed when some transport protocol doesn't use inet->tos, like sctp's per transport dscp, which will be

[PATCH net-next 0/5] sctp: fully support for dscp and flowlabel per transport

2018-06-24 Thread Xin Long
Now dscp and flowlabel are set from sock when sending the packets, but being multi-homing, sctp also supports for dscp and flowlabel per transport, which is described in section 8.1.12 in RFC6458. Xin Long (5): ipv4: add __ip_queue_xmit() that supports tos param sctp: add support for dscp and

[PATCHv2 net-next] sctp: add support for SCTP_REUSE_PORT sockopt

2018-06-24 Thread Xin Long
This feature is actually already supported by sk->sk_reuse which can be set by socket level opt SO_REUSEADDR. But it's not working exactly as RFC6458 demands in section 8.1.27, like: - This option only supports one-to-one style SCTP sockets - This socket option must not be used after calling b

Re: [PATCH 0/4] docs: e100[0] fix build errors

2018-06-24 Thread Tobin C. Harding
On Mon, Jun 25, 2018 at 01:11:33AM +, Kirsher, Jeffrey T wrote: > > > > On Jun 24, 2018, at 16:41, Tobin C. Harding wrote: > > > >> On Fri, Jun 22, 2018 at 01:22:37PM -0700, Randy Dunlap wrote: > >> Hi Tobin, > >> > >>> On 06/21/2018 05:37 PM, Tobin C. Harding wrote: > >>> Hi Jonathan, > >

Re: [PATCH rdma-next 06/12] RDMA/uverbs: Don't overwrite NULL pointer with ZERO_SIZE_PTR

2018-06-24 Thread Jason Gunthorpe
On Sun, Jun 24, 2018 at 11:23:47AM +0300, Leon Romanovsky wrote: > From: Leon Romanovsky > > Number of specs is provided by user and in valid case can be equal to zero. > Such argument causes to call to kcalloc() with zero-length request and in > return the ZERO_SIZE_PTR is assigned. This pointer

Re: [PATCH rdma-next 09/12] RDMA/mlx5: Fix shift overflow in mlx5_ib_create_wq

2018-06-24 Thread Jason Gunthorpe
On Sun, Jun 24, 2018 at 11:23:50AM +0300, Leon Romanovsky wrote: > From: Leon Romanovsky > > [ 61.182439] UBSAN: Undefined behaviour in > drivers/infiniband/hw/mlx5/qp.c:5366:34 > [ 61.183673] shift exponent 4294967288 is too large for 32-bit type > 'unsigned int' > [ 61.185530] CPU: 0 PI

[PATCH net-next 3/3] r8169: don't check WoL when powering down PHY and interface is down

2018-06-24 Thread Heiner Kallweit
We can power down the PHY irregardless of WOL settings if interface is down. So far we would have left the PHY enabled if WOL options are set and the interface is brought down. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH net-next 2/3] r8169: improve saved_wolopts handling

2018-06-24 Thread Heiner Kallweit
Let's make saved_wolopts a shadow copy of the WoL options. This allows to simplify the code and get rid of calls to now unneeded function __rtl8169_get_wol(). However don't remove __rtl8169_get_wol() completely to be prepared for the case that we can respect BIOS WOL settings again. Signed-off-by:

[PATCH net-next 1/3] r8169: improve phy initialization when resuming

2018-06-24 Thread Heiner Kallweit
Let's move calling rtl8169_init_phy() to __rtl8169_resume(). It simplifies the code and avoids rtl8169_init_phy() being called when resuming whilst interface is down. rtl_open() will initialize the PHY when the interface is brought up. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/real

[PATCH net-next 0/3] r8169: improve PHY initialization and WoL handling

2018-06-24 Thread Heiner Kallweit
Series with smaller improvements regarding PHY initialization and WoL handling. Heiner Kallweit (3): r8169: improve phy inititalization when resuming r8169: improve saved_wolopts handling r8169: don't check WoL when powering down PHY and interface is down drivers/net/ethernet/realtek/r8169

Re: [PATCH v2 net-next] net/sched: add skbprio scheduler

2018-06-24 Thread Jamal Hadi Salim
On 23/06/18 04:47 PM, Nishanth Devarajan wrote: [..] + /* Drop the packet at the tail of the lowest priority qdisc. */ + lp_qdisc = &q->qdiscs[lp]; + to_drop = __skb_dequeue_tail(lp_qdisc); + BUG_ON(!to_drop); + qdisc_qstats_backlog_dec(sch, to_drop); + qdisc_

[PATCH net-next] tcp: add SNMP counter for zero-window drops

2018-06-24 Thread Yafang Shao
It will be helpful if we could display the drops due to zero window or no enough window space. So a new SNMP MIB entry is added to track this behavior. This entry is named LINUX_MIB_TCPZEROWINDOWDROP and published in /proc/net/netstat in TcpExt line as TCPZeroWindowDrop. Signed-off-by: Yafang Shao

Re: Route fallback issue

2018-06-24 Thread Erik Auerswald
Hello Julien, On Thu, Jun 21, 2018 at 10:57:14PM +0300, Julian Anastasov wrote: > On Wed, 20 Jun 2018, Grant Taylor wrote: > > On 06/20/2018 01:00 PM, Julian Anastasov wrote: > > > You can also try alternative routes. > > > > "Alternative routes"? I can't say as I've heard that description as a

Re: Crash in netlink/sk_filter_trim_cap on ARMv7 on 4.18rc1

2018-06-24 Thread Peter Robinson
>> I'm seeing this netlink/sk_filter_trim_cap crash on ARMv7 across quite >> a few ARMv7 platforms on Fedora with 4.18rc1. I've tested RPi2/RPi3 >> (doesn't happen on aarch64), AllWinner H3, BeagleBone and a few >> others, both LPAE/normal kernels. >> >> I'm a bit out of my depth in this part of th

[patch net-next 3/3] cls_flower: fix error values for commands not supported by drivers

2018-06-24 Thread Jiri Pirko
From: Jiri Pirko -EOPNOTSUPP is the error value that should be reported if a flower command is not supported by a driver. Fix it in couple of Intel drivers. Signed-off-by: Jiri Pirko --- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2

[patch net-next 0/3] net: sched: couple of ndo_setup_tc fixes and adjustments

2018-06-24 Thread Jiri Pirko
From: Jiri Pirko This patchset includes couple of patches that fix or adjust default cases and return values in ndo_setup_tc implementations in drivers. Jiri Pirko (3): bnxt: simplify cls_flower command switch and handle default case nfp: handle cls_flower command default case cls_flower:

[patch net-next 2/3] nfp: handle cls_flower command default case

2018-06-24 Thread Jiri Pirko
From: Jiri Pirko Currently the default case is not handled, which with future command introductions would introduce a warning. So handle it. Signed-off-by: Jiri Pirko --- drivers/net/ethernet/netronome/nfp/flower/offload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[patch net-next 1/3] bnxt: simplify cls_flower command switch and handle default case

2018-06-24 Thread Jiri Pirko
From: Jiri Pirko Currently the default case is not handled, which with future command introductions would introduce a warning. So handle it and make the switch a bit simplier removing unneeded "rc" variable. Signed-off-by: Jiri Pirko --- drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 16 +-

[PATCH rdma-next 04/12] RDMA/verbs: Drop kernel variant of destroy_flow

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky Following the removal of ib_create_flow(), adjust the code to get rid of ib_destroy_flow() too. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/uverbs_cmd.c | 3 ++- drivers/infiniband/core/uverbs_std_types.c | 9 ++--- drivers/infiniband/core/verbs

[PATCH mlx5-next 05/12] net/mlx5: Rate limit errors in command interface

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky Any error status returned by FW will trigger similar to the following error message in the dmesg. [ 55.884355] mlx5_core :00:04.0: mlx5_cmd_check:712:(pid 555): ALLOC_UAR(0x802) op_mod(0x0) failed, status limits exceeded(0x8), syndrome (0x0) Those prints are extremel

[PATCH rdma-next 11/12] RDMA/uverbs: Remove redundant check

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky kern_spec->reserved is checked prior to calling to kern_spec_to_ib_spec_filter() and it makes this second check redundant. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/uverbs_cmd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/infiniband/core

[PATCH rdma-next 09/12] RDMA/mlx5: Fix shift overflow in mlx5_ib_create_wq

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky [ 61.182439] UBSAN: Undefined behaviour in drivers/infiniband/hw/mlx5/qp.c:5366:34 [ 61.183673] shift exponent 4294967288 is too large for 32-bit type 'unsigned int' [ 61.185530] CPU: 0 PID: 639 Comm: qp Not tainted 4.18.0-rc1-00037-g4aa1d69a9c60-dirty #96 [ 61.18

[PATCH rdma-next 07/12] RDMA/umem: Don't check for negative return value of dma_map_sg_attrs()

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky dma_map_sg_attrs() returns 0 on error and can't return negative number (ensured by BUG_ON), so don't check for being negative value. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/umem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drive

[PATCH rdma-next 12/12] RDMA/uverbs: Fix slab-out-of-bounds in ib_uverbs_ex_create_flow

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky The check of cmd.flow_attr.size should check into account the size of reserved field (2 bytes), otherwise user can provide size whihc will cause to slab-out-of-bounds warning below. == BUG: KASAN: slab-out-of-b

[PATCH rdma-next 02/12] RDMA/uverbs: Check existence of create_flow callback

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky In the accepted series "Refactor ib_uverbs_write path", we presented the roadmap to get rid of uverbs_cmd_mask and uverbs_ex_cmd_mask fields in favor of simple check of function pointer. So let's put NULL check of create_flow function callback despite the fact that uverbs_ex

[PATCH rdma-next 01/12] RDMA/uverbs: Protect from attempts to create flows on unsupported QP

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky Flows can be created on UD and RAW_PACKET QP types. Attempts to provide other QP types as an input causes to various unpredictable failures. The reason to it that in order to support all various types (e.g. XRC), we are supposed to use real_qp handle and not qp handle and g

[PATCH rdma-next 06/12] RDMA/uverbs: Don't overwrite NULL pointer with ZERO_SIZE_PTR

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky Number of specs is provided by user and in valid case can be equal to zero. Such argument causes to call to kcalloc() with zero-length request and in return the ZERO_SIZE_PTR is assigned. This pointer is different from NULL and makes various if (..) checks to success. Fixes

[PATCH rdma-next 03/12] RDMA/verbs: Drop kernel variant of create_flow

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky There are no kernel users of this interface so let's drop it. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/verbs.c | 17 - include/rdma/ib_verbs.h | 2 -- 2 files changed, 19 deletions(-) diff --git a/drivers/infiniband/core/verbs.c

[PATCH rdma-next 10/12] RDMA/mlx5: Reuse existed shift_overlow helper

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky Rewrite commit 002bf2282b2d ("RDMA/mlx5: Protect from shift operand overflow") to reuse newly introduced shift_overflow() helper. Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/qp.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --gi

[PATCH rdma-next 00/12] RDMA fixes 2018-06-24

2018-06-24 Thread Leon Romanovsky
From: Leon Romanovsky Hi, This is bunch of patches trigged by running syzkaller internally. I'm sending them based on rdma-next mainly for two reasons: 1, Most of the patches fix the old issues and it doesn't matter when they will hit the Linus's tree: now or later in a couple of weeks during m

Re: [Patch net-next] net_sched: remove unused htb drop_list

2018-06-24 Thread David Miller
From: Cong Wang Date: Sat, 23 Jun 2018 13:46:39 -0700 > After commit a09ceb0e0814 ("sched: remove qdisc->drop"), > it is no longer used. > > Cc: Florian Westphal > Signed-off-by: Cong Wang Applied, thanks Cong.

Re: [PATCH net-next] net: phy: fixed-phy: Make the error path simpler

2018-06-24 Thread David Miller
From: Fabio Estevam Date: Sat, 23 Jun 2018 21:28:22 -0300 > From: Fabio Estevam > > When platform_device_register_simple() fails we can return > the error immediately instead of jumping to the 'err_pdev' > label. > > This makes the error path a bit simpler. > > Signed-off-by: Fabio Estevam