[Patch net] ipv6: fix double refcount of fib6_metrics

2018-08-03 Thread Cong Wang
All the callers of ip6_rt_copy_init()/rt6_set_from() hold refcnt of the "from" fib6_info, so there is no need to hold fib6_metrics refcnt again, because fib6_metrics refcnt is only released when fib6_info is gone, that is, they have the same life time, so the whole fib6_metrics refcnt can be

[PATCH][net-next] tun: not use hardcoded mask value

2018-08-03 Thread Li RongQing
0x3ff in tun_hashfn is mask of TUN_NUM_FLOW_ENTRIES, instead of hardcode, define a macro to setup the relationship with TUN_NUM_FLOW_ENTRIES Signed-off-by: Li RongQing --- drivers/net/tun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/tun.c

Re: [PATCH v8 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-03 Thread Jesper Dangaard Brouer
On Fri, 3 Aug 2018 16:58:13 +0900 Toshiaki Makita wrote: > This is preparation for XDP TX and ndo_xdp_xmit. > This allows napi handler to handle xdp_frames through xdp ring as well > as sk_buff. > > v8: > - Don't use xdp_frame pointer address to calculate skb->head and > headroom. > > v7: >

Re: [PATCH v8 bpf-next 04/10] xdp: Helper function to clear kernel pointers in xdp_frame

2018-08-03 Thread Jesper Dangaard Brouer
On Fri, 3 Aug 2018 16:58:12 +0900 Toshiaki Makita wrote: > xdp_frame has kernel pointers which should not be readable from bpf > programs. When we want to reuse xdp_frame region but it may be read by > bpf programs later, we can use this helper to clear kernel pointers. > This is more efficient

[patch net-next] net: sched: fix flush on non-existing chain

2018-08-03 Thread Jiri Pirko
From: Jiri Pirko User was able to perform filter flush on chain 0 even if it didn't have any filters in it. With the patch that avoided implicit chain 0 creation, this changed. So in case user wants filter flush on chain which does not exist, just return success. There's no reason for non-0

ERP Business Solution

2018-08-03 Thread Janine Ben
Hi Sir/Ma'am, Hope you are doing great. This is Janine Ben(Business Consultant).We provide ERP Software for industries and also We create Apps, Websites, and Innovative Marketing Strategies to help brands excel in digital culture. We Offer ERP Software for industrial management as per their

[PATCH v8 bpf-next 10/10] veth: Support per queue XDP ring

2018-08-03 Thread Toshiaki Makita
Move XDP and napi related fields from veth_priv to newly created veth_rq structure. When xdp_frames are enqueued from ndo_xdp_xmit and XDP_TX, rxq is selected by current cpu. When skbs are enqueued from the peer device, rxq is one to one mapping of its peer txq. This way we have a restriction

[PATCH v8 bpf-next 09/10] veth: Add XDP TX and REDIRECT

2018-08-03 Thread Toshiaki Makita
This allows further redirection of xdp_frames like NIC -> veth--veth -> veth--veth (XDP) (XDP) (XDP) The intermediate XDP, redirecting packets from NIC to the other veth, reuses xdp_mem_info from NIC so that page recycling of the NIC works on the destination veth's XDP. In

[PATCH][net-next] net: check extack._msg before print

2018-08-03 Thread Li RongQing
dev_set_mtu_ext is able to fail with a valid mtu value, at that condition, extack._msg is not set and random since it is in stack, then kernel will crash when print it. Fixes: 7a4c53bee3324a ("net: report invalid mtu value via netlink extack") Signed-off-by: Zhang Yu Signed-off-by: Li RongQing

[PATCH v8 bpf-next 00/10] veth: Driver XDP

2018-08-03 Thread Toshiaki Makita
This patch set introduces driver XDP for veth. Basically this is used in conjunction with redirect action of another XDP program. NIC ---> veth===veth (XDP) (redirect)(XDP) In this case xdp_frame can be forwarded to the peer veth without modification, so we can expect far

Re: [PATCH net-next] vhost: switch to use new message format

2018-08-03 Thread Michael S. Tsirkin
On Fri, Aug 03, 2018 at 03:04:51PM +0800, Jason Wang wrote: > We use to have message like: > > struct vhost_msg { > int type; > union { > struct vhost_iotlb_msg iotlb; > __u8 padding[64]; > }; > }; > > Unfortunately, there will be a hole of 32bit in

[PATCH v8 bpf-next 01/10] net: Export skb_headers_offset_update

2018-08-03 Thread Toshiaki Makita
This is needed for veth XDP which does skb_copy_expand()-like operation. v2: - Drop skb_copy_header part because it has already been exported now. Signed-off-by: Toshiaki Makita --- include/linux/skbuff.h | 1 + net/core/skbuff.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)

Re: [PATCH bpf] selftests/bpf: update test_lwt_seg6local.sh according to iproute2

2018-08-03 Thread Daniel Borkmann
On 08/01/2018 05:34 PM, Mathieu Xhonneux wrote: > The shell file for test_lwt_seg6local contains an early iproute2 syntax > for installing a seg6local End.BPF route. iproute2 support for this > feature has recently been upstreamed, but with an additional keyword > required. This patch updates

