platform/kernel/linux-rpi.git
4 years agonet: macsec: introduce MACsec ops
Antoine Tenart [Mon, 13 Jan 2020 22:31:41 +0000 (23:31 +0100)]
net: macsec: introduce MACsec ops

This patch introduces MACsec ops for drivers to support offloading
MACsec operations.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: macsec: introduce the macsec_context structure
Antoine Tenart [Mon, 13 Jan 2020 22:31:40 +0000 (23:31 +0100)]
net: macsec: introduce the macsec_context structure

This patch introduces the macsec_context structure. It will be used
in the kernel to exchange information between the common MACsec
implementation (macsec.c) and the MACsec hardware offloading
implementations. This structure contains pointers to MACsec specific
structures which contain the actual MACsec configuration, and to the
underlying device (phydev for now).

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: macsec: move some definitions in a dedicated header
Antoine Tenart [Mon, 13 Jan 2020 22:31:39 +0000 (23:31 +0100)]
net: macsec: move some definitions in a dedicated header

This patch moves some structure, type and identifier definitions into a
MACsec specific header. This patch does not modify how the MACsec code
is running and only move things around. This is a preparation for the
future MACsec hardware offloading support, which will re-use those
definitions outside macsec.c.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'netns-Optimise-netns-ID-lookups'
David S. Miller [Tue, 14 Jan 2020 19:28:41 +0000 (11:28 -0800)]
Merge branch 'netns-Optimise-netns-ID-lookups'

Guillaume Nault says:

====================
netns: Optimise netns ID lookups

Netns ID lookups can be easily protected by RCU, rather than by holding
a spinlock.

Patch 1 prepares the code, patch 2 does the RCU conversion, and finally
patch 3 stops disabling BHs on updates (patch 2 makes that unnecessary).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonetns: don't disable BHs when locking "nsid_lock"
Guillaume Nault [Mon, 13 Jan 2020 21:39:23 +0000 (22:39 +0100)]
netns: don't disable BHs when locking "nsid_lock"

When peernet2id() had to lock "nsid_lock" before iterating through the
nsid table, we had to disable BHs, because VXLAN can call peernet2id()
from the xmit path:
  vxlan_xmit() -> vxlan_fdb_miss() -> vxlan_fdb_notify()
    -> __vxlan_fdb_notify() -> vxlan_fdb_info() -> peernet2id().

Now that peernet2id() uses RCU protection, "nsid_lock" isn't used in BH
context anymore. Therefore, we can safely use plain
spin_lock()/spin_unlock() and let BHs run when holding "nsid_lock".

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonetns: protect netns ID lookups with RCU
Guillaume Nault [Mon, 13 Jan 2020 21:39:22 +0000 (22:39 +0100)]
netns: protect netns ID lookups with RCU

__peernet2id() can be protected by RCU as it only calls idr_for_each(),
which is RCU-safe, and never modifies the nsid table.

rtnl_net_dumpid() can also do lockless lookups. It does two nested
idr_for_each() calls on nsid tables (one direct call and one indirect
call because of rtnl_net_dumpid_one() calling __peernet2id()). The
netnsid tables are never updated. Therefore it is safe to not take the
nsid_lock and run within an RCU-critical section instead.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonetns: Remove __peernet2id_alloc()
Guillaume Nault [Mon, 13 Jan 2020 21:39:20 +0000 (22:39 +0100)]
netns: Remove __peernet2id_alloc()

__peernet2id_alloc() was used for both plain lookups and for netns ID
allocations (depending the value of '*alloc'). Let's separate lookups
from allocations instead. That is, integrate the lookup code into
__peernet2id() and make peernet2id_alloc() responsible for allocating
new netns IDs when necessary.

This makes it clear that __peernet2id() doesn't modify the idr and
prepares the code for lockless lookups.

Also, mark the 'net' argument of __peernet2id() as 'const', since we're
modifying this line.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomdio_bus: Simplify reset handling and extend to non-DT systems
Geert Uytterhoeven [Mon, 13 Jan 2020 13:05:29 +0000 (14:05 +0100)]
mdio_bus: Simplify reset handling and extend to non-DT systems

Convert mdiobus_register_reset() from open-coded DT-only optional reset
handling to reset_control_get_optional_exclusive().  This not only
simplifies the code, but also adds support for lookup-based resets on
non-DT systems.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: phy: Added IRQ print to phylink_bringup_phy()
Florian Fainelli [Sun, 12 Jan 2020 17:35:38 +0000 (09:35 -0800)]
net: phy: Added IRQ print to phylink_bringup_phy()

The information about the PHY attached to the PHYLINK instance is useful
but is missing the IRQ prints that phy_attached_info() adds.
phy_attached_info() is a bit long and it would not be possible to use
phylink_info() anyway.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'stmmac-ETF-support'
Jakub Kicinski [Tue, 14 Jan 2020 02:32:31 +0000 (18:32 -0800)]
Merge branch 'stmmac-ETF-support'

Jose Abreu says:

====================
net: stmmac: ETF support

This series adds the support for ETF scheduler in stmmac.

1) Starts adding the support by implementing Enhanced Descriptors in stmmac
main core. This is needed for ETF feature in XGMAC and QoS cores.

2) Integrates the ETF logic into stmmac TC core.

3) and 4) adds the HW specific support for ETF in XGMAC and QoS cores. The
IP feature is called TBS (Time Based Scheduling).

5) Enables ETF in GMAC5 IPK PCI entry for all Queues except Queue 0.

6) Adds the new TBS feature and even more information into the debugFS
HW features file.
====================

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: stmmac: selftests: Add a test for TBS feature
Jose Abreu [Mon, 13 Jan 2020 16:24:16 +0000 (17:24 +0100)]
net: stmmac: selftests: Add a test for TBS feature

