[PATCH RFC net-next 2/3] net: add ndo for setting the iflink property

2019-08-23 Thread Marek Behún
In DSA the iflink value is used to report to which CPU port a given switch port is connected to. Since we want to support multi-CPU DSA, we want the user to be able to change this value. Add ndo_set_iflink method into the ndo strucutre to be a pair to ndo_get_iflink. Also create dev_set_iflink and

[PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports

2019-08-23 Thread Marek Behún
Allow for multiple CPU ports in a DSA switch tree. By default assign the CPU ports to user ports in a round robin way, ie. if there are two CPU ports connected to eth0 and eth1, and five user ports (lan1..lan5), assign them as: lan1 <-> eth0 lan2 <-> eth1 lan3 <-> eth0 lan4 <-> eth1 lan5

[PATCH RFC net-next 3/3] net: dsa: implement ndo_set_netlink for chaning port's CPU port

2019-08-23 Thread Marek Behún
Implement ndo_set_iflink for DSA slave device. In multi-CPU port setup this should be used to change to which CPU destination port a given port should be connected. This adds a new operation into the DSA switch operations structure, port_change_cpu_port. A driver implementing this function has the

[PATCH RFC iproute2-next] iplink: allow to change iplink value

2019-08-23 Thread Marek Behún
Allow to change the interface to which a given interface is linked to. This is useful in the case of multi-CPU port DSA, for changing the CPU port of a given user port. Signed-off-by: Marek Behún Cc: David Ahern Cc: Stephen Hemminger --- ip/iplink.c | 16 +--- man/man8/ip

[PATCH RFC net-next 0/3] Multi-CPU DSA support

2019-08-23 Thread Marek Behún
Hi, this is my attempt to solve the multi-CPU port issue for DSA. Patch 1 adds code for handling multiple CPU ports in a DSA switch tree. If more than one CPU port is found in a tree, the code assigns CPU ports to user/DSA ports in a round robin way. So for the simplest case where we have one swit

[PATCH bpf] nfp: bpf: fix latency bug when updating stack index register

2019-08-23 Thread Jakub Kicinski
From: Jiong Wang NFP is using Local Memory to model stack. LM_addr could be used as base of a 16 32-bit word region of Local Memory. Then, if the stack offset is beyond the current region, the local index needs to be updated. The update needs at least three cycles to take effect, therefore the se

Re: [PATCHv2 1/1] net: rds: add service level support in rds-info

2019-08-23 Thread Zhu Yanjun
On 2019/8/24 9:25, santosh.shilim...@oracle.com wrote: On 8/23/19 6:04 PM, Zhu Yanjun wrote:  From IB specific 7.6.5 SERVICE LEVEL, Service Level (SL) is used to identify different flows within an IBA subnet. It is carried in the local route header of the packet. Before this commit, run "rds-

Re: [net-next 07/14] ice: Rename ethtool private flag for lldp

2019-08-23 Thread Jakub Kicinski
On Fri, 23 Aug 2019 16:37:43 -0700, Jeff Kirsher wrote: > From: Dave Ertman > > The current flag name of "enable-fw-lldp" is a bit cumbersome. > > Change priv-flag name to "fw-lldp-agent" with a value of on or > off. This is more straight-forward in meaning. > > Signed-off-by: Dave Ertman > T

Re: [PATCHv2 1/1] net: rds: add service level support in rds-info

2019-08-23 Thread santosh . shilimkar
On 8/23/19 6:04 PM, Zhu Yanjun wrote: From IB specific 7.6.5 SERVICE LEVEL, Service Level (SL) is used to identify different flows within an IBA subnet. It is carried in the local route header of the packet. Before this commit, run "rds-info -I". The outputs are as below: " RDS IB Connections:

Re: [net PATCH] net: route dump netlink NLM_F_MULTI flag missing

2019-08-23 Thread Stefano Brivio
On Fri, 23 Aug 2019 17:11:38 -0700 John Fastabend wrote: > An excerpt from netlink(7) man page, > > In multipart messages (multiple nlmsghdr headers with associated payload > in one byte stream) the first and all following headers have the > NLM_F_MULTI flag set, except for the last heade

[PATCHv2 1/1] net: rds: add service level support in rds-info

2019-08-23 Thread Zhu Yanjun
>From IB specific 7.6.5 SERVICE LEVEL, Service Level (SL) is used to identify different flows within an IBA subnet. It is carried in the local route header of the packet. Before this commit, run "rds-info -I". The outputs are as below: " RDS IB Connections: LocalAddr RemoteAddr Tos SL LocalDev

Re: pull-request: bpf 2019-08-24

2019-08-23 Thread David Miller
From: Daniel Borkmann Date: Sat, 24 Aug 2019 02:11:57 +0200 > The following pull-request contains BPF updates for your *net* tree. > > The main changes are: > > 1) Fix verifier precision tracking with BPF-to-BPF calls, from Alexei. > > 2) Fix a use-after-free in prog symbol exposure, from Dani

Re: [PATCH net-next v2 03/10] net: sched: refactor block offloads counter usage

2019-08-23 Thread Jakub Kicinski
On Fri, 23 Aug 2019 21:50:49 +0300, Vlad Buslov wrote: > @@ -1201,14 +1199,11 @@ static int u32_reoffload_knode(struct tcf_proto *tp, > struct tc_u_knode *n, > cls_u32.knode.link_handle = ht->handle; > } > > - err = cb(TC_SETUP_CLSU32, &cls_u32, cb_priv); > -