Re: [PATCH v8 bpf-next 00/10] veth: Driver XDP

2018-08-03 Thread Jesper Dangaard Brouer
On Fri, 3 Aug 2018 16:58:08 +0900 Toshiaki Makita wrote: > This patch set introduces driver XDP for veth. > Basically this is used in conjunction with redirect action of another XDP > program. > > NIC ---> veth===veth > (XDP) (redirect)(XDP) > I'm was playing with V7 on my

[PATCH v8 bpf-next 07/10] bpf: Make redirect_info accessible from modules

2018-08-03 Thread Toshiaki Makita
We are going to add kern_flags field in redirect_info for kernel internal use. In order to avoid function call to access the flags, make redirect_info accessible from modules. Also as it is now non-static, add prefix bpf_ to redirect_info. v6: - Fix sparse warning around EXPORT_SYMBOL.

[PATCH v8 bpf-next 04/10] xdp: Helper function to clear kernel pointers in xdp_frame

2018-08-03 Thread Toshiaki Makita
xdp_frame has kernel pointers which should not be readable from bpf programs. When we want to reuse xdp_frame region but it may be read by bpf programs later, we can use this helper to clear kernel pointers. This is more efficient than calling memset() for the entire struct. Signed-off-by:

[PATCH v8 bpf-next 02/10] veth: Add driver XDP

2018-08-03 Thread Toshiaki Makita
This is the basic implementation of veth driver XDP. Incoming packets are sent from the peer veth device in the form of skb, so this is generally doing the same thing as generic XDP. This itself is not so useful, but a starting point to implement other useful veth XDP features like TX and

[PATCH v8 bpf-next 03/10] veth: Avoid drops by oversized packets when XDP is enabled

2018-08-03 Thread Toshiaki Makita
Oversized packets including GSO packets can be dropped if XDP is enabled on receiver side, so don't send such packets from peer. Drop TSO and SCTP fragmentation features so that veth devices themselves segment packets with XDP enabled. Also cap MTU accordingly. v4: - Don't auto-adjust MTU but

[PATCH v8 bpf-next 06/10] veth: Add ndo_xdp_xmit

2018-08-03 Thread Toshiaki Makita
This allows NIC's XDP to redirect packets to veth. The destination veth device enqueues redirected packets to the napi ring of its peer, then they are processed by XDP on its peer veth device. This can be thought as calling another XDP program by XDP program using REDIRECT, when the peer enables

[PATCH v8 bpf-next 08/10] xdp: Helpers for disabling napi_direct of xdp_return_frame

2018-08-03 Thread Toshiaki Makita
We need some mechanism to disable napi_direct on calling xdp_return_frame_rx_napi() from some context. When veth gets support of XDP_REDIRECT, it will redirects packets which are redirected from other devices. On redirection veth will reuse xdp_mem_info of the redirection source device to make

[PATCH v8 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring

2018-08-03 Thread Toshiaki Makita
This is preparation for XDP TX and ndo_xdp_xmit. This allows napi handler to handle xdp_frames through xdp ring as well as sk_buff. v8: - Don't use xdp_frame pointer address to calculate skb->head and headroom. v7: - Use xdp_scrub_frame() instead of memset(). v3: - Revert v2 change around

[PATCH net-next 3/3] l2tp: ignore L2TP_ATTR_MTU

2018-08-03 Thread Guillaume Nault
This attribute's handling is broken. It can only be used when creating Ethernet pseudo-wires, in which case its value can be used as the initial MTU for the l2tpeth device. However, when handling update requests, L2TP_ATTR_MTU only modifies session->mtu. This value is never propagated to the

[PATCH net-next 1/3] l2tp: define l2tp_tunnel_dst_mtu()

2018-08-03 Thread Guillaume Nault
Consolidate retrieval of tunnel's socket mtu in order to simplify l2tp_eth and l2tp_ppp a bit. Signed-off-by: Guillaume Nault --- net/l2tp/l2tp_core.h | 18 ++ net/l2tp/l2tp_eth.c | 14 -- net/l2tp/l2tp_ppp.c | 15 --- 3 files changed, 26 insertions(+),

[PATCH net-next 2/3] l2tp: simplify MTU handling in l2tp_ppp

2018-08-03 Thread Guillaume Nault
The value of the session's .mtu field, as defined by pppol2tp_connect() or pppol2tp_session_create(), is later overwritten by pppol2tp_session_init() (unless getting the tunnel's socket PMTU fails). This field is then only used when setting the PPP channel's MTU in pppol2tp_connect(). Furthermore,

[PATCH net-next 0/3] l2tp: sanitise MTU handling on sessions

2018-08-03 Thread Guillaume Nault
Most of the code handling sessions' MTU has no effect. The ->mtu field in struct l2tp_session might be used at session creation time, but neither PPP nor Ethernet pseudo-wires take updates into account. L2TP sessions don't have a concept of MTU, which is the reason why ->mtu is mostly ignored.