Add a new test for TBS feature which is used in ETF scheduler. In this
test, we send a packet with a launch time specified as now + 500ms and
check if the packet was transmitted on that time frame.

Changes from v2:
- Use the TBS bitfield
- Remove debug message

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: stmmac: selftests: Switch to dev_direct_xmit()
Jose Abreu [Mon, 13 Jan 2020 16:24:15 +0000 (17:24 +0100)]
net: stmmac: selftests: Switch to dev_direct_xmit()

In the upcoming commit for TBS selftest we will need to send a packet on
a specific Queue. As stmmac fallsback to netdev_pick_tx() on the select
Queue callback, we need to switch all selftests logic to
dev_direct_xmit() so that we can send the given SKB on a specific Queue.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: stmmac: Add missing information in DebugFS capabilities file
Jose Abreu [Mon, 13 Jan 2020 16:24:14 +0000 (17:24 +0100)]
net: stmmac: Add missing information in DebugFS capabilities file

Adds more information regarding HW Capabilities in the corresponding
DebugFS file.

Changes from v2:
- Remove the TX/RX queues in use (Jakub)

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: stmmac: pci: Enable TBS on GMAC5 IPK PCI entry
Jose Abreu [Mon, 13 Jan 2020 16:24:13 +0000 (17:24 +0100)]
net: stmmac: pci: Enable TBS on GMAC5 IPK PCI entry

Enable TBS support on GMAC5 PCI entry for all Queues except Queue 0.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: stmmac: gmac4+: Add TBS support
Jose Abreu [Mon, 13 Jan 2020 16:24:12 +0000 (17:24 +0100)]
net: stmmac: gmac4+: Add TBS support

Adds all the necessary HW hooks to support TBS feature in QoS cores.

Changes from v1:
- Remove unneeded LT shift as the IP already does this.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: stmmac: xgmac: Add TBS support
Jose Abreu [Mon, 13 Jan 2020 16:24:11 +0000 (17:24 +0100)]
net: stmmac: xgmac: Add TBS support

Adds all the necessary HW hooks to support TBS feature in XGMAC cores.

Changes from v1:
- Remove unneeded LT shift as the IP already does this.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: stmmac: tc: Add support for ETF Scheduler using TBS
Jose Abreu [Mon, 13 Jan 2020 16:24:10 +0000 (17:24 +0100)]
net: stmmac: tc: Add support for ETF Scheduler using TBS

Adds the support for ETF scheduler using TBS feature which is available
in XGMAC and QoS IPs.

Changes from v2:
- Fix checkpatch issues (Jakub)
- Use the TBS bitfield

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: stmmac: Initial support for TBS
Jose Abreu [Mon, 13 Jan 2020 16:24:09 +0000 (17:24 +0100)]
net: stmmac: Initial support for TBS

Adds the initial hooks for TBS support. This needs a 32 byte descriptor
in order for it to work with current HW. Adds all the logic for Enhanced
Descriptors in main core but no HW related logic for now.

Changes from v2:
- Use bitfield for TBS status / support (Jakub)
- Remove unneeded cache alignment (Jakub)
- Fix checkpatch issues

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agoamd-xgbe: remove unnecessary conversion to bool
Chen Zhou [Mon, 13 Jan 2020 13:15:16 +0000 (21:15 +0800)]
amd-xgbe: remove unnecessary conversion to bool

The conversion to bool is not needed, remove it.

Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agoptr_ring: add include of linux/mm.h
Jesper Dangaard Brouer [Mon, 13 Jan 2020 10:22:16 +0000 (11:22 +0100)]
ptr_ring: add include of linux/mm.h

Commit 0bf7800f1799 ("ptr_ring: try vmalloc() when kmalloc() fails")
started to use kvmalloc_array and kvfree, which are defined in mm.h,
the previous functions kcalloc and kfree, which are defined in slab.h.

Add the missing include of linux/mm.h.  This went unnoticed as other
include files happened to include mm.h.

Fixes: 0bf7800f1799 ("ptr_ring: try vmalloc() when kmalloc() fails")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: mvneta: change page pool nid to NUMA_NO_NODE
Lorenzo Bianconi [Mon, 13 Jan 2020 09:28:12 +0000 (10:28 +0100)]
net: mvneta: change page pool nid to NUMA_NO_NODE

With 'commit 44768decb7c0 ("page_pool: handle page recycle for NUMA_NO_NODE
condition")' we can safely change nid to NUMA_NO_NODE and accommodate
future NUMA aware hardware using mvneta network interface

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agosfc/ethtool_common: Make some function to static
Zhang Xiaoxu [Mon, 13 Jan 2020 11:24:11 +0000 (19:24 +0800)]
sfc/ethtool_common: Make some function to static

Fix sparse warning:

drivers/net/ethernet/sfc/ethtool_common.c
  warning: symbol 'efx_fill_test' was not declared. Should it be static?
  warning: symbol 'efx_fill_loopback_test' was not declared.
           Should it be static?
  warning: symbol 'efx_describe_per_queue_stats' was not declared.
           Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: Martin Habets <mhabets@solarflare.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: amd: a2065: Use print_hex_dump_debug() helper
Geert Uytterhoeven [Sun, 12 Jan 2020 16:33:54 +0000 (17:33 +0100)]
net: amd: a2065: Use print_hex_dump_debug() helper

Use the print_hex_dump_debug() helper, instead of open-coding the same
operations.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: amd: a2065: Kill Sun LANCE relics
Geert Uytterhoeven [Sun, 12 Jan 2020 16:32:11 +0000 (17:32 +0100)]
net: amd: a2065: Kill Sun LANCE relics

Remove unused fields, copied from the Sun LANCE driver eons ago.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agoMerge branch 'IXP4xx-networking-cleanups'
Jakub Kicinski [Sun, 12 Jan 2020 21:05:14 +0000 (13:05 -0800)]
Merge branch 'IXP4xx-networking-cleanups'

