]> git.ipfire.org Git - thirdparty/kernel/stable.git/log
thirdparty/kernel/stable.git
5 years agonet: phy: start state machine in phy_start only
Heiner Kallweit [Wed, 23 Jan 2019 06:27:21 +0000 (07:27 +0100)] 
net: phy: start state machine in phy_start only

The state machine is a no-op before phy_start() has been called.
Therefore let's enable it in phy_start() only. In phy_start()
let's call phy_start_machine() instead of phy_trigger_machine().
phy_start_machine is an alias for phy_trigger_machine but it makes
clearer that we start the state machine here instead of just
triggering a run.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: stmmac: Fix return value check in qcom_ethqos_probe()
Wei Yongjun [Wed, 23 Jan 2019 06:19:18 +0000 (06:19 +0000)] 
net: stmmac: Fix return value check in qcom_ethqos_probe()

In case of error, the function devm_clk_get() returns ERR_PTR() and
never returns NULL. The NULL test in the return value check should be
replaced with IS_ERR().

Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Vinod Koul <vkoul@kernel.org>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: amd8111e: clean up two minor indentation issues
Colin Ian King [Tue, 22 Jan 2019 14:37:55 +0000 (14:37 +0000)] 
net: amd8111e: clean up two minor indentation issues

Two statements are incorrecly indented, fix these by removing a space.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 'ENETC'
David S. Miller [Fri, 25 Jan 2019 05:55:53 +0000 (21:55 -0800)] 
Merge branch 'ENETC'

Claudiu Manoil says:

====================
Introduce ENETC ethernet drivers

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, discoverable by standard PCI Express.

The patch series adds basic enablement for these otherwise standard
buffer descriptor (BD) ring based ethernet devices (PCIe PFs and VFs),
currently included in the 64-bit dual ARMv8 processors LS1028A SoC.
The driver is portable to 32-bit designs, and it's independent of CPU
endianness.

Contributors:
Alex Marginean <alexandru.marginean@nxp.com>
Catalin Horghidan <catalin.horghidan@nxp.com>

TODO list:
* IEEE 1588 PTP support;
* TSN support;
* MDIO support and VF link management;
* power management support;
* flow control support;
* TC offloading with h/w MQPRIO;
* interrupt coalescing, configurable BD ring sizes, and other usual
config options if missing.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoenetc: Add RFS and RSS support
Claudiu Manoil [Tue, 22 Jan 2019 13:29:57 +0000 (15:29 +0200)] 
enetc: Add RFS and RSS support

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).
Portions of the RFS table can be assigned to each SI by the PSI (PF)
driver in PSIaRFSCFGR.  Assignments are cumulative, the entries assigned
to SIn start after those assigned to SIn-1.  The total assignments to
all SIs must be equal to or less than the number available to the port
as found in PRFSCAPR.

For RSS, the Toeplitz hash function used requires two inputs, a 40B
random secret key that is supplied through the PRSSKR0-9 registers as well
as the relevant pieces of the packet header (n-tuple).  The 6 LSB bits of
the hash function result will then be used as a pointer to obtain the tag
referenced in the 64 entry indirection table.  The result will provide a
winning group which will be used to help route the received packet.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoenetc: Add vf to pf messaging support
Claudiu Manoil [Tue, 22 Jan 2019 13:29:56 +0000 (15:29 +0200)] 
enetc: Add vf to pf messaging support

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 with fail or success and a 16-bit message code.
The patch implements the vf to pf messaging mechanism above and, as the
first application making use of this support, it enables the VF to
configure its own primary MAC address.

Signed-off-by: Catalin Horghidan <catalin.horghidan@nxp.com>
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoenetc: Add ethtool statistics
Claudiu Manoil [Tue, 22 Jan 2019 13:29:55 +0000 (15:29 +0200)] 
enetc: Add ethtool statistics

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 <alexandru.marginean@nxp.com>
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoenetc: Introduce basic PF and VF ENETC ethernet drivers
Claudiu Manoil [Tue, 22 Jan 2019 13:29:54 +0000 (15:29 +0200)] 
enetc: Introduce basic PF and VF ENETC ethernet drivers

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, discoverable by standard PCI Express.

Introduce basic PF and VF ENETC ethernet drivers.  The PF has access to
the ENETC Port registers and resources and makes the required privileged
configurations for the underlying VF devices.  Common functionality is
controlled through so called System Interface (SI) register blocks, PFs
and VFs own a SI each.  Though SI register blocks are almost identical,
there are a few privileged SI level controls that are accessible only to
PFs, and so the distinction is made between PF SIs (PSI) and VF SIs (VSI).
As such, the bulk of the code, including datapath processing, basic h/w
offload support and generic pci related configuration, is shared between
the 2 drivers and is factored out in common source files (i.e. enetc.c).

Major functionalities included (for both drivers):
MSI-X support for Rx and Tx processing, assignment of Rx/Tx BD ring pairs
to MSI-X entries, multi-queue support, Rx S/G (Rx frame fragmentation) and
jumbo frame (up to 9600B) support, Rx paged allocation and reuse, Tx S/G
support (NETIF_F_SG), Rx and Tx checksum offload, PF MAC filtering and
initial control ring support, VLAN extraction/ insertion, PF Rx VLAN
CTAG filtering, VF mac address config support, VF VLAN isolation support,
etc.

Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet/mlx4_core: A write memory barrier is sufficient in EQ ci update
Tariq Toukan [Tue, 22 Jan 2019 13:25:50 +0000 (15:25 +0200)] 
net/mlx4_core: A write memory barrier is sufficient in EQ ci update

Soften the memory barrier call of mb() by a sufficient wmb() in the
consumer index update of the event queues.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agor8169: improve firmware handling
Heiner Kallweit [Tue, 22 Jan 2019 21:23:41 +0000 (22:23 +0100)] 
r8169: improve firmware handling

So far member rtl_fw has three states:
- IS_ERR(rtl_fw): firmware not loaded
- !rtl_fw: no firmware available
- other: firmware loaded

This can be made simpler and clearer by adding the firmware name as
member fw_name to struct rtl8169_private. Then:

- !fw_name: no firmware available
- !rtl_fw: firmware not loaded
- rtl_fw: firmware loaded

This change also allows to easily merge rtl_request_uncached_firmware
into rtl_request_firmware.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 'hns3-next'
David S. Miller [Wed, 23 Jan 2019 19:13:02 +0000 (11:13 -0800)] 
Merge branch 'hns3-next'

Huazhong Tan says:

====================
code optimizations & bugfixes for HNS3 driver

This patchset includes bugfixes and code optimizations for the HNS3
ethernet controller driver

Change log:
V1->V2: fixes comment from Eric Dumazet
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: fix PFC not setting problem for DCB module
Yunsheng Lin [Tue, 22 Jan 2019 23:39:38 +0000 (07:39 +0800)] 
net: hns3: fix PFC not setting problem for DCB module

