[PATCH v3 2/2] arm64/bpf: don't allocate BPF JIT programs in module memory

2018-11-23 Thread Ard Biesheuvel
The arm64 module region is a 128 MB region that is kept close to the core kernel, in order to ensure that relative branches are always in range. So using the same region for programs that do not have this restriction is wasteful, and preferably avoided. Now that the core BPF JIT code permits the a

[PATCH v3 1/2] bpf: add __weak hook for allocating executable memory

2018-11-23 Thread Ard Biesheuvel
By default, BPF uses module_alloc() to allocate executable memory, but this is not necessary on all arches and potentially undesirable on some of them. So break out the module_alloc() and module_memfree() calls into __weak functions to allow them to be overridden in arch code. Signed-off-by: Ard

[PATCH v3 0/2] bpf: permit JIT allocations to be served outside the module region

2018-11-23 Thread Ard Biesheuvel
On arm64, modules are allocated from a 128 MB window which is close to the core kernel, so that relative direct branches are guaranteed to be in range (except in some KASLR configurations). Also, module_alloc() is in charge of allocating KASAN shadow memory when running with KASAN enabled. This me

[PATCH] mm: Replace all open encodings for NUMA_NO_NODE

2018-11-23 Thread Anshuman Khandual
At present there are multiple places where invalid node number is encoded as -1. Even though implicitly understood it is always better to have macros in there. Replace these open encodings for an invalid node number with the global macro NUMA_NO_NODE. This helps remove NUMA related assumptions like

[RFC PATCH] net: macb: Apply RXUBR workaround only to versions with errata

2018-11-23 Thread Harini Katakam
The interrupt handler contains a workaround for RX hang applicable to Zynq and AT91 only. Subsequent versions do not need this workaround. This workaround unecessarily reset RX whenever RX used bit read is observed, which can be often under heavy traffic.Hence introduce an errata field and a check

RE: [PATCH net-next v2 1/4] enetc: Introduce basic PF and VF ENETC ethernet drivers

2018-11-23 Thread Claudiu Manoil
>-Original Message- >From: Andrew Lunn >Sent: Thursday, November 22, 2018 8:06 PM >To: Claudiu Manoil >Cc: David Miller ; netdev@vger.kernel.org; linux- >ker...@vger.kernel.org; Alexandru Marginean >; Catalin Horghidan > >Subject: Re: [PATCH net-next v2 1/4] enetc: Introduce basic PF and

Re: [PATCH] mm: Replace all open encodings for NUMA_NO_NODE

2018-11-23 Thread David Hildenbrand
On 23.11.18 10:54, Anshuman Khandual wrote: > At present there are multiple places where invalid node number is encoded > as -1. Even though implicitly understood it is always better to have macros > in there. Replace these open encodings for an invalid node number with the > global macro NUMA_NO_N

[PATCH net-next v3 4/4] enetc: Add RFS and RSS support

2018-11-23 Thread Claudiu Manoil
A ternary match table is used for RFS. If multiple entries in the table match, the entry with the lowest numerical values index is chosen as the matching entry. Entries in the table are identified using an index which takes a value from 0 to PRFSCAPR[NUM_RFS]-1 when accessed by the PSI (PF). Porti

[PATCH net-next v3 1/4] enetc: Introduce basic PF and VF ENETC ethernet drivers

2018-11-23 Thread Claudiu Manoil
ENETC is a multi-port virtualized Ethernet controller supporting GbE designs and Time-Sensitive Networking (TSN) functionality. ENETC is operating as an SR-IOV multi-PF capable Root Complex Integrated Endpoint (RCIE). As such, it contains multiple physical (PF) and virtual (VF) PCIe functions, dis

[PATCH net-next v3 2/4] enetc: Add ethtool statistics

2018-11-23 Thread Claudiu Manoil
This adds most h/w statistics counters: non-privileged SI conters, as well as privileged Port and MAC counters available only to the PF. Per ring software stats are also included. Signed-off-by: Alex Marginean Signed-off-by: Claudiu Manoil --- v2: - replaced sprintf by snprintf v3: - non

[PATCH net-next v3 0/4] Introduce ENETC ethernet drivers

2018-11-23 Thread Claudiu Manoil
ENETC is a multi-port virtualized Ethernet controller supporting GbE designs and Time-Sensitive Networking (TSN) functionality. ENETC is operating as an SR-IOV multi-PF capable Root Complex Integrated Endpoint (RCIE). As such, it contains multiple physical (PF) and virtual (VF) PCIe functions, dis

[PATCH net-next v3 3/4] enetc: Add vf to pf messaging support

2018-11-23 Thread Claudiu Manoil
VSIs (VFs) may send a message to the PSI (PF) for general notification or to gain access to hardware resources which requires host inspection. These messages may vary in size and are handled as a partition copy between two memory regions owned by the respective participants. The PSI will respond wi

Re: [PATCH] mm: Replace all open encodings for NUMA_NO_NODE

2018-11-23 Thread Anshuman Khandual
min On 11/23/2018 04:06 PM, David Hildenbrand wrote: > On 23.11.18 10:54, Anshuman Khandual wrote: >> At present there are multiple places where invalid node number is encoded >> as -1. Even though implicitly understood it is always better to have macros >> in there. Replace these open encodings f