[PATCH net 1/4] mlxsw: core_acl_flex_actions: Return error for conflicting actions

2018-08-03 Thread Ido Schimmel
From: Nir Dotan Spectrum switch ACL action set is built in groups of three actions which may point to additional actions. A group holds a single record which can be set as goto record for pointing at a following group or can be set to mark the termination of the lookup. This is perfectly

[PATCH net 2/4] mlxsw: core_acl_flex_actions: Remove redundant resource destruction

2018-08-03 Thread Ido Schimmel
From: Nir Dotan Some ACL actions require the allocation of a separate resource prior to applying the action itself. When facing an error condition during the setup phase of the action, resource should be destroyed. For such actions the destruction was done twice which is dangerous and lead to a

[PATCH net 0/4] mlxsw: Fix ACL actions error condition handling

2018-08-03 Thread Ido Schimmel
Nir says: Two issues were lately noticed within mlxsw ACL actions error condition handling. The first patch deals with conflicting actions such as: # tc filter add dev swp49 parent : \ protocol ip pref 10 flower skip_sw dst_ip 192.168.101.1 \ action goto chain 100 \ action mirred

[PATCH net 4/4] mlxsw: core_acl_flex_actions: Remove redundant mirror resource destruction

2018-08-03 Thread Ido Schimmel
From: Nir Dotan In previous patch mlxsw_afa_resource_del() was added to avoid a duplicate resource detruction scenario. For mirror actions, such duplicate destruction leads to a crash as in: # tc qdisc add dev swp49 ingress # tc filter add dev swp49 parent : \ protocol ip chain 100

[PATCH net 3/4] mlxsw: core_acl_flex_actions: Remove redundant counter destruction

2018-08-03 Thread Ido Schimmel
From: Nir Dotan Each tc flower rule uses a hidden count action. As counter resource may not be available due to limited HW resources, update _counter_create() and _counter_destroy() pair to follow previously introduced symmetric error condition handling, add a call to mlxsw_afa_resource_del() as

Re: [PATCH v8 bpf-next 00/10] veth: Driver XDP

2018-08-03 Thread Toshiaki Makita
On 18/08/03 (金) 18:45, Jesper Dangaard Brouer wrote: On Fri, 3 Aug 2018 16:58:08 +0900 Toshiaki Makita wrote: This patch set introduces driver XDP for veth. Basically this is used in conjunction with redirect action of another XDP program. NIC ---> veth===veth (XDP) (redirect)

Re: [PATCH net 1/4] mlxsw: core_acl_flex_actions: Return error for conflicting actions

2018-08-03 Thread Ido Schimmel
+Stephen On Fri, Aug 03, 2018 at 03:57:41PM +0300, Ido Schimmel wrote: > From: Nir Dotan > > Spectrum switch ACL action set is built in groups of three actions > which may point to additional actions. A group holds a single record > which can be set as goto record for pointing at a following

Re: [PATCH net 0/5] tcp: more robust ooo handling

2018-08-03 Thread David Woodhouse
On Mon, 2018-07-23 at 12:03 -0700, David Miller wrote: > From: Eric Dumazet > Date: Mon, 23 Jul 2018 09:28:16 -0700 > > > Juha-Matti Tilli reported that malicious peers could inject tiny > > packets in out_of_order_queue, forcing very expensive calls > > to tcp_collapse_ofo_queue() and

Re: UDP packets arriving on wrong sockets

2018-08-03 Thread Willem de Bruijn
On Fri, Aug 3, 2018 at 12:20 AM Andrew Cann wrote: > > On Thu, Aug 02, 2018 at 11:21:41AM -0400, Willem de Bruijn wrote: > > You have two sockets bound to the same address and port? Is this using > > SO_REUSEPORT? > > Yes, this is using SO_REUSEPORT. Then this is working as intended. Without

[PATCH v2 net-next 4/9] net: stmmac: Add descriptor related callbacks for XGMAC2

2018-08-03 Thread Jose Abreu
Add the descriptor related callbacks for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/Makefile | 3 +- drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h |

[PATCH v2 net-next 1/9] net: stmmac: Add XGMAC 2.10 HWIF entry

2018-08-03 Thread Jose Abreu
Add a new entry to HWIF table for XGMAC 2.10. For now we fill it with empty callbacks which will be added in posterior patches. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/common.h | 14

[PATCH v2 net-next 8/9] net: stmmac: Add the bindings parsing for XGMAC2

2018-08-03 Thread Jose Abreu
Add the bindings parsing for XGMAC2 IP block. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c | 2 ++ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 6 ++ 2 files

[PATCH v2 net-next 0/9] Add support for XGMAC2 in stmmac

2018-08-03 Thread Jose Abreu
This series adds support for 10Gigabit IP in stmmac. The IP is called XGMAC2 and has many similarities with GMAC4. Due to this, its relatively easy to incorporate this new IP into stmmac driver by adding a new block and filling the necessary callbacks. The functionality added by this series is