The PFC enabling is based on user priority, currently it is
based on TC, which may cause PFC not setting correctly when pri
to TC mapping is not one to one relation.

This patch adds pfc_en in tm_info to fix it.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: add statistics for PFC frames and MAC control frames
liuzhongzhu [Tue, 22 Jan 2019 23:39:37 +0000 (07:39 +0800)] 
net: hns3: add statistics for PFC frames and MAC control frames

In the old firmware version, statistics acquisition of
PFC frames and MAC control frames is not supported.
Add command retrieves statistics for PFC frames and
MAC control frames from the firmware.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: add ETS TC weight setting in SSU module
Yunsheng Lin [Tue, 22 Jan 2019 23:39:36 +0000 (07:39 +0800)] 
net: hns3: add ETS TC weight setting in SSU module

This patch sets the TC weight in SSU module according to
info in tm_info.

Also, zero weight of TC weight in SSU ETS module means enabling
strict priority, so do not allow zero weight when in ETS mode.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: do not return GE PFC setting err when initializing
Yunsheng Lin [Tue, 22 Jan 2019 23:39:35 +0000 (07:39 +0800)] 
net: hns3: do not return GE PFC setting err when initializing

GE MAC does not support PFC, when driver is initializing and MAC
is in GE Mode, ignore the fw not supported error, otherwise
initialization will fail.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED
Yunsheng Lin [Tue, 22 Jan 2019 23:39:34 +0000 (07:39 +0800)] 
net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED

According to firmware error code definition, the error code of 2
means NOT_SUPPORTED, this patch changes it to NOT_SUPPORTED.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: clear param in ring when free ring
Peng Li [Tue, 22 Jan 2019 23:39:33 +0000 (07:39 +0800)] 
net: hns3: clear param in ring when free ring

Param pending_buf and skb may be not NULL when free ring.
This patch clears them when free ring.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: fix bug of ethtool_ops.get_channels for VF
Huazhong Tan [Tue, 22 Jan 2019 23:39:32 +0000 (07:39 +0800)] 
net: hns3: fix bug of ethtool_ops.get_channels for VF

The current code returns the number of all queues that can be used and
the number of queues that have been allocated, which is incorrect.
What should be returned is the number of queues allocated for each enabled
TC and the number of queues that can be allocated.

This patch fixes it.

Fixes: 849e46077689 ("net: hns3: add ethtool_ops.get_channels support for VF")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: fix for shaper not setting when TC num changes
Yunsheng Lin [Tue, 22 Jan 2019 23:39:31 +0000 (07:39 +0800)] 
net: hns3: fix for shaper not setting when TC num changes

Shaper setting does not change currently, when TC num changes,
which may cause shaper parameter not setting problem.

This patch fixes it by setting the shaper parameter when TC num
changes.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: fix rss configuration lost problem when setting channel
Yunsheng Lin [Tue, 22 Jan 2019 23:39:30 +0000 (07:39 +0800)] 
net: hns3: fix rss configuration lost problem when setting channel

Currently rss configuration set by user will be lost when setting
channel.

This patch fixes it by not setting rss configuration to default
if user has configured the rss.

Fixes: 09f2af6405b8 ("net: hns3: add support to modify tqps number")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: refactor the statistics updating for netdev
Jian Shen [Tue, 22 Jan 2019 23:39:29 +0000 (07:39 +0800)] 
net: hns3: refactor the statistics updating for netdev

In origin codes, there are some statistics item are got from mac, which
also include the packets statistics of VF. It is unreasonable. This
patch fixes it by counting them in the rx/tx processing flow.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: add rx multicast packets statistic
Jian Shen [Tue, 22 Jan 2019 23:39:28 +0000 (07:39 +0800)] 
net: hns3: add rx multicast packets statistic

This patch adds rx multicast packets statistic for each ring.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: hns3: add calling roce callback function when link status change
Peng Li [Tue, 22 Jan 2019 23:39:27 +0000 (07:39 +0800)] 
net: hns3: add calling roce callback function when link status change

This patch adds calling roce callback function when link status
change.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 'mlxsw-Add-VXLAN-support-for-Spectrum-2'
David S. Miller [Wed, 23 Jan 2019 17:28:27 +0000 (09:28 -0800)] 
Merge branch 'mlxsw-Add-VXLAN-support-for-Spectrum-2'

Ido Schimmel says:

====================
mlxsw: Add VXLAN support for Spectrum-2

This patchset adds support for VXLAN tunneling on the Spectrum-2 ASIC.
Spectrum-1 and Spectrum-2 are largely backward compatible in this area,
so not too many changes are required.

Patches #1-#2 expose a function and perform small refactoring towards
the actual Spectrum-2 implementation in patches #3-#4.

Patch #3 adds the required initialization steps on Spectrum-2.

Patch #4 finally enables VXLAN on Spectrum-2.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agomlxsw: spectrum_nve: Enable VXLAN on Spectrum-2
Ido Schimmel [Wed, 23 Jan 2019 14:32:59 +0000 (14:32 +0000)] 
mlxsw: spectrum_nve: Enable VXLAN on Spectrum-2

Enable VXLAN on Spectrum-2 as previous patches added the required
functionality.

Note that for now Spectrum-1 and Spectrum-2 use the same function to
determine whether the VXLAN configuration is valid or not. In the
future, when the driver will be extended to support features not present
in Spectrum-1, two different functions will be needed.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agomlxsw: spectrum_nve: Add support for VXLAN on Spectrum-2
Ido Schimmel [Wed, 23 Jan 2019 14:32:57 +0000 (14:32 +0000)] 
mlxsw: spectrum_nve: Add support for VXLAN on Spectrum-2

Spectrum-1 and Spectrum-2 are largely backward compatible with regards
to VXLAN. One difference - as explained in previous patch - is that an
underlay RIF needs to be specified instead of an underlay VR during NVE
initialization. This is accomplished by calling the relevant function
that returns the index of such a RIF based on the table ID
(RT_TABLE_MAIN) where underlay look up occurs.

The second difference is that VXLAN learning (snooping) is controlled
via a different register (TNPC).

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agomlxsw: spectrum_nve: Breakout common code to a common function
Ido Schimmel [Wed, 23 Jan 2019 14:32:56 +0000 (14:32 +0000)] 
mlxsw: spectrum_nve: Breakout common code to a common function

The configuration of a VXLAN tunnel in Spectrum-1 and Spectrum-2 is
largely the same. To avoid code duplication, breakout the common parts
to a common function that can be invoked from the ASIC-specific code.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agomlxsw: spectrum: Expose functions to create and destroy underlay RIF
Ido Schimmel [Wed, 23 Jan 2019 14:32:55 +0000 (14:32 +0000)] 
mlxsw: spectrum: Expose functions to create and destroy underlay RIF