Linus Walleij says:

====================
IXP4xx networking cleanups

This is a patch series which jams together Arnds and mine
cleanups for the IXP4xx networking.

I also have patches for device tree support but that
requires more elaborate work, this series is some of
mine and some of Arnds patches that is a good foundation
for his multiplatform work and my device tree work.

These are for application to the networking tree so
that can be taken in one separate sweep.

I have tested the patches for a bit using zeroday builds
and some boots on misc IXP4xx devices and haven't run
into any major problems. We might find some new stuff
as a result from the new compiler coverage.

I had to depromote enabling compiler coverage at one
point in the v2 set because it depended on other patches
making the code more generic.

The change in v3 was simply dropping one offending
patch hardcoding base addresses into the driver.

The change in v4 drops a stable@ tag that was
unnecessary.

This v5 is a rebase of the v4 patch set on top of
net-next.
====================

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: ethernet: ixp4xx: Use parent dev for DMA pool
Linus Walleij [Sun, 12 Jan 2020 12:04:50 +0000 (13:04 +0100)]
net: ethernet: ixp4xx: Use parent dev for DMA pool

Use the netdevice struct device .parent field when calling
dma_pool_create(): the .dma_coherent_mask and .dma_mask
pertains to the bus device on the hardware (platform)
bus in this case, not the struct device inside the network
device. This makes the pool allocation work.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agoARM/net: ixp4xx: Pass ethernet physical base as resource
Linus Walleij [Sun, 12 Jan 2020 12:04:49 +0000 (13:04 +0100)]
ARM/net: ixp4xx: Pass ethernet physical base as resource

In order to probe this ethernet interface from the device tree
all physical MMIO regions must be passed as resources. Begin
this rewrite by first passing the port base address as a
resource for all platforms using this driver, remap it in
the driver and avoid using any reference of the statically
mapped virtual address in the driver.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: ehernet: ixp4xx: Use netdev_* messages
Linus Walleij [Sun, 12 Jan 2020 12:04:48 +0000 (13:04 +0100)]
net: ehernet: ixp4xx: Use netdev_* messages

Simplify and correct a bunch of messages using printk
directly to use the netdev_* macros. I have not changed
all of them, just the low-hanging fruit.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: ethernet: ixp4xx: Use distinct local variable
Linus Walleij [Sun, 12 Jan 2020 12:04:47 +0000 (13:04 +0100)]
net: ethernet: ixp4xx: Use distinct local variable

Use "ndev" for the struct net_device and "dev" for the
struct device in probe() and remove(). Add the local
"dev" pointer for later use in refactoring.

Take this opportunity to fix inverse christmas tree
coding style.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agonet: ethernet: ixp4xx: Standard module init
Linus Walleij [Sun, 12 Jan 2020 12:04:46 +0000 (13:04 +0100)]
net: ethernet: ixp4xx: Standard module init

The IXP4xx driver was initializing the MDIO bus before even
probing, in the callbacks supposed to be used for setting up
the module itself, and with the side effect of trying to
register the MDIO bus as soon as this module was loaded or
compiled into the kernel whether the device was discovered
or not.

This does not work with multiplatform environments.

To get rid of this: set up the MDIO bus from the probe()
callback and remove it in the remove() callback. Rename
the probe() and remove() calls to reflect the most common
conventions.

Since there is a bit of checking for the ethernet feature
to be present in the MDIO registering function, making the
whole module not even be registered if we can't find an
MDIO bus, we need something similar: register the MDIO
bus when the corresponding ethernet is probed, and
return -EPROBE_DEFER on the other interfaces until this
happens. If no MDIO bus is present on any of the
registered interfaces we will eventually bail out.

None of the platforms I've seen has e.g. MDIO on EthB
and only uses EthC, there is always a Ethernet hardware
on the NPE (B, C) that has the MDIO bus, we just might
have to wait for it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agoixp4xx_eth: move platform_data definition
Arnd Bergmann [Sun, 12 Jan 2020 12:04:45 +0000 (13:04 +0100)]
ixp4xx_eth: move platform_data definition

The platform data is needed to compile the driver as standalone,
so move it to a global location along with similar files.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agoptp: ixp46x: move adjacent to ethernet driver
Arnd Bergmann [Sun, 12 Jan 2020 12:04:44 +0000 (13:04 +0100)]
ptp: ixp46x: move adjacent to ethernet driver

The ixp46x ptp driver has a somewhat unusual setup, where the ptp
driver and the ethernet driver are in different directories but
access the same registers that are defined a platform specific
header file.

Moving everything into drivers/net/ makes it look more like most
other ptp drivers and allows compile-testing this driver on
other targets.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agowan: ixp4xx_hss: prepare compile testing
Arnd Bergmann [Sun, 12 Jan 2020 12:04:43 +0000 (13:04 +0100)]
wan: ixp4xx_hss: prepare compile testing

The ixp4xx_hss driver needs the platform data definition and the
system clock rate to be compiled. Move both into a new platform_data
header file.

This is a prerequisite for compile testing, but turning on compile
testing requires further patches to isolate the SoC headers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agowan: ixp4xx_hss: fix compile-testing on 64-bit
Arnd Bergmann [Sun, 12 Jan 2020 12:04:42 +0000 (13:04 +0100)]
wan: ixp4xx_hss: fix compile-testing on 64-bit

Change the driver to use portable integer types to avoid
warnings during compile testing:

drivers/net/wan/ixp4xx_hss.c:863:21: error: cast to 'u32 *' (aka 'unsigned int *') from smaller integer type 'int' [-Werror,-Wint-to-pointer-cast]
        memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4);
                           ^