[PATCH v2 net-next 3/9] net: stmmac: Add DMA related callbacks for XGMAC2

2018-08-03 Thread Jose Abreu
Add the DMA related callbacks for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/Makefile | 2 +- drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 56 +++

[PATCH v2 net-next 2/9] net: stmmac: Add MAC related callbacks for XGMAC2

2018-08-03 Thread Jose Abreu
Add the MAC related callbacks for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/Makefile | 2 +- drivers/net/ethernet/stmicro/stmmac/common.h | 3 +

[PATCH v2 net-next 6/9] net: stmmac: Add PTP support for XGMAC2

2018-08-03 Thread Jose Abreu
XGMAC2 uses the same engine of timestamping as GMAC4. Let's use the same callbacks. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/hwif.c | 4 ++--

Re: UDP packets arriving on wrong sockets

2018-08-03 Thread Andrew Cann
On Fri, Aug 03, 2018 at 10:20:06AM -0400, Willem de Bruijn wrote: > On Fri, Aug 3, 2018 at 12:20 AM Andrew Cann wrote: > > > > On Thu, Aug 02, 2018 at 11:21:41AM -0400, Willem de Bruijn wrote: > > > You have two sockets bound to the same address and port? Is this using > > > SO_REUSEPORT? > > > >

[PATCH net] l2tp: fix missing refcount drop in pppol2tp_tunnel_ioctl()

2018-08-03 Thread Guillaume Nault
If 'session' is not NULL and is not a PPP pseudo-wire, then we fail to drop the reference taken by l2tp_session_get(). Fixes: ecd012e45ab5 ("l2tp: filter out non-PPP sessions in pppol2tp_tunnel_ioctl()") Signed-off-by: Guillaume Nault --- Sorry for the stupid mistake. I guess I got blinded by

Re: [PATCH v2 net-next 5/9] net: stmmac: Add MDIO related functions for XGMAC2

2018-08-03 Thread Andrew Lunn
On Fri, Aug 03, 2018 at 03:56:07PM +0100, Jose Abreu wrote: > Add the MDIO related funcionalities for the new IP block XGMAC2. > > Signed-off-by: Jose Abreu > Cc: David S. Miller > Cc: Joao Pinto > Cc: Giuseppe Cavallaro > Cc: Alexandre Torgue > Cc: Andrew Lunn > --- > Changes from v1: >

Re: [PATCH v2 net-next 5/9] net: stmmac: Add MDIO related functions for XGMAC2

2018-08-03 Thread Jose Abreu
Hi Andrew, On 03-08-2018 16:20, Andrew Lunn wrote: > On Fri, Aug 03, 2018 at 03:56:07PM +0100, Jose Abreu wrote: >> Add the MDIO related funcionalities for the new IP block XGMAC2. >> >> Signed-off-by: Jose Abreu >> Cc: David S. Miller >> Cc: Joao Pinto >> Cc: Giuseppe Cavallaro >> Cc:

Re: [PATCH v2 net-next 5/9] net: stmmac: Add MDIO related functions for XGMAC2

2018-08-03 Thread Andrew Lunn
> > Probably you want to wait for the bus to be idle before you change the > > mode to C22. Some PHYs can do both C22 and C45, e.g. EEE registers can > > be in C45 space, while the rest are in C22. > > Ok but I can't test C45 right now so maybe leave that change to > when I can test it ? I would

[PATCH v2 net-next 7/9] net: stmmac: Integrate XGMAC into main driver flow

2018-08-03 Thread Jose Abreu
Now that we have all the XGMAC related callbacks, lets start integrating this IP block into main driver. Also, we corrected the initialization flow to only start DMA after setting descriptors length. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc:

[PATCH v2 net-next 9/9] dt-bindings: net: stmmac: Add the bindings documentation for XGMAC2.

2018-08-03 Thread Jose Abreu
Adds the documentation for XGMAC2 DT bindings. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Sergei Shtylyov Cc: devicet...@vger.kernel.org Cc: Rob Herring --- Changes from v1: - Correct header, now we also support

[PATCH v2 net-next 5/9] net: stmmac: Add MDIO related functions for XGMAC2

2018-08-03 Thread Jose Abreu
Add the MDIO related funcionalities for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Andrew Lunn --- Changes from v1: - Remove C45 support (Andrew) - Add define for bits (Andrew)

RE: [PATCH v2 1/2] net/sctp: Make wrappers for accessing in/out streams

2018-08-03 Thread David Laight
From: Konstantin Khorenko > Sent: 03 August 2018 17:21 ... > --- a/net/sctp/stream.c > +++ b/net/sctp/stream.c > @@ -37,6 +37,18 @@ > #include > #include > > +struct sctp_stream_out *sctp_stream_out(const struct sctp_stream *stream, > + __u16 sid) > +{ > +

Re: [PATCH v3 net-next 5/9] net: stmmac: Add MDIO related functions for XGMAC2

