[PATCH net-next 03/16] qlge: Deduplicate lbq_buf_size

2019-06-17 Thread Benjamin Poirier
lbq_buf_size is duplicated to every rx_ring structure whereas lbq_buf_order is present once in the ql_adapter structure. All rings use the same buf size, keep only one copy of it. Also factor out the calculation of lbq_buf_size instead of having two copies. Signed-off-by: Benjamin Poirier --- dr

[PATCH net-next 11/16] qlge: Remove qlge_bq.len & size

2019-06-17 Thread Benjamin Poirier
Given the way the driver currently works, these values are always known at compile time. Signed-off-by: Benjamin Poirier --- drivers/net/ethernet/qlogic/qlge/qlge.h | 17 +++-- drivers/net/ethernet/qlogic/qlge/qlge_dbg.c | 4 - drivers/net/ethernet/qlogic/qlge/qlge_main.c | 79 ---

[PATCH net-next 10/16] qlge: Factor out duplicated expression

2019-06-17 Thread Benjamin Poirier
Signed-off-by: Benjamin Poirier --- drivers/net/ethernet/qlogic/qlge/qlge.h | 6 ++ drivers/net/ethernet/qlogic/qlge/qlge_main.c | 18 ++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qlge/qlge.h b/drivers/net/ethernet/qlog

[PATCH net-next 14/16] qlge: Update buffer queue prod index despite oom

2019-06-17 Thread Benjamin Poirier
Currently, if we repeatedly fail to allocate all of the buffers from the desired batching budget, we will never update the prod_idx register. Restructure code to always update prod_idx if new buffers could be allocated. This eliminates the current two stage process (clean_idx -> prod_idx) and some

[PATCH net-next 16/16] qlge: Refill empty buffer queues from wq

2019-06-17 Thread Benjamin Poirier
When operating at mtu 9000, qlge does order-1 allocations for rx buffers in atomic context. This is especially unreliable when free memory is low or fragmented. Add an approach similar to commit 3161e453e496 ("virtio: net refill on out-of-memory") to qlge so that the device doesn't lock up if there

[PATCH net-next 01/16] qlge: Remove irq_cnt

2019-06-17 Thread Benjamin Poirier
qlge uses an irq enable/disable refcounting scheme that is: * poorly implemented Uses a spin_lock to protect accesses to the irq_cnt atomic variable * buggy Breaks when there is not a 1:1 sequence of irq - napi_poll, such as when using SO_BUSY_POLL. * unnecessary The

[PATCH net-next 04/16] qlge: Remove bq_desc.maplen

2019-06-17 Thread Benjamin Poirier
The size of the mapping is known statically in all cases, there's no need to save it at runtime. Remove this member. Signed-off-by: Benjamin Poirier --- drivers/net/ethernet/qlogic/qlge/qlge.h | 1 - drivers/net/ethernet/qlogic/qlge/qlge_main.c | 43 +++- 2 files changed, 1

[PATCH net-next 02/16] qlge: Remove page_chunk.last_flag

2019-06-17 Thread Benjamin Poirier
As already done in ql_get_curr_lchunk(), this member can be replaced by a simple test. Signed-off-by: Benjamin Poirier --- drivers/net/ethernet/qlogic/qlge/qlge.h | 1 - drivers/net/ethernet/qlogic/qlge/qlge_main.c | 13 + 2 files changed, 5 insertions(+), 9 deletions(-) diff

[PATCH net-next 07/16] qlge: Deduplicate rx buffer queue management

2019-06-17 Thread Benjamin Poirier
The qlge driver (and device) uses two kinds of buffers for reception, so-called "small buffers" and "large buffers". The two are arranged in rings, the sbq and lbq. These two share similar data structures and code. Factor out data structures into a common struct qlge_bq, make required adjustments

[PATCH net-next 09/16] qlge: Remove rx_ring.type

2019-06-17 Thread Benjamin Poirier
This field is redundant, the type can be determined from the index, cq_id. Signed-off-by: Benjamin Poirier --- drivers/net/ethernet/qlogic/qlge/qlge.h | 10 --- drivers/net/ethernet/qlogic/qlge/qlge_dbg.c | 16 +++--- drivers/net/ethernet/qlogic/qlge/qlge_main.c | 31 +-

[PATCH net-next 08/16] qlge: Fix dma_sync_single calls

2019-06-17 Thread Benjamin Poirier
Using the unmap addr elsewhere than unmap calls is a misuse of the dma api. In prevision of this fix, qlge kept two copies of the dma address around ;) Fixes: c4e84bde1d59 ("qlge: New Qlogic 10Gb Ethernet Driver.") Fixes: 7c734359d350 ("qlge: Size RX buffers based on MTU.") Fixes: 2c9a266afefe ("q

[PATCH net-next 06/16] qlge: Remove useless dma synchronization calls

2019-06-17 Thread Benjamin Poirier
This is unneeded for two reasons: 1) the mapping is not written by the cpu 2) calls like ..._sync_..._for_device(..., ..._FROMDEVICE) are nonsensical, see commit 3f0fb4e85b38 ("Documentation/DMA-API-HOWTO.txt: fix misleading example") Signed-off-by: Benjamin Poirier --- drivers/net/etherne

[PATCH net-next 15/16] qlge: Refill rx buffers up to multiple of 16

