RE: [PATCH] e1000e: Disable TSO for buffer overrun workaround

2020-05-21 Thread Brown, Aaron F
> From: netdev-ow...@vger.kernel.org On > Behalf Of Kai-Heng Feng > Sent: Thursday, May 7, 2020 7:21 AM > To: Kirsher, Jeffrey T > Cc: Kai-Heng Feng ; David S. Miller > ; Neftin, Sasha ; Dima > Ruinskiy ; Avargil, Raanan > ; moderated list:INTEL ETHERNET DRIVERS wired-...@lists.osuosl.org>; open

[net-next 00/15][pull request] 1GbE Intel Wired LAN Driver Updates 2020-05-20

2020-05-21 Thread Jeff Kirsher
This series contains updates to igc and e1000. Andre cleans up code that was left over from the igb driver that handled MAC address filters based on the source address, which is not currently supported. Simplifies the MAC address filtering code and prepare the igc driver for future source address

[net-next 07/15] igc: Remove header redirection register

2020-05-21 Thread Jeff Kirsher
From: Sasha Neftin Header redirection missed packet counter not applicable for i225 device. This patch comes to clean up this register. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/igc/igc_regs.h | 1 - 1 file changed, 1 deleti

[net-next 08/15] igc: Remove per queue good transmited counter register

2020-05-21 Thread Jeff Kirsher
From: Sasha Neftin Per queue good transmitted packet counter not applicable for i225 device. This patch comes to clean up this register. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/igc/igc_regs.h | 3 --- 1 file changed, 3 del

[net-next 12/15] igc: Early return in igc_get_ethtool_nfc_entry()

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes This patch re-writes the second half of igc_ethtool_get_nfc_entry() to follow the 'return early' pattern seen in other parts of the driver and removes some duplicate comments. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- drivers/net/et

[net-next 09/15] igc: Remove unused field from igc_nfc_filter

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes The 'cookie' field is not used anywhere in the code so this patch removes it from struct igc_nfc_filter. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/igc/igc.h | 1 - 1 file changed, 1 deletion(-) diff --git

[net-next 05/15] e1000: Do not perform reset in reset_task if we are already down

2020-05-21 Thread Jeff Kirsher
From: Alexander Duyck We are seeing a deadlock in e1000 down when NAPI is being disabled. Looking over the kernel function trace of the system it appears that the interface is being closed and then a reset is hitting which deadlocks the interface as the NAPI interface is already disabled. To pre

[net-next 11/15] igc: Cleanup _get|set_rxnfc ethtool ops

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes This patch does a trivial change in igc_ethtool_get_rxnfc() and igc_ethtool_set_rxnfc() to simplify their logic. Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/igc/igc_ethtool.c | 33 ++-- 1 fil

RE: [PATCH net-next] igb: make igb_set_fc_watermarks() return void

2020-05-21 Thread Brown, Aaron F
> From: netdev-ow...@vger.kernel.org On > Behalf Of Jason Yan > Sent: Thursday, May 7, 2020 4:09 AM > To: Kirsher, Jeffrey T ; da...@davemloft.net; > yanai...@huawei.com; intel-wired-...@lists.osuosl.org; > netdev@vger.kernel.org; linux-ker...@vger.kernel.org > Subject: [PATCH net-next] igb: make

[net-next 15/15] igc: Change byte order in struct igc_nfc_filter

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes Every time we access the 'etype' and 'vlan_tci' fields from struct igc_nfc_filter to enable or disable filters in hardware we have to convert them from big endian to host order so it makes more sense to simply have these fields in host order. The byte order conversion should t

[net-next 06/15] igc: Remove obsolete circuit breaker registers

2020-05-21 Thread Jeff Kirsher
From: Sasha Neftin Part of circuit breaker registers is obsolete and not applicable for i225 device. This patch comes to clean up these registers. Signed-off-by: Sasha Neftin Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- drivers/net/ethernet/intel/igc/igc_mac.c | 4 drivers/ne

[net-next 10/15] igc: Get rid of igc_max_channels()

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes The local function igc_max_channels() is a pointless wrapper around igc_get_max_rss_queues(). This patch removes it and updates the callers accordingly. It also does some cleanup on igc_get_max_rss_queues(). Signed-off-by: Andre Guedes Tested-by: Aaron Brown Signed-off-by: J

[net-next 02/15] igc: Remove mac_table from igc_adapter

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes In igc_adapter we keep a sort of shadow copy of RAL and RAH registers. There is not much benefit in keeping it, at the cost of maintainability, since adding/removing MAC address filters is not hot path, and we already keep filters information in adapter->nfc_filter_list for cle

[net-next 04/15] igc: Enable NFC rules based source MAC address

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes This patch adds support for Network Flow Classification (NFC) rules based on source MAC address. Note that the controller doesn't support rules with both source and destination addresses set, so this special case is checked in igc_add_ethtool_nfc_entry(). Signed-off-by: Andre

[net-next 01/15] igc: Remove IGC_MAC_STATE_SRC_ADDR flag

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes MAC address filters based on source address are not currently supported by the IGC driver. Despite of that, the driver have some dangling code to handle it, inherited from IGB driver. This patch removes that code to prepare for a follow up patch that adds proper source MAC addr