drivers/net/wan/ixp4xx_hss.c:979:12: error: incompatible pointer types passing 'u32 *' (aka 'unsigned int *') to parameter of type 'dma_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
                                              &port->desc_tab_phys)))
                                              ^~~~~~~~~~~~~~~~~~~~
include/linux/dmapool.h:27:20: note: passing argument to parameter 'handle' here
                     dma_addr_t *handle);
                                 ^

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agomlx4: Bump up MAX_MSIX from 64 to 128
Jonathan Lemon [Thu, 9 Jan 2020 19:23:17 +0000 (11:23 -0800)]
mlx4: Bump up MAX_MSIX from 64 to 128

On modern hardware with a large number of cpus and using XDP,
the current MSIX limit is insufficient.  Bump the limit in
order to allow more queues.

Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Reviewed-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 years agoMerge branch 'hns3-next'
David S. Miller [Sat, 11 Jan 2020 22:52:56 +0000 (14:52 -0800)]
Merge branch 'hns3-next'

Huazhong Tan says:

====================
net: hns3: add some misc update about reset issue

This series includes some misc update relating to reset issue.
[patch 1/7] & [patch 2/7] splits hclge_reset()/hclgevf_reset()
into two parts: preparing and rebuilding. Since the procedure
of FLR should be separated out from the reset task([patch 3/7 &
patch 3/7]), then the FLR's processing can reuse these codes.

pci_error_handlers.reset_prepare() is void type function, so
[patch 6/7] & [patch 7/7] factor some codes related to PF
function reset to make the preparing done before .reset_prepare()
return.

BTW, [patch 5/7] enlarges the waiting time of reset for matching
the hardware's.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: refactor the notification scheme of PF reset
Huazhong Tan [Sat, 11 Jan 2020 08:33:53 +0000 (16:33 +0800)]
net: hns3: refactor the notification scheme of PF reset

hclge_reset_prepare_down() is only used to inform VF that PF is
going to do function reset, then using hclge_func_reset_sync_vf()
in hclge_reset_prepare_wait() to query whether VF is ready before
asserting PF function reset. To make the code more readable,
this patch uses a new function hclge_function_reset_notify_vf()
to do this job.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: modify hclge_func_reset_sync_vf()'s return type to void
Huazhong Tan [Sat, 11 Jan 2020 08:33:52 +0000 (16:33 +0800)]
net: hns3: modify hclge_func_reset_sync_vf()'s return type to void

When synchronizes with VFs fail before PF function reset,
PF driver should go on its function reset, otherwise it
can not run normally anymore. So, hclge_func_reset_sync_vf()
should not affect the processing of PF reset, this patch
modifies its return type to void.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: enlarge HCLGE_RESET_WAIT_CNT
Huazhong Tan [Sat, 11 Jan 2020 08:33:51 +0000 (16:33 +0800)]
net: hns3: enlarge HCLGE_RESET_WAIT_CNT

When the load of firmware is high, its reset task may takes
more time(which will be as long as 35 seconds). So this
patch modifies HCLGE_RESET_WAIT_CNT to match the firmware's.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: refactor the procedure of VF FLR
Huazhong Tan [Sat, 11 Jan 2020 08:33:50 +0000 (16:33 +0800)]
net: hns3: refactor the procedure of VF FLR

Currently, the actual work of VF FLR is handled in the reset task,
which is asynchronous. So in some case, if the preparing and
rebuilding are not done, then the VF FLR will trigger some problems,
for example, makes hardware go into chaos.

So this patch separates the process of VF FLR from reset task, and
adds a semaphore to serialize this reset and others.

When FLR's preparing fails, if there has other higher level reset
pending or failing times less than the HCLGE_FLR_RETRY_CNT, this
preparing should be retried, otherwise it will get into a wrong state.

BTW, while the hardware reports misc interrupt during pcie_flr(),
the driver can not receive this interrupt anymore, so disable it
when hclgevf_flr_prepare() return, and re-enable it when enter
hclgevf_flr_done().

Avoid declaring internal function hclgevf_enable_vector(), this patch
also moves its definition forward, and removes unused enum
hnae3_flr_state.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: refactor the precedure of PF FLR
Huazhong Tan [Sat, 11 Jan 2020 08:33:49 +0000 (16:33 +0800)]
net: hns3: refactor the precedure of PF FLR

Currently, the actual work of PF FLR is handled in the reset task,
which is asynchronous. So in some case, if the preparing and
rebuilding are not done, then the PF FLR will trigger some problems,
for example, makes hardware go into chaos.

So this patch separates the process of PF FLR from reset task, and
adds a semaphore to serialize this reset and others.

When FLR's preparing fails, if there has other higher level reset
pending or failing times less than the HCLGE_FLR_RETRY_CNT, this
preparing should be retried, otherwise PF and its VF may get into
wrong state.

BTW, while the hardware reports misc interrupt during pcie_flr(),
the driver can not receive this interrupt anymore, so disable it
when hclge_flr_prepare() return, and re-enable it when enter
hclge_flr_done().

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: split hclgevf_reset() into preparing and rebuilding part
Huazhong Tan [Sat, 11 Jan 2020 08:33:48 +0000 (16:33 +0800)]
net: hns3: split hclgevf_reset() into preparing and rebuilding part

hclgevf_reset() is a little bloated, and the process of VF FLR will
be separated from the reset task later. So this patch splits
hclgevf_reset() into hclgevf_reset_prepare() and hclge_reset_rebuild(),
then FLR can also reuse these two functions. Also moves HNAE3_UP_CLIENT
into hclgevf_reset_stack().

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: split hclge_reset() into preparing and rebuilding part
Huazhong Tan [Sat, 11 Jan 2020 08:33:47 +0000 (16:33 +0800)]
net: hns3: split hclge_reset() into preparing and rebuilding part

hclge_reset() is a little bloated, and the process of PF FLR will
be separated from the reset task later. So this patch splits
hclge_reset() into hclge_reset_prepare() and hclge_reset_rebuild(),
then FLR can also reuse these two functions.