In Spectrum-2, instead of providing the ID of the virtual router (VR)
where NVE underlay lookups will occur as in Spectrum-1, the ID of a
router interface (RIF) in this VR is required.

Expose functions to create and destroy such a RIF.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet/mlx4: Mark expected switch fall-through
Gustavo A. R. Silva [Wed, 23 Jan 2019 08:05:11 +0000 (02:05 -0600)] 
net/mlx4: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/ethernet/mellanox/mlx4/eq.c: In function ‘mlx4_eq_int’:
drivers/net/ethernet/mellanox/mlx4/mlx4.h:219:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
  if (mlx4_debug_level)      \
     ^
drivers/net/ethernet/mellanox/mlx4/eq.c:558:4: note: in expansion of macro ‘mlx4_dbg’
    mlx4_dbg(dev, "%s: MLX4_EVENT_TYPE_SRQ_LIMIT. srq_no=0x%x, eq 0x%x\n",
    ^~~~~~~~
drivers/net/ethernet/mellanox/mlx4/eq.c:561:3: note: here
   case MLX4_EVENT_TYPE_SRQ_CATAS_ERROR:
   ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoqed: Mark expected switch fall-through
Gustavo A. R. Silva [Wed, 23 Jan 2019 07:59:12 +0000 (01:59 -0600)] 
qed: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/ethernet/qlogic/qed/qed_cxt.c:2126:4: warning: this statement may fall through [-Wimplicit-fallthrough=]

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobna: Mark expected switch fall-throughs
Gustavo A. R. Silva [Wed, 23 Jan 2019 07:53:28 +0000 (01:53 -0600)] 
bna: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

This patch fixes the following warnings:

drivers/net/ethernet/brocade/bna/bfa_ioc.c:790:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/net/ethernet/brocade/bna/bfa_ioc.c:860:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Sudarsana Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobroadcom: Mark expected switch fall-throughs
Gustavo A. R. Silva [Wed, 23 Jan 2019 07:41:19 +0000 (01:41 -0600)] 
broadcom: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

This patch fixes the following warnings:

drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:6336:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:2231:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/net/ethernet/broadcom/tg3.c:722:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/net/ethernet/broadcom/tg3.c:783:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Sudarsana Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: 3c509: mark expected switch fall-throughs
Gustavo A. R. Silva [Wed, 23 Jan 2019 07:29:55 +0000 (01:29 -0600)] 
net: 3c509: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

This patch fixes the following warnings:

drivers/net/ethernet/3com/3c509.c:1265:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
drivers/net/ethernet/3com/3c509.c:1271:8: warning: this statement may fall through [-Wimplicit-fallthrough=]

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agotipc: mark expected switch fall-throughs
Gustavo A. R. Silva [Wed, 23 Jan 2019 07:09:31 +0000 (01:09 -0600)] 
tipc: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

This patch fixes the following warnings:

net/tipc/link.c:1125:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
net/tipc/socket.c:736:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
net/tipc/socket.c:2418:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobnx2x: Bump up driver version to 1.713.36
Sudarsana Reddy Kalluru [Tue, 22 Jan 2019 11:05:20 +0000 (03:05 -0800)] 
bnx2x: Bump up driver version to 1.713.36

Recently, there were bunch of fixes to bnx2x driver, the code is now
aligned to out-of-box driver version 1.713.36. This patch updates
bnx2x driver version to 1.713.36.

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agodevlink: Use DIV_ROUND_UP_ULL in DEVLINK_HEALTH_SIZE_TO_BUFFERS
Nathan Chancellor [Tue, 22 Jan 2019 04:23:01 +0000 (21:23 -0700)] 
devlink: Use DIV_ROUND_UP_ULL in DEVLINK_HEALTH_SIZE_TO_BUFFERS

When building this code on a 32-bit platform such as ARM, there is a
link time error (lld error shown, happpens with ld.bfd too):

ld.lld: error: undefined symbol: __aeabi_uldivmod
>>> referenced by devlink.c
>>>               net/core/devlink.o:(devlink_health_buffers_create) in archive built-in.a

This happens when using a regular division symbol with a u64 dividend.
Use DIV_ROUND_UP_ULL, which wraps do_div, to avoid this situation.

Fixes: cb5ccfbe73b3 ("devlink: Add health buffer support")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: phy: Add SDPX tag based on COPYING file
Andrew Lunn [Mon, 21 Jan 2019 18:34:53 +0000 (19:34 +0100)] 
net: phy: Add SDPX tag based on COPYING file

Some of the PHY and MDIO drivers refer to the COPYING file in the main
directory of this archive. This is the main license for Linux, thus
GPLv2 plus syscall extension.

Fixup the MODULE_LICENSE() where needed and add an SDPX header for
GPLv2.

Cc: David Daney <david.daney@cavium.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: phy: Fixup GPLv2 SPDX tags based on license text
Andrew Lunn [Mon, 21 Jan 2019 18:10:19 +0000 (19:10 +0100)] 
net: phy: Fixup GPLv2 SPDX tags based on license text

A few PHY drivers have the GPLv2 license text. They then either have
a MODULE_LICENSE() of GPLv2+, or an SPDX tag of GPLv2+.

Since the license text is much easier to understand than either the
SPDX tag or the MODULE_LICENSE, use it as the definitive source of the
licence, and fixup with others when there are contradictions.

Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Jonas Jensen <jonas.jensen@gmail.com>
Cc: Laurent Pinchart <laurentp@cse-semaphore.com>
Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Cc: Scott Wood <scottwood@freescale.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Andrew F. Davis <afd@ti.com>
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 'SPDX-tags-for-PHY-and-MDIO-drivers'
David S. Miller [Wed, 23 Jan 2019 04:53:08 +0000 (20:53 -0800)] 
Merge branch 'SPDX-tags-for-PHY-and-MDIO-drivers'

Andrew Lunn says:

====================
SPDX tags for PHY and MDIO drivers

This patchset adds SPDX tags to files where the license information is
clear and consistent. It also removes redundent license text when an
SPDX header is present.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: phy: Remove redundent License text when SPDX header is present
Andrew Lunn [Mon, 21 Jan 2019 18:05:51 +0000 (19:05 +0100)] 
net: phy: Remove redundent License text when SPDX header is present

The SPDX header makes any license text redundent. Remove it.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: phy: Convert some PHY and MDIO driver files to SPDX headers
Andrew Lunn [Mon, 21 Jan 2019 18:05:50 +0000 (19:05 +0100)] 
net: phy: Convert some PHY and MDIO driver files to SPDX headers

Where the license text and the MODULE_LICENSE() value agree, convert
to using an SPDX header, removing the license text.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agocxgb4/cxgb4vf: Link management changes
Vishal Kulkarni [Mon, 21 Jan 2019 11:42:11 +0000 (17:12 +0530)] 
cxgb4/cxgb4vf: Link management changes

1) Speed should be supported by Physical Port Capabilities.
2) report Forward Error Correction mode which are available.
3) Added few comments.

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 'selftests-forwarding-Add-tests-for-VXLAN-routing'
David S. Miller [Wed, 23 Jan 2019 04:40:35 +0000 (20:40 -0800)] 
Merge branch 'selftests-forwarding-Add-tests-for-VXLAN-routing'