[net-next 03/15] igc: Add support for source address filters in core

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes This patch extends MAC address filter internal APIs igc_add_mac_filter() and igc_del_mac_filter(), as well as local helpers, to support filters based on source address. A new parameters 'type' is added to the APIs to indicate if the filter type is source or destination. In cas

[net-next 14/15] igc: Align terms used in NFC support code

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes The Network Flow Classification (NFC) support code from IGC driver uses terms such as 'rule', 'filter', 'entry', 'input' interchangeably when referring to NFC rules, making it harder to follow the code. This patch renames IGC's internal APIs, structs, and variables so we stick

[net-next 13/15] igc: Add 'igc_ethtool_' prefix to functions in igc_ethtool.c

2020-05-21 Thread Jeff Kirsher
From: Andre Guedes This patch adds the prefix 'igc_ethtool_' to all functions defined in igc_ethtool.c so they align with the name convention already followed by other parts of the driver (e.g. igc_tsn, igc_ptp). Also, this avoids some name clashing with functions added to igc_main.c by upcoming

RE: [PATCH net-next] sctp: Pull the user copies out of the individual sockopt functions.

2020-05-21 Thread David Laight
From: 'Marcelo Ricardo Leitner' > Sent: 21 May 2020 01:17 > On Wed, May 20, 2020 at 03:08:13PM +, David Laight wrote: > ... > > Only SCTP_SOCKOPT_CONNECTX3 contains an indirect pointer. > > It is also the only getsockopt() that wants to return a buffer > > and an error code. It is also definite

Re: [PATCH net 0/3] rxrpc: Fix retransmission timeout and ACK discard

2020-05-21 Thread David Howells
I've posted a new version of this with a fixed description for patch 1. David

Re: [PATCH 29/33] rxrpc: add rxrpc_sock_set_min_security_level

2020-05-21 Thread David Howells
Christoph Hellwig wrote: > Add a helper to directly set the RXRPC_MIN_SECURITY_LEVEL sockopt from > kernel space without going through a fake uaccess. > > Thanks to David Howells for the documentation updates. > > Signed-off-by: Christoph Hellwig Acked-by: David Howells

RE: [PATCH] e1000e: Relax condition to trigger reset for ME workaround

2020-05-21 Thread Brown, Aaron F
> From: netdev-ow...@vger.kernel.org On > Behalf Of Punit Agrawal > Sent: Thursday, May 14, 2020 9:31 PM > To: Kirsher, Jeffrey T > Cc: daniel.sangor...@toshiba.co.jp; Punit Agrawal > ; Alexander Duyck > ; David S. Miller ; > intel-wired-...@lists.osuosl.org; netdev@vger.kernel.org; linux- > ker.

RE: remove kernel_setsockopt and kernel_getsockopt v2

2020-05-21 Thread David Laight
From: Christoph Hellwig > Sent: 20 May 2020 20:55 > > this series removes the kernel_setsockopt and kernel_getsockopt > functions, and instead switches their users to small functions that > implement setting (or in one case getting) a sockopt directly using > a normal kernel function call with typ

Re: [PATCH 1/3] bridge: mrp: Add br_mrp_unique_ifindex function