[PATCH v2] media: bpf: add bpf function to report mouse movement

2018-11-23 Thread Sean Young
Some IR remotes have a directional pad or other pointer-like thing that can be used as a mouse. Make it possible to decode these types of IR protocols in BPF. Cc: netdev@vger.kernel.org Signed-off-by: Sean Young --- drivers/media/rc/bpf-lirc.c | 24 +++ include/

[PATCH] net: stmmac: Move debugfs init/exit to ->probe()/->remove()

2018-11-23 Thread Thierry Reding
From: Thierry Reding Setting up and tearing down debugfs is current unbalanced, as seen by this error during resume from suspend: [ 752.134067] dwc-eth-dwmac 249.ethernet eth0: ERROR failed to create debugfs directory [ 752.134347] dwc-eth-dwmac 249.ethernet eth0: stmmac_hw_se

Re: [PATCH] net: stmmac: Move debugfs init/exit to ->probe()/->remove()

2018-11-23 Thread Jose Abreu
On 23-11-2018 12:21, Thierry Reding wrote: > From: Thierry Reding > > Setting up and tearing down debugfs is current unbalanced, as seen by > this error during resume from suspend: > > [ 752.134067] dwc-eth-dwmac 249.ethernet eth0: ERROR failed to > create debugfs directory > [ 752.

[PATCH] usbnet: ipheth: fix potential recvmsg bug and recvmsg bug 2

2018-11-23 Thread Bernd Eckstein
The bug is not easily reproducable, as it may occur very infrequently (we had machines with 20minutes heavy downloading before it occurred) However, on a virual machine (VMWare on Windows 10 host) it occurred pretty frequently (1-2 seconds after a speedtest was started) dev->tx_skb mab be freed vi

Re: [PATCH] usbnet: ipheth: fix potential recvmsg bug and recvmsg bug 2

2018-11-23 Thread Yves-Alexis Perez
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On Fri, 2018-11-23 at 13:51 +0100, Bernd Eckstein wrote: > This causes the following problems: > - double free of the skb or potential memory leak > - in dmesg: 'recvmsg bug' and 'recvmsg bug 2' and eventually > general protection fault For what i

Re: [PATCH] net: stmmac: Move debugfs init/exit to ->probe()/->remove()

2018-11-23 Thread Thierry Reding
On Fri, Nov 23, 2018 at 12:44:02PM +, Jose Abreu wrote: > On 23-11-2018 12:21, Thierry Reding wrote: > > From: Thierry Reding > > > > Setting up and tearing down debugfs is current unbalanced, as seen by > > this error during resume from suspend: > > > > [ 752.134067] dwc-eth-dwmac 249000

Re: [PATCH v3 2/2] arm64/bpf: don't allocate BPF JIT programs in module memory

2018-11-23 Thread Ard Biesheuvel
On Fri, 23 Nov 2018 at 10:42, Ard Biesheuvel wrote: > > The arm64 module region is a 128 MB region that is kept close to > the core kernel, in order to ensure that relative branches are > always in range. So using the same region for programs that do > not have this restriction is wasteful, and pr

Re: [PATCH v2 net] phy: Micrel KSZ8061: link failure after cable connect

2018-11-23 Thread Andrew Lunn
On Fri, Nov 23, 2018 at 09:36:11AM +, Onnasch, Alexander (EXT) wrote: > With Micrel KSZ8061 PHY, the link may occasionally not come up after > Ethernet cable connect. The vendor's (Microchip, former Micrel) errata > sheet 8688A.pdf describes the problem and possible workarounds in > detail,

Re: [PATCH net v2] net: phy: mscc: fix deadlock in vsc85xx_default_config

2018-11-23 Thread Andrew Lunn
On Fri, Nov 23, 2018 at 09:16:36AM +0100, Quentin Schulz wrote: > The vsc85xx_default_config function called in the vsc85xx_config_init > function which is used by VSC8530, VSC8531, VSC8540 and VSC8541 PHYs > mistakenly calls phy_read and phy_write in-between phy_select_page and > phy_restore_page.

Re: [PATCH net-next 3/3] vhost: don't touch avail ring if in_order is negotiated

2018-11-23 Thread Michael S. Tsirkin
On Fri, Nov 23, 2018 at 11:00:16AM +0800, Jason Wang wrote: > Device use descriptors table in order, so there's no need to read > index from available ring. This eliminate the cache contention on > avail ring completely. Well this isn't what the in order feature says in the spec. It forces the us

Re: [PATCH net-next 2/3] vhost_net: support in order feature

2018-11-23 Thread Michael S. Tsirkin
On Fri, Nov 23, 2018 at 11:00:15AM +0800, Jason Wang wrote: > This makes vhost_net to support in order feature. This is as simple as > use datacopy path when it was negotiated. An alternative is not to > advertise in order when zerocopy is enabled which tends to be > suboptimal consider zerocopy ma

[PATCH 0/1] drivers/i40iw: out of bound access in i40iw_net_event()

2018-11-23 Thread Konstantin Khorenko
Running debug kernel on a node with infiniband card, got a KASan complain: == BUG: KASAN: slab-out-of-bounds in i40iw_copy_ip_ntohl+0x1c0/0x220 Read of size 4 at addr 88852d477380 by task swapper/6/0 CPU: 6 PID: 0 Comm: swapp

[PATCH 1/1] drivers/net/i40e: define proper net_device::neigh_priv_len

2018-11-23 Thread Konstantin Khorenko
Out of bound read reported by KASan. i40iw_net_event() reads unconditionally 16 bytes from neigh->primary_key while the memory allocated for "neighbour" struct is evaluated in neigh_alloc() as tbl->entry_size + dev->neigh_priv_len where "dev" is a net_device. But the driver does not setup dev

[RFC v2 18/19] batman-adv: Add throughput_override hardif genl configuration

2018-11-23 Thread Sven Eckelmann
The B.A.T.M.A.N. V implementation tries to estimate the link throughput of an interface to an originator using different automatic methods. It is still possible to overwrite it the link throughput for all reachable originators via this interface. The BATADV_CMD_SET_HARDIF/BATADV_CMD_GET_HARDIF com

[RFC v2 03/19] batman-adv: Prepare framework for hardif genl config

2018-11-23 Thread Sven Eckelmann
The batman-adv configuration interface was implemented solely using sysfs. This approach was condemned by non-batadv developers as "huge mistake". Instead a netlink/genl based implementation was suggested. Beside the mesh/soft-interface specific configuration, the slave/hard-interface have B.A.T.M

[RFC v2 17/19] batman-adv: Add elp_interval hardif genl configuration

2018-11-23 Thread Sven Eckelmann
The ELP packets are transmitted every elp_interval milliseconds on an slave/hard-interface. This value can be changed using the configuration interface. The BATADV_CMD_SET_HARDIF/BATADV_CMD_GET_HARDIF commands allow to set/get the configuration of this feature using the u32 BATADV_ATTR_ELP_INTERVA

[RFC v2 04/19] batman-adv: Prepare framework for vlan genl config

2018-11-23 Thread Sven Eckelmann
The batman-adv configuration interface was implemented solely using sysfs. This approach was condemned by non-batadv developers as "huge mistake". Instead a netlink/genl based implementation was suggested. Beside the mesh/soft-interface specific configuration, the VLANs on top of the mesh/soft-int

[RFC v2 11/19] batman-adv: Add gateway mesh genl configuration

2018-11-23 Thread Sven Eckelmann
The mesh/soft-interface can optimize the handling of DHCP packets. Instead of flooding them through the whole mesh, it can be forwarded as unicast to a specific gateway server. The originator which injects the packets in the mesh has to select (based on sel_class thresholds) a responsible gateway s

[RFC v2 06/19] batman-adv: Add ap_isolation mesh/vlan genl configuration

2018-11-23 Thread Sven Eckelmann
The mesh interface can drop messages between clients to implement a mesh-wide AP isolation. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH and BATADV_CMD_SET_VLAN/BATADV_CMD_GET_VLAN commands allow to set/get the configuration of this feature using the BATADV_ATTR_AP_ISOLATION attribute. Setting the

[RFC v2 02/19] batman-adv: Prepare framework for mesh genl config

2018-11-23 Thread Sven Eckelmann
The batman-adv configuration interface was implemented solely using sysfs. This approach was condemned by non-batadv developers as "huge mistake". Instead a netlink/genl based implementation was suggested. The main objects for this configuration is the mesh/soft-interface object. Its actual object

[RFC v2 00/19] batman-adv: netlink restructuring, part 2

2018-11-23 Thread Sven Eckelmann
Hi, Jiri Pirko called the batman-adv configuration interface a while back "a huge mistake" [1] and suggested genl as alternative. The first reimplementation [2] (based on the team/devlink design) was rejected. This second implementation is now using a nl80211-like design. The objects which can now

[RFC v2 09/19] batman-adv: Add distributed_arp_table mesh genl configuration

2018-11-23 Thread Sven Eckelmann
The mesh interface can use a distributed hash table to answer ARP requests without flooding the request through the whole mesh. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the configuration of this feature using the BATADV_ATTR_DISTRIBUTED_ARP_TABLE attribute. Setting the

[RFC v2 16/19] batman-adv: Add orig_interval mesh genl configuration

2018-11-23 Thread Sven Eckelmann
The OGM packets are transmitted every orig_interval milliseconds. This value can be changed using the configuration interface. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the configuration of this feature using the u32 BATADV_ATTR_ORIG_INTERVAL attribute. Cc: Jiri Pirko

[RFC v2 10/19] batman-adv: Add fragmentation mesh genl configuration

2018-11-23 Thread Sven Eckelmann
The mesh interface can fragment unicast packets when the packet size exceeds the outgoing slave/hard-interface MTU. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the configuration of this feature using the BATADV_ATTR_FRAGMENTATION attribute. Setting the u8 to zero will dis

[RFC v2 13/19] batman-adv: Add log_level mesh genl configuration

2018-11-23 Thread Sven Eckelmann
In contrast to other modules, batman-adv allows to set the debug message verbosity per mesh/soft-interface and not per module (via modparam). The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the configuration of this feature using the u32 (bitmask) BATADV_ATTR_LOG_LEVEL attrib

[RFC v2 08/19] batman-adv: Add bridge_loop_avoidance mesh genl configuration

2018-11-23 Thread Sven Eckelmann
The mesh interface can try to detect loops in the same mesh caused by (indirectly) bridged mesh/soft-interfaces of different nodes. Some of the loops can also be resolved without breaking the mesh. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the configuration of this feat

[RFC v2 01/19] batman-adv: Move common genl doit code pre/post hooks

2018-11-23 Thread Sven Eckelmann
The commit ff4c92d85c6f ("genetlink: introduce pre_doit/post_doit hooks") intoduced a mechanism to run specific code for doit hooks before/after the hooks are run. Since all doit hooks are requiring the batadv softif, it should be retrieved/freed in these helpers to simplify the code. Signed-off-b

[RFC v2 07/19] batman-adv: Add bonding mesh genl configuration

2018-11-23 Thread Sven Eckelmann
The mesh interface can use multiple slave/hard-interface ports at the same time to transport the traffic to other nodes. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the configuration of this feature using the BATADV_ATTR_BONDING attribute. Setting the u8 to zero will disa

[RFC v2 15/19] batman-adv: Add network_coding mesh genl configuration

2018-11-23 Thread Sven Eckelmann
The mesh interface can use (in an homogeneous mesh) network coding, a mechanism that aims to increase the overall network throughput by fusing multiple packets in one transmission. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the configuration of this feature using the BAT

[RFC v2 05/19] batman-adv: Add aggregated_ogms mesh genl configuration

2018-11-23 Thread Sven Eckelmann
The mesh interface can delay OGM messages to aggregate different ogms together in a single OGM packet. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the configuration of this feature using the BATADV_ATTR_AGGREGATED_OGMS attribute. Setting the u8 to zero will disable this f

[RFC v2 12/19] batman-adv: Add hop_penalty mesh genl configuration

2018-11-23 Thread Sven Eckelmann
The TQ (B.A.T.M.A.N. IV) and throughput values (B.A.T.M.A.N. V) are reduced when they are forwarded. One of the reductions is the penalty for traversing an additional hop. This hop_penalty (0-255) defines the percentage of reduction (0-100%). The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands al

[RFC v2 14/19] batman-adv: Add multicast_mode mesh genl configuration

2018-11-23 Thread Sven Eckelmann
The mesh interface can optimize the flooding of multicast packets based on the content of the global translation tables. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the configuration of this feature using the BATADV_ATTR_MULTICAST_MODE attribute. Setting the u8 to zero wi

[RFC v2 19/19] batman-adv: Trigger genl notification on sysfs config change

2018-11-23 Thread Sven Eckelmann
The generic netlink code is expected to trigger notification messages when configuration might have been changed. But the configuration of batman-adv is most of the time still done using sysfs. So the sysfs interface should also trigger the corresponding netlink messages via the "config" multicast

Re: [PATCH v2 net-next] ptp: Fix pass zero to ERR_PTR() in ptp_clock_register

2018-11-23 Thread Richard Cochran
On Fri, Nov 23, 2018 at 09:54:55AM +0800, YueHaibing wrote: > @@ -264,6 +266,7 @@ struct ptp_clock *ptp_clock_register(struct > ptp_clock_info *info, > pps.owner = info->owner; > ptp->pps_source = pps_register_source(&pps, PTP_PPS_DEFAULTS); > if (!ptp->pp

Re: [PATCH net v2] net: phy: mscc: fix deadlock in vsc85xx_default_config

2018-11-23 Thread Quentin Schulz
Hi Andrew, On Fri, Nov 23, 2018 at 04:08:06PM +0100, Andrew Lunn wrote: > On Fri, Nov 23, 2018 at 09:16:36AM +0100, Quentin Schulz wrote: > > The vsc85xx_default_config function called in the vsc85xx_config_init > > function which is used by VSC8530, VSC8531, VSC8540 and VSC8541 PHYs > > mistakenl

[PATCH net v3] net: phy: mscc: fix deadlock in vsc85xx_default_config

2018-11-23 Thread Quentin Schulz
The vsc85xx_default_config function called in the vsc85xx_config_init function which is used by VSC8530, VSC8531, VSC8540 and VSC8541 PHYs mistakenly calls phy_read and phy_write in-between phy_select_page and phy_restore_page. phy_select_page and phy_restore_page actually take and release the MDI

Re: [PATCH net v3] net: phy: mscc: fix deadlock in vsc85xx_default_config

2018-11-23 Thread Andrew Lunn
On Fri, Nov 23, 2018 at 07:01:51PM +0100, Quentin Schulz wrote: > The vsc85xx_default_config function called in the vsc85xx_config_init > function which is used by VSC8530, VSC8531, VSC8540 and VSC8541 PHYs > mistakenly calls phy_read and phy_write in-between phy_select_page and > phy_restore_page.

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-23 Thread Jason Gunthorpe
On Fri, Nov 23, 2018 at 04:02:42PM +0800, Kenneth Lee wrote: > It is already part of Jean's patchset. And that's why I built my solution on > VFIO in the first place. But I think the concept of SVA and PASID is not > compatible with the original VFIO concept space. You would not share your > whol

[PATCH 0/3] bpf: Test defence against SSB exploitation

2018-11-23 Thread Ben Hutchings
This series adds log messages for all patching done by the verifier, and a test case to verify that the patch to defend against SSB exploitation is applied where needed. Ben. Ben Hutchings (3): bpf/verifier: Log instruction patching when verbose logging is enabled selftests/bpf: Add the abili

[PATCH 2/3] selftests/bpf: Add the ability to test for a log message on success

2018-11-23 Thread Ben Hutchings
This is needed to test that code is being patched when it should be. Signed-off-by: Ben Hutchings --- tools/testing/selftests/bpf/test_verifier.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests

[PATCH 3/3] selftests/bpf: Add test case for defence against SSB exploitation

2018-11-23 Thread Ben Hutchings
Test that the defence added by commit af86ca4e3088 "bpf: Prevent memory disambiguation attack" is actually being applied. Signed-off-by: Ben Hutchings --- tools/testing/selftests/bpf/test_verifier.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/tools/testing/selftests/bpf/

[PATCH 1/3] bpf/verifier: Log instruction patching when verbose logging is enabled

2018-11-23 Thread Ben Hutchings
User-space does not have access to the patched eBPF code, but we need to be able to test that patches are being applied. Therefore log distinct messages for each case that requires patching. Signed-off-by: Ben Hutchings --- kernel/bpf/verifier.c | 13 + 1 file changed, 13 insertions

Re: [PATCH net-next] net: bcmgenet: remove HFB_CTRL access

2018-11-23 Thread David Miller
From: Doug Berger Date: Tue, 20 Nov 2018 15:17:01 -0800 > Commit c5a54bbcecec ("net: bcmgenet: abort suspend on error") > mistakenly introduced register accesses that should not occur > in bcmgenet_wol_power_up_cfg(). > > Fixes: c5a54bbcecec ("net: bcmgenet: abort suspend on error") > Signed-off

Re: [PATCH net-next] cxgb4: use new fw interface to get the VIN and smt index

2018-11-23 Thread David Miller
From: Ganesh Goudar Date: Wed, 21 Nov 2018 13:40:24 +0530 > From: Santosh Rastapur > > If the fw supports returning VIN/VIVLD in FW_VI_CMD save it > in port_info structure else retrieve these from viid and save > them in port_info structure. Do the same for smt_idx from > FW_VI_MAC_CMD > > Si

Re: [PATCH v3 00/02] ravb: Duplex handling update V3

2018-11-23 Thread David Miller
From: Magnus Damm Date: Wed, 21 Nov 2018 20:21:08 +0900 > ravb: Duplex handling update V3 > > [PATCH v3 01/02] ravb: Do not announce HDX as supported > [PATCH v3 02/02] ravb: Clean up duplex handling Series applied to net-next.

Re: [PATCH v3 0/3] dpaa_eth: add ethtool coalesce control

2018-11-23 Thread David Miller
From: Madalin Bucur Date: Wed, 21 Nov 2018 13:41:06 +0200 > Add control of the DPAA portal interrupt coalescing settings from > ethtool. > > changes from v2: read ithresh from HW, set previous values on failure > changes from v1: added range checking for the QMan APIs Series applied.

Re: [PATCH net 1/2] virtio-net: disable guest csum during XDP set

2018-11-23 Thread David Miller
From: Jason Wang Date: Thu, 22 Nov 2018 14:36:30 +0800 > We don't disable VIRTIO_NET_F_GUEST_CSUM if XDP was set. This means we > can receive partial csumed packets with metadata kept in the > vnet_hdr. This may have several side effects: > > - It could be overridden by header adjustment, thus i

Re: [PATCH net 2/2] virtio-net: fail XDP set if guest csum is negotiated

2018-11-23 Thread David Miller
From: Jason Wang Date: Thu, 22 Nov 2018 14:36:31 +0800 > We don't support partial csumed packet since its metadata will be lost > or incorrect during XDP processing. So fail the XDP set if guest_csum > feature is negotiated. > > Fixes: f600b6905015 ("virtio_net: Add XDP support") > Reported-by:

Re: [PATCH 1/3] bpf/verifier: Log instruction patching when verbose logging is enabled

2018-11-23 Thread Daniel Borkmann
On 11/23/2018 07:34 PM, Ben Hutchings wrote: > User-space does not have access to the patched eBPF code, but we > need to be able to test that patches are being applied. Therefore > log distinct messages for each case that requires patching. Thanks for the patches, Ben! Above is actually not the

Re: [PATCH v3 1/2] bpf: add __weak hook for allocating executable memory

2018-11-23 Thread Daniel Borkmann
On 11/23/2018 10:41 AM, Ard Biesheuvel wrote: > By default, BPF uses module_alloc() to allocate executable memory, > but this is not necessary on all arches and potentially undesirable > on some of them. > > So break out the module_alloc() and module_memfree() calls into __weak > functions to allo

Re: [PATCH v3 1/2] bpf: add __weak hook for allocating executable memory

2018-11-23 Thread Ard Biesheuvel
On Fri, 23 Nov 2018 at 22:07, Daniel Borkmann wrote: > > On 11/23/2018 10:41 AM, Ard Biesheuvel wrote: > > By default, BPF uses module_alloc() to allocate executable memory, > > but this is not necessary on all arches and potentially undesirable > > on some of them. > > > > So break out the module

[PATCH v4 2/2] arm64/bpf: don't allocate BPF JIT programs in module memory

2018-11-23 Thread Ard Biesheuvel
The arm64 module region is a 128 MB region that is kept close to the core kernel, in order to ensure that relative branches are always in range. So using the same region for programs that do not have this restriction is wasteful, and preferably avoided. Now that the core BPF JIT code permits the a

[PATCH v4 0/2] bpf: permit JIT allocations to be served outside the module region

2018-11-23 Thread Ard Biesheuvel
On arm64, modules are allocated from a 128 MB window which is close to the core kernel, so that relative direct branches are guaranteed to be in range (except in some KASLR configurations). Also, module_alloc() is in charge of allocating KASAN shadow memory when running with KASAN enabled. This me

[PATCH v4 1/2] bpf: add __weak hook for allocating executable memory

2018-11-23 Thread Ard Biesheuvel
By default, BPF uses module_alloc() to allocate executable memory, but this is not necessary on all arches and potentially undesirable on some of them. So break out the module_alloc() and module_memfree() calls into __weak functions to allow them to be overridden in arch code. Signed-off-by: Ard

Re: [PATCH] mm: Replace all open encodings for NUMA_NO_NODE

2018-11-23 Thread Andrew Morton
On Fri, 23 Nov 2018 15:24:16 +0530 Anshuman Khandual wrote: > At present there are multiple places where invalid node number is encoded > as -1. Even though implicitly understood it is always better to have macros > in there. Replace these open encodings for an invalid node number with the > glo

Re: [PATCH net-next] net: mvneta: remove redundant check for eee->tx_lpi_timer < 0

2018-11-23 Thread David Miller
From: YueHaibing Date: Thu, 22 Nov 2018 14:42:00 +0800 > fixes the smatch warning: > > drivers/net/ethernet/marvell/mvneta.c:4252 mvneta_ethtool_set_eee() warn: > unsigned 'eee->tx_lpi_timer' is never less than zero. > > Signed-off-by: YueHaibing Applied.

Re: [PATCH][V2] net: hinic: fix null pointer dereference on pointer hwdev

2018-11-23 Thread David Miller
From: Colin King Date: Thu, 22 Nov 2018 10:05:01 + > From: Colin Ian King > > Pointer hwdev is being dereferenced when declaring hwif , however, later > on hwdev is being null checked, hence we have dereference before null > check error. Fix this by assigning hwif and pdef only once hwdev h

Re: [PATCH v2] net: amd: add missing of_node_put()

2018-11-23 Thread David Miller
From: Yangtao Li Date: Thu, 22 Nov 2018 07:34:41 -0500 > of_find_node_by_path() acquires a reference to the node > returned by it and that reference needs to be dropped by its caller. > This place doesn't do that, so fix it. > > Signed-off-by: Yangtao Li Applied.

Re: [PATCH net-next] net: phy: vitesse: remove duplicate support for VSC8574

2018-11-23 Thread David Miller
From: Quentin Schulz Date: Thu, 22 Nov 2018 14:24:32 +0100 > A more featureful support for VSC8574 was recently added to the > Microsemi (mscc.c) driver. I checked that features supported in the > Vitesse driver are also supported in the Microsemi driver. > > Signed-off-by: Quentin Schulz Appl

Re: [PATCH net-next] net: cavium: clean up return value check in cavium_ptp_probe

2018-11-23 Thread David Miller
From: YueHaibing Date: Thu, 22 Nov 2018 21:27:19 +0800 > ptp_clock_register never return NULL, so no need check this > in cavium_ptp_probe. > > Signed-off-by: YueHaibing Applied.

Re: [PATCH V2 net-next 0/8] net: hns3: Adds support of debugfs to HNS3 driver

2018-11-23 Thread David Miller
From: Salil Mehta Date: Thu, 22 Nov 2018 14:09:40 + > This patchset adds support of debugfs to the HNS3 driver. > > Support has been added to query info related to below items: > 1. Queue related ("echo queue info [queue no] > cmd") > 2. Flow Director ("echo dump fd tcam > cmd") > 3. TC con

Re: [PATCH v2 net-next] ptp: Fix pass zero to ERR_PTR() in ptp_clock_register

2018-11-23 Thread David Miller
From: YueHaibing Date: Fri, 23 Nov 2018 09:54:55 +0800 > Fix smatch warning: > > drivers/ptp/ptp_clock.c:298 ptp_clock_register() warn: > passing zero to 'ERR_PTR' > > 'err' should be set while device_create_with_groups and > pps_register_source fails > > Fixes: 85a66e550195 ("ptp: create "pi

[PATCH 0/8] net: y2038-safe socket timestamps

2018-11-23 Thread Deepa Dinamani
The series introduces new socket timestamps that are y2038 safe. The time data types used for the existing socket timestamp options: SO_TIMESTAMP, SO_TIMESTAMPNS and SO_TIMESTAMPING are not y2038 safe. The series introduces SO_TIMESTAMP_NEW, SO_TIMESTAMPNS_NEW and SO_TIMESTAMPING_NEW to replace th

[PATCH 7/8] socket: Add SO_TIMESTAMP[NS]_NEW

2018-11-23 Thread Deepa Dinamani
Add SO_TIMESTAMP_NEW and SO_TIMESTAMPNS_NEW variants of socket timestamp options. These are the y2038 safe versions of the SO_TIMESTAMP_OLD and SO_TIMESTAMPNS_OLD for all architectures. Note that the format of scm_timestamping.ts[0] is not changed in this patch. Signed-off-by: Deepa Dinamani Cc:

[PATCH 6/8] socket: Add struct sock_timeval

2018-11-23 Thread Deepa Dinamani
The new type is meant to be used as a y2038 safe structure to be used as part of cmsg data. Presently the SO_TIMESTAMP socket option uses struct timeval for timestamps. This is not y2038 safe. Subsequent patches in the series add new y2038 safe socket option to be used in the place of SO_TIMESTAMP_

[PATCH 1/8] arch: Use asm-generic/socket.h when possible

2018-11-23 Thread Deepa Dinamani
Many architectures maintain an arch specific copy of the file even though there are no differences with the asm-generic one. Allow these architectures to use the generic one instead. Signed-off-by: Deepa Dinamani Cc: ch...@zankel.net Cc: fenghua...@intel.com Cc: t...@linutronix.de Cc: schwidef...

[PATCH 8/8] socket: Add SO_TIMESTAMPING_NEW

2018-11-23 Thread Deepa Dinamani
Add SO_TIMESTAMPING_NEW variant of socket timestamp options. This is the y2038 safe versions of the SO_TIMESTAMPING_OLD for all architectures. Signed-off-by: Deepa Dinamani Cc: ch...@zankel.net Cc: fenghua...@intel.com Cc: r...@twiddle.net Cc: t...@linutronix.de Cc: ubr...@linux.ibm.com Cc: linux

[PATCH 4/8] arch: sparc: Override struct __kernel_old_timeval

2018-11-23 Thread Deepa Dinamani
struct __kernel_old_timeval is supposed to have the same layout as struct timeval. But, it was inadvarently missed that __kernel_suseconds has a different definition for sparc64. Provide an asm-specific override that fixes it. Reported-by: Arnd Bergmann Suggested-by: Arnd Bergmann Signed-off-by:

[PATCH 5/8] socket: Use old_timeval types for socket timestamps

2018-11-23 Thread Deepa Dinamani
As part of y2038 solution, all internal uses of struct timeval are replaced by struct __kernel_old_timeval and struct compat_timeval by struct old_timeval32. Make socket timestamps use these new types. This is mainly to be able to verify that the kernel build is y2038 safe when such non y2038 safe

[PATCH 2/8] sockopt: Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD

2018-11-23 Thread Deepa Dinamani
SO_TIMESTAMP, SO_TIMESTAMPNS and SO_TIMESTAMPING options, the way they are currently defined, are not y2038 safe. Subsequent patches in the series add new y2038 safe versions of these options which provide 64 bit timestamps on all architectures uniformly. Hence, rename existing options with OLD tag

[PATCH 3/8] socket: Disentangle SOCK_RCVTSTAMPNS from SOCK_RCVTSTAMP

2018-11-23 Thread Deepa Dinamani
SOCK_RCVTSTAMPNS is never set alone. SOCK_RCVTSTAMP is always set along with SOCK_RCVTSTAMPNS. This leads to checking for two flag states whenever we need to check for SOCK_RCVTSTAMPS. Also SOCK_RCVTSTAMPS was the only flag that needed to be checked in order to verify if either of the two flags ar

[PATCH net-next v2 0/3] net: bridge: add an option to disabe linklocal learning

2018-11-23 Thread Nikolay Aleksandrov
Hi, This set adds a new bridge option which can control learning from link-local packets, by default learning is on to be consistent and avoid breaking users expectations. If the new no_linklocal_learn option is enabled then the bridge will stop learning from link-local packets. In order to save s

[PATCH net-next v2 2/3] net: bridge: add no_linklocal_learn bool option

2018-11-23 Thread Nikolay Aleksandrov
Use the new boolopt API to add an option which disables learning from link-local packets. The default is kept as before and learning is enabled. This is a simple map from a boolopt bit to a bridge private flag that is tested before learning. v2: pass NULL for extack via sysfs Signed-off-by: Nikol

[PATCH net-next v2 1/3] net: bridge: add support for user-controlled bool options

2018-11-23 Thread Nikolay Aleksandrov
We have been adding many new bridge options, a big number of which are boolean but still take up netlink attribute ids and waste space in the skb. Recently we discussed learning from link-local packets[1] and decided yet another new boolean option will be needed, thus introducing this API to save s

[PATCH net-next v2 3/3] net: bridge: export supported boolopts

2018-11-23 Thread Nikolay Aleksandrov
Now that we have at least one bool option, we can export all of the supported bool options via optmask when dumping them. v2: new patch Signed-off-by: Nikolay Aleksandrov --- net/bridge/br.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/br.c b/net/bridge/br.c in

Re: [PATCH v2 2/2] arm64/bpf: don't allocate BPF JIT programs in module memory

2018-11-23 Thread kbuild test robot
Hi Ard, I love your patch! Yet something to improve: [auto build test ERROR on bpf-next/master] [also build test ERROR on v4.20-rc3 next-20181123] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-23 Thread Kenneth Lee
On Fri, Nov 23, 2018 at 11:05:04AM -0700, Jason Gunthorpe wrote: > Date: Fri, 23 Nov 2018 11:05:04 -0700 > From: Jason Gunthorpe > To: Kenneth Lee > CC: Leon Romanovsky , Kenneth Lee , > Tim Sell , linux-...@vger.kernel.org, Alexander > Shishkin , Zaibo Xu > , zhangfei@foxmail.com, linux..

Re: [PATCH v2 net] phy: Micrel KSZ8061: link failure after cable connect

2018-11-23 Thread David Miller
From: "Onnasch, Alexander (EXT)" Date: Fri, 23 Nov 2018 09:36:11 + > With Micrel KSZ8061 PHY, the link may occasionally not come up after > Ethernet cable connect. The vendor's (Microchip, former Micrel) errata > sheet 8688A.pdf describes the problem and possible workarounds in > detail,

Re: [PATCH net-next v3 1/4] enetc: Introduce basic PF and VF ENETC ethernet drivers

2018-11-23 Thread David Miller
From: Claudiu Manoil Date: Fri, 23 Nov 2018 12:46:00 +0200 > +static int enetc_poll(struct napi_struct *napi, int budget) > +{ > + struct enetc_int_vector > + *v = container_of(napi, struct enetc_int_vector, napi); > + bool complete = true; > + int work_done; > + int i

Re: [PATCH net v3] net: phy: mscc: fix deadlock in vsc85xx_default_config

2018-11-23 Thread David Miller
From: Quentin Schulz Date: Fri, 23 Nov 2018 19:01:51 +0100 > The vsc85xx_default_config function called in the vsc85xx_config_init > function which is used by VSC8530, VSC8531, VSC8540 and VSC8541 PHYs > mistakenly calls phy_read and phy_write in-between phy_select_page and > phy_restore_page. >

[GIT] Networking

2018-11-23 Thread David Miller
1) Need to take mutex in ath9k_add_interface(), from Dan Carpenter. 2) Fix mt76 build without CONFIG_LEDS_CLASS, from Arnd Bergmann. 3) Fix socket wmem accounting in SCTP, from Xin Long. 4) Fix failed resume crash in ena driver, from Arthur Kiyanovski. 5) qed driver passes bytes instead of bi