BTW, since hclge_clear_reset_cause() and hclge_reset_prepare_up()
will not affect the device, so in hclge_reset_rebuild(), these
functions are called without rtnl_lock.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: remove set but not used variable 'nic_data'
YueHaibing [Fri, 10 Jan 2020 06:09:08 +0000 (06:09 +0000)]
sfc: remove set but not used variable 'nic_data'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/ethernet/sfc/mcdi_functions.c: In function 'efx_mcdi_ev_init':
drivers/net/ethernet/sfc/mcdi_functions.c:79:28: warning:
 variable 'nic_data' set but not used [-Wunused-but-set-variable]

commit 4438b587fe4b ("sfc: move MCDI event queue management code")
introduces this unused variable.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: remove duplicated include from ef10.c
YueHaibing [Fri, 10 Jan 2020 01:35:17 +0000 (01:35 +0000)]
sfc: remove duplicated include from ef10.c

Remove duplicated include.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobnxt: Detach page from page pool before sending up the stack
Jonathan Lemon [Thu, 9 Jan 2020 19:35:42 +0000 (11:35 -0800)]
bnxt: Detach page from page pool before sending up the stack

When running in XDP mode, pages come from the page pool, and should
be freed back to the same pool or specifically detached.  Currently,
when the driver re-initializes, the page pool destruction is delayed
forever since it thinks there are oustanding pages.

Fixes: 322b87ca55f2 ("bnxt_en: add page_pool support")
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'devlink-documentation-refactor'
David S. Miller [Sat, 11 Jan 2020 01:07:00 +0000 (17:07 -0800)]
Merge branch 'devlink-documentation-refactor'

Jacob Keller says:

====================
devlink documentation refactor

This series updates the devlink documentation, with a few primary goals

 * move all of the devlink documentation into a dedicated subfolder
 * convert that documentation to the reStructuredText format
 * merge driver-specific documentations into a single file per driver
 * add missing documentation, including per-driver and devlink generally

For each driver, I took the time to review the code and add further
documentation on the various features it currently supports. Additionally, I
added new documentation files for some of the features such as
devlink-dpipe, devlink-resource, and devlink-regions.

Note for the region snapshot triggering, I kept that as a separate patch as
that is based on work that has not yet been merged to net-next, and may
change.

I also improved the existing documentation for devlink-info and
devlink-param by adding a bit more of an introduction when converting it to
the rst format.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: document region snapshot triggering from userspace
Jacob Keller [Thu, 9 Jan 2020 22:46:25 +0000 (14:46 -0800)]
devlink: document region snapshot triggering from userspace

Now that devlink regions can be triggered via
DEVLINK_CMD_REGION_TRIGGER, document this in the devlink-region.rst
file.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: introduce devlink-dpipe.rst documentation file
Jacob Keller [Thu, 9 Jan 2020 22:46:24 +0000 (14:46 -0800)]
devlink: introduce devlink-dpipe.rst documentation file

Primarily based on the DPIPE netdev conference paper, introduce a new
file to document the dpipe interface.

This likely needs further improvement, but is at least a good overall
start.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: add a devlink-resource.rst documentation file
Jacob Keller [Thu, 9 Jan 2020 22:46:23 +0000 (14:46 -0800)]
devlink: add a devlink-resource.rst documentation file

Take the little bit of documentation for resources from various commit
messages and combine it into a new devlink-resource.rst file.

This could probably be expanded on even further by someone with more
knowledge of how the devlink resources work.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: rename and expand devlink-trap-netdevsim.rst
Jacob Keller [Thu, 9 Jan 2020 22:46:22 +0000 (14:46 -0800)]
devlink: rename and expand devlink-trap-netdevsim.rst

Rename the trap-specific netdevimsim.rst file, and expand it to include
documentation of all the devlink features currently implemented by the
netdevsim driver code.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: add documentation for ionic device driver
Jacob Keller [Thu, 9 Jan 2020 22:46:21 +0000 (14:46 -0800)]
devlink: add documentation for ionic device driver

The IONIC device driver allocates a devlink and reports versions. Add
documentation for this driver.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Shannon Nelson <snelson@pensando.io>
Acked-by: Shannon Nelson <snelson@pensandi.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: add a file documenting devlink regions
Jacob Keller [Thu, 9 Jan 2020 22:46:20 +0000 (14:46 -0800)]
devlink: add a file documenting devlink regions

Also document the regions created by the mlx4 driver. This is currently
the only in-tree driver that creates devlink region snapshots.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: add a driver-specific file for the qed driver
Jacob Keller [Thu, 9 Jan 2020 22:46:19 +0000 (14:46 -0800)]
devlink: add a driver-specific file for the qed driver

The qed driver recently added devlink support with a single devlink
parameter. Add a driver-specific file to document the devlink features
that the qed driver supports.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Ariel Elior <aelior@marvell.com>
Cc: GR-everest-linux-l2@marvell.com
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: add parameter documentation for the mlx4 driver
Jacob Keller [Thu, 9 Jan 2020 22:46:18 +0000 (14:46 -0800)]
devlink: add parameter documentation for the mlx4 driver

The mlx5 and mlxsw drivers have driver-specific documentation for the
devlink features they support. No such file was added for mlx4.

Add a file to document the mlx4 devlink support. Initially it contains
only the devlink parameters.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: document info versions for each driver
Jacob Keller [Thu, 9 Jan 2020 22:46:17 +0000 (14:46 -0800)]
devlink: document info versions for each driver

Add the set of info versions reported by each device driver, including
a description of what the version represents, and what modes (fixed,
running, stored) it reports.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: convert driver-specific files to reStructuredText
Jacob Keller [Thu, 9 Jan 2020 22:46:16 +0000 (14:46 -0800)]
devlink: convert driver-specific files to reStructuredText