Re: [PATCHv4 net 1/2] ipv4/icmp: fix rt dst dev null pointer dereference

2019-08-23 Thread Jonathan Lemon
On 22 Aug 2019, at 7:19, Hangbin Liu wrote: > In __icmp_send() there is a possibility that the rt->dst.dev is NULL, > e,g, with tunnel collect_md mode, which will cause kernel crash. > Here is what the code path looks like, for GRE: > > - ip6gre_tunnel_xmit > - ip6gre_xmit_ipv4 > - __gre6_xm

pull-request: bpf 2019-08-24

2019-08-23 Thread Daniel Borkmann
Hi David, The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix verifier precision tracking with BPF-to-BPF calls, from Alexei. 2) Fix a use-after-free in prog symbol exposure, from Daniel. 3) Several s390x JIT fixes plus BE related fixes in BPF ksel

[net PATCH] net: route dump netlink NLM_F_MULTI flag missing

2019-08-23 Thread John Fastabend
An excerpt from netlink(7) man page, In multipart messages (multiple nlmsghdr headers with associated payload in one byte stream) the first and all following headers have the NLM_F_MULTI flag set, except for the last header which has the type NLMSG_DONE. but, after (ee28906) there is a

[net-next 07/14] ice: Rename ethtool private flag for lldp

2019-08-23 Thread Jeff Kirsher
From: Dave Ertman The current flag name of "enable-fw-lldp" is a bit cumbersome. Change priv-flag name to "fw-lldp-agent" with a value of on or off. This is more straight-forward in meaning. Signed-off-by: Dave Ertman Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/eth

[net-next 00/14][pull request] 100GbE Intel Wired LAN Driver Updates 2019-08-23

2019-08-23 Thread Jeff Kirsher
This series contains updates to ice driver only. Dave adds logic for the necessary bits to be set in the VSI context for the PF_VSI and the TX_descriptors for control packets egressing the PF_VSI. Updated the logic to detect both DCBx and LLDP states in the firmware engine to account for situatio

[net-next 10/14] ice: Don't clear auto_fec bit in ice_cfg_phy_fec()

2019-08-23 Thread Jeff Kirsher
From: Chinh T Cao The driver should never clear the auto_fec_enable bit. Signed-off-by: Chinh T Cao Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/ice/ice_common.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/et

[net-next 08/14] ice: silence some bogus error messages

2019-08-23 Thread Jeff Kirsher
From: Mitch Williams In some circumstances, VF devices can be deactivated while a message is in-flight. In that case, a series of scary error message will be printed in the log. Since these are actually harmless, check for this case and suppress them. No harm, no foul. Signed-off-by: Mitch Willi

[net-next 13/14] ice: Fix issues updating VSI MAC filters

2019-08-23 Thread Jeff Kirsher
From: Akeem G Abodunrin VSI, especially VF could request to add or remove filter for another VSI, driver should really guide such request and disallow it. However, instead of returning error for such malicious request, driver can simply return success. In addition, we are not tracking number of

[net-next 03/14] ice: Don't call synchronize_irq() for VF's from the host