Re: [RFC PATCH bpf-next] libbpf: make bpf_object__open default to UNSPEC

2018-11-23 Thread Wangnan (F)
On 2018/11/23 5:52, Daniel Borkmann wrote: > [ +Wang ] > > On 11/22/2018 07:03 AM, Nikita V. Shirokov wrote: >> currently by default libbpf's bpf_object__open requires >> bpf's program to specify version in a code because of two things: >> 1) default prog type is set to KPROBE >> 2) KPROBE req

Re: [PATCH bpf-next] bpf: libbpf: retry program creation without the name

2018-11-23 Thread Quentin Monnet
2018-11-21 09:28 UTC-0800 ~ Stanislav Fomichev On 11/21, Quentin Monnet wrote: 2018-11-20 15:26 UTC-0800 ~ Stanislav Fomichev On 11/20, Alexei Starovoitov wrote: On Wed, Nov 21, 2018 at 12:18:57AM +0100, Daniel Borkmann wrote: On 11/21/2018 12:04 AM, Alexei Starovoitov wrote: On Tue, Nov 2

Re: [PATCH bpf-next] bpf: Add BPF_MAP_TYPE_QUEUE and BPF_MAP_TYPE_QUEUE to bpftool-map

2018-11-23 Thread Edward Cree
On 22/11/18 20:59, David Calavera wrote: > I noticed that these two new BPF Maps are not defined in bpftool. > This patch defines those two maps and adds their names to the > bpftool-map documentation. > > Signed-off-by: David Calavera > --- Subject line says 'QUEUE' twice, should one of those be