Ido Schimmel says:

====================
selftests: forwarding: Add tests for VXLAN routing

VXLAN routing allows hosts in different overlay networks (i.e.,
different VNIs) to communicate with one another.

Two popular routing models are asymmetric and symmetric routing.

In asymmetric routing the ingress VTEP routes the packet into the
correct VXLAN tunnel, whereas the egress VTEP only bridges the packet to
the correct host. Therefore, packets in different directions use
different VNIs - the target VNI.

In symmetric routing both the ingress and egress VTEPs perform routing
in the overlay network into / from the VXLAN tunnel. Packets in
different directions use the same VNI - the L3 VNI. Different tenants
(VRFs) use different L3 VNIs.

Patch #1 adds a test for asymmetric routing. Patches #2-#3 reuse the
topology and add test cases for ARP decapsulation and suppression.

Patch #4 adds a test for symmetric routing.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoselftests: forwarding: Add a test case for ARP suppression
Ido Schimmel [Mon, 21 Jan 2019 13:22:54 +0000 (13:22 +0000)] 
selftests: forwarding: Add a test case for ARP suppression

ARP suppression allows the Linux bridge to answer ARP requests on behalf
of remote hosts. It reduces the amount of packets a VTEP needs to flood.

This test verifies that ARP suppression on / off works when a neighbour
exists and when it does not exist. It does so by sending an ARP request
from a host connected to one VTEP and checking whether it was received
by a second VTEP.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoselftests: forwarding: Add a test for VXLAN symmetric routing
Ido Schimmel [Mon, 21 Jan 2019 13:22:54 +0000 (13:22 +0000)] 
selftests: forwarding: Add a test for VXLAN symmetric routing

In a similar fashion to the asymmetric test, add a test for symmetric
routing. In symmetric routing both the ingress and egress VTEPs perform
routing in the overlay network into / from the VXLAN tunnel. Packets in
different directions use the same VNI - the L3 VNI. Different tenants
(VRFs) use different L3 VNIs.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoselftests: forwarding: Add a test case for ARP decapsulation
Ido Schimmel [Mon, 21 Jan 2019 13:22:53 +0000 (13:22 +0000)] 
selftests: forwarding: Add a test case for ARP decapsulation

Verify that ARP packets are correctly decapsulated by the ingress VTEP
by removing the neighbours configured on both VLAN interfaces and
running a ping test.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoselftests: forwarding: Add a test for VXLAN asymmetric routing
Ido Schimmel [Mon, 21 Jan 2019 13:22:52 +0000 (13:22 +0000)] 
selftests: forwarding: Add a test for VXLAN asymmetric routing

In asymmetric routing the ingress VTEP routes the packet into the
correct VXLAN tunnel, whereas the egress VTEP only bridges the packet to
the correct host. Therefore, packets in different directions use
different VNIs - the target VNI.

The test uses a simple topology with two VTEPs and two VNIs and verifies
that ping passes between hosts (local / remote) in the same VLAN (VNI)
and in different VLANs belonging to the same tenant (VRF).

While the test does not check VM mobility, it does configure an anycast
gateway using a macvlan device on both VTEPs.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 'ptp_qoriq'
David S. Miller [Wed, 23 Jan 2019 04:21:58 +0000 (20:21 -0800)] 
Merge branch 'ptp_qoriq'

Yangbo Lu says:

====================
External trigger stamp fifo support for ptp_qoriq

This patch-set is to add external trigger stamp fifo support by a new
binding "fsl,extts-fifo", and to add fiper pulse loopback support which
is very useful for validating trigger without external hardware.
Also fixed issues in interrupt enabling/handling.

"fsl,extts-fifo" is required to be added into 1588 timer dts node whose
hardware supports it. The work will be done for some QorIQ platforms dts in
the near future.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMAINTAINERS: add drivers/ptp/ptp_qoriq_debugfs.c into QorIQ PTP list
Yangbo Lu [Mon, 21 Jan 2019 10:41:43 +0000 (18:41 +0800)] 
MAINTAINERS: add drivers/ptp/ptp_qoriq_debugfs.c into QorIQ PTP list

Added drivers/ptp/ptp_qoriq_debugfs.c into QorIQ PTP clock driver list.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoptp: add debugfs support for ptp_qoriq
Yangbo Lu [Mon, 21 Jan 2019 10:41:42 +0000 (18:41 +0800)] 
ptp: add debugfs support for ptp_qoriq

This patch is to add debugfs support for ptp_qoriq. Current debugfs
supports to control fiper1/fiper2 loopback mode. If the loopback mode
is enabled, the fiper1/fiper2 pulse is looped back into trigger1/
trigger2 input. This is very useful for validating hardware and driver
without external hardware. Below is an example to enable fiper1 loopback.

echo 1 > /sys/kernel/debug/2d10e00.ptp_clock/fiper1-loopback

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoARM: dts: ls1021a: add 1588 external trigger stamp fifo support
Yangbo Lu [Mon, 21 Jan 2019 10:41:41 +0000 (18:41 +0800)] 
ARM: dts: ls1021a: add 1588 external trigger stamp fifo support

This patch is to add external trigger stamp fifo support
for 1588 timer.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agodt-binding: ptp_qoriq: document "fsl,extts-fifo" property
Yangbo Lu [Mon, 21 Jan 2019 10:41:40 +0000 (18:41 +0800)] 
dt-binding: ptp_qoriq: document "fsl,extts-fifo" property

Documented "fsl,extts-fifo" property.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoptp_qoriq: support external trigger stamp FIFO
Yangbo Lu [Mon, 21 Jan 2019 10:41:39 +0000 (18:41 +0800)] 
ptp_qoriq: support external trigger stamp FIFO

The external trigger stamp FIFO was introduced as a new feature
for QorIQ 1588 timer IP block. This patch is to support it by
adding a new dts property "fsl,extts-fifo". Any QorIQ 1588 timer
supporting this feature is required to add this property in its
dts node.

In addition, the FIFO should be cleaned up before enabling external
trigger interrupts. Otherwise, there will be interrupts immediately
just after enabling external trigger interrupts.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoptp_qoriq: fix interrupt enabling and handling
Yangbo Lu [Mon, 21 Jan 2019 10:41:38 +0000 (18:41 +0800)] 
ptp_qoriq: fix interrupt enabling and handling

The tmr_tevent register would update event bits
no matter tmr_temask bits were set or not. So we
should get interrupts by tmr_tevent & tmr_temask,
and clean up interrupts in tmr_tevent before
enabling them.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agodevlink: Add missing check of nlmsg_put
YueHaibing [Mon, 21 Jan 2019 09:34:53 +0000 (09:34 +0000)] 
devlink: Add missing check of nlmsg_put