Several drivers document what parameters they support in
a devlink-params-*.txt file. This file is supposed to contain both the
list of generic parameters implemented by the driver, as well as a list
of driver-specific parameters and their descriptions.

It would also be good if the driver documentation included other
driver-specific implementations, such as info versions, devlink
regions, and so forth.

Convert all of these documentation files to reStructuredText, and rename
them to just the driver name. Future changes will include other
driver-specific implementations. Each file will contain a table for the
generic parameters implemented, as well as a separate table for the
driver-specific parameters.

Future sections such as for devlink info versions will be added to these
files. This avoids creating additional devlink-<feature>-<driver> files
for each devlink feature, reducing clutter in the documentation folder.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Ido Schimmel <idosch@mellanox.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: mention reloading in devlink-params.rst
Jacob Keller [Thu, 9 Jan 2020 22:46:15 +0000 (14:46 -0800)]
devlink: mention reloading in devlink-params.rst

Mention that drivers must support devlink-reload in order for driverinit
parameters to function properly

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: add documentation for generic devlink parameters
Jacob Keller [Thu, 9 Jan 2020 22:46:14 +0000 (14:46 -0800)]
devlink: add documentation for generic devlink parameters

A few generic devlink parameters have been added, but never documented.
Fix that now.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: convert devlink-params.txt to reStructuredText
Jacob Keller [Thu, 9 Jan 2020 22:46:13 +0000 (14:46 -0800)]
devlink: convert devlink-params.txt to reStructuredText

Convert the generic parameters descriptions into the reStructuredText
format.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: rename devlink-info-versions.rst and add a header
Jacob Keller [Thu, 9 Jan 2020 22:46:12 +0000 (14:46 -0800)]
devlink: rename devlink-info-versions.rst and add a header

Rename the devlink-info-versions.rst file to a plain devlink-info.rst
file. Add additional paragraphs explaining what devlink-info is for,
and the expectation that drivers use the generic names where plausible.

Note that drivers which use non-standard info version names ought to
document these in a driver-specific info-versions.rst file.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: convert devlink-health.txt to rst format
Jacob Keller [Thu, 9 Jan 2020 22:46:11 +0000 (14:46 -0800)]
devlink: convert devlink-health.txt to rst format

Update the devlink-health documentation to use the newer
ReStructuredText format.

Note that it's unclear what OOB stood for, and it has been left as-is
without a proper first-use expansion of the acronym.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: move devlink documentation to subfolder
Jacob Keller [Thu, 9 Jan 2020 22:46:10 +0000 (14:46 -0800)]
devlink: move devlink documentation to subfolder

Combine the documentation for devlink into a subfolder, and provide an
index.rst file that can be used to generally describe devlink.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodevlink: add macro for "fw.psid"
Jacob Keller [Thu, 9 Jan 2020 22:46:09 +0000 (14:46 -0800)]
devlink: add macro for "fw.psid"

The "fw.psid" devlink info version is documented in devlink-info.rst,
and used by one driver. However, there is no associated macro for this
firmware version like there is for others. Add one now.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'r8169-factor-out-chip-specific-PHY-configuration-to-a-separate-source...
David S. Miller [Sat, 11 Jan 2020 00:41:35 +0000 (16:41 -0800)]
Merge branch 'r8169-factor-out-chip-specific-PHY-configuration-to-a-separate-source-file'

Heiner Kallweit says:

====================
r8169: factor out chip-specific PHY configuration to a separate source file

Basically every chip version needs its own PHY configuration.
To improve maintainability of the driver move all these PHY
configurations to a separate source file. To allow this we first have
to change all PHY configurations to use phylib functions wherever
possible.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: factor out PHY configuration to r8169_phy_config.c
Heiner Kallweit [Thu, 9 Jan 2020 19:34:55 +0000 (20:34 +0100)]
r8169: factor out PHY configuration to r8169_phy_config.c

Move chip-specific PHY configurations to separate source file
r8169_phy_config.c. This improves maintainability of the driver.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: add r8169.h
Heiner Kallweit [Thu, 9 Jan 2020 19:34:05 +0000 (20:34 +0100)]
r8169: add r8169.h

In preparation of factoring out PHY configuration to a separate source
file move commonly used definitions to new header file r8169.h.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: rename rtl_apply_firmware
Heiner Kallweit [Thu, 9 Jan 2020 19:33:13 +0000 (20:33 +0100)]
r8169: rename rtl_apply_firmware

Rename rtl_apply_firmware() to r8169_apply_firmware() before exporting
it to avoid namespace clashes with other drivers for Realtek hardware.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: add phydev argument to rtl8168d_apply_firmware_cond
Heiner Kallweit [Thu, 9 Jan 2020 19:32:36 +0000 (20:32 +0100)]
r8169: add phydev argument to rtl8168d_apply_firmware_cond

Pass the phy_device as parameter to rtl8168d_apply_firmware_cond(),
this avoids having to access rtl8169_private internals.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: use phy_read/write instead of rtl_readphy/writephy
Heiner Kallweit [Thu, 9 Jan 2020 19:31:47 +0000 (20:31 +0100)]
r8169: use phy_read/write instead of rtl_readphy/writephy

Replace rtl_writephy and rtl_readphy with the respective phylib
functions.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: replace rtl_w0w1_phy
Heiner Kallweit [Thu, 9 Jan 2020 19:31:10 +0000 (20:31 +0100)]
r8169: replace rtl_w0w1_phy

Replace rtl_w0w1_phy with phylib functions.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: replace rtl_patchphy
Heiner Kallweit [Thu, 9 Jan 2020 19:30:37 +0000 (20:30 +0100)]
r8169: replace rtl_patchphy