2018-08-03 Thread Andrew Lunn
On Fri, Aug 03, 2018 at 04:50:23PM +0100, Jose Abreu wrote: > Add the MDIO related funcionalities for the new IP block XGMAC2. > > Signed-off-by: Jose Abreu > Cc: David S. Miller > Cc: Joao Pinto > Cc: Giuseppe Cavallaro > Cc: Alexandre Torgue > Cc: Andrew Lunn Reviewed-by: Andrew Lunn

Re: [patch net-next] net: sched: fix flush on non-existing chain

2018-08-03 Thread David Miller
From: Jiri Pirko Date: Fri, 3 Aug 2018 11:08:47 +0200 > From: Jiri Pirko > > User was able to perform filter flush on chain 0 even if it didn't have > any filters in it. With the patch that avoided implicit chain 0 > creation, this changed. So in case user wants filter flush on chain > which

Re: [PATCH RFC net-next] openvswitch: Queue upcalls to userspace in per-port round-robin order

2018-08-03 Thread Stefano Brivio
Hi Ben, On Tue, 31 Jul 2018 15:06:57 -0700 Ben Pfaff wrote: > This is an awkward problem to try to solve with sockets because of the > nature of sockets, which are strictly first-in first-out. What you > really want is something closer to the algorithm that we use in > ovs-vswitchd to send

Re: [PATCH net-next 0/3] l2tp: sanitise MTU handling on sessions

2018-08-03 Thread David Miller
From: Guillaume Nault Date: Fri, 3 Aug 2018 12:38:32 +0200 > Most of the code handling sessions' MTU has no effect. The ->mtu field > in struct l2tp_session might be used at session creation time, but > neither PPP nor Ethernet pseudo-wires take updates into account. > > L2TP sessions don't

Re: Security enhancement proposal for kernel TLS

2018-08-03 Thread Dave Watson
On 08/02/18 05:23 PM, Vakul Garg wrote: > > I agree that Boris' patch does what you say it does - it sets keys > > immediately > > after CCS instead of after FINISHED message. I disagree that the kernel tls > > implementation currently requires that specific ordering, nor do I think > > that it

[PATCH v3 net-next 3/9] net: stmmac: Add DMA related callbacks for XGMAC2

2018-08-03 Thread Jose Abreu
Add the DMA related callbacks for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/Makefile | 2 +- drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 56 +++

[PATCH v3 net-next 4/9] net: stmmac: Add descriptor related callbacks for XGMAC2

2018-08-03 Thread Jose Abreu
Add the descriptor related callbacks for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/Makefile | 3 +- drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h |

[PATCH v3 net-next 1/9] net: stmmac: Add XGMAC 2.10 HWIF entry

2018-08-03 Thread Jose Abreu
Add a new entry to HWIF table for XGMAC 2.10. For now we fill it with empty callbacks which will be added in posterior patches. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/common.h | 14

[PATCH v3 net-next 5/9] net: stmmac: Add MDIO related functions for XGMAC2

2018-08-03 Thread Jose Abreu
Add the MDIO related funcionalities for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Andrew Lunn --- Changes from v2: - Use helper to set C22 (Andrew) - Wait for bus free before setting

[PATCH v3 net-next 7/9] net: stmmac: Integrate XGMAC into main driver flow

2018-08-03 Thread Jose Abreu
Now that we have all the XGMAC related callbacks, lets start integrating this IP block into main driver. Also, we corrected the initialization flow to only start DMA after setting descriptors length. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc:

[PATCH v3 net-next 6/9] net: stmmac: Add PTP support for XGMAC2

2018-08-03 Thread Jose Abreu
XGMAC2 uses the same engine of timestamping as GMAC4. Let's use the same callbacks. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/hwif.c | 4 ++--

[PATCH v3 net-next 9/9] dt-bindings: net: stmmac: Add the bindings documentation for XGMAC2.

2018-08-03 Thread Jose Abreu
Adds the documentation for XGMAC2 DT bindings. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Sergei Shtylyov Cc: devicet...@vger.kernel.org Cc: Rob Herring --- Changes from v1: - Correct header, now we also support

[PATCH v3 net-next 8/9] net: stmmac: Add the bindings parsing for XGMAC2

2018-08-03 Thread Jose Abreu
Add the bindings parsing for XGMAC2 IP block. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c | 2 ++ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 6 ++ 2 files

[PATCH v3 net-next 0/9] Add support for XGMAC2 in stmmac

2018-08-03 Thread Jose Abreu
This series adds support for 10Gigabit IP in stmmac. The IP is called XGMAC2 and has many similarities with GMAC4. Due to this, its relatively easy to incorporate this new IP into stmmac driver by adding a new block and filling the necessary callbacks. The functionality added by this series is

[PATCH v3 net-next 2/9] net: stmmac: Add MAC related callbacks for XGMAC2

2018-08-03 Thread Jose Abreu
Add the MAC related callbacks for the new IP block XGMAC2. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/Makefile | 2 +- drivers/net/ethernet/stmicro/stmmac/common.h | 3 +

[PATCH v2 2/2] net/sctp: Replace in/out stream arrays with flex_array