nlmsg_put may fail, this fix add a check of its return value.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 'Qualcomm-ethqos'
David S. Miller [Wed, 23 Jan 2019 03:38:00 +0000 (19:38 -0800)] 
Merge branch 'Qualcomm-ethqos'

Vinod Koul says:

====================
net: Add support for Qualcomm ethqos

Some Qualcomm SoCs sport a ethqos controller which use DW ip, so add
the glue driver which uses stmmac driver along with DT bindings for
this device.

This controller supports rgmii mode and doesn't work with existing
phy drivers as they do not remove the phy delay delay in this mode,
so fix the two phy drivers tested with this.

Changes in v3:
 - Add description in DT and rename the file and compatible as suggested by
   Rob
 - Update changelog for QCA8K driver
 - Update AT803x phy disable delay for all RGMxx modes

Changes in v2:
 - Fix the example in dt-binding
 - Remove DT property for disable the delay and disable delay for RGMII mode
   in AT803x and QCA8K PHY drivers
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: dsa: qca8k: disable delay for RGMII mode
Vinod Koul [Mon, 21 Jan 2019 09:13:18 +0000 (14:43 +0530)] 
net: dsa: qca8k: disable delay for RGMII mode

In RGMII mode we should not have any delay in port MAC, so disable
the delay.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: phy: at803x: Disable phy delay for RGMII mode
Vinod Koul [Mon, 21 Jan 2019 09:13:17 +0000 (14:43 +0530)] 
net: phy: at803x: Disable phy delay for RGMII mode

For RGMII mode, phy delay should be disabled. Add this case along
with disable delay routines.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMAINTAINER: Add entry for Qualcomm ETHQOS ethernet driver
Vinod Koul [Mon, 21 Jan 2019 09:13:16 +0000 (14:43 +0530)] 
MAINTAINER: Add entry for Qualcomm ETHQOS ethernet driver

Add myself and Niklas as maintainers for this driver

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: stmmac: Add driver for Qualcomm ethqos
Vinod Koul [Mon, 21 Jan 2019 09:13:15 +0000 (14:43 +0530)] 
net: stmmac: Add driver for Qualcomm ethqos

Add glue driver to support Qualcomm ETHQOS using stmmac driver.

This is based on downstream driver written by Siddarth Gupta, Sunil
Kumar Paidimarri, Rahul Ankushrao Kawadgave, Nisha Menon, Jagadeesh
Babu Challagundla, Chaitanya Pratapa, Lakshit Tyagi, Suraj Jaiswal,
Sneh Shah and Ventrapragada Ravi Kanth

Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agodt-bindings: net: Add Qualcomm ethqos binding
Vinod Koul [Mon, 21 Jan 2019 09:13:14 +0000 (14:43 +0530)] 
dt-bindings: net: Add Qualcomm ethqos binding

Add support for Qualcomm ethqos found in some SoCs like QCS404.

Signed-off-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: stmmac: implement the SIOCGHWTSTAMP ioctl
Artem Panfilov [Sun, 20 Jan 2019 16:05:15 +0000 (19:05 +0300)] 
net: stmmac: implement the SIOCGHWTSTAMP ioctl

This patch adds support for the SIOCGHWTSTAMP ioctl which enables user
processes to read the current hwtstamp_config settings
non-destructively.

Signed-off-by: Artem Panfilov <panfilov.artyom@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 'bridge-mrd'
David S. Miller [Wed, 23 Jan 2019 01:18:09 +0000 (17:18 -0800)] 
Merge branch 'bridge-mrd'

Linus Lüssing says:

====================
bridge: implement Multicast Router Discovery (RFC4286)

This patchset adds initial Multicast Router Discovery support to
the Linux bridge (RFC4286). With MRD it is possible to detect multicast
routers and mark bridge ports and forward multicast packets to such routers
accordingly.

So far, multicast routers are detected via IGMP/MLD queries and PIM
messages in the Linux bridge. As there is only one active, selected
querier at a time RFC4541 ("Considerations for Internet Group Management
Protocol (IGMP) and Multicast Listener Discovery (MLD) Snooping
Switches") section 2.1.1.a) recommends snooping Multicast Router
Advertisements as provided by MRD (RFC4286).

The first two patches are refactoring some existing code which is reused
for parsing the Multicast Router Advertisements later in the fourth
patch. The third patch lets the bridge join the all-snoopers multicast
address to be able to reliably receive the Multicast Router
Advertisements.

What is not implemented yet from RFC4286 yet:

* Sending Multicast Router Solicitations:
  -> RFC4286: "[...] may be sent when [...] an interface is
     (re-)initialized [or] MRD is enabled"
* Snooping Multicast Router Terminations:
  -> currently this only relies on our own timeouts
* Adjusting timeouts with the values provided in the announcements

Changes in v2:

* rebased to current net-next/master (no conflicts/changes)
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobridge: Snoop Multicast Router Advertisements
Linus Lüssing [Mon, 21 Jan 2019 06:26:28 +0000 (07:26 +0100)] 
bridge: Snoop Multicast Router Advertisements

When multiple multicast routers are present in a broadcast domain then
only one of them will be detectable via IGMP/MLD query snooping. The
multicast router with the lowest IP address will become the selected and
active querier while all other multicast routers will then refrain from
sending queries.

To detect such rather silent multicast routers, too, RFC4286
("Multicast Router Discovery") provides a standardized protocol to
detect multicast routers for multicast snooping switches.

This patch implements the necessary MRD Advertisement message parsing
and after successful processing adds such routers to the internal
multicast router list.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobridge: join all-snoopers multicast address
Linus Lüssing [Mon, 21 Jan 2019 06:26:27 +0000 (07:26 +0100)] 
bridge: join all-snoopers multicast address

Next to snooping IGMP/MLD queries RFC4541, section 2.1.1.a) recommends
to snoop multicast router advertisements to detect multicast routers.

Multicast router advertisements are sent to an "all-snoopers"
multicast address. To be able to receive them reliably, we need to
join this group.

Otherwise other snooping switches might refrain from forwarding these
advertisements to us.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobridge: simplify ip_mc_check_igmp() and ipv6_mc_check_mld() internals
Linus Lüssing [Mon, 21 Jan 2019 06:26:26 +0000 (07:26 +0100)] 
bridge: simplify ip_mc_check_igmp() and ipv6_mc_check_mld() internals

With this patch the internal use of the skb_trimmed is reduced to
the ICMPv6/IGMP checksum verification. And for the length checks
the newly introduced helper functions are used instead of calculating
and checking with skb->len directly.

These changes should hopefully make it easier to verify that length
checks are performed properly.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobridge: simplify ip_mc_check_igmp() and ipv6_mc_check_mld() calls
Linus Lüssing [Mon, 21 Jan 2019 06:26:25 +0000 (07:26 +0100)] 
bridge: simplify ip_mc_check_igmp() and ipv6_mc_check_mld() calls