2019-08-23 Thread Jeff Kirsher
From: Brett Creeley Currently we will call synchronize_irq() from the host for VF's. This is not correct, so don't allow it. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/ice/ice_lib.c | 4 1 file changed, 4 insertions(+

[net-next 12/14] ice: update ethtool stats on-demand

2019-08-23 Thread Jeff Kirsher
From: Bruce Allan Users expect ethtool statistics to be updated on-demand when invoking 'ethtool -S ' instead of providing a snapshot of statistics taken once a second (the frequency of the watchdog task where stats are currently updated). Update stats every time 'ethtool -S ' is run. Also, fix

[net-next 09/14] ice: Fix flag used for module query

2019-08-23 Thread Jeff Kirsher
From: Chinh T Cao When checking the PHY for status, by specification, the driver should be using "topology" mode when querying the module type. Signed-off-by: Chinh T Cao Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/ice/ice_common.c | 2 +- 1 file chang

[net-next 06/14] ice: reject VF attempts to enable head writeback

2019-08-23 Thread Jeff Kirsher
From: Jacob Keller The virtchnl interface provides a mechanism for a VF driver to request head writeback support. This feature is deprecated as of AVF 1.0, but older versions of a VF driver may still attempt to request the mode. Since the ice hardware does not support head writeback, we should n

[net-next 14/14] ice: Don't allow VSI to remove unassociated ucast filter

2019-08-23 Thread Jeff Kirsher
From: Akeem G Abodunrin If a VSI is not using a unicast filter or did not configure that particular unicast filter, driver should not allow it to be removed by the rogue VSI. Signed-off-by: Akeem G Abodunrin Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/

[net-next 04/14] ice: Treat DCBx state NOT_STARTED as valid

2019-08-23 Thread Jeff Kirsher
From: Dave Ertman When a port is not cabled, but DCBx is enabled in the firmware, the status of DCBx will be NOT_STARTED. This is a valid state for FW enabled and should not be treated as a is_fw_lldp true automatically. Add the code to treat NOT_STARTED as another valid state. Signed-off-by:

[net-next 11/14] ice: Add input handlers for virtual channel handlers

2019-08-23 Thread Jeff Kirsher
From: "Amruth G.P" Move the assignment to local variables after validation. Remove unnecessary checks in ice_vc_process_vf_msg() as the respective functions are now performing the checks. Signed-off-by: "Amruth G.P" Signed-off-by: Nitesh B Venkatesh Signed-off-by: Tony Nguyen Tested-by: Andr

[net-next 02/14] ice: Account for all states of FW DCBx and LLDP

2019-08-23 Thread Jeff Kirsher
From: Dave Ertman Currently, only the DCBx status is taken into account to determine if FW LLDP is possible. But there are NVM version coming out with DCBx enabled, and FW LLDP disabled. This is causing errors where the driver sees that DCBx is not disabled, and then tries to register for LLDP

[net-next 05/14] ice: Copy dcbx configuration only if mode is correct

2019-08-23 Thread Jeff Kirsher
From: Michal Swiatkowski In rebuild DCB desired_dcbx_cfg was copy to local_dcbx_cfg, but if DCBX mode is IEEE desired_dcbx_cfg is not initialized by DCBX config from FW. Change logic to copy config value only if mode is set to CEE. If driver copy desired_dcbx_cfg to local_dcbx_cfg in IEEE mode t

[net-next 01/14] ice: Allow egress control packets from PF_VSI

2019-08-23 Thread Jeff Kirsher
From: Dave Ertman For control packets (i.e. LLDP packets) to be able to egress from the main VSI, a bit has to be set in the TX_descriptor. This should only be done for the main VSI and only if the FW LLDP agent is disabled. A bit to allow this also has to be set in the VSI context. Add the log

Re: [PATCH bpf] bpf: fix precision tracking in presence of bpf2bpf calls

2019-08-23 Thread Daniel Borkmann
On 8/21/19 11:07 PM, Alexei Starovoitov wrote: While adding extra tests for precision tracking and extra infra to adjust verifier heuristics the existing test "calls: cross frame pruning - liveness propagation" started to fail. The root cause is the same as described in verifer.c comment: * Al

Re: [PATCH bpf] flow_dissector: Fix potential use-after-free on BPF_PROG_DETACH

2019-08-23 Thread Daniel Borkmann
On 8/21/19 2:17 PM, Jakub Sitnicki wrote: Call to bpf_prog_put(), with help of call_rcu(), queues an RCU-callback to free the program once a grace period has elapsed. The callback can run together with new RCU readers that started after the last grace period. New RCU readers can potentially see t

Re: [PATCH ipsec-next 0/7] ipsec: add TCP encapsulation support (RFC 8229)

2019-08-23 Thread Carl-Daniel Hailfinger
Hi! On Wed, 21 Aug 2019 23:46:18 +0200, Sabrina Dubroca wrote: > This patchset introduces support for TCP encapsulation of IKE and ESP > messages, as defined by RFC 8229 [0]. It is an evolution of what > Herbert Xu proposed in January 2018 [1] that addresses the main > criticism against it, by not

Re: RFC: very rough draft of a bpf permission model

2019-08-23 Thread Andy Lutomirski
On Thu, Aug 22, 2019 at 4:26 PM Alexei Starovoitov wrote: > You're proposing all of the above in addition to CAP_BPF, right? > Otherwise I don't see how it addresses the use cases I kept > explaining for the last few weeks. None of my proposal is intended to exclude changes like CAP_BPF to make p

Re: [PATCHv4 net 2/2] xfrm/xfrm_policy: fix dst dev null pointer dereference in collect_md mode

2019-08-23 Thread Jonathan Lemon
On 22 Aug 2019, at 7:19, Hangbin Liu wrote: > In decode_session{4,6} there is a possibility that the skb dst dev is NULL, > e,g, with tunnel collect_md mode, which will cause kernel crash. > Here is what the code path looks like, for GRE: > > - ip6gre_tunnel_xmit > - ip6gre_xmit_ipv6 > - __g

Re: [PATCH v4 net-next 4/7] ip6tlvs: Registration of TLV handlers and parameters

2019-08-23 Thread David Miller
From: Tom Herbert Date: Fri, 23 Aug 2019 12:14:00 -0700 > int off, enum ipeh_parse_errors error)) > { > const unsigned char *nh = skb_network_header(skb); > - const struct tlvtype_proc *curr; > + const struct tlv_proc *curr; > bool disall

Re: [PATCH net] Revert "r8169: remove not needed call to dma_sync_single_for_device"

2019-08-23 Thread David Miller
From: Heiner Kallweit Date: Fri, 23 Aug 2019 19:57:49 +0200 > This reverts commit f072218cca5b076dd99f3dfa3aaafedfd0023a51. > > As reported by Aaro this patch causes network problems on > MIPS Loongson platform. Therefore revert it. > > Fixes: f072218cca5b ("r8169: remove not needed call to >

Re: [PATCH net-next] r8169: fix DMA issue on MIPS platform

2019-08-23 Thread David Miller
From: Heiner Kallweit Date: Fri, 23 Aug 2019 20:07:26 +0200 > As reported by Aaro this patch causes network problems on > MIPS Loongson platform. Therefore revert it. > > Fixes: f072218cca5b ("r8169: remove not needed call to > dma_sync_single_for_device") > Signed-off-by: Heiner Kallweit > Re

Re: [PATCH net] ipv4: mpls: fix mpls_xmit for iptunnel

2019-08-23 Thread David Miller
From: David Ahern Date: Fri, 23 Aug 2019 13:59:05 -0400 > I am traveling today and doubt I will be able to take a deep look at > this until Monday. I'll wait until you've had a chance to review this properly.

Re: [PATCH net-next] drop_monitor: Make timestamps y2038 safe

2019-08-23 Thread David Miller
From: Ido Schimmel Date: Fri, 23 Aug 2019 18:47:21 +0300 > From: Ido Schimmel > > Timestamps are currently communicated to user space as 'struct > timespec', which is not considered y2038 safe since it uses a 32-bit > signed value for seconds. > > Fix this while the API is still not part of an

Re: [PATCH net-next] net/rds: Whitelist rdma_cookie and rx_tstamp for usercopy

2019-08-23 Thread David Miller
From: Dag Moxnes Date: Fri, 23 Aug 2019 16:03:18 +0200 > Add the RDMA cookie and RX timestamp to the usercopy whitelist. > > After the introduction of hardened usercopy whitelisting > (https://lwn.net/Articles/727322/), a warning is displayed when the > RDMA cookie or RX timestamp is copied to u

Re: [PATCH net] ipv6: propagate ipv6_add_dev's error returns out of ipv6_find_idev

2019-08-23 Thread David Miller
From: Sabrina Dubroca Date: Fri, 23 Aug 2019 15:44:36 +0200 > Currently, ipv6_find_idev returns NULL when ipv6_add_dev fails, > ignoring the specific error value. This results in addrconf_add_dev > returning ENOBUFS in all cases, which is unfortunate in cases such as: > > # ip link add dummy

Re: [PATCH net-next] net/mlx5: Fix return code in case of hyperv wrong size read

2019-08-23 Thread David Miller
From: Eran Ben Elisha Date: Fri, 23 Aug 2019 15:34:47 +0300 > Return code value could be non deterministic in case of wrong size read. > With this patch, if such error occurs, set rc to be -EIO. > > In addition, mlx5_hv_config_common() supports reading of > HV_CONFIG_BLOCK_SIZE_MAX bytes only, f

Re: [PATCH net-next] net: ipv6: fix listify ip6_rcv_finish in case of forwarding

2019-08-23 Thread David Miller
From: Xin Long Date: Fri, 23 Aug 2019 19:33:03 +0800 > We need a similar fix for ipv6 as Commit 0761680d5215 ("net: ipv4: fix > listify ip_rcv_finish in case of forwarding") does for ipv4. > > This issue can be reprocuded by syzbot since Commit 323ebb61e32b ("net: > use listified RX for handling

Re: [PATCH 1/2] rtnetlink: gate MAC address with an LSM hook

2019-08-23 Thread David Miller
From: Jeffrey Vander Stoep Date: Fri, 23 Aug 2019 13:41:38 +0200 > I could make this really generic by adding a single hook to the end of > sock_msgrecv() which would allow an LSM to modify the message to omit > the MAC address and any other information that we deem as sensitive in the > future.

[PATCH net-next v2 9/9] net: dsa: mv88e6xxx: fully support SERDES on Topaz family

2019-08-23 Thread Marek Behún
Currently we support SERDES on the Topaz family in a limited way: no IRQs and the cmode is not writable, thus the mode is determined by strapping pins. Marvell's examples though show how to make cmode writable on port 5 and support SGMII autonegotiation. It is done by writing hidden registers, for

[PATCH net-next v2 8/9] net: dsa: mv88e6xxx: support Block Address setting in hidden registers

2019-08-23 Thread Marek Behún
Add support for setting the Block Address parameter when reading/writing hidden registers. Marvell's mdio examples for SERDES settings on Topaz use Block Address 0x7 when reading/writing hidden registers, although the specification says that block must be set to 0xf. Signed-off-by: Marek Behún --

[PATCH net-next v2 5/9] net: dsa: mv88e6xxx: add serdes_get_lane method for Topaz family

2019-08-23 Thread Marek Behún
The Topaz family has only one SERDES, on port 5, with address 0x15. Currently we have MV88E6341_ADDR_SERDES macro used in the mv88e6341_serdes_power method. Rename the macro to MV88E6341_PORT5_LANE and use the new mv88e6xxx_serdes_get_lane method in mv88e6341_serdes_power. Signed-off-by: Marek Beh

[PATCH net-next v2 3/9] net: dsa: mv88e6xxx: fix port hidden register macros

2019-08-23 Thread Marek Behún
In order to be uniform with the rest of the driver, prepend hidden register macro names with the MV88E6XXX_ prefix. Also do not use the BIT() macro nor bit shifts, to be consistent with rest of port.h macro definitions. Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv8

[PATCH net-next v2 6/9] net: dsa: mv88e6xxx: rename port cmode macro

2019-08-23 Thread Marek Behún
This is a cosmetic update. We are removing the last underscore from macros MV88E6XXX_PORT_STS_CMODE_100BASE_X and MV88E6XXX_PORT_STS_CMODE_1000BASE_X. The 2500base-x version does not have that underscore. Also PHY_INTERFACE_MODE_ macros do not have it there. Signed-off-by: Marek Behún Reviewed-by

[PATCH net-next v2 2/9] net: dsa: mv88e6xxx: move hidden registers operations in own file

2019-08-23 Thread Marek Behún
This patch moves the functions operating on the hidden debug registers into it's own file, port_hidden.c. The functions prefix is renamed from mv88e6390_hidden_ to mv88e6xxx_port_hidden_, to be consistent with the rest of this driver. Signed-off-by: Marek Behún --- drivers/net/dsa/mv88e6xxx/Make

[PATCH net-next v2 4/9] net: dsa: mv88e6xxx: create chip->info->ops->serdes_get_lane method

2019-08-23 Thread Marek Behún
Create a serdes_get_lane() method in the mv88e6xxx operations structure. Use it instead of calling the different implementations. Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn --- drivers/net/dsa/mv88e6xxx/chip.c | 6 ++ drivers/net/dsa/mv88e6xxx/chip.h | 3 +++ drivers/net/dsa/

[PATCH net-next v2 1/9] net: dsa: mv88e6xxx: support 2500base-x in SGMII IRQ handler

2019-08-23 Thread Marek Behún
The mv88e6390_serdes_irq_link_sgmii IRQ handler reads the SERDES PHY status register to determine speed, among other things. If cmode of the port is set to 2500base-x, though, the PHY still reports 1000 Mbps (the PHY register itself does not differentiate between 1000 Mbps and 2500 Mbps - it thinks

[PATCH net-next v2 7/9] net: dsa: mv88e6xxx: simplify SERDES code for Topaz and Peridot

2019-08-23 Thread Marek Behún
Now that we have correct serdes_get_lane() for Topaz and Peridot families, we can merge the implementations of their other SERDES functions. We can skip checking port number, since the serdes_get_lane() method return -ENODEV if a given port does not have a lane or does not support given cmode. Sig

[PATCH net-next v2 0/9] net: dsa: mv88e6xxx: Peridot/Topaz SERDES changes

2019-08-23 Thread Marek Behún
Hello, this is the second version of changes for the Topaz/Peridot family of switches. The patches apply on net-next. Changes since v1: - addressed David's reverse christmas tree issue - as suggested by Andrew and Vivien, the hidden port register functions were moved to port_hidden.c and the

[PATCH bpf] bpf: fix use after free in prog symbol exposure

2019-08-23 Thread Daniel Borkmann
syzkaller managed to trigger the warning in bpf_jit_free() which checks via bpf_prog_kallsyms_verify_off() for potentially unlinked JITed BPF progs in kallsyms, and subsequently trips over GPF when walking kallsyms entries: [...] 8021q: adding VLAN 0 to HW filter on device batadv0 8021q: add

[PATCH v4 net-next 7/7] ip6tlvs: Validation of TX Destination and Hop-by-Hop options

2019-08-23 Thread Tom Herbert
From: Tom Herbert Validate Destination and Hop-by-Hop options. This uses the information in the TLV parameters table to validate various aspects of both individual TLVs as well as a list of TLVs in an extension header. There are two levels of validation that can be performed: simple checks and d

[PATCH v4 net-next 2/7] ipeh: Move generic EH functions to exthdrs_common.c

2019-08-23 Thread Tom Herbert
From: Tom Herbert Move generic functions in exthdrs.c to new exthdrs_common.c so that exthdrs.c only contains functions that are specific to IPv6 processing, and exthdrs_common.c contains functions that are generic. These functions include those that will be used with IPv4 extension headers. Gene

[PATCH v4 net-next 0/7] ipv6: Extension header infrastructure

2019-08-23 Thread Tom Herbert
This patchset improves the IPv6 extension header infrastructure to make extension headers more usable and scalable. - Reorganize extension header files to separate out common API components - Create common TLV handler that will can be used in other use cases (e.g. segment routing TLVs,

[PATCH v4 net-next 3/7] ipeh: Generic TLV parser

2019-08-23 Thread Tom Herbert
From: Tom Herbert Create a generic TLV parser. This will be used with various extension headers that carry options including Destination, Hop-by-Hop, Segment Routing TLVs, and other cases of simple stateless parsing. Signed-off-by: Tom Herbert --- include/net/ipeh.h| 25 net/

[PATCH v4 net-next 5/7] ip6tlvs: Add TX parameters

2019-08-23 Thread Tom Herbert
From: Tom Herbert Define a number of transmit parameters for TLV Parameter table definitions. These will be used for validating TLVs that are set on a socket. Signed-off-by: Tom Herbert --- include/net/ipeh.h | 18 include/uapi/linux/ipeh.h | 8 +++ net/ipv6/exth

[PATCH v4 net-next 6/7] ip6tlvs: Add netlink interface

2019-08-23 Thread Tom Herbert
From: Tom Herbert Add a netlink interface to manage the TX TLV parameters. Managed parameters include those for validating and sending TLVs being sent such as alignment, TLV ordering, length limits, etc. Signed-off-by: Tom Herbert --- include/net/ipeh.h | 16 +++ include/net/ipv6.h

[PATCH v4 net-next 4/7] ip6tlvs: Registration of TLV handlers and parameters

2019-08-23 Thread Tom Herbert
From: Tom Herbert Create a single TLV parameter table that holds meta information for IPv6 Hop-by-Hop and Destination TLVs. The data structure is composed of a 256 element array of u8's (one entry for each TLV type to allow O(1) lookup). Each entry provides an offset into an array of TLV proc dat

[PATCH v4 net-next 1/7] ipeh: Create exthdrs_options.c and ipeh.h

2019-08-23 Thread Tom Herbert
From: Tom Herbert Create exthdrs_options.c to hold code related to specific Hop-by-Hop and Destination extension header options. Move related functions in exthdrs.c to the new file. Create include net/ipeh.h to contain common definitions for IP extension headers. Signed-off-by: Tom Herbert ---

RE: Is bug 200755 in anyone's queue??

2019-08-23 Thread Steve Zabele
Hi folks, Is there a way to find out where the SO_REUSEPORT bug reported a year ago in August (and apparently has been a bug with kernels later than 4.4) is being addressed? The bug characteristics, simple standalone test code demonstrating the bug, and an assessment of the likely location/cause

RE: Is bug 200755 in anyone's queue??

2019-08-23 Thread Steve Zabele
Hi folks, Is there a way to find out where the SO_REUSEPORT bug reported a year ago in August (and apparently has been a bug with kernels later than 4.4) is being addressed? The bug characteristics, simple standalone test code demonstrating the bug, and an assessment of the likely location/cause

Re: New skb extension for use by LSMs (skb "security blob")?

2019-08-23 Thread Casey Schaufler
On 8/22/2019 3:36 PM, David Miller wrote: > From: Casey Schaufler > Date: Thu, 22 Aug 2019 15:34:44 -0700 > >> On 8/22/2019 3:28 PM, David Miller wrote: >>> From: Casey Schaufler >>> Date: Thu, 22 Aug 2019 14:59:37 -0700 >>> Sure, you *can* do that, but it would be insane to do so. >>> We lo

[PATCH net-next v2 10/10] net: sched: flower: don't take rtnl lock for cls hw offloads API

2019-08-23 Thread Vlad Buslov
Don't manually take rtnl lock in flower classifier before calling cls hardware offloads API. Instead, pass rtnl lock status via 'rtnl_held' parameter. Signed-off-by: Vlad Buslov Acked-by: Jiri Pirko --- net/sched/cls_flower.c | 53 +- 1 file changed, 16 i

[PATCH net-next v2 05/10] net: sched: add API for registering unlocked offload block callbacks

2019-08-23 Thread Vlad Buslov
Extend struct flow_block_offload with "unlocked_driver_cb" flag to allow registering and unregistering block hardware offload callbacks that do not require caller to hold rtnl lock. Extend tcf_block with additional lockeddevcnt counter that is incremented for each non-unlocked driver callback attac

[PATCH net-next v2 03/10] net: sched: refactor block offloads counter usage

2019-08-23 Thread Vlad Buslov
Without rtnl lock protection filters can no longer safely manage block offloads counter themselves. Refactor cls API to protect block offloadcnt with tcf_block->cb_lock that is already used to protect driver callback list and nooffloaddevcnt counter. The counter can be modified by concurrent tasks

[PATCH net-next v2 04/10] net: sched: notify classifier on successful offload add/delete

2019-08-23 Thread Vlad Buslov
To remove dependency on rtnl lock, extend classifier ops with new ops->hw_add() and ops->hw_del() callbacks. Call them from cls API while holding cb_lock every time filter if successfully added to or deleted from hardware. Implement the new API in flower classifier. Use it to manage hw_filters lis

[PATCH net-next v2 07/10] net: sched: take rtnl lock in tc_setup_flow_action()

2019-08-23 Thread Vlad Buslov
In order to allow using new flow_action infrastructure from unlocked classifiers, modify tc_setup_flow_action() to accept new 'rtnl_held' argument. Take rtnl lock before accessing tc_action data. This is necessary to protect from concurrent action replace. Signed-off-by: Vlad Buslov Acked-by: Jir

[PATCH net-next v2 08/10] net: sched: take reference to action dev before calling offloads

2019-08-23 Thread Vlad Buslov
In order to remove dependency on rtnl lock when calling hardware offload API, take reference to action mirred dev when initializing flow_action structure in tc_setup_flow_action(). Implement function tc_cleanup_flow_action(), use it to release the device after hardware offload API is done using it.

[PATCH net-next v2 06/10] net: sched: conditionally obtain rtnl lock in cls hw offloads API

2019-08-23 Thread Vlad Buslov
In order to remove dependency on rtnl lock from offloads code of classifiers, take rtnl lock conditionally before executing driver callbacks. Only obtain rtnl lock if block is bound to devices that require it. Block bind/unbind code is rtnl-locked and obtains block->cb_lock while holding rtnl lock

[PATCH net-next v2 09/10] net: sched: copy tunnel info when setting flow_action entry->tunnel

2019-08-23 Thread Vlad Buslov
In order to remove dependency on rtnl lock, modify tc_setup_flow_action() to copy tunnel info, instead of just saving pointer to tunnel_key action tunnel info. This is necessary to prevent concurrent action overwrite from releasing tunnel info while it is being used by rtnl-unlocked driver. Implem

[PATCH net-next v2 00/10] Refactor cls hardware offload API to support rtnl-independent drivers

2019-08-23 Thread Vlad Buslov
Currently, all cls API hardware offloads driver callbacks require caller to hold rtnl lock when calling them. This patch set introduces new API that allows drivers to register callbacks that are not dependent on rtnl lock and unlocked classifiers to offload filters without obtaining rtnl lock first

[PATCH net-next v2 01/10] net: sched: protect block offload-related fields with rw_semaphore

2019-08-23 Thread Vlad Buslov
In order to remove dependency on rtnl lock, extend tcf_block with 'cb_lock' rwsem and use it to protect flow_block->cb_list and related counters from concurrent modification. The lock is taken in read mode for read-only traversal of cb_list in tc_setup_cb_call() and write mode in all other cases. T

[PATCH net-next v2 02/10] net: sched: change tcf block offload counter type to atomic_t

2019-08-23 Thread Vlad Buslov
As a preparation for running proto ops functions without rtnl lock, change offload counter type to atomic. This is necessary to allow updating the counter by multiple concurrent users when offloading filters to hardware from unlocked classifiers. Signed-off-by: Vlad Buslov Acked-by: Jiri Pirko -

Re: [PATCH net-next] net/rds: Whitelist rdma_cookie and rx_tstamp for usercopy

2019-08-23 Thread santosh . shilimkar
On 8/23/19 7:03 AM, Dag Moxnes wrote: Add the RDMA cookie and RX timestamp to the usercopy whitelist. After the introduction of hardened usercopy whitelisting (https://lwn.net/Articles/727322/), a warning is displayed when the RDMA cookie or RX timestamp is copied to userspace: kernel: WARNING:

Re: [net-next 4/8] net/mlx5e: Add device out of buffer counter

2019-08-23 Thread Jakub Kicinski
On Fri, 23 Aug 2019 06:00:45 +, Saeed Mahameed wrote: > On Thu, 2019-08-22 at 18:33 -0700, Jakub Kicinski wrote: > > On Thu, 22 Aug 2019 23:35:52 +, Saeed Mahameed wrote: > > > From: Moshe Shemesh > > > > > > Added the following packets drop counter: > > > Device out of buffer - counts

Re: r8169: regression on MIPS/Loongson

2019-08-23 Thread Heiner Kallweit
On 23.08.2019 01:38, Aaro Koskinen wrote: > Hi, > > On Fri, Aug 23, 2019 at 12:52:34AM +0200, Heiner Kallweit wrote: >> On 23.08.2019 00:25, Aaro Koskinen wrote: >>> After upgrading from v5.2 to v5.3-rc5 on MIPS/Loongson board, copying >>> large files from network with scp started to fail with "In

[PATCH net-next] r8169: fix DMA issue on MIPS platform

2019-08-23 Thread Heiner Kallweit
As reported by Aaro this patch causes network problems on MIPS Loongson platform. Therefore revert it. Fixes: f072218cca5b ("r8169: remove not needed call to dma_sync_single_for_device") Signed-off-by: Heiner Kallweit Reported-by: Aaro Koskinen --- drivers/net/ethernet/realtek/r8169_main.c | 4

[PATCH net] Revert "r8169: remove not needed call to dma_sync_single_for_device"

2019-08-23 Thread Heiner Kallweit
This reverts commit f072218cca5b076dd99f3dfa3aaafedfd0023a51. As reported by Aaro this patch causes network problems on MIPS Loongson platform. Therefore revert it. Fixes: f072218cca5b ("r8169: remove not needed call to dma_sync_single_for_device") Signed-off-by: Heiner Kallweit Reported-by: Aa

RE: [PATCH v2 0/2] Simplify mtty driver and mdev core

2019-08-23 Thread Parav Pandit
> -Original Message- > From: Alex Williamson > Sent: Friday, August 23, 2019 10:47 PM > To: Parav Pandit > Cc: Jiri Pirko ; Jiri Pirko ; David S . > Miller > ; Kirti Wankhede ; Cornelia > Huck ; k...@vger.kernel.org; linux- > ker...@vger.kernel.org; cjia ; netdev@vger.kernel.org > Sub

Re: [PATCH net] ipv4: mpls: fix mpls_xmit for iptunnel

2019-08-23 Thread David Ahern
On 8/23/19 1:51 PM, Alexey Kodanev wrote: > When using mpls over gre/gre6 setup, rt->rt_gw4 address is not set, the > same for rt->rt_gw_family. Therefore, when rt->rt_gw_family is checked > in mpls_xmit(), neigh_xmit() call is skipped. As a result, such setup > doesn't work anymore. > > This iss

Aw: [PATCH net-next v3 0/3] net: ethernet: mediatek: convert to PHYLINK

2019-08-23 Thread Frank Wunderlich
tested on bpi-r2 (mt7623/mt7530) and bpi-r64 (mt7622/rtl8367) as reported to rene directly rx-path needs some rework because current rx-speed on bpi-r2 is 865 Mbits/sec instead of ~940 Mbits/sec Tested-by: Frank Wunderlich regards Frank > Gesendet: Freitag, 23. August 2019 um 15:45 Uhr > Von:

[PATCH net] ipv4: mpls: fix mpls_xmit for iptunnel

2019-08-23 Thread Alexey Kodanev
When using mpls over gre/gre6 setup, rt->rt_gw4 address is not set, the same for rt->rt_gw_family. Therefore, when rt->rt_gw_family is checked in mpls_xmit(), neigh_xmit() call is skipped. As a result, such setup doesn't work anymore. This issue was found with LTP mpls03 tests. Fixes: 1550c17193

Re: [PATCH v4 00/14] NFC: nxp-nci: clean up and new device support

2019-08-23 Thread Andy Shevchenko
On Tue, Aug 20, 2019 at 11:27:59PM +0200, Sedat Dilek wrote: > > Andy Shevchenko hat am 29. Juli 2019 > > 15:35 geschrieben: > I gave that patchset v4 a try against Linux v5.3-rc5. > > And played with neard and neard-tools v0.16-0.1 from Debian/buster AMD64. > > # nfctool --list > > # nfctool

Re: [PATCH v2 0/2] Simplify mtty driver and mdev core

2019-08-23 Thread Alex Williamson
On Fri, 23 Aug 2019 16:14:04 + Parav Pandit wrote: > > -Original Message- > > From: Alex Williamson > > Sent: Friday, August 23, 2019 9:22 PM > > To: Parav Pandit > > Cc: Jiri Pirko ; Jiri Pirko ; David S > > . Miller > > ; Kirti Wankhede ; Cornelia > > Huck ; k...@vger.kernel.org;

Re: [PATCH net-next 6/6] net: dsa: clear VLAN flags for CPU port

2019-08-23 Thread Florian Fainelli
On 8/22/19 4:51 PM, Vladimir Oltean wrote: > On 8/22/19 11:13 PM, Vivien Didelot wrote: >> When the bridge offloads a VLAN on a slave port, we also need to >> program its dedicated CPU port as a member of the VLAN. >> >> Drivers may handle the CPU port's membership as they want. For example, >> Mar

Re: [PATCH net-next 2/6] net: dsa: do not skip -EOPNOTSUPP in dsa_port_vid_add

2019-08-23 Thread Florian Fainelli
On 8/23/19 9:32 AM, Vladimir Oltean wrote: > Hi Florian, > > On Fri, 23 Aug 2019 at 19:23, Florian Fainelli wrote: >> >> On 8/22/19 4:44 PM, Vladimir Oltean wrote: >>> On Fri, 23 Aug 2019 at 02:43, Vivien Didelot >>> wrote: Hi Vladimir, On Fri, 23 Aug 2019 01:06:58 +0300, Vl

Re: [PATCH bpf-next 2/4] xsk: add proper barriers and {READ, WRITE}_ONCE-correctness for state

2019-08-23 Thread Jonathan Lemon
On 22 Aug 2019, at 2:13, Björn Töpel wrote: From: Björn Töpel The state variable was read, and written outside the control mutex (struct xdp_sock, mutex), without proper barriers and {READ, WRITE}_ONCE correctness. In this commit this issue is addressed, and the state member is now used a

Re: [PATCH bpf-next 4/4] xsk: lock the control mutex in sock_diag interface

2019-08-23 Thread Jonathan Lemon
On 22 Aug 2019, at 2:13, Björn Töpel wrote: > From: Björn Töpel > > When accessing the members of an XDP socket, the control mutex should > be held. This commit fixes that. > > Fixes: a36b38aa2af6 ("xsk: add sock_diag interface for AF_XDP") > Signed-off-by: Björn Töpel Acked-by: Jonathan Lem

Re: [PATCH bpf-next 3/4] xsk: avoid store-tearing when assigning umem

2019-08-23 Thread Jonathan Lemon
On 22 Aug 2019, at 2:13, Björn Töpel wrote: > From: Björn Töpel > > The umem member of struct xdp_sock is read outside of the control > mutex, in the mmap implementation, and needs a WRITE_ONCE to avoid > potentional store-tearing. > > Fixes: 423f38329d26 ("xsk: add umem fill queue support and

Re: [PATCH bpf-next 1/4] xsk: avoid store-tearing when assigning queues

2019-08-23 Thread Jonathan Lemon
On 22 Aug 2019, at 2:13, Björn Töpel wrote: > From: Björn Töpel > > Use WRITE_ONCE when doing the store of tx, rx, fq, and cq, to avoid > potential store-tearing. These members are read outside of the control > mutex in the mmap implementation. > > Fixes: 37b076933a8e ("xsk: add missing write-

Re: [PATCH net v2] openvswitch: Fix conntrack cache with timeout

2019-08-23 Thread Yi-Hung Wei
On Thu, Aug 22, 2019 at 11:51 PM Pravin Shelar wrote: > > On Thu, Aug 22, 2019 at 1:28 PM Yi-Hung Wei wrote: > > > > This patch addresses a conntrack cache issue with timeout policy. > > Currently, we do not check if the timeout extension is set properly in the > > cached conntrack entry. Thus,

[PATCH] net: fix skb use after free in netpoll_send_skb_on_dev

2019-08-23 Thread Feng Sun
After commit baeababb5b85d5c4e6c917efe2a1504179438d3b ("tun: return NET_XMIT_DROP for dropped packets"), when tun_net_xmit drop packets, it will free skb and return NET_XMIT_DROP, netpoll_send_skb_on_dev will run into two use after free cases: 1. retry netpoll_start_xmit with freed skb; 2. queue fr

Re: [PATCH net-next 2/6] net: dsa: do not skip -EOPNOTSUPP in dsa_port_vid_add

2019-08-23 Thread Vladimir Oltean
Hi Florian, On Fri, 23 Aug 2019 at 19:23, Florian Fainelli wrote: > > On 8/22/19 4:44 PM, Vladimir Oltean wrote: > > On Fri, 23 Aug 2019 at 02:43, Vivien Didelot > > wrote: > >> > >> Hi Vladimir, > >> > >> On Fri, 23 Aug 2019 01:06:58 +0300, Vladimir Oltean > >> wrote: > >>> Hi Vivien, > >>>

Re: [PATCH net-next] dpaa2-eth: Add pause frame support

2019-08-23 Thread Andrew Lunn
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c > +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c > @@ -78,29 +78,20 @@ static int > dpaa2_eth_get_link_ksettings(struct net_device *net_dev, >struct ethtool_link_ksettings *link_settings) > { > -

  1   2   >