2019-06-17 Thread Benjamin Poirier
Reading the {s,l}bq_prod_idx registers on a running device, it appears that the adapter will only use buffers up to prod_idx & 0xfff0. The driver currently uses fixed-size guard zones (16 for sbq, 32 for lbq - don't know why this difference). After the previous patch, this approach no longer guaran

[PATCH net-next 13/16] qlge: Replace memset with assignment

2019-06-17 Thread Benjamin Poirier
Instead of clearing the structure wholesale, it is sufficient to initialize the skb member which is used to manage sbq instances. lbq instances are managed according to curr_idx and clean_idx. Signed-off-by: Benjamin Poirier --- drivers/net/ethernet/qlogic/qlge/qlge_main.c | 3 +-- 1 file change

[PATCH net-next 05/16] qlge: Remove rx_ring.sbq_buf_size

2019-06-17 Thread Benjamin Poirier
Tx rings have sbq_buf_size = 0 but there's no case where the code actually tests on that value. We can remove sbq_buf_size and use a constant instead. Signed-off-by: Benjamin Poirier --- drivers/net/ethernet/qlogic/qlge/qlge.h | 1 - drivers/net/ethernet/qlogic/qlge/qlge_dbg.c | 1 - dri

[PATCH net-next 12/16] qlge: Remove useless memset

2019-06-17 Thread Benjamin Poirier
This just repeats what the other memset a few lines above did. Signed-off-by: Benjamin Poirier --- drivers/net/ethernet/qlogic/qlge/qlge_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index b1

Re: [PATCH net-next v3 7/7] net: ipv4: provide __rcu annotation for ifa_list

2019-06-17 Thread Tariq Toukan
On 5/31/2019 7:27 PM, Florian Westphal wrote: > ifa_list is protected by rcu, yet code doesn't reflect this. > > Add the __rcu annotations and fix up all places that are now reported by > sparse. > > I've done this in the same commit to not add intermediate patches that > result in new warning

[PATCH net-next v4 1/2] ipoib: correcly show a VF hardware address

2019-06-17 Thread Denis Kirjanov
in the case of IPoIB with SRIOV enabled hardware ip link show command incorrecly prints 0 instead of a VF hardware address. Before: 11: ib1: mtu 2044 qdisc pfifo_fast state UP mode DEFAULT group default qlen 256 link/infiniband 80:00:00:66:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a4:3e:7c brd 0

[PATCH net-next v4 2/2] ipoib: show VF broadcast address

2019-06-17 Thread Denis Kirjanov
in IPoIB case we can't see a VF broadcast address for but can see for PF Before: 11: ib1: mtu 2044 qdisc pfifo_fast state UP mode DEFAULT group default qlen 256 link/infiniband 80:00:00:66:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a4:3e:7c brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:f

[PATCH 2/2] ipoib: show VF broadcast address

2019-06-17 Thread Denis Kirjanov
in IPoIB case we can't see a VF broadcast address for but can see for PF Before: 11: ib1: mtu 2044 qdisc pfifo_fast state UP mode DEFAULT group default qlen 256 link/infiniband 80:00:00:66:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a4:3e:7c brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:f

[PATCH 1/2] ipoib: correcly show a VF hardware address

2019-06-17 Thread Denis Kirjanov
in the case of IPoIB with SRIOV enabled hardware ip link show command incorrecly prints 0 instead of a VF hardware address. Before: 11: ib1: mtu 2044 qdisc pfifo_fast state UP mode DEFAULT group default qlen 256 link/infiniband 80:00:00:66:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a4:3e:7c brd 0

Re: [PATCHv2 net-next] team: add ethtool get_link_ksettings

2019-06-17 Thread Jiri Pirko
Mon, Jun 17, 2019 at 03:32:55AM CEST, liuhang...@gmail.com wrote: >Like bond, add ethtool get_link_ksettings to show the total speed. > >v2: no update, just repost. > >Signed-off-by: Hangbin Liu Acked-by: Jiri Pirko

Re: [RFC PATCH bpf-next 6/8] libbpf: allow specifying map definitions using BTF

2019-06-17 Thread Lorenz Bauer
On Thu, 6 Jun 2019 at 23:35, Andrii Nakryiko wrote: > > On Thu, Jun 6, 2019 at 9:43 AM Lorenz Bauer wrote: > > > > Thanks for sending this RFC! For me, the biggest draw is that map-in-map > > would be so much nicer to use, plus automatic dumping of map values. > > > > Others on the thread have ra

Re: [PATCH ipsec-next] xfrm: fix bogus WARN_ON with ipv6

2019-06-17 Thread Steffen Klassert
On Wed, Jun 12, 2019 at 10:30:58AM +0200, Florian Westphal wrote: > net/xfrm/xfrm_input.c:378:17: warning: this statement may fall through > [-Wimplicit-fallthrough=] > skb->protocol = htons(ETH_P_IPV6); > > ... the fallthrough then causes a bogus WARN_ON(). > > Reported-by: Stephen Rothwell >

Re: [PATCH] xfrm: remove empty xfrmi_init_net

2019-06-17 Thread Steffen Klassert
On Thu, Jun 13, 2019 at 07:45:24PM +0800, Li RongQing wrote: > Pointer members of an object with static storage duration, if not > explicitly initialized, will be initialized to a NULL pointer. The > net namespace API checks if this pointer is not NULL before using it, > it are safe to remove the f

Re: [PATCH net-next v3 7/7] net: ipv4: provide __rcu annotation for ifa_list

2019-06-17 Thread Florian Westphal
Tariq Toukan wrote: > On 5/31/2019 7:27 PM, Florian Westphal wrote: > > ifa_list is protected by rcu, yet code doesn't reflect this. > > > > Add the __rcu annotations and fix up all places that are now reported by > > sparse. > > > > I've done this in the same commit to not add intermediate patc

RE: [EXT] [PATCH net-next 06/16] qlge: Remove useless dma synchronization calls

2019-06-17 Thread Manish Chopra
> -Original Message- > From: Benjamin Poirier > Sent: Monday, June 17, 2019 1:19 PM > To: Manish Chopra ; GR-Linux-NIC-Dev nic-...@marvell.com>; netdev@vger.kernel.org > Subject: [EXT] [PATCH net-next 06/16] qlge: Remove useless dma > synchronization calls > > External Email > > ---

[PATCH net-next 0/2] net: sched: act_ctinfo: fixes

2019-06-17 Thread Kevin Darbyshire-Bryant
This is first attempt at sending a small series. Order is important because one bug (policy validation) prevents us from encountering the more important 'OOPS' generating bug in action creation. Fix the OOPS first. Confession time: Until very recently, development of this module has been done on

[PATCH net-next 1/2] net: sched: act_ctinfo: fix action creation

2019-06-17 Thread Kevin Darbyshire-Bryant
Use correct return value on action creation: ACT_P_CREATED. The use of incorrect return value could result in a situation where the system thought a ctinfo module was listening but actually wasn't instantiated correctly leading to an OOPS in tcf_generic_walker(). Confession time: Until very recen

[PATCH net-next 2/2] net: sched: act_ctinfo: fix policy validation

2019-06-17 Thread Kevin Darbyshire-Bryant
Fix nla_policy definition by specifying an exact length type attribute to CTINFO action paraneter block structure. Without this change, netlink parsing will fail validation and the action will not be instantiated. 8cb081746c03 ("netlink: make validation more configurable for future") introduced m

Re: [PATCH net-next 0/2] selftests: pmtu: List/flush IPv4 cached routes, improve IPv6 test

2019-06-17 Thread Stefano Brivio
On Sun, 16 Jun 2019 20:45:52 -0700 (PDT) David Miller wrote: > From: Stefano Brivio > Date: Sat, 15 Jun 2019 03:38:16 +0200 > > > This series introduce a new test, list_flush_ipv4_exception, and improves > > the existing list_flush_ipv6_exception test by making it as demanding as > > the IPv4 o

[PATCH net-next 4/4] qed: Add devlink support for configuration attributes.

2019-06-17 Thread Sudarsana Reddy Kalluru
This patch adds implementation for devlink callbacks for reading/ configuring the device attributes. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ariel Elior --- drivers/net/ethernet/qlogic/qed/qed.h | 1 + drivers/net/ethernet/qlogic/qed/qed_devlink.c | 184 +

[PATCH net-next 1/4] qed: Add APIs for device attributes configuration.

2019-06-17 Thread Sudarsana Reddy Kalluru
The patch adds APIs for reading/configuring the device attributes using mailbox interfaces. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ariel Elior --- drivers/net/ethernet/qlogic/qed/qed_hsi.h | 20 ++ drivers/net/ethernet/qlogic/qed/qed_mcp.c | 64 +++

[PATCH net-next 2/4] qed: Perform devlink registration after the hardware init.

2019-06-17 Thread Sudarsana Reddy Kalluru
Devlink callbacks need access to device resources such as ptt lock, hence performing the devlink registration after the device initialization. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ariel Elior --- drivers/net/ethernet/qlogic/qed/qed_main.c | 16 +--- 1 file changed,

[PATCH net-next 3/4] qed: Add new file for devlink implementation.

2019-06-17 Thread Sudarsana Reddy Kalluru
The patch introduces new files for qed devlink implementation. Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Ariel Elior --- drivers/net/ethernet/qlogic/qed/Makefile | 3 +- drivers/net/ethernet/qlogic/qed/qed_devlink.c | 97 drivers/net/ethernet/qlogic/

[PATCH net-next 0/4] qed: Devlink support for config attributes management.

2019-06-17 Thread Sudarsana Reddy Kalluru
The patch series adds support for managing the config attributes using devlink interfaces. Please consider applying it to 'net-next' tree. Sudarsana Reddy Kalluru (4): qed: Add APIs for device attributes configuration. qed: Perform devlink registration after the hardware init. qed: Add new

RE: [PATCH net] bnx2x: Check if transceiver implements DDM before access

2019-06-17 Thread Sudarsana Reddy Kalluru
> -Original Message- > From: David Miller > Sent: Monday, June 17, 2019 2:09 AM > To: maur...@linux.vnet.ibm.com > Cc: netdev@vger.kernel.org; Ariel Elior ; Sudarsana > Reddy Kalluru ; GR-everest-linux-l2 linux...@marvell.com> > Subject: Re: [PATCH net] bnx2x: Check if transceiver impleme

Re: [PATCH] can: flexcan: fix stop mode acknowledgment

2019-06-17 Thread Marc Kleine-Budde
On 6/11/19 8:47 AM, Joakim Zhang wrote: > To enter stop mode, the CPU should manually assert a global Stop Mode > request and check the acknowledgment asserted by FlexCAN. The CPU must > only consider the FlexCAN in stop mode when both request and > acknowledgment conditions are satisfied. > > Fix

Re: [PATCH net-next 06/17] ipv6: Add IPv6 multipath notifications for add / replace

2019-06-17 Thread David Ahern
On 6/15/19 8:07 AM, Ido Schimmel wrote: > From: Ido Schimmel > > Emit a notification when a multipath routes is added or replace. > > Note that unlike the replace notifications sent from fib6_add_rt2node(), > it is possible we are sending a 'FIB_EVENT_ENTRY_REPLACE' when a route > was merely add

Re: [PATCH net-next 07/17] ipv6: Add IPv6 multipath notification for route delete

2019-06-17 Thread David Ahern
On 6/15/19 8:07 AM, Ido Schimmel wrote: > From: Ido Schimmel > > If all the nexthops of a multipath route are being deleted, send one > notification for the entire route, instead of one per-nexthop. > > Signed-off-by: Ido Schimmel > Acked-by: Jiri Pirko > --- > net/ipv6/route.c | 6 ++ >

Re: [PATCH net-next 16/17] ipv6: Stop sending in-kernel notifications for each nexthop

2019-06-17 Thread David Ahern
On 6/15/19 8:07 AM, Ido Schimmel wrote: > From: Ido Schimmel > > Both listeners - mlxsw and netdevsim - of IPv6 FIB notifications are now > ready to handle IPv6 multipath notifications. > > Therefore, stop ignoring such notifications in both drivers and stop > sending notification for each added

Re: [RFC PATCH net-next 1/2] tcp: ulp: add functions to dump ulp-specific information

2019-06-17 Thread Davide Caratti
On Wed, 2019-06-05 at 16:14 -0700, Jakub Kicinski wrote: > On Wed, 5 Jun 2019 17:39:22 +0200, Davide Caratti wrote: > > currently, only getsockopt(TCP_ULP) can be invoked to know if a ULP is on > > top of a TCP socket. Extend idiag_get_aux() and idiag_get_aux_size(), > > introduced by commit b37e8

Re: [PATCH net v4 1/8] ipv4/fib_frontend: Rename ip_valid_fib_dump_req, provide non-strict version

2019-06-17 Thread David Ahern
On 6/14/19 9:27 PM, Stefano Brivio wrote: Can you explain why this patch is needed? The existing function requires strict mode and is needed to enable any of the kernel side filtering beyond the RTM_F_CLONED setting in rtm_flags. >>> >>> It's mostly to have proper NLM_F_MATCH suppo

Re: [PATCH net v4 2/8] ipv4: Honour NLM_F_MATCH, make semantics of NETLINK_GET_STRICT_CHK consistent

2019-06-17 Thread David Ahern
On 6/14/19 9:23 PM, Stefano Brivio wrote: > > 1. we need a way to filter on cached routes > > 2. RTM_F_CLONED, by itself, doesn't specify a filter > > 3. how do we turn that into a filter? NLM_F_MATCH, says RFC 3549 > > 4. but if strict checking is requested, you also turn some attributes >

[PATCH net 0/3] net: fix quite a few dst_cache crashes reported by syzbot

2019-06-17 Thread Xin Long
There are two kinds of crashes reported many times by syzbot with no reproducer. Call Traces are like: BUG: KASAN: slab-out-of-bounds in rt_cache_valid+0x158/0x190 net/ipv4/route.c:1556 rt_cache_valid+0x158/0x190 net/ipv4/route.c:1556 __mkroute_output net/ipv4/route.c:2332

[PATCH net 1/3] ip_tunnel: allow not to count pkts on tstats by setting skb's dev to NULL

2019-06-17 Thread Xin Long
iptunnel_xmit() works as a common function, also used by a udp tunnel which doesn't have to have a tunnel device, like how TIPC works with udp media. In these cases, we should allow not to count pkts on dev's tstats, so that udp tunnel can work with no tunnel device safely. Signed-off-by: Xin Lon

[PATCH net 2/3] ip6_tunnel: allow not to count pkts on tstats by passing dev as NULL

2019-06-17 Thread Xin Long
A similar fix to Patch "ip_tunnel: allow not to count pkts on tstats by setting skb's dev to NULL" is also needed by ip6_tunnel. Signed-off-by: Xin Long --- include/net/ip6_tunnel.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/net/ip6_tunnel.h b/include/ne

[PATCH net 3/3] tipc: pass tunnel dev as NULL to udp_tunnel(6)_xmit_skb

2019-06-17 Thread Xin Long
udp_tunnel(6)_xmit_skb() called by tipc_udp_xmit() expects a tunnel device to count packets on dev->tstats, a perpcu variable. However, TIPC is using udp tunnel with no tunnel device, and pass the lower dev, like veth device that only initializes dev->lstats(a perpcu variable) when creating it. La

Re: [PATCH net v4 1/8] ipv4/fib_frontend: Rename ip_valid_fib_dump_req, provide non-strict version

2019-06-17 Thread David Ahern
On 6/16/19 2:04 PM, Stefano Brivio wrote: > We could do this: > > - strict checking enabled (iproute2 >= 5.0.0): > - in inet{,6}_dump_fib(): if NLM_F_MATCH is set, set > filter->filter_set in any case > > - in fn_trie_dump_leaf() and rt6_dump_route(): use filter->filter_set > to decid

Re: [PATCH net-next 0/2] net: mediatek: Add MT7621 TRGMII mode support

2019-06-17 Thread Andrew Lunn
On Sun, Jun 16, 2019 at 08:20:08PM +0200, René van Dorst wrote: > Like many other mediatek SOCs, the MT7621 SOC and the internal MT7530 switch > both > supports TRGMII mode. MT7621 TRGMII speed is 1200MBit. Hi René Is TRGMII used only between the SoC and the Switch? Or does external ports of the

[PATCH net-next 0/2] net: ipv4: remove erroneous advancement of list pointer

2019-06-17 Thread Florian Westphal
Tariq reported a soft lockup on net-next that Mellanox was able to bisect to 2638eb8b50cf ("net: ipv4: provide __rcu annotation for ifa_list"). While reviewing above patch I found a regression when addresses have a lifetime specified. Second patch extends rtnetlink.sh to trigger crash (without fi

Re: [PATCH net v4 1/8] ipv4/fib_frontend: Rename ip_valid_fib_dump_req, provide non-strict version

2019-06-17 Thread Stefano Brivio
On Mon, 17 Jun 2019 07:38:54 -0600 David Ahern wrote: > On 6/16/19 2:04 PM, Stefano Brivio wrote: > > We could do this: > > > > - strict checking enabled (iproute2 >= 5.0.0): > > - in inet{,6}_dump_fib(): if NLM_F_MATCH is set, set > > filter->filter_set in any case > > > > - in fn_trie

[PATCH net-next 1/2] net: ipv4: remove erroneous advancement of list pointer

2019-06-17 Thread Florian Westphal
Causes crash when lifetime expires on an adress as garbage is dereferenced soon after. This used to look like this: for (ifap = &ifa->ifa_dev->ifa_list; *ifap != NULL; ifap = &(*ifap)->ifa_next) { if (*ifap == ifa) ... but this was changed to: struct in_ifaddr *tmp; ifap = &if

[PATCH net-next 2/2] selftests: rtnetlink: add addresses with fixed life time

2019-06-17 Thread Florian Westphal
This exercises kernel code path that deal with addresses that have a limited lifetime. Without previous fix, this triggers following crash on net-next: BUG: KASAN: null-ptr-deref in check_lifetime+0x403/0x670 Read of size 8 at addr 0010 by task kworker [..] Signed-off-by: Florian We

Re: [PATCH RFC 3/6] dpaa2-mac: add MC API for the DPMAC object

2019-06-17 Thread Andrew Lunn
On Fri, Jun 14, 2019 at 02:06:05PM +, Ioana Ciornei wrote: > > Subject: Re: [PATCH RFC 3/6] dpaa2-mac: add MC API for the DPMAC object > > > > > +/** > > > + * dpmac_set_link_state() - Set the Ethernet link status > > > + * @mc_io: Pointer to opaque I/O object > > > + * @cmd_flags: Comma

Re: [PATCH net-next v3] ipv4: Support multipath hashing on inner IP pkts for GRE tunnel

2019-06-17 Thread Ido Schimmel
On Thu, Jun 13, 2019 at 02:38:58PM -0400, Stephen Suryaputra wrote: > Multipath hash policy value of 0 isn't distributing since the outer IP > dest and src aren't varied eventhough the inner ones are. Since the flow > is on the inner ones in the case of tunneled traffic, hashing on them is > desire

Re: [PATCH RFC 0/6] DPAA2 MAC Driver

2019-06-17 Thread Andrew Lunn
On Fri, Jun 14, 2019 at 03:26:50PM +, Ioana Ciornei wrote: > > Subject: Re: [PATCH RFC 0/6] DPAA2 MAC Driver > > > > On Fri, Jun 14, 2019 at 02:55:47AM +0300, Ioana Ciornei wrote: > > > After today's discussion with Russell King about what phylink exposes > > > in > > > .mac_config(): https://

Re: [PATCH net-next v3] ipv4: Support multipath hashing on inner IP pkts for GRE tunnel

2019-06-17 Thread David Ahern
On 6/17/19 8:39 AM, Ido Schimmel wrote: > > Do you plan to add IPv6 support? Would be good to have the same features > in both stacks. we really should be mandating equal support for all new changes like this. > > Also, we have tests for these sysctls under > tools/testing/selftests/net/forward

[patch net-next internal] net: sched: cls_matchall: allow to delete filter

2019-06-17 Thread Jiri Pirko
From: Jiri Pirko Currently user is unable to delete the filter. See following example: $ tc filter add dev ens16np1 ingress pref 1 handle 1 matchall action drop $ tc filter show dev ens16np1 ingress filter protocol all pref 1 matchall chain 0 filter protocol all pref 1 matchall chain 0 handle 0x1

[patch net-next] net: sched: cls_matchall: allow to delete filter

2019-06-17 Thread Jiri Pirko
From: Jiri Pirko Currently user is unable to delete the filter. See following example: $ tc filter add dev ens16np1 ingress pref 1 handle 1 matchall action drop $ tc filter show dev ens16np1 ingress filter protocol all pref 1 matchall chain 0 filter protocol all pref 1 matchall chain 0 handle 0x1

Re: [patch net-next internal] net: sched: cls_matchall: allow to delete filter

2019-06-17 Thread Jiri Pirko
Sorry, wrong prefix, please ignore.

Re: [RFC PATCH net-next 2/2] net: tls: export protocol version and cipher to socket diag

2019-06-17 Thread Davide Caratti
On Wed, 2019-06-05 at 16:25 -0700, Jakub Kicinski wrote: > On Wed, 5 Jun 2019 17:39:23 +0200, Davide Caratti wrote: > > When an application configures kernel TLS on top of a TCP socket, it's > > now possible for inet_diag_handler to collect information regarding the > > protocol version and the ci

Re: [PATCH net-next 0/2] net: ipv4: remove erroneous advancement of list pointer

2019-06-17 Thread Tariq Toukan
On 6/17/2019 5:02 PM, Florian Westphal wrote: > Tariq reported a soft lockup on net-next that Mellanox was able to > bisect to 2638eb8b50cf ("net: ipv4: provide __rcu annotation for ifa_list"). > > While reviewing above patch I found a regression when addresses have a > lifetime specified. > >

Re: [PATCH v3 bpf-next 0/9] bpf: bounded loops and other features

2019-06-17 Thread Andrii Nakryiko
On Sat, Jun 15, 2019 at 12:12 PM Alexei Starovoitov wrote: > > v2->v3: fixed issues in backtracking pointed out by Andrii. > The next step is to add a lot more tests for backtracking. > Tests would be great, verifier complexity is at the level, where it's very easy to miss issues. Was fuzzying a

RE: [PATCH net-next 01/16] qlge: Remove irq_cnt

2019-06-17 Thread Manish Chopra
> -Original Message- > From: Benjamin Poirier > Sent: Monday, June 17, 2019 1:19 PM > To: Manish Chopra ; GR-Linux-NIC-Dev nic-...@marvell.com>; netdev@vger.kernel.org > Subject: [PATCH net-next 01/16] qlge: Remove irq_cnt > > qlge uses an irq enable/disable refcounting scheme that is: >

[PATCH net 0/4] tcp: make sack processing more robust

2019-06-17 Thread Eric Dumazet
Jonathan Looney brought to our attention multiple problems in TCP stack at the sender side. SACK processing can be abused by malicious peers to either cause overflows, or increase of memory usage. First two patches fix the immediate problems. Since the malicious peers abuse senders by advertizin

[PATCH net 4/4] tcp: enforce tcp_min_snd_mss in tcp_mtu_probing()

2019-06-17 Thread Eric Dumazet
If mtu probing is enabled tcp_mtu_probing() could very well end up with a too small MSS. Use the new sysctl tcp_min_snd_mss to make sure MSS search is performed in an acceptable range. CVE-2019-11479 -- tcp mss hardcoded to 48 Signed-off-by: Eric Dumazet Reported-by: Jonathan Lemon Cc: Jonatha

[PATCH net 2/4] tcp: tcp_fragment() should apply sane memory limits

2019-06-17 Thread Eric Dumazet
Jonathan Looney reported that a malicious peer can force a sender to fragment its retransmit queue into tiny skbs, inflating memory usage and/or overflow 32bit counters. TCP allows an application to queue up to sk_sndbuf bytes, so we need to give some allowance for non malicious splitting of retra

[PATCH net 3/4] tcp: add tcp_min_snd_mss sysctl

2019-06-17 Thread Eric Dumazet
Some TCP peers announce a very small MSS option in their SYN and/or SYN/ACK messages. This forces the stack to send packets with a very high network/cpu overhead. Linux has enforced a minimal value of 48. Since this value includes the size of TCP options, and that the options can consume up to 40

[PATCH net 1/4] tcp: limit payload size of sacked skbs

2019-06-17 Thread Eric Dumazet
Jonathan Looney reported that TCP can trigger the following crash in tcp_shifted_skb() : BUG_ON(tcp_skb_pcount(skb) < pcount); This can happen if the remote peer has advertized the smallest MSS that linux TCP accepts : 48 An skb can hold 17 fragments, and each fragment can hold 32KB on x

Re: [PATCH net v4 1/8] ipv4/fib_frontend: Rename ip_valid_fib_dump_req, provide non-strict version

2019-06-17 Thread David Ahern
On 6/17/19 8:13 AM, Stefano Brivio wrote: >> >> With strict checking (5.0 and forward): >> - RTM_F_CLONED NOT set means dump only FIB entries >> - RTM_F_CLONED set means dump only exceptions > > Okay. Should we really ignore the RFC and NLM_F_MATCH though? If we add > field(s) to the filter, it co

Re: [PATCH net-next v3] ipv4: Support multipath hashing on inner IP pkts for GRE tunnel

2019-06-17 Thread Stephen Suryaputra
On Mon, Jun 17, 2019 at 09:53:06AM -0600, David Ahern wrote: > On 6/17/19 8:39 AM, Ido Schimmel wrote: > > > > Do you plan to add IPv6 support? Would be good to have the same features > > in both stacks. > > we really should be mandating equal support for all new changes like this. > I will add

Re: [PATCH net 1/4] tcp: limit payload size of sacked skbs

2019-06-17 Thread Jonathan Lemon
On 17 Jun 2019, at 10:03, Eric Dumazet wrote: Jonathan Looney reported that TCP can trigger the following crash in tcp_shifted_skb() : BUG_ON(tcp_skb_pcount(skb) < pcount); This can happen if the remote peer has advertized the smallest MSS that linux TCP accepts : 48 An skb can hol

Re: [PATCH net 2/4] tcp: tcp_fragment() should apply sane memory limits

2019-06-17 Thread Jonathan Lemon
On 17 Jun 2019, at 10:03, Eric Dumazet wrote: > Jonathan Looney reported that a malicious peer can force a sender > to fragment its retransmit queue into tiny skbs, inflating memory > usage and/or overflow 32bit counters. > > TCP allows an application to queue up to sk_sndbuf bytes, > so we nee

Re: [PATCH net 3/4] tcp: add tcp_min_snd_mss sysctl

2019-06-17 Thread Jonathan Lemon
On 17 Jun 2019, at 10:03, Eric Dumazet wrote: > Some TCP peers announce a very small MSS option in their SYN and/or > SYN/ACK messages. > > This forces the stack to send packets with a very high network/cpu > overhead. > > Linux has enforced a minimal value of 48. Since this value includes > th

Re: [PATCH net 4/4] tcp: enforce tcp_min_snd_mss in tcp_mtu_probing()

2019-06-17 Thread Jonathan Lemon
On 17 Jun 2019, at 10:03, Eric Dumazet wrote: > If mtu probing is enabled tcp_mtu_probing() could very well end up > with a too small MSS. > > Use the new sysctl tcp_min_snd_mss to make sure MSS search > is performed in an acceptable range. > > CVE-2019-11479 -- tcp mss hardcoded to 48 > > Sign

Re: [PATCH net 3/4] tcp: add tcp_min_snd_mss sysctl

2019-06-17 Thread Tyler Hicks
On 2019-06-17 10:03:53, Eric Dumazet wrote: > Some TCP peers announce a very small MSS option in their SYN and/or > SYN/ACK messages. > > This forces the stack to send packets with a very high network/cpu > overhead. > > Linux has enforced a minimal value of 48. Since this value includes > the si

Re: [PATCH net 4/4] tcp: enforce tcp_min_snd_mss in tcp_mtu_probing()

2019-06-17 Thread Tyler Hicks
On 2019-06-17 10:03:54, Eric Dumazet wrote: > If mtu probing is enabled tcp_mtu_probing() could very well end up > with a too small MSS. > > Use the new sysctl tcp_min_snd_mss to make sure MSS search > is performed in an acceptable range. > > CVE-2019-11479 -- tcp mss hardcoded to 48 > > Signed-

Re: [PATCH v3 bpf-next 9/9] bpf: precise scalar_value tracking

2019-06-17 Thread Andrii Nakryiko
On Sat, Jun 15, 2019 at 12:13 PM Alexei Starovoitov wrote: > > Introduce precision tracking logic that > helps cilium programs the most: > old clang old clangnew clang new clang > with all patches with all patches > bpf_lb-DLB_L3.o 183

Re: [PATCH bpf-next 2/8] libbpf: extract BTF loading and simplify ELF parsing logic

2019-06-17 Thread Andrii Nakryiko
On Sat, Jun 15, 2019 at 1:26 PM Song Liu wrote: > > On Mon, Jun 10, 2019 at 9:49 PM Andrii Nakryiko wrote: > > > > As a preparation for adding BTF-based BPF map loading, extract .BTF and > > .BTF.ext loading logic. Also simplify error handling in > > bpf_object__elf_collect() by returning early,

Re: [PATCH net 0/4] tcp: make sack processing more robust

2019-06-17 Thread David Miller
From: Eric Dumazet Date: Mon, 17 Jun 2019 10:03:50 -0700 > Jonathan Looney brought to our attention multiple problems > in TCP stack at the sender side. > > SACK processing can be abused by malicious peers to either > cause overflows, or increase of memory usage. > > First two patches fix the i

Re: [RFC PATCH net-next 1/2] tcp: ulp: add functions to dump ulp-specific information

2019-06-17 Thread Jakub Kicinski
On Mon, 17 Jun 2019 15:06:33 +0200, Davide Caratti wrote: > > > + if (icsk->icsk_ulp_ops->get_info_size) > > > + size += icsk->icsk_ulp_ops->get_info_size(sk); > > > > I don't know the diag code, is the socket locked at this point? > > as far as I can see, it's not. Th

Re: [PATCH bpf-next 2/8] libbpf: extract BTF loading and simplify ELF parsing logic

2019-06-17 Thread Andrii Nakryiko
On Sat, Jun 15, 2019 at 1:28 PM Song Liu wrote: > > On Sat, Jun 15, 2019 at 1:25 PM Song Liu wrote: > > > > On Mon, Jun 10, 2019 at 9:49 PM Andrii Nakryiko wrote: > > > > > > As a preparation for adding BTF-based BPF map loading, extract .BTF and > > > .BTF.ext loading logic. Also simplify error

[PATCH bpf-next v6 0/9] bpf: getsockopt and setsockopt hooks

2019-06-17 Thread Stanislav Fomichev
This series implements two new per-cgroup hooks: getsockopt and setsockopt along with a new sockopt program type. The idea is pretty similar to recently introduced cgroup sysctl hooks, but implementation is simpler (no need to convert to/from strings). What this can be applied to: * move business

[PATCH bpf-next v6 1/9] bpf: implement getsockopt and setsockopt hooks

2019-06-17 Thread Stanislav Fomichev
Implement new BPF_PROG_TYPE_CGROUP_SOCKOPT program type and BPF_CGROUP_{G,S}ETSOCKOPT cgroup hooks. BPF_CGROUP_SETSOCKOPT get a read-only view of the setsockopt arguments. BPF_CGROUP_GETSOCKOPT can modify the supplied buffer. Both of them reuse existing PTR_TO_PACKET{,_END} infrastructure. The bu

[PATCH bpf-next v6 2/9] bpf: sync bpf.h to tools/

2019-06-17 Thread Stanislav Fomichev
Export new prog type and hook points to the libbpf. Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- tools/include/uapi/linux/bpf.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index d0a23476f887..5dc906f

[PATCH bpf-next v6 6/9] selftests/bpf: add sockopt test that exercises sk helpers

2019-06-17 Thread Stanislav Fomichev
socktop test that introduces new SOL_CUSTOM sockopt level and stores whatever users sets in sk storage. Whenever getsockopt is called, the original value is retrieved. v6: * test 'ret=1' use-case as well (Alexei Starovoitov) v4: * don't call bpf_sk_fullsock helper v3: * drop (__u8 *)(long) casts

[PATCH bpf-next v6 5/9] selftests/bpf: add sockopt test

2019-06-17 Thread Stanislav Fomichev
Add sockopt selftests: * require proper expected_attach_type * enforce context field read/write access * test bpf_sockopt_handled handler * test EPERM * test limiting optlen from getsockopt * test out-of-bounds access v3: * use DW for optval{,_end} loads v2: * use return code 2 for kernel bypass

[PATCH bpf-next v6 8/9] bpf: add sockopt documentation

2019-06-17 Thread Stanislav Fomichev
Provide user documentation about sockopt prog type and cgroup hooks. v6: * describe cgroup chaining, add example v2: * use return code 2 for kernel bypass Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- Documentation/bpf/index.rst | 1 + Documentation/bpf/prog_cgroup_socko

[PATCH bpf-next v6 7/9] selftests/bpf: add sockopt test that exercises BPF_F_ALLOW_MULTI

2019-06-17 Thread Stanislav Fomichev
sockopt test that verifies chaining behavior when 0/2 is returned. Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- tools/testing/selftests/bpf/.gitignore| 1 + tools/testing/selftests/bpf/Makefile | 4 +- .../selftests/bpf/test_sockopt_multi.c| 264

Re: [RFC PATCH bpf-next 3/8] libbpf: refactor map initialization

2019-06-17 Thread Andrii Nakryiko
On Sat, Jun 15, 2019 at 2:03 PM Song Liu wrote: > > On Mon, Jun 10, 2019 at 9:35 PM Andrii Nakryiko wrote: > > > > User and global data maps initialization has gotten pretty complicated > > and unnecessarily convoluted. This patch splits out the logic for global > > data map and user-defined map

[PATCH bpf-next v6 4/9] selftests/bpf: test sockopt section name

2019-06-17 Thread Stanislav Fomichev
Add tests that make sure libbpf section detection works. Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- tools/testing/selftests/bpf/test_section_names.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tools/testing/selftests/bpf/test_section_names.c b/tools/testing/selfte

[PATCH bpf-next v6 3/9] libbpf: support sockopt hooks

2019-06-17 Thread Stanislav Fomichev
Make libbpf aware of new sockopt hooks so it can derive prog type and hook point from the section names. Cc: Martin Lau Signed-off-by: Stanislav Fomichev --- tools/lib/bpf/libbpf.c| 5 + tools/lib/bpf/libbpf_probes.c | 1 + 2 files changed, 6 insertions(+) diff --git a/tools/lib/bp

[PATCH bpf-next v6 9/9] bpftool: support cgroup sockopt

2019-06-17 Thread Stanislav Fomichev
Support sockopt prog type and cgroup hooks in the bpftool. Cc: Martin Lau Acked-by: Jakub Kicinski Signed-off-by: Stanislav Fomichev --- tools/bpf/bpftool/Documentation/bpftool-cgroup.rst | 7 +-- tools/bpf/bpftool/Documentation/bpftool-prog.rst | 2 +- tools/bpf/bpftool/bash-completion/

Re: [RFC PATCH bpf-next 4/8] libbpf: identify maps by section index in addition to offset

2019-06-17 Thread Andrii Nakryiko
On Sat, Jun 15, 2019 at 2:08 PM Song Liu wrote: > > On Mon, Jun 10, 2019 at 9:37 PM Andrii Nakryiko wrote: > > > > To support maps to be defined in multiple sections, it's important to > > identify map not just by offset within its section, but section index as > > well. This patch adds tracking

Re: [RFC PATCH net-next 2/2] net: tls: export protocol version and cipher to socket diag

2019-06-17 Thread Jakub Kicinski
On Mon, 17 Jun 2019 18:04:06 +0200, Davide Caratti wrote: > On Wed, 2019-06-05 at 16:25 -0700, Jakub Kicinski wrote: > > On Wed, 5 Jun 2019 17:39:23 +0200, Davide Caratti wrote: > > We need some indication of the directions in which kTLS is active > > (none, rx, tx, rx/tx). > > > > Also perhaps

Re: [PATCH bpf-next 2/8] libbpf: extract BTF loading and simplify ELF parsing logic

2019-06-17 Thread Song Liu
> On Jun 17, 2019, at 10:24 AM, Andrii Nakryiko > wrote: > > On Sat, Jun 15, 2019 at 1:26 PM Song Liu wrote: >> >> On Mon, Jun 10, 2019 at 9:49 PM Andrii Nakryiko wrote: >>> >>> As a preparation for adding BTF-based BPF map loading, extract .BTF and >>> .BTF.ext loading logic. Also simpli

[PATCH net v2 0/2] net: netem: fix issues with corrupting GSO frames

2019-06-17 Thread Jakub Kicinski
Hi! Corrupting GSO frames currently leads to crashes, due to skb use after free. These stem from the skb list handling - the segmented skbs come back on a list, and this list is not properly unlinked before enqueuing the segments. Turns out this condition is made very likely to occur because of

[PATCH net v2 1/2] net: netem: fix backlog accounting for corrupted GSO frames

2019-06-17 Thread Jakub Kicinski
When GSO frame has to be corrupted netem uses skb_gso_segment() to produce the list of frames, and re-enqueues the segments one by one. The backlog length has to be adjusted to account for new frames. The current calculation is incorrect, leading to wrong backlog lengths in the parent qdisc (both

[PATCH net v2 2/2] net: netem: fix use after free and double free with packet corruption

2019-06-17 Thread Jakub Kicinski
Brendan reports that the use of netem's packet corruption capability leads to strange crashes. This seems to be caused by commit d66280b12bd7 ("net: netem: use a list in addition to rbtree") which uses skb->next pointer to construct a fast-path queue of in-order skbs. Packet corruption code has t

  1   2   3   >