This patch refactors ip_mc_check_igmp(), ipv6_mc_check_mld() and
their callers (more precisely, the Linux bridge) to not rely on
the skb_trimmed parameter anymore.

An skb with its tail trimmed to the IP packet length was initially
introduced for the following three reasons:

1) To be able to verify the ICMPv6 checksum.
2) To be able to distinguish the version of an IGMP or MLD query.
   They are distinguishable only by their size.
3) To avoid parsing data for an IGMPv3 or MLDv2 report that is
   beyond the IP packet but still within the skb.

The first case still uses a cloned and potentially trimmed skb to
verfiy. However, there is no need to propagate it to the caller.
For the second and third case explicit IP packet length checks were
added.

This hopefully makes ip_mc_check_igmp() and ipv6_mc_check_mld() easier
to read and verfiy, as well as easier to use.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agohinic: Add pci device ids
Xue Chaojing [Sun, 20 Jan 2019 22:15:46 +0000 (22:15 +0000)] 
hinic: Add pci device ids

This patch adds PCI device IDs to support following cards:

1. Add device id 0x0205 for HINIC 100GE dual port mezz card.
2. Add device id 0x0210 for HINIC 25GE quad port mezz card.
3. Delete device id 0x0201 for HINIC 100GE dual port card, because
this is used by other product.
4. Macro of device id 0x200 is modified for HINIC 100GE dual port card.

Signed-off-by: Xue Chaojing <xuechaojing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agor8169: remove PCI DAC support
Heiner Kallweit [Sun, 20 Jan 2019 10:45:20 +0000 (11:45 +0100)] 
r8169: remove PCI DAC support

The old non-PCIe chip versions support PCI DAC, however this feature
seems to be fragile, see comment in the PCI error handler. Therefore
it's disabled per default. I think meanwhile it's time remove support
for this legacy feature. This helps to reduce complexity of the driver.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agor8169: improve rx buffer allocation
Heiner Kallweit [Sun, 20 Jan 2019 10:12:01 +0000 (11:12 +0100)] 
r8169: improve rx buffer allocation

8 years ago, as part of 6f0333b8fde4 ("r8169: use 50% less ram for RX
ring"), the alignment requirement for rx buffers was silently changed
from 8 bytes to 16 bytes. I found nothing explaining this, also the
chip specs I have only mention an 8 byte requirement.
AFAICS kmalloc_node() guarantees allocated memory to be at least
"long long" aligned, what is 8 bytes on a 32 bit machine.
So we can take this memory as-is and avoid some overhead by changing
the alignment requirement back to 8 bytes.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: phy: improve phy_init_hw
Heiner Kallweit [Sat, 19 Jan 2019 09:43:07 +0000 (10:43 +0100)] 
net: phy: improve phy_init_hw

Currently the soft reset (if defined) is done only if the driver also
implements the config_init callback. I think this dependency is a
mistake, so let's remove it.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: phy: fix issue with loading PHY driver w/o initramfs
Heiner Kallweit [Sat, 19 Jan 2019 09:30:21 +0000 (10:30 +0100)] 
net: phy: fix issue with loading PHY driver w/o initramfs

It was reported that on a system with nfsboot and w/o initramfs network
fails because trying to load the PHY driver returns -ENOENT. Reason was
that due to missing initramfs the modprobe binary isn't available.
So we have to ignore error code -ENOENT.

Fixes: 13d0ab6750b2 ("net: phy: check return code when requesting PHY driver module")
Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Tested-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Tue, 22 Jan 2019 22:32:58 +0000 (14:32 -0800)] 
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2019-01-22

This series contains updates to i40e and xsk.

Jan exports xdp_get_umem_from_qid() for other drivers/modules to use.
Refactored the code use the netdev provided umems, instead of containing
them inside our i40e_vsi.

Aleksandr fixes an issue where RSS queues were misconfigured, so limit
the RSS queue number to the online CPU number.

Damian adds support for ethtool's setting and getting the FEC
configuration.

Grzegorz fixes a type mismatch, where the return value was not matching
the function declaration.

Sergey adds checks in the queue configuration handler to ensure the
number of queue pairs requested by the VF is less than maximum possible.

Lihong cleans up code left around from earlier silicon validation in the
i40e debugfs code.

Julia Lawall and Colin Ian King clean up white space indentation issues
found.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoMerge branch 'bonding-add-3ad-stats-and-export-them-via-xstats'
David S. Miller [Tue, 22 Jan 2019 20:04:15 +0000 (12:04 -0800)] 
Merge branch 'bonding-add-3ad-stats-and-export-them-via-xstats'

Nikolay Aleksandrov says:

====================
bonding: add 3ad stats and export them via xstats

This set adds support for counting some 3ad-specific packet types and
exports the new stats via the xstats API. atomic64 counters are used
since these are not fastpaths and we can avoid the per-cpu allocations.
Each 3ad counter is exported as a separate attribute to be easily
extensible since we plan to add more later. The stats are per-slave and
when the master stats are requested the slaves' stats are summed up.
Patches 01 and 02 do minor cleanups in preparation for the new stats
API. Patch 03 adds the new stats and patch 04 adds xstats support to
export them.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobonding: add support for xstats and export 3ad stats
Nikolay Aleksandrov [Fri, 18 Jan 2019 12:30:23 +0000 (14:30 +0200)] 
bonding: add support for xstats and export 3ad stats

This patch adds support for extended statistics (xstats) call to the
bonding. The first user would be the 3ad code which counts the following
events:
 - LACPDU Rx/Tx
 - LACPDU unknown type Rx
 - LACPDU illegal Rx
 - Marker Rx/Tx
 - Marker response Rx/Tx
 - Marker unknown type Rx

All of these are exported via netlink as separate attributes to be
easily extensible as we plan to add more in the future.
Similar to how the bridge and other xstats exports, the structure
inside is:
 [ IFLA_STATS_LINK_XSTATS ]
   -> [ LINK_XSTATS_TYPE_BOND ]
        -> [ BOND_XSTATS_3AD ]
             -> [ 3ad stats attributes ]

With this structure it's easy to add more stat types later.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobonding: add 3ad stats
Nikolay Aleksandrov [Fri, 18 Jan 2019 12:30:22 +0000 (14:30 +0200)] 
bonding: add 3ad stats

Count the following types of 3ad packets per slave:
 - rx/tx lacpdu
 - rx/tx marker
 - rx/tx marker response
 - rx illegal lacpdus (right now counted on wrong length)
 - rx unknown lacpdu type
 - rx unknown marker type

The counters are using atomic64 since this is not fast path.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobonding: 3ad: remove bond_3ad_rx_indication's length argument
Nikolay Aleksandrov [Fri, 18 Jan 2019 12:30:21 +0000 (14:30 +0200)] 
bonding: 3ad: remove bond_3ad_rx_indication's length argument