Re: [PATCHv2 1/2] can: xilinx: add can 2.0 support

2018-11-23 Thread Marc Kleine-Budde
On 10/12/18 6:25 AM, shubhrajyoti.da...@gmail.com wrote: > From: Shubhrajyoti Datta > > Add support for can 2.0. > > Signed-off-by: Shubhrajyoti Datta Added to linux-can-next. Tnx, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions|

ixgbe driver hits null pointer in net/core/dev.c

2018-11-23 Thread Nathanael Davison
Hi all, Running Kernel 4.19.x on Xen in machines using intel ixgbe driver the driver crashes on startup with the kernel trace below. It appears that the loop on line 2432 of net/core/dev.c iterates beyond the end of the dev_maps->attr_map array, resulting in dereferencing garbage. A workaround

[PATCH v2] bpf: fix check of allowed specifiers in bpf_trace_printk

2018-11-23 Thread Martynas Pumputis
A format string consisting of "%p" or "%s" followed by an invalid specifier (e.g. "%p%\n" or "%s%") could pass the check which would make format_decode (lib/vsprintf.c) to warn. Reported-by: syzbot+1ec5c5ec949c4adaa...@syzkaller.appspotmail.com Signed-off-by: Martynas Pumputis --- kernel/trace/b

  1   2   >