2018-08-03 Thread Konstantin Khorenko
This path replaces physically contiguous memory arrays allocated using kmalloc_array() with flexible arrays. This enables to avoid memory allocation failures on the systems under a memory stress. Signed-off-by: Oleg Babin --- include/net/sctp/structs.h | 1 + net/sctp/stream.c | 78

[PATCH v2 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-03 Thread Konstantin Khorenko
Each SCTP association can have up to 65535 input and output streams. For each stream type an array of sctp_stream_in or sctp_stream_out structures is allocated using kmalloc_array() function. This function allocates physically contiguous memory regions, so this can lead to allocation of memory

[PATCH v2 1/2] net/sctp: Make wrappers for accessing in/out streams

2018-08-03 Thread Konstantin Khorenko
This patch introduces wrappers for accessing in/out streams indirectly. This will enable to replace physically contiguous memory arrays of streams with flexible arrays (or maybe any other appropriate mechanism) which do memory allocation on a per-page basis. Signed-off-by: Oleg Babin

Re: [pull request][net-next 00/10] Mellanox, mlx5 and devlink updates 2018-07-31

2018-08-03 Thread Ido Schimmel
On Thu, Aug 02, 2018 at 03:53:15PM -0700, Jakub Kicinski wrote: > No one is requesting full RED offload here.. if someone sets the > parameters you can't support you simply won't offload them. And ignore > the parameters which only make sense in software terms. Look at the > docs for mlxsw: >

RE: [PATCH v2 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-03 Thread David Laight
From: Konstantin Khorenko > Sent: 03 August 2018 17:21 > > Each SCTP association can have up to 65535 input and output streams. > For each stream type an array of sctp_stream_in or sctp_stream_out > structures is allocated using kmalloc_array() function. This function > allocates physically

Re: [PATCH iproute2] ip link: don't stop batch processing

2018-08-03 Thread Dave Taht
On Fri, Aug 3, 2018 at 10:50 AM Matteo Croce wrote: > > When 'ip link show dev DEVICE' is processed in a batch mode, ip exits > and stop processing further commands. > This because ipaddr_list_flush_or_save() calls exit() to avoid printing > the link information twice. > Replace the exit with a

[PATCH iproute2] ip link: don't stop batch processing

2018-08-03 Thread Matteo Croce
When 'ip link show dev DEVICE' is processed in a batch mode, ip exits and stop processing further commands. This because ipaddr_list_flush_or_save() calls exit() to avoid printing the link information twice. Replace the exit with a classic goto out instruction. Signed-off-by: Matteo Croce ---

Re: [PATCH ethtool] ethtool: Add support for WAKE_FILTER

2018-08-03 Thread Florian Fainelli
On 08/01/2018 09:32 AM, David Miller wrote: > From: Florian Fainelli > Date: Mon, 30 Jul 2018 15:26:24 -0700 > >> On 07/17/2018 08:36 AM, Florian Fainelli wrote: >>> Allow re-purposing the wol->sopass storage area to specify a bitmask of >>> filters >>> (programmed previously via

[PATCH net-next 1/4] net: dsa: bcm_sf2: Allow targeting CPU ports for CFP rules

2018-08-03 Thread Florian Fainelli
ds->enabled_port_mask only contains a bitmask of user-facing enabled ports, we also need to allow programming CFP rules that target CPU ports (e.g: ports 5 and 8). Signed-off-by: Florian Fainelli --- drivers/net/dsa/bcm_sf2_cfp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH net-next 4/4] net: systemport: Create helper to set MPD

2018-08-03 Thread Florian Fainelli
Create a helper function to turn on/off MPD, this will be used to avoid duplicating code as we are going to add additional types of wake-up types. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/broadcom/bcmsysport.c | 20 +--- 1 file changed, 13 insertions(+), 7

[PATCH net-next 3/4] net: systemport: Do not re-configure upon WoL interrupt

2018-08-03 Thread Florian Fainelli
We already properly resume from Wake-on-LAN whether such a condition occured or not, no need to process the WoL interrupt for functional changes since that could race with other settings. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/broadcom/bcmsysport.c | 4 +--- 1 file changed, 1

[PATCH net-next 0/4] net: dsa and systemport WoL changes

2018-08-03 Thread Florian Fainelli
Hi David, This patch series extracts what was previously submitted as part of the "WAKE_FILTER" Wake-on-LAN patch series into patches that do not. Changes in this series: - properly align the dsa_is_cpu_port() check in first patch Florian Fainelli (4): net: dsa: bcm_sf2: Allow targeting CPU

[PATCH net-next 2/4] net: dsa: bcm_sf2: Disable learning while in WoL

2018-08-03 Thread Florian Fainelli
When we are in Wake-on-LAN, we operate with the host sofware not running a network stack, so we want to the switch to flood packets in order to cause a system wake-up when matching specific filters (unicast or multicast). This was not necessary before since we supported Magic Packet which are

Re: [PATCH net-next 1/4] net: dsa: bcm_sf2: Allow targeting CPU ports for CFP rules

2018-08-03 Thread Andrew Lunn
On Fri, Aug 03, 2018 at 11:08:41AM -0700, Florian Fainelli wrote: > ds->enabled_port_mask only contains a bitmask of user-facing enabled > ports, we also need to allow programming CFP rules that target CPU ports > (e.g: ports 5 and 8). > > Signed-off-by: Florian Fainelli Reviewed-by: Andrew

Re: [PATCH net-next 2/4] net: dsa: bcm_sf2: Disable learning while in WoL

2018-08-03 Thread Andrew Lunn
On Fri, Aug 03, 2018 at 11:08:42AM -0700, Florian Fainelli wrote: > When we are in Wake-on-LAN, we operate with the host sofware not running > a network stack, so we want to the switch to flood packets in order to > cause a system wake-up when matching specific filters (unicast or > multicast).

Re: [PATCH net] l2tp: fix missing refcount drop in pppol2tp_tunnel_ioctl()

2018-08-03 Thread David Miller
From: Guillaume Nault Date: Fri, 3 Aug 2018 17:00:11 +0200 > If 'session' is not NULL and is not a PPP pseudo-wire, then we fail to > drop the reference taken by l2tp_session_get(). > > Fixes: ecd012e45ab5 ("l2tp: filter out non-PPP sessions in > pppol2tp_tunnel_ioctl()") > Signed-off-by:

Re: [PATCH v2 1/2] net/sctp: Make wrappers for accessing in/out streams

2018-08-03 Thread Marcelo Ricardo Leitner
On Fri, Aug 03, 2018 at 07:21:01PM +0300, Konstantin Khorenko wrote: > This patch introduces wrappers for accessing in/out streams indirectly. > This will enable to replace physically contiguous memory arrays > of streams with flexible arrays (or maybe any other appropriate > mechanism) which do

Re: [PATCH RFC net-next] openvswitch: Queue upcalls to userspace in per-port round-robin order

2018-08-03 Thread Ben Pfaff
On Fri, Aug 03, 2018 at 06:52:41PM +0200, Stefano Brivio wrote: > On Tue, 31 Jul 2018 15:06:57 -0700 Ben Pfaff wrote: > > My current thought is that any fairness scheme we implement directly in > > the kernel is going to need to evolve over time. Maybe we could do > > something flexible with BPF

Re: [PATCH RFC net-next] openvswitch: Queue upcalls to userspace in per-port round-robin order

2018-08-03 Thread Ben Pfaff
On Sat, Aug 04, 2018 at 02:43:24AM +0200, Stefano Brivio wrote: > On Fri, 3 Aug 2018 16:01:08 -0700 > Ben Pfaff wrote: > > I would be very pleased if we could integrate a simple mechanism for > > fairness, based for now on some simple criteria like the source port, > > but thinking ahead to how

Re: KCM - recvmsg() mangles packets?

2018-08-03 Thread Dominique Martinet
Tom Herbert wrote on Fri, Aug 03, 2018: > On Fri, Aug 3, 2018 at 4:20 PM, Dominique Martinet > wrote: > > Tom Herbert wrote on Fri, Aug 03, 2018: > >> struct my_proto { > >>struct _hdr { > >>uint32_t len; > >> } hdr; > >> char data[32]; > >> } __attribute__((packed)); > >> >

Re: [PATCH ethtool] ethtool: Add support for WAKE_FILTER

2018-08-03 Thread Florian Fainelli
On 08/03/2018 12:07 PM, David Miller wrote: > From: Florian Fainelli > Date: Fri, 3 Aug 2018 10:57:13 -0700 > >> Does the current approach of specifying a bitmask of filters looks >> reasonable to you though? > > So, in order to answer that, I need some clarification. > > The mask, as I see

Re: [PATCH v2 net-next 0/3] ip: Use rb trees for IP frag queue

2018-08-03 Thread Peter Oskolkov
On Fri, Aug 3, 2018 at 12:33 PM Josh Hunt wrote: > > On Thu, Aug 2, 2018 at 4:34 PM, Peter Oskolkov wrote: >> >> This patchset >> * changes IPv4 defrag behavior to match that of IPv6: overlapping >>fragments now cause the whole IP datagram to be discarded (suggested >>by David Miller):

Re: [PATCH v2 0/2] net/sctp: Avoid allocating high order memory with kmalloc()

2018-08-03 Thread Marcelo Ricardo Leitner
On Fri, Aug 03, 2018 at 07:21:00PM +0300, Konstantin Khorenko wrote: ... > Performance results: > > * Kernel: v4.18-rc6 - stock and with 2 patches from Oleg (earlier in this > thread) > * Node: CPU (8 cores): Intel(R) Xeon(R) CPU E31230 @ 3.20GHz > RAM: 32 Gb >

Re: [PATCH ethtool] ethtool: Add support for WAKE_FILTER

2018-08-03 Thread David Miller
From: Florian Fainelli Date: Fri, 3 Aug 2018 12:58:12 -0700 > For instance, in the current HW, you can program 128 filters through > the switch, but only 8 of those could be wake-up capable at the > CPU/management (SYSTEM PORT) level. Yes, I noticed this in the driver patches. > Let me cook

Re: [PATCH RFC net-next] openvswitch: Queue upcalls to userspace in per-port round-robin order

2018-08-03 Thread Stefano Brivio
On Fri, 3 Aug 2018 16:01:08 -0700 Ben Pfaff wrote: > I think that a simple mechanism for fairness is fine. The direction > of extensibility that makes me anxious is how to decide what matters > for fairness. So far, we've talked about per-vport fairness. That > works pretty well for packets

Re: KCM - recvmsg() mangles packets?

2018-08-03 Thread Tom Herbert
struct my_proto { struct _hdr { uint32_t len; } hdr; char data[32]; } __attribute__((packed)); // use htons to use LE header size, since load_half does a first convertion // from network byte order const char *bpf_prog_string = " \ ssize_t bpf_prog1(struct __sk_buff *skb) \ { \

Re: [PATCH v2 net-next 0/3] ip: Use rb trees for IP frag queue

2018-08-03 Thread Josh Hunt
On Thu, Aug 2, 2018 at 4:34 PM, Peter Oskolkov wrote: > This patchset > * changes IPv4 defrag behavior to match that of IPv6: overlapping >fragments now cause the whole IP datagram to be discarded (suggested >by David Miller): there are no legitimate use cases for overlapping >

Re: [Patch net] ipv6: fix double refcount of fib6_metrics

2018-08-03 Thread David Miller
From: Cong Wang Date: Thu, 2 Aug 2018 23:20:38 -0700 > All the callers of ip6_rt_copy_init()/rt6_set_from() hold refcnt > of the "from" fib6_info, so there is no need to hold fib6_metrics > refcnt again, because fib6_metrics refcnt is only released when > fib6_info is gone, that is, they have

Re: [PATCH net] dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart()

2018-08-03 Thread David Miller
From: Alexey Kodanev Date: Thu, 2 Aug 2018 19:22:05 +0300 > Make sure that the value of "(now - hc->tx_lsndtime) / hc->tx_rto" is > properly limited when shifting 'u32 cwnd' with it, otherwise we can get: ... > Fixes: 113ced1f52e5 ("dccp ccid-2: Perform congestion-window validation") >

Re: [PATCH v2 net-next] af_unix: ensure POLLOUT on remote close() for connected dgram socket

2018-08-03 Thread David Miller
From: Jason Baron Date: Fri, 3 Aug 2018 17:24:53 -0400 > Applications use -ECONNREFUSED as returned from write() in order to > determine that a socket should be closed. However, when using connected > dgram unix sockets in a poll/write loop, a final POLLOUT event can be > missed when the remote

Re: KCM - recvmsg() mangles packets?

2018-08-03 Thread Tom Herbert
On Fri, Aug 3, 2018 at 4:20 PM, Dominique Martinet wrote: > Tom Herbert wrote on Fri, Aug 03, 2018: >> struct my_proto { >>struct _hdr { >>uint32_t len; >> } hdr; >> char data[32]; >> } __attribute__((packed)); >> >> // use htons to use LE header size, since load_half does a

Re: [PATCH net-next 4/4] net: systemport: Create helper to set MPD

2018-08-03 Thread Andrew Lunn
On Fri, Aug 03, 2018 at 11:08:44AM -0700, Florian Fainelli wrote: > Create a helper function to turn on/off MPD, this will be used to avoid > duplicating code as we are going to add additional types of wake-up > types. > > Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Andrew

KCM - recvmsg() mangles packets?

2018-08-03 Thread Dominique Martinet
I've been playing with KCM on a 4.18.0-rc7 kernel and I'm running in a problem where the iovec filled by recvmsg() is mangled up: it is filled by the length of one packet, but contains (truncated) data from another packet, rendering KCM unuseable. (I haven't tried old kernels to see for how long

Re: [PATCH net-next] net/tls: Calculate nsg for zerocopy path without skb_cow_data.

2018-08-03 Thread Doron Roberts-Kedes
On Fri, Aug 03, 2018 at 01:23:33AM +, Vakul Garg wrote: > > > > -Original Message- > > From: Doron Roberts-Kedes [mailto:doro...@fb.com] > > Sent: Friday, August 3, 2018 6:00 AM > > To: David S . Miller > > Cc: Dave Watson ; Vakul Garg > > ; Boris Pismenny ; Aviad > > Yehezkel ;

Re: [PATCH v3 net-next 1/9] net: stmmac: Add XGMAC 2.10 HWIF entry

2018-08-03 Thread Florian Fainelli
On 08/03/2018 08:50 AM, Jose Abreu wrote: > Add a new entry to HWIF table for XGMAC 2.10. For now we fill it with > empty callbacks which will be added in posterior patches. > > Signed-off-by: Jose Abreu > Cc: David S. Miller > Cc: Joao Pinto > Cc: Giuseppe Cavallaro > Cc: Alexandre Torgue >

  1   2   >