Since the received lacpdu is accessed via skb_header_pointer() in
bond_3ad_lacpdu_recv() we no longer need to check for skb->len's length.
If the returned lacpdu pointer is not null that should be enough.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agobonding: adjust style of bond_3ad_rx_indication
Nikolay Aleksandrov [Fri, 18 Jan 2019 12:30:20 +0000 (14:30 +0200)] 
bonding: adjust style of bond_3ad_rx_indication

No functional changes, adjust the style of bond_3ad_rx_indication to
prepare it for the stats changes:
 - reduce indentation by returning early on wrong length
 - remove extra new lines between switch cases
 - add marker local variable and use it to reduce line length
 - rearrange local variables in reverse xmas tree
 - separate final return

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agocxgb4: TLS record offload enable
Atul Gupta [Fri, 18 Jan 2019 04:56:39 +0000 (20:56 -0800)] 
cxgb4: TLS record offload enable

Enable Inline TLS record by default

Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet/tls: free ctx in sock destruct
Atul Gupta [Fri, 18 Jan 2019 04:56:21 +0000 (20:56 -0800)] 
net/tls: free ctx in sock destruct

free tls context in sock destruct. close may not be the last
call to free sock but force releasing the ctx in close
will result in GPF when ctx referred again in tcp_done

[  515.330477] general protection fault: 0000 [#1] SMP PTI
[  515.330539] CPU: 5 PID: 0 Comm: swapper/5 Not tainted 4.20.0-rc7+ #10
[  515.330657] Hardware name: Supermicro X8ST3/X8ST3, BIOS 2.0b
11/07/2013
[  515.330844] RIP: 0010:tls_hw_unhash+0xbf/0xd0
[
[  515.332220] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  515.332340] CR2: 00007fab32c55000 CR3: 000000009261e000 CR4:
00000000000006e0
[  515.332519] Call Trace:
[  515.332632]  <IRQ>
[  515.332793]  tcp_set_state+0x5a/0x190
[  515.332907]  ? tcp_update_metrics+0xe3/0x350
[  515.333023]  tcp_done+0x31/0xd0
[  515.333130]  tcp_rcv_state_process+0xc27/0x111a
[  515.333242]  ? __lock_is_held+0x4f/0x90
[  515.333350]  ? tcp_v4_do_rcv+0xaf/0x1e0
[  515.333456]  tcp_v4_do_rcv+0xaf/0x1e0

Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet/tls: build_protos moved to common routine
Atul Gupta [Fri, 18 Jan 2019 04:55:53 +0000 (20:55 -0800)] 
net/tls: build_protos moved to common routine

build protos is required for tls_hw_prot also hence moved to
'tls_build_proto' and called as required from tls_init
and tls_hw_proto. This is required since build_protos
for v4 is moved from tls_register to tls_init in
commit <28cb6f1eaffdc5a6a9707cac55f4a43aa3fd7895>

Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agonet: introduce a knob to control whether to inherit devconf config
Cong Wang [Fri, 18 Jan 2019 07:27:11 +0000 (23:27 -0800)] 
net: introduce a knob to control whether to inherit devconf config

There have been many people complaining about the inconsistent
behaviors of IPv4 and IPv6 devconf when creating new network
namespaces.  Currently, for IPv4, we inherit all current settings
from init_net, but for IPv6 we reset all setting to default.

This patch introduces a new /proc file
/proc/sys/net/core/devconf_inherit_init_net to control the
behavior of whether to inhert sysctl current settings from init_net.
This file itself is only available in init_net.

As demonstrated below:

Initial setup in init_net:
 # cat /proc/sys/net/ipv4/conf/all/rp_filter
 2
 # cat /proc/sys/net/ipv6/conf/all/accept_dad
 1

Default value 0 (current behavior):
 # ip netns del test
 # ip netns add test
 # ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
 2
 # ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
 0

Set to 1 (inherit from init_net):
 # echo 1 > /proc/sys/net/core/devconf_inherit_init_net
 # ip netns del test
 # ip netns add test
 # ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
 2
 # ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
 1

Set to 2 (reset to default):
 # echo 2 > /proc/sys/net/core/devconf_inherit_init_net
 # ip netns del test
 # ip netns add test
 # ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
 0
 # ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
 0

Set to a value out of range (invalid):
 # echo 3 > /proc/sys/net/core/devconf_inherit_init_net
 -bash: echo: write error: Invalid argument
 # echo -1 > /proc/sys/net/core/devconf_inherit_init_net
 -bash: echo: write error: Invalid argument

Reported-by: Zhu Yanjun <Yanjun.Zhu@windriver.com>
Reported-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoi40e: clean up several indentation issues
Colin Ian King [Mon, 7 Jan 2019 22:59:28 +0000 (22:59 +0000)] 
i40e: clean up several indentation issues

There are several statements that have incorrect levels of indentation,
fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5 years agoi40e: increase indentation
Julia Lawall [Sun, 30 Dec 2018 15:53:10 +0000 (16:53 +0100)] 
i40e: increase indentation

Convert spaces to tabs to get correct alignment.

Found with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5 years agoi40e: update version number
Alice Michael [Wed, 19 Dec 2018 14:45:42 +0000 (06:45 -0800)] 
i40e: update version number

Signed-off-by: Alice Michael <alice.michael@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5 years agoi40e: remove debugfs tx_timeout support
Lihong Yang [Wed, 19 Dec 2018 14:45:41 +0000 (06:45 -0800)] 
i40e: remove debugfs tx_timeout support

The tx_timeout command from debugfs was originally intended to support
early silicon validation efforts. It is no longer needed. Thus remove it to
avoid misuse of triggering tx_timeout through debugfs.

Signed-off-by: Lihong Yang <lihong.yang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5 years agoi40e: check queue pairs num in config queues handler
Sergey Nemov [Wed, 19 Dec 2018 14:45:40 +0000 (06:45 -0800)] 
i40e: check queue pairs num in config queues handler

Check if num_queue_pairs number requested by VF is less than
maximum possible value in VIRTCHNL_OP_CONFIG_VSI_QUEUES handler.

Also check if local_vf_id >= 0 in common handler since it is of
int type and can potentially be negative.

Signed-off-by: Sergey Nemov <sergey.nemov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5 years agoi40e: Change unmatched function types
Grzegorz Siwik [Wed, 19 Dec 2018 14:45:39 +0000 (06:45 -0800)] 
i40e: Change unmatched function types

Change of function declaration from int to u64 due to
return type mismatch (u64).

Signed-off-by: Grzegorz Siwik <grzegorz.siwik@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5 years agoi40e: Add support FEC configuration for Fortville 25G
Damian Dybek [Wed, 19 Dec 2018 14:45:38 +0000 (06:45 -0800)] 
i40e: Add support FEC configuration for Fortville 25G

This patch adds support for setting/getting FEC configuration
using ethtool options:
       set/show-priv-flags rs-fec/base-r-fec
       set/show-fec off/rs/baser/auto for kernels version >= 4.14

Signed-off-by: Damian Dybek <damian.dybek@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5 years agoi40e: Limiting RSS queues to CPUs
Aleksandr Loktionov [Wed, 19 Dec 2018 14:45:37 +0000 (06:45 -0800)] 
i40e: Limiting RSS queues to CPUs

Limiting RSS queues number to online CPUs number in order to
avoid issues with creating misconfigured RSS queues.

Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5 years agoi40e: Remove umem from VSI
Jan Sokolowski [Tue, 18 Dec 2018 13:45:14 +0000 (13:45 +0000)] 
i40e: Remove umem from VSI

As current implementation of netdev already contains and provides
umems for us, we no longer have the need to contain these
structures in i40e_vsi.

Refactor the code to operate on netdev-provided umems.

Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5 years agoxsk: export xdp_get_umem_from_qid
Jan Sokolowski [Tue, 18 Dec 2018 13:45:13 +0000 (13:45 +0000)] 
xsk: export xdp_get_umem_from_qid

Export xdp_get_umem_from_qid for other modules to use.

Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
5 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
David S. Miller [Mon, 21 Jan 2019 22:41:32 +0000 (14:41 -0800)] 
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Completely minor snmp doc conflict.

Signed-off-by: David S. Miller <davem@davemloft.net>
5 years agoLinux 5.0-rc3 v5.0-rc3
Linus Torvalds [Mon, 21 Jan 2019 00:14:44 +0000 (13:14 +1300)] 
Linux 5.0-rc3

5 years agoMerge tag 'pstore-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees...
Linus Torvalds [Mon, 21 Jan 2019 00:12:03 +0000 (13:12 +1300)] 
Merge tag 'pstore-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull pstore fixes from Kees Cook:

 - Fix console ramoops to show the previous boot logs (Sai Prakash
   Ranjan)

 - Avoid allocation and leak of platform data

* tag 'pstore-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  pstore/ram: Avoid allocation and leak of platform data
  pstore/ram: Fix console ramoops to show the previous boot logs

5 years agoMerge tag 'gcc-plugins-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 21 Jan 2019 00:07:03 +0000 (13:07 +1300)] 
Merge tag 'gcc-plugins-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull gcc-plugins fixes from Kees Cook:
 "Fix ARM per-task stack protector plugin under GCC 9 (Ard Biesheuvel)"

* tag 'gcc-plugins-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  gcc-plugins: arm_ssp_per_task_plugin: fix for GCC 9+
  gcc-plugins: arm_ssp_per_task_plugin: sign extend the SP mask

5 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Sun, 20 Jan 2019 23:52:31 +0000 (12:52 +1300)] 
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) Fix endless loop in nf_tables, from Phil Sutter.

 2) Fix cross namespace ip6_gre tunnel hash list corruption, from
    Olivier Matz.

 3) Don't be too strict in phy_start_aneg() otherwise we might not allow
    restarting auto negotiation. From Heiner Kallweit.

 4) Fix various KMSAN uninitialized value cases in tipc, from Ying Xue.

 5) Memory leak in act_tunnel_key, from Davide Caratti.

 6) Handle chip errata of mv88e6390 PHY, from Andrew Lunn.

 7) Remove linear SKB assumption in fou/fou6, from Eric Dumazet.

 8) Missing udplite rehash callbacks, from Alexey Kodanev.

 9) Log dirty pages properly in vhost, from Jason Wang.