Replace rtl_patchphy with phylib functions.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: move disabling MAC EEE for RTL8402/RTL8106e
Heiner Kallweit [Thu, 9 Jan 2020 19:30:00 +0000 (20:30 +0100)]
r8169: move disabling MAC EEE for RTL8402/RTL8106e

Move configuring EEE on MAC side out of the PHY configuration.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: move setting ERI register 0x1d0 for RTL8106
Heiner Kallweit [Thu, 9 Jan 2020 19:29:21 +0000 (20:29 +0100)]
r8169: move setting ERI register 0x1d0 for RTL8106

Writing this ERI register is a MAC setting, so move it to
rtl_hw_start_8106().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: switch to phylib functions in rtl_writephy_batch
Heiner Kallweit [Thu, 9 Jan 2020 19:28:45 +0000 (20:28 +0100)]
r8169: switch to phylib functions in rtl_writephy_batch

Switch rtl_writephy_batch() to phylib functions, as a result we can
avoid passing a rtl8169_private parameter.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: change argument type of RTL8168g-specific PHY config functions
Heiner Kallweit [Thu, 9 Jan 2020 19:28:08 +0000 (20:28 +0100)]
r8169: change argument type of RTL8168g-specific PHY config functions

These functions use only the phy_device member of rtl8169_private,
so we can pass the phy_device as parameter directly.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: change argument type of EEE PHY functions
Heiner Kallweit [Thu, 9 Jan 2020 19:27:33 +0000 (20:27 +0100)]
r8169: change argument type of EEE PHY functions

These functions use only the phy_device member of rtl8169_private,
so we can pass the phy_device as parameter directly.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: move RTL8169scd Gigabyte PHY quirk
Heiner Kallweit [Thu, 9 Jan 2020 19:26:59 +0000 (20:26 +0100)]
r8169: move RTL8169scd Gigabyte PHY quirk

In preparation of factoring out rtl8169scd_hw_phy_config() move this
quirk to rtl8169_init_phy().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: remove not needed debug print in rtl8169_init_phy
Heiner Kallweit [Thu, 9 Jan 2020 19:26:19 +0000 (20:26 +0100)]
r8169: remove not needed debug print in rtl8169_init_phy

Remove a useless debug statement. This also allows to remove the
net_device parameter from rtl8169_init_phy().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: prepare for exporting rtl_hw_phy_config
Heiner Kallweit [Thu, 9 Jan 2020 19:25:31 +0000 (20:25 +0100)]
r8169: prepare for exporting rtl_hw_phy_config

In preperation of factoring out the PHY configuration to a separate
source file this patch:
- avoids accessing rtl8169_private internals by passing the phy_device
  and mac_version as separate parameters
- renames rtl_hw_phy_config to r8169_hw_phy_config to avoid namespace
  clashes with other drivers for Realtek hardware

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'stmmac-Frame-Preemption-fixes'
David S. Miller [Fri, 10 Jan 2020 19:29:44 +0000 (11:29 -0800)]
Merge branch 'stmmac-Frame-Preemption-fixes'

Jose Abreu says:

====================
net: stmmac: Frame Preemption fixes

Two single fixes for the -next tree for recently introduced Frame Preemption
feature.

1) and 2) fixes the disabling of Frame Preemption that was not being correctly
handled because of a missing return.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: stmmac: gmac5+: Fix missing return
Jose Abreu [Fri, 10 Jan 2020 15:13:35 +0000 (16:13 +0100)]
net: stmmac: gmac5+: Fix missing return

If FPE is supposed to be disabled we need to return after disabling it.

Fixes: 7c7282746883 ("net: stmmac: gmac5+: Add support for Frame Preemption")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: stmmac: xgmac: Fix missing return
Jose Abreu [Fri, 10 Jan 2020 15:13:34 +0000 (16:13 +0100)]
net: stmmac: xgmac: Fix missing return

If FPE is supposed to be disabled we need to return after disabling it.

Fixes: f0e56c8d8f7d ("net: stmmac: xgmac3+: Add support for Frame Preemption")
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'sfc-even-more-code-refactoring'
David S. Miller [Fri, 10 Jan 2020 19:24:37 +0000 (11:24 -0800)]
Merge branch 'sfc-even-more-code-refactoring'

Alex Maftei says:

====================
sfc: even more code refactoring

Splitting even more of the driver code into different files, which
will later be used in another driver for a new product.

This is a continuation to my previous patch series, and the one
before it.
There will be a stand-alone patch as well after this - after which
the refactoring will be concluded, for now.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: move RPS code
Alex Maftei (amaftei) [Fri, 10 Jan 2020 13:28:45 +0000 (13:28 +0000)]
sfc: move RPS code

Includes a couple of filtering functions and also renames a constant.

Style fixes included.

Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: move yet more functions
Alex Maftei (amaftei) [Fri, 10 Jan 2020 13:28:23 +0000 (13:28 +0000)]
sfc: move yet more functions

Functions are not related.

Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: move RSS code
Alex Maftei (amaftei) [Fri, 10 Jan 2020 13:28:07 +0000 (13:28 +0000)]
sfc: move RSS code

Style fixes included.

Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: move a couple more functions
Alex Maftei (amaftei) [Fri, 10 Jan 2020 13:27:50 +0000 (13:27 +0000)]
sfc: move a couple more functions

Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: move some ethtool code
Alex Maftei (amaftei) [Fri, 10 Jan 2020 13:27:32 +0000 (13:27 +0000)]
sfc: move some ethtool code

Various ethtool entry points are moved.

Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: move various functions
Alex Maftei (amaftei) [Fri, 10 Jan 2020 13:27:17 +0000 (13:27 +0000)]
sfc: move various functions

Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: move more rx code
Alex Maftei (amaftei) [Fri, 10 Jan 2020 13:27:03 +0000 (13:27 +0000)]
sfc: move more rx code

Page recycling code and GRO packet receipt code were moved.