2020-05-21 Thread Nikolay Aleksandrov
On 20/05/2020 16:09, Horatiu Vultur wrote: > It is not allow to have the same net bridge port part of multiple MRP > rings. Therefore add a check if the port is used already in a different > MRP. In that case return failure. > > Fixes: 9a9f26e8f7ea ("bridge: mrp: Connect MRP API with the switchdev

Re: [PATCH 3/3] bridge: mrp: Restore port state when deleting MRP instance

2020-05-21 Thread Nikolay Aleksandrov
On 20/05/2020 16:09, Horatiu Vultur wrote: > When a MRP instance is deleted, then restore the port according to the > bridge state. If the bridge is up then the ports will be in forwarding > state otherwise will be in disabled state. > > Fixes: 9a9f26e8f7ea ("bridge: mrp: Connect MRP API with the

Re: [PATCH 31/33] sctp: add sctp_sock_set_nodelay

2020-05-21 Thread Christoph Hellwig
On Wed, May 20, 2020 at 08:39:13PM -0300, Marcelo Ricardo Leitner wrote: > On Wed, May 20, 2020 at 04:23:55PM -0700, David Miller wrote: > > From: Marcelo Ricardo Leitner > > Date: Wed, 20 May 2020 20:10:01 -0300 > > > > > The duplication with sctp_setsockopt_nodelay() is quite silly/bad. > > > A

[PATCH bpf v2] flow_dissector: Drop BPF flow dissector prog ref on netns cleanup

2020-05-21 Thread Jakub Sitnicki
When attaching a flow dissector program to a network namespace with bpf(BPF_PROG_ATTACH, ...) we grab a reference to bpf_prog. If netns gets destroyed while a flow dissector is still attached, and there are no other references to the prog, we leak the reference and the program remains loaded. Lea

Re: [PATCH bpf] flow_dissector: Drop BPF flow dissector prog ref on netns cleanup

2020-05-21 Thread Jakub Sitnicki
On Wed, 20 May 2020 10:40:00 -0700 s...@google.com wrote: > > +static void __net_exit flow_dissector_pernet_pre_exit(struct net *net) > > +{ > > + struct bpf_prog *attached; > > + > > + /* We don't lock the update-side because there are no > > +* references left to this netns when we get c

Re: [PATCH 32/33] net: add a new bind_add method

2020-05-21 Thread Christoph Hellwig
On Wed, May 20, 2020 at 08:00:25PM -0300, Marcelo Ricardo Leitner wrote: > > + if (err) > > + return err; > > + > > + lock_sock(sk); > > + err = sctp_do_bind(sk, (union sctp_addr *)addr, af->sockaddr_len); > > + if (!err) > > + err = sctp_send_asconf_add_ip(sk, addr, 1);

Re: [PATCH net-next v2 2/5] vxlan: ecmp support for mac fdb entries

2020-05-21 Thread Nikolay Aleksandrov
On 20/05/2020 07:33, Roopa Prabhu wrote: > From: Roopa Prabhu > > Todays vxlan mac fdb entries can point to multiple remote > ips (rdsts) with the sole purpose of replicating > broadcast-multicast and unknown unicast packets to those remote ips. > > E-VPN multihoming [1,2,3] requires bridged vxl

Re: [PATCH net-next] net/tls: fix race condition causing kernel panic

2020-05-21 Thread Vinay Kumar Yadav
Jakub On 5/21/2020 1:28 AM, Jakub Kicinski wrote: On Wed, 20 May 2020 22:39:11 +0530 Vinay Kumar Yadav wrote: On 5/20/2020 12:46 AM, David Miller wrote: From: Vinay Kumar Yadav Date: Tue, 19 May 2020 13:13:27 +0530 + spin_lock_bh(&ctx->encrypt_compl_lock); + pe

RE: [PATCH 31/33] sctp: add sctp_sock_set_nodelay

2020-05-21 Thread David Laight
From: Christoph Hellwig > Sent: 21 May 2020 09:35 > On Wed, May 20, 2020 at 08:39:13PM -0300, Marcelo Ricardo Leitner wrote: > > On Wed, May 20, 2020 at 04:23:55PM -0700, David Miller wrote: > > > From: Marcelo Ricardo Leitner > > > Date: Wed, 20 May 2020 20:10:01 -0300 > > > > > > > The duplicati

Re: [PATCH 31/33] sctp: add sctp_sock_set_nodelay

2020-05-21 Thread 'Christoph Hellwig'
On Thu, May 21, 2020 at 09:06:19AM +, David Laight wrote: > > > The comment still applies, though. (re the duplication) > > > > Where do you see duplication? > > The whole thing just doesn't scale. > > As soon as you get to the slightly more complex requests > like SCTP_INITMSG (which should

Re: remove kernel_setsockopt and kernel_getsockopt v2

2020-05-21 Thread 'Christoph Hellwig'
On Thu, May 21, 2020 at 08:01:33AM +, David Laight wrote: > How much does this increase the kernel code by? 44 files changed, 660 insertions(+), 843 deletions(-) > You are also replicating a lot of code making it more > difficult to maintain. No, I specifically don't. > I don't think the

RE: [EXT] Re: [PATCH net-next 03/12] net: atlantic: changes for multi-TC support

2020-05-21 Thread Mark Starovoytov
Hi Jakub, > > In the first generation of our hardware (A1), a whole traffic class is > > consumed for PTP handling in FW (FW uses it to send the ptp data and > > to send back timestamps). > > Since this conflicts with QoS (user is unable to use the reserved > > TC2), we suggest using module param

Re: [PATCH net-next 1/2] flow_dissector: Parse multiple MPLS Label Stack Entries

2020-05-21 Thread Guillaume Nault
On Thu, May 21, 2020 at 09:24:25AM +0800, kbuild test robot wrote: > All errors (new ones prefixed by >>, old ones prefixed by <<): > > In file included from include/linux/build_bug.h:5, > from include/linux/bitfield.h:10, > from drivers/net/ethernet/netronome/nfp/flower/match.c:4: > drivers/net/e

[PATCH net-next] cxgb4: add adapter hotplug support for ULDs

2020-05-21 Thread Potnuri Bharat Teja
Upon adapter hotplug, cxgb4 registers ULD devices for all the ULDs that are already loaded, ensuring that ULD's can enumerate the hotplugged adapter without reloading the ULD. Signed-off-by: Potnuri Bharat Teja --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h| 8 + .../net/ethernet/chelsio/c

RE: remove kernel_setsockopt and kernel_getsockopt v2

2020-05-21 Thread David Laight
From: 'Christoph Hellwig' > Sent: 21 May 2020 10:12 ... > > I worried about whether getsockopt() should read the entire > > user buffer first. SCTP needs the some of it often (including a > > sockaddr_storage in one case), TCP needs it once. > > However the cost of reading a few words is small, and

Re: [PATCH 5/7] perf metricgroup: Remove duped metric group events

2020-05-21 Thread Jiri Olsa
On Wed, May 20, 2020 at 03:42:02PM -0700, Ian Rogers wrote: SNIP > > > > hum, I think that's also concern if you are multiplexing 2 groups and one > > metric getting events from both groups that were not meassured together > > > > it makes sense to me put all the merged events into single weak gr

[PATCH V2 net-next 2/2] net: hns3: add support for 'QoS' in port based VLAN configuration

2020-05-21 Thread Huazhong Tan
From: GuoJia Liao This patch adds support for 'QoS' in port based VLAN configuration. Signed-off-by: GuoJia Liao Signed-off-by: Huazhong Tan --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c| 32 -- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h| 4 +-- .../net

[PATCH V2 net-next 1/2] net: hns3: adds support for dynamic VLAN mode

2020-05-21 Thread Huazhong Tan
From: GuoJia Liao There is a scenario which needs vNICs enable the VLAN filter in access port, while disable the VLAN filter in trunk port. Access port and trunk port can switch according to the user's configuration. This patch adds a new VLAN mode called dynamic mode for it. So there are two VL

[PATCH V2 net-next 0/2] net: hns3: adds two VLAN feature

2020-05-21 Thread Huazhong Tan
This patchset adds two new VLAN feature. [patch 1] adds a new dynamic VLAN mode. [patch 2] adds support for 'QoS' field to PVID. Change log: V1->V2: modifies [patch 1]'s commit log, suggested by Jakub Kicinski. GuoJia Liao (2): net: hns3: adds support for dynamic VLAN mode net: hns3: add sup

Re: [PATCH v2 0/7] Share events between metrics

2020-05-21 Thread Jiri Olsa
On Wed, May 20, 2020 at 11:20:04AM -0700, Ian Rogers wrote: SNIP > There are 5 out of 12 metric groups where no events are shared, such > as Power, however, disabling grouping of events always reduces the > number of events. > > The result for Memory_BW needs explanation: > > Metric group: Memo

[PATCH net 0/2] netdevsim: Two small fixes

2020-05-21 Thread Ido Schimmel
From: Ido Schimmel Fix two bugs observed while analyzing regression failures. Patch #1 fixes a bug where sometimes the drop counter of a packet trap policer would not increase. Patch #2 adds a missing initialization of a variable in a related selftest. Ido Schimmel (2): netdevsim: Ensure pol

[PATCH net 2/2] selftests: netdevsim: Always initialize 'RET' variable

2020-05-21 Thread Ido Schimmel
From: Ido Schimmel The variable is used by log_test() to check if the test case completely successfully or not. In case it is not initialized at the start of a test case, it is possible for the test case to fail despite not encountering any errors. Example: ``` ... TEST: Trap group statistics

[PATCH net 1/2] netdevsim: Ensure policer drop counter always increases

2020-05-21 Thread Ido Schimmel
From: Ido Schimmel In case the policer drop counter is retrieved when the jiffies value is a multiple of 64, the counter will not be incremented. This randomly breaks a selftest [1] the reads the counter twice and checks that it was incremented: ``` TEST: Trap policer

[PATCH net 2/2] selftests: mlxsw: qos_mc_aware: Specify arping timeout as an integer

2020-05-21 Thread Ido Schimmel
From: Amit Cohen Starting from iputils s20190709 (used in Fedora 31), arping does not support timeout being specified as a decimal: $ arping -c 1 -I swp1 -b 192.0.2.66 -q -w 0.1 arping: invalid argument: '0.1' Previously, such timeouts were rounded to an integer. Fix this by specifying the tim

[PATCH net 1/2] mlxsw: spectrum: Fix use-after-free of split/unsplit/type_set in case reload fails

2020-05-21 Thread Ido Schimmel
From: Jiri Pirko In case of reload fail, the mlxsw_sp->ports contains a pointer to a freed memory (either by reload_down() or reload_up() error path). Fix this by initializing the pointer to NULL and checking it before dereferencing in split/unsplit/type_set callpaths. Fixes: 24cc68ad6c46 ("mlxs

[PATCH net 0/2] mlxsw: Various fixes

2020-05-21 Thread Ido Schimmel
From: Ido Schimmel Patch #1 from Jiri fixes a use-after-free discovered while fuzzing mlxsw / devlink with syzkaller. Patch #2 from Amit works around a limitation in new versions of arping, which is used in several selftests. Amit Cohen (1): selftests: mlxsw: qos_mc_aware: Specify arping time

[PATCH] net: ethernet: stmmac: Enable interface clocks on probe for IPQ806x

2020-05-21 Thread Jonathan McDowell
The ipq806x_gmac_probe() function enables the PTP clock but not the appropriate interface clocks. This means that if the bootloader hasn't done so attempting to bring up the interface will fail with an error like: [ 59.028131] ipq806x-gmac-dwmac 3760.ethernet: Failed to reset the dma [ 59.

[PATCH] mwifiex: Parse all API_VER_ID properties

2020-05-21 Thread Pali Rohár
During initialization of SD8997 wifi chip kernel prints warnings: mwifiex_sdio mmc0:0001:1: Unknown api_id: 3 mwifiex_sdio mmc0:0001:1: Unknown api_id: 4 This patch adds support for parsing all api ids provided by SD8997 firmware. Signed-off-by: Pali Rohár --- drivers/net/wireless/marvell/

Re: [net-next RFC PATCH 00/13] net: hsr: Add PRP driver

2020-05-21 Thread Murali Karicheri
Hi David, et all, On 5/13/20 8:27 AM, Murali Karicheri wrote: Hello netdev experts, On 5/6/20 12:30 PM, Murali Karicheri wrote: This RFC series add support for Parallel Redundancy Protocol (PRP) as defined in IEC-62439-3 in the kernel networking subsystem. PRP Uses a Redundancy Control Trailer

[PATCH] mwifiex: Add support for NL80211_ATTR_MAX_AP_ASSOC_STA

2020-05-21 Thread Pali Rohár
SD8997 firmware sends TLV_TYPE_MAX_CONN with struct hw_spec_max_conn to inform kernel about maximum number of p2p connections and stations in AP mode. During initialization of SD8997 wifi chip kernel prints warning: mwifiex_sdio mmc0:0001:1: Unknown GET_HW_SPEC TLV type: 0x217 This patch adds

[PATCH] files: Use rcu lock to get the file structures for better performance

2020-05-21 Thread Muchun Song
There is another safe way to get the file structure without holding the files->file_lock. That is rcu lock, and this way has better performance. So use the rcu lock instead of the files->file_lock. Signed-off-by: Muchun Song --- fs/proc/fd.c | 31 --- kernel/b

Re: [PATCH net-next 1/2] flow_dissector: Parse multiple MPLS Label Stack Entries

2020-05-21 Thread kbuild test robot
ck-Entries/20200521-052254 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 4f65e2f483b6f764c15094d14dd53dda048a4048 config: i386-allyesconfig (attached as .config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce: # apt-get install sparse # sparse versi

[PATCH net-next] Extending bpf_setsockopt with SO_BINDTODEVICE sockopt

2020-05-21 Thread Ferenc Fejes
This option makes possible to programatically bind sockets to netdevices. With the help of this option sockets of VRF unaware applications could be distributed between multiple VRFs with eBPF sock_ops program. This let the applications benefit from the multiple possible routes. Signed-off-by: Fere

Re: [EXT] Re: [PATCH net 3/4] ARM: dts: imx6: update fec gpr property to match new format

2020-05-21 Thread Andrew Lunn
> Andrew, patch#1 in the series will parse the property to get register offset > and bit. > Patch#2 describes the property format as below: ><&gpr req_gpr req_bit>. > gpr is the phandle to general purpose register node. > req_gpr is the gpr register offset for ENET stop req

Re: [PATCH V6 00/20] net: ks8851: Unify KS8851 SPI and MLL drivers

2020-05-21 Thread Marek Vasut
On 5/17/20 9:30 PM, David Miller wrote: > From: Andrew Lunn > Date: Sun, 17 May 2020 21:16:35 +0200 > >>> Nevertheless I was going to repeat the performance measurements on a >>> recent kernel but haven't gotten around to that yet because the >>> measurements need to be performed with CONFIG_PREE

Re: [PATCH 31/33] sctp: add sctp_sock_set_nodelay

2020-05-21 Thread Marcelo Ricardo Leitner
On Thu, May 21, 2020 at 10:34:42AM +0200, Christoph Hellwig wrote: > On Wed, May 20, 2020 at 08:39:13PM -0300, Marcelo Ricardo Leitner wrote: > > On Wed, May 20, 2020 at 04:23:55PM -0700, David Miller wrote: > > > From: Marcelo Ricardo Leitner > > > Date: Wed, 20 May 2020 20:10:01 -0300 > > > > >

Re: [PATCH 32/33] net: add a new bind_add method

2020-05-21 Thread Marcelo Ricardo Leitner
On Thu, May 21, 2020 at 10:42:24AM +0200, Christoph Hellwig wrote: > On Wed, May 20, 2020 at 08:00:25PM -0300, Marcelo Ricardo Leitner wrote: > > > + if (err) > > > + return err; > > > + > > > + lock_sock(sk); > > > + err = sctp_do_bind(sk, (union sctp_addr *)addr, af->sockaddr_len); > > >

Re: [PATCH 31/33] sctp: add sctp_sock_set_nodelay

2020-05-21 Thread Christoph Hellwig
On Thu, May 21, 2020 at 10:33:48AM -0300, Marcelo Ricardo Leitner wrote: > With the patch there are now two ways of enabling nodelay. There is exactly one way to do for user applications, and one way for kernel drivers. (actually they could just set the field directly, which no one does for sctp,

Re: [PATCH] lan743x: Added fixed link support

2020-05-21 Thread Andrew Lunn
On Wed, May 20, 2020 at 07:10:06PM +0200, Roelof Berg wrote: Hi Roelof Here is how i would do this. I don't like this MII bus snooping. It is a microchip propriety's thing, which is not well understood. It adds no value over just doing what every other MAC driver does in the link_change callback,

Re: KASAN: slab-out-of-bounds Read in br_mrp_parse

2020-05-21 Thread Dan Carpenter
On Wed, May 20, 2020 at 11:23:18AM -0700, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:dda18a5c selftests/bpf: Convert bpf_iter_test_kern{3, 4}.c.. > git tree: bpf-next I can figure out what this is from reading Next/Trees b

Re: [RDMA RFC v6 00/16] Intel RDMA Driver Updates 2020-05-19

2020-05-21 Thread Jason Gunthorpe
On Wed, May 20, 2020 at 12:03:59AM -0700, Jeff Kirsher wrote: > This patch set adds a unified Intel Ethernet Protocol Driver for RDMA that > supports a new network device E810 (iWARP and RoCEv2 capable) and the > existing X722 iWARP device. The driver architecture provides the extensibility > for f

[PATCH] net: mvneta: only do WoL speed down if the PHY is valid

2020-05-21 Thread Daniel González Cabanelas
Previous patch: "net: mvneta: speed down the PHY, if WoL used, to save energy" was causing a NULL pointer dereference when ethernet switches are connected to mvneta, because they aren't handled directly as PHYs. Fix it by restricting the mentioned patch for the PHY detected cases. Reported-by:

[bpf-next PATCH v3 1/5] bpf: sk_msg add some generic helpers that may be useful from sk_msg

2020-05-21 Thread John Fastabend
Add these generic helpers that may be useful to use from sk_msg programs. The helpers do not depend on ctx so we can simply add them here, BPF_FUNC_perf_event_output BPF_FUNC_get_current_uid_gid BPF_FUNC_get_current_pid_tgid BPF_FUNC_get_current_comm BPF_FUNC_get_current_cgroup_id BPF_FUNC_g

[bpf-next PATCH v3 0/5] bpf: Add sk_msg and networking helpers

2020-05-21 Thread John Fastabend
This series adds helpers for sk_msg program type and based on feedback from v1 adds *_task_* helpers and probe_* helpers to all networking programs with perfmon_capable() capabilities. The list of helpers breaks down as follows, Networking with perfmon_capable() guard (patch2): BPF_FUNC_get_cur

[bpf-next PATCH v3 2/5] bpf: extend bpf_base_func_proto helpers with probe_* and *current_task*

2020-05-21 Thread John Fastabend
Often it is useful when applying policy to know something about the task. If the administrator has CAP_SYS_ADMIN rights then they can use kprobe + networking hook and link the two programs together to accomplish this. However, this is a bit clunky and also means we have to call both the network pro

[bpf-next PATCH v3 3/5] bpf: sk_msg add get socket storage helpers

2020-05-21 Thread John Fastabend
Add helpers to use local socket storage. Signed-off-by: John Fastabend Acked-by: Yonghong Song --- include/uapi/linux/bpf.h |2 ++ net/core/filter.c | 15 +++ tools/include/uapi/linux/bpf.h |2 ++ 3 files changed, 19 insertions(+) diff --git a/include/u

[bpf-next PATCH v3 4/5] bpf: selftests, add sk_msg helpers load and attach test

2020-05-21 Thread John Fastabend
The test itself is not particularly useful but it encodes a common pattern we have. Namely do a sk storage lookup then depending on data here decide if we need to do more work or alternatively allow packet to PASS. Then if we need to do more work consult task_struct for more information about the

Re: [PATCH net-next] sctp: Pull the user copies out of the individual sockopt functions.

2020-05-21 Thread 'Marcelo Ricardo Leitner'
On Thu, May 21, 2020 at 07:32:14AM +, David Laight wrote: > From: 'Marcelo Ricardo Leitner' > > Sent: 21 May 2020 01:17 > > On Wed, May 20, 2020 at 03:08:13PM +, David Laight wrote: > > ... > > > Only SCTP_SOCKOPT_CONNECTX3 contains an indirect pointer. > > > It is also the only getsockopt(

[bpf-next PATCH v3 5/5] bpf: selftests, test probe_* helpers from SCHED_CLS

2020-05-21 Thread John Fastabend
Lets test using probe* in SCHED_CLS network programs as well just to be sure these keep working. Its cheap to add the extra test and provides a second context to test outside of sk_msg after we generalized probe* helpers to all networking types. Signed-off-by: John Fastabend --- .../testing/self

Re: [PATCH net-next v2 0/4] Implement classifier-action terse dump mode

2020-05-21 Thread Vlad Buslov
Hi Edward, Cong, On Mon 18 May 2020 at 18:37, Edward Cree wrote: > On 15/05/2020 12:40, Vlad Buslov wrote: >> In order to >> significantly improve filter dump rate this patch sets implement new >> mode of TC filter dump operation named "terse dump" mode. In this mode >> only parameters necessary

Re: [net-next v4 01/12] Implementation of Virtual Bus

2020-05-21 Thread Parav Pandit
Hi Greg, Jason, On 5/20/2020 12:32 PM, Jeff Kirsher wrote: > From: Dave Ertman > > +static const > +struct virtbus_dev_id *virtbus_match_id(const struct virtbus_dev_id *id, > + struct virtbus_device *vdev) > +{ > + while (id->name[0]) { > + if

Re: KASAN: slab-out-of-bounds Read in br_mrp_parse

2020-05-21 Thread Dan Carpenter
On Thu, May 21, 2020 at 04:28:05PM +0200, Dmitry Vyukov wrote: > What do you want to script? Note syzbot is not promising a specific > stable API wrt these plain text emails. These are flattened into text > format for human consumption and sent over unreliable media. I just want to pipe the email

Re: KASAN: slab-out-of-bounds Read in br_mrp_parse

2020-05-21 Thread Dan Carpenter
On Thu, May 21, 2020 at 04:28:05PM +0200, 'Dmitry Vyukov' via syzkaller-bugs wrote: > On Thu, May 21, 2020 at 4:08 PM Dan Carpenter > wrote: > > > > On Wed, May 20, 2020 at 11:23:18AM -0700, syzbot wrote: > > > Hello, > > > > > > syzbot found the following crash on: > > > > > > HEAD commit:d

Re: [PATCH] net: mvneta: only do WoL speed down if the PHY is valid

2020-05-21 Thread Andrew Lunn
> drivers/net/ethernet/marvell/mvneta.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/mvneta.c > b/drivers/net/ethernet/marvell/mvneta.c > index 41d2a0eac..f9170bc93 100644 > --- a/drivers/net/ethernet/marvell/mvneta.c > +++ b/driver

Re: [PATCH] files: Use rcu lock to get the file structures for better performance

2020-05-21 Thread Matthew Wilcox
On Thu, May 21, 2020 at 08:38:35PM +0800, Muchun Song wrote: > There is another safe way to get the file structure without > holding the files->file_lock. That is rcu lock, and this way > has better performance. So use the rcu lock instead of the > files->file_lock. What makes you think this is sa

[PATCH 04/23] maccess: clarify kerneldoc comments

2020-05-21 Thread Christoph Hellwig
Add proper kerneldoc comments for probe_kernel_read_strict and probe_kernel_read strncpy_from_unsafe_strict and explain the different versus the non-strict version. Signed-off-by: Christoph Hellwig --- mm/maccess.c | 61 1 file changed, 43 ins

[PATCH 07/23] maccess: rename strncpy_from_unsafe_strict to strncpy_from_kernel_nofault

2020-05-21 Thread Christoph Hellwig
This matches the naming of strncpy_from_user_nofault, and also makes it more clear what the function is supposed to do. Signed-off-by: Christoph Hellwig --- arch/x86/mm/maccess.c| 2 +- include/linux/uaccess.h | 4 ++-- kernel/trace/bpf_trace.c | 4 ++-- mm/maccess.c | 6 +++---

[PATCH 03/23] maccess: remove duplicate kerneldoc comments

2020-05-21 Thread Christoph Hellwig
Many of the maccess routines have a copy of the kerneldoc comment in the header. Remove it as it is not useful and will get out of sync sooner or later. Signed-off-by: Christoph Hellwig --- include/linux/uaccess.h | 38 -- 1 file changed, 38 deletions(-) dif

[PATCH 05/23] maccess: update the top of file comment

2020-05-21 Thread Christoph Hellwig
This file now also contains several helpers for accessing user memory. Signed-off-by: Christoph Hellwig --- mm/maccess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/maccess.c b/mm/maccess.c index 747581ac50dc9..65880ba2ca376 100644 --- a/mm/maccess.c +++ b/mm/maccess.c

clean up and streamline probe_kernel_* and friends v4

2020-05-21 Thread Christoph Hellwig
Hi all, this series start cleaning up the safe kernel and user memory probing helpers in mm/maccess.c, and then allows architectures to implement the kernel probing without overriding the address space limit and temporarily allowing access to user memory. It then switches x86 over to this new mec

[PATCH 13/23] bpf: rework the compat kernel probe handling

2020-05-21 Thread Christoph Hellwig
Instead of using the dangerous probe_kernel_read and strncpy_from_unsafe helpers, rework the compat probes to check if an address is a kernel or userspace one, and then use the low-level kernel or user probe helper shared by the proper kernel and user probe helpers. This slightly changes behavior

[PATCH 14/23] tracing/kprobes: handle mixed kernel/userspace probes better

2020-05-21 Thread Christoph Hellwig
Instead of using the dangerous probe_kernel_read and strncpy_from_unsafe helpers, rework probes to try a user probe based on the address if the architecture has a common address space for kernel and userspace. Signed-off-by: Christoph Hellwig --- kernel/trace/trace_kprobe.c | 72

[PATCH 12/23] bpf: handle the compat string in bpf_trace_copy_string better

2020-05-21 Thread Christoph Hellwig
User the proper helper for kernel or userspace addresses based on TASK_SIZE instead of the dangerous strncpy_from_unsafe function. Signed-off-by: Christoph Hellwig --- kernel/trace/bpf_trace.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/trace/bpf_trace.c b/k

[PATCH 11/23] bpf: factor out a bpf_trace_copy_string helper

2020-05-21 Thread Christoph Hellwig
Split out a helper to do the fault free access to the string pointer to get it out of a crazy indentation level. Signed-off-by: Christoph Hellwig --- kernel/trace/bpf_trace.c | 42 +++- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/kernel/tra

[PATCH 23/23] maccess: return -ERANGE when copy_from_kernel_nofault_allowed fails

2020-05-21 Thread Christoph Hellwig
Allow the callers to distinguish a real unmapped address vs a range that can't be probed. Suggested-by: Masami Hiramatsu Signed-off-by: Christoph Hellwig Reviewed-by: Masami Hiramatsu --- mm/maccess.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mm/macce

[PATCH 21/23] maccess: rename probe_user_{read,write} to copy_{from,to}_user_nofault

2020-05-21 Thread Christoph Hellwig
Better describe what these functions do. Suggested-by: Linus Torvalds Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/process.c | 3 ++- arch/powerpc/kvm/book3s_64_mmu_radix.c | 4 ++-- arch/powerpc/mm/fault.c| 2 +- arch/powerpc/oprofile/backtrace.c |

[PATCH 18/23] maccess: allow architectures to provide kernel probing directly

2020-05-21 Thread Christoph Hellwig
Provide alternative versions of probe_kernel_read, probe_kernel_write and strncpy_from_kernel_unsafe that don't need set_fs magic, but instead use arch hooks that are modelled after unsafe_{get,put}_user to access kernel memory in an exception safe way. Signed-off-by: Christoph Hellwig --- mm/ma

[PATCH 17/23] maccess: move user access routines together

2020-05-21 Thread Christoph Hellwig
Move kernel access vs user access routines together to ease upcoming ifdefs. Signed-off-by: Christoph Hellwig --- mm/maccess.c | 110 +-- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/mm/maccess.c b/mm/maccess.c index 81a85c1e7116

[PATCH 19/23] x86: use non-set_fs based maccess routines

2020-05-21 Thread Christoph Hellwig
Provide arch_kernel_read and arch_kernel_write routines to implement the maccess routines without messing with set_fs and without stac/clac that opens up access to user space. Signed-off-by: Christoph Hellwig --- arch/x86/include/asm/uaccess.h | 16 1 file changed, 16 insertions

[PATCH 16/23] maccess: always use strict semantics for probe_kernel_read

2020-05-21 Thread Christoph Hellwig
Except for historical confusion in the kprobes/uprobes and bpf tracers, which has been fixed now, there is no good reason to ever allow user memory accesses from probe_kernel_read. Switch probe_kernel_read to only read from kernel memory. Signed-off-by: Christoph Hellwig --- arch/parisc/lib/mem

[PATCH 20/23] maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault

2020-05-21 Thread Christoph Hellwig
Better describe what these functions do. Suggested-by: Linus Torvalds Signed-off-by: Christoph Hellwig --- arch/arm/kernel/ftrace.c | 3 +- arch/arm/kernel/kgdb.c | 2 +- arch/arm64/kernel/insn.c | 4 +-- arch/csky/kernel/ftrace.c | 5 +-- arch/ia64/

[PATCH 22/23] maccess: rename probe_kernel_address to get_kernel_nofault

2020-05-21 Thread Christoph Hellwig
Better describe what this helper does, and match the naming of copy_from_kernel_nofault. Signed-off-by: Christoph Hellwig --- arch/arm/kernel/traps.c | 2 +- arch/arm/mm/alignment.c | 4 ++-- arch/arm64/kernel/traps.c | 2 +- arch/ia64/include/asm/sections.h

[PATCH 15/23] maccess: remove strncpy_from_unsafe

2020-05-21 Thread Christoph Hellwig
All users are gone now. Signed-off-by: Christoph Hellwig --- include/linux/uaccess.h | 1 - mm/maccess.c| 39 +-- 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 65a37ae3b8871.

[PATCH 10/23] maccess: unify the probe kernel arch hooks

2020-05-21 Thread Christoph Hellwig
Currently architectures have to override every routine that probes kernel memory, which includes a pure read and strcpy, both in strict and not strict variants. Just provide a single arch hooks instead to make sure all architectures cover all the cases. Signed-off-by: Christoph Hellwig --- arch

[PATCH 09/23] maccess: remove probe_read_common and probe_write_common

2020-05-21 Thread Christoph Hellwig
Each of the helpers has just two callers, which also different in dealing with kernel or userspace pointers. Just open code the logic in the callers. Signed-off-by: Christoph Hellwig --- mm/maccess.c | 63 1 file changed, 29 insertions(+), 34

[PATCH 08/23] maccess: rename strnlen_unsafe_user to strnlen_user_nofault

2020-05-21 Thread Christoph Hellwig
This matches the naming of strnlen_user, and also makes it more clear what the function is supposed to do. Signed-off-by: Christoph Hellwig --- include/linux/uaccess.h | 2 +- kernel/trace/trace_kprobe.c | 2 +- mm/maccess.c| 4 ++-- 3 files changed, 4 insertions(+), 4 deleti

[PATCH 06/23] maccess: rename strncpy_from_unsafe_user to strncpy_from_user_nofault

2020-05-21 Thread Christoph Hellwig
This matches the naming of strncpy_from_user, and also makes it more clear what the function is supposed to do. Signed-off-by: Christoph Hellwig --- include/linux/uaccess.h | 4 ++-- kernel/trace/bpf_trace.c| 4 ++-- kernel/trace/trace_kprobe.c | 2 +- mm/maccess.c| 4 ++-

  1   2   3   4   5   >