10) Use consume_skb() in neigh_probe() as this is a normal free not a
    drop, from Yang Wei. Likewise in macvlan_process_broadcast().

11) Missing device_del() in mdiobus_register() error paths, from Thomas
    Petazzoni.

12) Fix checksum handling of short packets in mlx5, from Cong Wang.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (96 commits)
  bpf: in __bpf_redirect_no_mac pull mac only if present
  virtio_net: bulk free tx skbs
  net: phy: phy driver features are mandatory
  isdn: avm: Fix string plus integer warning from Clang
  net/mlx5e: Fix cb_ident duplicate in indirect block register
  net/mlx5e: Fix wrong (zero) TX drop counter indication for representor
  net/mlx5e: Fix wrong error code return on FEC query failure
  net/mlx5e: Force CHECKSUM_UNNECESSARY for short ethernet frames
  tools: bpftool: Cleanup license mess
  bpf: fix inner map masking to prevent oob under speculation
  bpf: pull in pkt_sched.h header for tooling to fix bpftool build
  selftests: forwarding: Add a test case for externally learned FDB entries
  selftests: mlxsw: Test FDB offload indication
  mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky
  net: bridge: Mark FDB entries that were added by user as such
  mlxsw: spectrum_fid: Update dummy FID index
  mlxsw: pci: Return error on PCI reset timeout
  mlxsw: pci: Increase PCI SW reset timeout
  mlxsw: pci: Ring CQ's doorbell before RDQ's
  MAINTAINERS: update email addresses of liquidio driver maintainers
  ...

5 years agopstore/ram: Avoid allocation and leak of platform data
Kees Cook [Sun, 20 Jan 2019 22:33:34 +0000 (14:33 -0800)] 
pstore/ram: Avoid allocation and leak of platform data

Yue Hu noticed that when parsing device tree the allocated platform data
was never freed. Since it's not used beyond the function scope, this
switches to using a stack variable instead.

Reported-by: Yue Hu <huyue2@yulong.com>
Fixes: 35da60941e44 ("pstore/ram: add Device Tree bindings")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
5 years agogcc-plugins: arm_ssp_per_task_plugin: fix for GCC 9+
Ard Biesheuvel [Fri, 18 Jan 2019 10:58:07 +0000 (11:58 +0100)] 
gcc-plugins: arm_ssp_per_task_plugin: fix for GCC 9+

GCC 9 reworks the way the references to the stack canary are
emitted, to prevent the value from being spilled to the stack
before the final comparison in the epilogue, defeating the
purpose, given that the spill slot is under control of the
attacker that we are protecting ourselves from.

Since our canary value address is obtained without accessing
memory (as opposed to pre-v7 code that will obtain it from a
literal pool), it is unlikely (although not guaranteed) that
the compiler will spill the canary value in the same way, so
let's just disable this improvement when building with GCC9+.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
5 years agogcc-plugins: arm_ssp_per_task_plugin: sign extend the SP mask
Ard Biesheuvel [Fri, 18 Jan 2019 10:58:06 +0000 (11:58 +0100)] 
gcc-plugins: arm_ssp_per_task_plugin: sign extend the SP mask

The ARM per-task stack protector GCC plugin hits an assert in
the compiler in some case, due to the fact the the SP mask
expression is not sign-extended as it should be. So fix that.

Suggested-by: Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Kees Cook <keescook@chromium.org>