One function contains code extracted from another.

Code style fixes included.

Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: move more tx code
Alex Maftei (amaftei) [Fri, 10 Jan 2020 13:26:46 +0000 (13:26 +0000)]
sfc: move more tx code

The code that handles transmission finalization will also be common.

Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosfc: refactor selftest work init code
Alex Maftei (amaftei) [Fri, 10 Jan 2020 13:26:34 +0000 (13:26 +0000)]
sfc: refactor selftest work init code

Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'mptcp-prereq'
David S. Miller [Fri, 10 Jan 2020 02:41:42 +0000 (18:41 -0800)]
Merge branch 'mptcp-prereq'

Mat Martineau says:

====================
Multipath TCP: Prerequisites

v6 -> v7: Rename/move ULP clone helper to make inline-friendly (patch 5)

v5 -> v6: Fix BPF accessors for sk_type and sk_protocol (patch 2), fix
the width of an __unused bitfield (patch 6), and add some commit message
and comment text (patches 5 & 7).

v4 -> v5: Cover letter subject fix. No changes to commits.

v3 -> v4: Update coalesce/collapse of incoming MPTCP skbs (patch 7)

v2 -> v3: Ensure sk_type alignment in struct sock (patch 2)

v1 -> v2: sk_pacing_shift left as a regular struct member (patch 2), and
modified SACK space check based on recent -net fix (patch 9).

The MPTCP upstreaming community has been collaborating on an
upstreamable MPTCP implementation that complies with RFC 8684. A minimal
set of features to comply with the specification involves a sizeable set
of code changes, so David requested that we split this work in to
multiple, smaller patch sets to build up MPTCP infrastructure.

The minimal MPTCP feature set we are proposing for review in the v5.6
timeframe begins with these three parts:

Part 1 (this patch set): MPTCP prerequisites. Introduce some MPTCP
definitions, additional ULP and skb extension features, TCP option space
checking, and a few exported symbols.

Part 2: Single subflow implementation and self tests.

Part 3: Switch from MPTCP v0 (RFC 6824) to MPTCP v1 (new RFC 8684,
publication expected in the next few days).

Additional patches for multiple subflow support, path management, active
backup, and other features are in the pipeline for submission after
making progress with the above reviews.

Clone/fetch:
https://github.com/multipath-tcp/mptcp_net-next.git (tag: netdev-v7-part1)

Browse:
https://github.com/multipath-tcp/mptcp_net-next/tree/netdev-v7-part1

Thank you for your review. You can find us at mptcp@lists.01.org and
https://is.gd/mptcp_upstream
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoskb: add helpers to allocate ext independently from sk_buff
Paolo Abeni [Thu, 9 Jan 2020 15:59:24 +0000 (07:59 -0800)]
skb: add helpers to allocate ext independently from sk_buff

Currently we can allocate the extension only after the skb,
this change allows the user to do the opposite, will simplify
allocation failure handling from MPTCP.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agotcp: clean ext on tx recycle
Paolo Abeni [Thu, 9 Jan 2020 15:59:23 +0000 (07:59 -0800)]
tcp: clean ext on tx recycle

Otherwise we will find stray/unexpected/old extensions value on next
iteration.

On tcp_write_xmit() we can end-up splitting an already queued skb in two
parts, via tso_fragment(). The newly created skb can be allocated via
the tx cache and an upper layer will not be aware of it, so that upper
layer cannot set the ext properly.

Resetting the ext on recycle ensures that stale data is not propagated
in to packet headers or elsewhere.

An alternative would be add an additional hook in tso_fragment() or in
sk_stream_alloc_skb() to init the ext for upper layers that need it.

Co-developed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agotcp: Check for filled TCP option space before SACK
Mat Martineau [Thu, 9 Jan 2020 15:59:22 +0000 (07:59 -0800)]
tcp: Check for filled TCP option space before SACK

Update the SACK check to work with zero option space available, a case
that's possible with MPTCP but not MD5+TS. Maintained only one
conditional branch for insufficient SACK space.

v1 -> v2:
- Moves the check inside the SACK branch by taking recent SACK fix:

    9424e2e7ad93 (tcp: md5: fix potential overestimation of TCP option space)

  in to account, but modifies it to work in MPTCP scenarios beyond the
  MD5+TS corner case.

Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agotcp: Export TCP functions and ops struct
Mat Martineau [Thu, 9 Jan 2020 15:59:21 +0000 (07:59 -0800)]
tcp: Export TCP functions and ops struct

MPTCP will make use of tcp_send_mss() and tcp_push() when sending
data to specific TCP subflows.

tcp_request_sock_ipvX_ops and ipvX_specific will be referenced
during TCP subflow creation.

Co-developed-by: Peter Krystad <peter.krystad@linux.intel.com>
Signed-off-by: Peter Krystad <peter.krystad@linux.intel.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agotcp: coalesce/collapse must respect MPTCP extensions
Mat Martineau [Thu, 9 Jan 2020 15:59:20 +0000 (07:59 -0800)]
tcp: coalesce/collapse must respect MPTCP extensions

Coalesce and collapse of packets carrying MPTCP extensions is allowed
when the newer packet has no extension or the extensions carried by both
packets are equal.

This allows merging of TSO packet trains and even cross-TSO packets, and
does not require any additional action when moving data into existing
SKBs.

v3 -> v4:
 - allow collapsing, under mptcp_skb_can_collapse() constraint

v5 -> v6:
 - clarify MPTCP skb extensions must always be cleared at allocation
   time

Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomptcp: Add MPTCP to skb extensions
Mat Martineau [Thu, 9 Jan 2020 15:59:19 +0000 (07:59 -0800)]
mptcp: Add MPTCP to skb extensions

Add enum value for MPTCP and update config dependencies

v5 -> v6:
 - fixed '__unused' field size

Co-developed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>