linux-2.6-microblaze.git
3 years agoigc: Refactor the igc_power_down_link()
Sasha Neftin [Mon, 8 Jun 2020 15:49:39 +0000 (18:49 +0300)]
igc: Refactor the igc_power_down_link()

Currently the implementation of igc_power_down_link()
method was just calling igc_power_down_phy_copper_base()
method.
We can just call igc_power_down_phy_copper_base()
method directly.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoigc: Remove TCP segmentation TX fail counter
Sasha Neftin [Sun, 7 Jun 2020 08:51:27 +0000 (11:51 +0300)]
igc: Remove TCP segmentation TX fail counter

TCP segmentation TX context fail counter is not
applicable for i225 devices.
This patch comes to clean up this counter.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown<aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoigc: Add LPI counters
Sasha Neftin [Thu, 4 Jun 2020 11:25:16 +0000 (14:25 +0300)]
igc: Add LPI counters

Add EEE TX LPI and EEE RX LPI counters. A EEE TX LPI event
occurs when the transmitter enters EEE (IEEE 802.3az) LPI
state. A EEE RX LPI event occurs when the receiver detect
link partner entry into EEE(IEEE 802.3az) LPI state.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoigc: Fix Rx timestamp disabling
Andre Guedes [Thu, 4 Jun 2020 00:01:05 +0000 (17:01 -0700)]
igc: Fix Rx timestamp disabling

When Rx timestamping is enabled, we set the timestamp bit in SRRCTL
register for each queue, but we don't clear it when disabling. This
patch fixes igc_ptp_disable_rx_timestamp() accordingly.

Also, this patch gets rid of igc_ptp_enable_tstamp_rxqueue() and
igc_ptp_enable_tstamp_all_rxqueues() and move their logic into
igc_ptp_enable_rx_timestamp() to keep the enable and disable
helpers symmetric.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoigc: Refactor igc_ptp_set_timestamp_mode()
Andre Guedes [Thu, 4 Jun 2020 00:01:04 +0000 (17:01 -0700)]
igc: Refactor igc_ptp_set_timestamp_mode()

Current igc_ptp_set_timestamp_mode() logic is a bit tangled since it
handles many different hardware configurations in one single place,
making it harder to follow. This patch untangles that code by breaking
it into helper functions.

Quick note about the hw->mac.type check which was removed in this
refactoring: this check it not really needed since igc_i225 is the only
type supported by the IGC driver.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoigc: Remove UDP filter setup in PTP code
Andre Guedes [Thu, 4 Jun 2020 00:01:03 +0000 (17:01 -0700)]
igc: Remove UDP filter setup in PTP code

As implemented in igc_ethtool_get_ts_info(), igc only supports HWTSTAMP_
FILTER_ALL so any HWTSTAMP_FILTER_* option the user may set falls back to
HWTSTAMP_FILTER_ALL.

HWTSTAMP_FILTER_ALL is implemented via Rx Time Sync Control (TSYNCRXCTL)
configuration which timestamps all incoming packets. Configuring a
UDP filter, in addition to TSYNCRXCTL, doesn't add much so this patch
removes that code. It also takes this opportunity to remove some
non-applicable comments.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoigc: Check __IGC_PTP_TX_IN_PROGRESS instead of ptp_tx_skb
Andre Guedes [Thu, 4 Jun 2020 00:01:02 +0000 (17:01 -0700)]
igc: Check __IGC_PTP_TX_IN_PROGRESS instead of ptp_tx_skb

The __IGC_PTP_TX_IN_PROGRESS flag indicates we have a pending Tx
timestamp. In some places, instead of checking that flag, we check
adapter->ptp_tx_skb. This patch fixes those places to use the flag.

Quick note about igc_ptp_tx_hwtstamp() change: when that function is
called, adapter->ptp_tx_skb is expected to be valid always so we
WARN_ON_ONCE() in case it is not.

Quick note about igc_ptp_suspend() change: when suspending, we don't
really need to check if there is a pending timestamp. We can simply
clear it unconditionally.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoigc: Remove duplicate code in Tx timestamp handling
Andre Guedes [Thu, 4 Jun 2020 00:01:01 +0000 (17:01 -0700)]
igc: Remove duplicate code in Tx timestamp handling

The functions igc_ptp_tx_hang() and igc_ptp_tx_work() have duplicate
code which handles Tx timestamp timeouts. This patch does a trivial
refactoring by moving that code to its own function and reusing it.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoigc: Clean up Rx timestamping logic
Andre Guedes [Thu, 4 Jun 2020 00:01:00 +0000 (17:01 -0700)]
igc: Clean up Rx timestamping logic

Differently from I210, I225 doesn't report Rx timestamps via the TS bit
Rx descriptor + RXSTMPL/RXSTMPH registers mechanism. Rx timestamps are
reported in the packet buffer only, which is implemented by igc_ptp_rx_
pktstamp(). So this patch removes igc_ptp_rx_rgtstamp() and all code
related to it, copied from igb driver.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoigc: Add initial LTR support
Sasha Neftin [Tue, 2 Jun 2020 07:50:47 +0000 (10:50 +0300)]
igc: Add initial LTR support

The LTR message on the PCIe inform the requested latency
on which the PCIe must become active to the downstream
PCIe port of the system.
This patch provide recommended LTR parameters by i225
specification.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoigc: Add initial EEE support
Sasha Neftin [Wed, 27 May 2020 20:51:32 +0000 (13:51 -0700)]
igc: Add initial EEE support

IEEE802.3az-2010 Energy Efficient Ethernet has been
approved as standard (September 2010) and the driver
can enable and disable it via ethtool.
Disable the feature by default on parts which support it.
Add enable/disable eee options.
tx-lpi, tx-timer and advertise not supported yet.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Reviewed-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoliquidio: use list_empty_careful in lio_list_delete_head
Geliang Tang [Sun, 28 Jun 2020 10:14:13 +0000 (18:14 +0800)]
liquidio: use list_empty_careful in lio_list_delete_head

Use list_empty_careful() instead of open-coding.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosctp: use list_is_singular in sctp_list_single_entry
Geliang Tang [Sun, 28 Jun 2020 09:32:25 +0000 (17:32 +0800)]
sctp: use list_is_singular in sctp_list_single_entry

Use list_is_singular() instead of open-coding.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years ago8390: Fix coding-style issues
Armin Wolf [Sat, 27 Jun 2020 22:07:47 +0000 (00:07 +0200)]
8390: Fix coding-style issues

Fix some coding-style issues, including one which
made the function pointers in the struct ei_device
hard to understand.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: mscc: ocelot: remove EXPORT_SYMBOL from ocelot_net.c
Vladimir Oltean [Sat, 27 Jun 2020 12:03:06 +0000 (15:03 +0300)]
net: mscc: ocelot: remove EXPORT_SYMBOL from ocelot_net.c

Now that all net_device operations are bundled together inside
mscc_ocelot.ko and no longer part of the common library, there's no
reason to export these symbols.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'r8169-make-RTL8401-a-separate-chip-version'
David S. Miller [Mon, 29 Jun 2020 03:56:38 +0000 (20:56 -0700)]
Merge branch 'r8169-make-RTL8401-a-separate-chip-version'

Heiner Kallweit says:

====================
r8169: make RTL8401 a separate chip version

So far RTL8401 was treated like a RTL8101e, means we relied on the BIOS
to configure MAC and PHY properly. Make RTL8401 a separate chip version
and copy MAC / PHY config from r8101 vendor driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agor8169: sync support for RTL8401 with vendor driver
Heiner Kallweit [Sun, 28 Jun 2020 21:17:07 +0000 (23:17 +0200)]
r8169: sync support for RTL8401 with vendor driver

So far RTL8401 was treated like a RTL8101e, means we relied on the BIOS
to configure MAC and PHY properly. Make RTL8401 a separate chip version
and copy MAC / PHY config from r8101 vendor driver.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agor8169: merge handling of RTL8101e and RTL8100e
Heiner Kallweit [Sun, 28 Jun 2020 21:15:45 +0000 (23:15 +0200)]
r8169: merge handling of RTL8101e and RTL8100e

Chip versions 13, 14, 15 are treated the same by the driver, therefore
let's merge them.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'netdev_tx_t'
David S. Miller [Mon, 29 Jun 2020 03:52:53 +0000 (20:52 -0700)]
Merge branch 'netdev_tx_t'

Luc Van Oostenryck says:

====================
net: always use netdev_tx_t for xmit()'s return type

The ndo_start_xmit() methods should return a 'netdev_tx_t', not
an int, and so should return NETDEV_TX_OK, not 0.
The patches in the series fix most of the remaning drivers and
subsystems (those included in allyesconfig on x86).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agocxgb4vf: fix t4vf_eth_xmit()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:37 +0000 (21:53 +0200)]
cxgb4vf: fix t4vf_eth_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agol2tp: fix l2tp_eth_dev_xmit()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:36 +0000 (21:53 +0200)]
l2tp: fix l2tp_eth_dev_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/hsr: fix hsr_dev_xmit()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:35 +0000 (21:53 +0200)]
net/hsr: fix hsr_dev_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agousbnet: ipheth: fix ipheth_tx()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:34 +0000 (21:53 +0200)]
usbnet: ipheth: fix ipheth_tx()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: plip: fix plip_tx_packet()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:33 +0000 (21:53 +0200)]
net: plip: fix plip_tx_packet()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: dwc-xlgmac: fix xlgmac_xmit()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:32 +0000 (21:53 +0200)]
net: dwc-xlgmac: fix xlgmac_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: pch_gbe: fix pch_gbe_xmit_frame()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:31 +0000 (21:53 +0200)]
net: pch_gbe: fix pch_gbe_xmit_frame()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: nfp: fix nfp_net_tx()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:30 +0000 (21:53 +0200)]
net: nfp: fix nfp_net_tx()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: nb8800: fix nb8800_xmit()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:29 +0000 (21:53 +0200)]
net: nb8800: fix nb8800_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: arc_emac: fix arc_emac_tx()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:28 +0000 (21:53 +0200)]
net: arc_emac: fix arc_emac_tx()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: aquantia: fix aq_ndev_start_xmit()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:27 +0000 (21:53 +0200)]
net: aquantia: fix aq_ndev_start_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agocaif: fix cfv_netdev_tx()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:26 +0000 (21:53 +0200)]
caif: fix cfv_netdev_tx()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agocaif: fix cfspi_xmit()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:25 +0000 (21:53 +0200)]
caif: fix cfspi_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too and
returning NETDEV_TX_OK instead of 0 accordingly.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agocaif: fix caif_xmit()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:24 +0000 (21:53 +0200)]
caif: fix caif_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agocail,hsi: fix cfhsi_xmit()'s return type
Luc Van Oostenryck [Sun, 28 Jun 2020 19:53:23 +0000 (21:53 +0200)]
cail,hsi: fix cfhsi_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too and
returning NETDEV_TX_OK instead of 0 accordingly.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agobareudp: Added attribute to enable & disable rx metadata collection
Martin [Sun, 28 Jun 2020 17:48:23 +0000 (23:18 +0530)]
bareudp: Added attribute to enable & disable rx metadata collection

Metadata need not be collected in receive if the packet from bareudp
device is not targeted to openvswitch.

Signed-off-by: Martin <martin.varghese@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'hinic-add-some-ethtool-ops-support'
David S. Miller [Mon, 29 Jun 2020 03:40:58 +0000 (20:40 -0700)]
Merge branch 'hinic-add-some-ethtool-ops-support'

Luo bin says:

====================
hinic: add some ethtool ops support

patch #1: support to set and get pause params with
          "ethtool -A/a" cmd
patch #2: support to set and get irq coalesce params with
          "ethtool -C/c" cmd
patch #3: support to do self test with "ethtool -t" cmd
patch #4: support to identify physical device with "ethtool -p" cmd
patch #5: support to get eeprom information with "ethtool -m" cmd
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agohinic: add support to get eeprom information
Luo bin [Sun, 28 Jun 2020 12:36:24 +0000 (20:36 +0800)]
hinic: add support to get eeprom information

add support to get eeprom information from the plug-in module
with ethtool -m cmd.

Signed-off-by: Luo bin <luobin9@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agohinic: add support to identify physical device
Luo bin [Sun, 28 Jun 2020 12:36:23 +0000 (20:36 +0800)]
hinic: add support to identify physical device

add support to identify physical device by flashing an LED
attached to it with ethtool -p cmd.

Signed-off-by: Luo bin <luobin9@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agohinic: add self test support
Luo bin [Sun, 28 Jun 2020 12:36:22 +0000 (20:36 +0800)]
hinic: add self test support

add support to excute internal and external loopback test with
ethtool -t cmd.

Signed-off-by: Luo bin <luobin9@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agohinic: add support to set and get irq coalesce
Luo bin [Sun, 28 Jun 2020 12:36:21 +0000 (20:36 +0800)]
hinic: add support to set and get irq coalesce

add support to set TX/RX irq coalesce params with ethtool -C and
get these params with ethtool -c.

Signed-off-by: Luo bin <luobin9@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agohinic: add support to set and get pause params
Luo bin [Sun, 28 Jun 2020 12:36:20 +0000 (20:36 +0800)]
hinic: add support to set and get pause params

add support to set pause params with ethtool -A and get pause
params with ethtool -a. Also remove set_link_ksettings ops for VF
and enable pause by default.

Signed-off-by: Luo bin <luobin9@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'tcp-improve-delivered-counts-in-SCM_TSTAMP_ACK'
David S. Miller [Sun, 28 Jun 2020 00:41:27 +0000 (17:41 -0700)]
Merge branch 'tcp-improve-delivered-counts-in-SCM_TSTAMP_ACK'

Yousuk Seung says:

====================
tcp: improve delivered counts in SCM_TSTAMP_ACK

Currently delivered and delivered_ce in OPT_STATS of SCM_TSTAMP_ACK do
not fully reflect the current ack being timestamped. Also they are not
in sync as the delivered count includes packets being sacked and some of
cumulatively acked but delivered_ce includes none.

This patch series updates tp->delivered and tp->delivered_ce together to
keep them in sync. It also moves generating SCM_TSTAMP_ACK to later in
tcp_clean_rtx_queue() to reflect packets being cumulatively acked up
until the current skb for sack-enabled connections.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agotcp: update delivered_ce with delivered
Yousuk Seung [Sat, 27 Jun 2020 04:05:35 +0000 (21:05 -0700)]
tcp: update delivered_ce with delivered

Currently tp->delivered is updated in various places in tcp_ack() but
tp->delivered_ce is updated once at the end. As a result two counts in
OPT_STATS of SCM_TSTAMP_ACK timestamps generated in tcp_ack() may not be
in sync. This patch updates both counts at the same in tcp_ack().

Signed-off-by: Yousuk Seung <ysseung@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agotcp: count sacked packets in tcp_sacktag_state
Yousuk Seung [Sat, 27 Jun 2020 04:05:34 +0000 (21:05 -0700)]
tcp: count sacked packets in tcp_sacktag_state

Add sack_delivered to tcp_sacktag_state and count the number of sacked
and dsacked packets. This is pure refactor for future patches to improve
tracking delivered counts.

Signed-off-by: Yousuk Seung <ysseung@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agotcp: add ece_ack flag to reno sack functions
Yousuk Seung [Sat, 27 Jun 2020 04:05:33 +0000 (21:05 -0700)]
tcp: add ece_ack flag to reno sack functions

Pass a boolean flag that tells the ECE state of the current ack to reno
sack functions. This is pure refactor for future patches to improve
tracking delivered counts.

Signed-off-by: Yousuk Seung <ysseung@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agotcp: stamp SCM_TSTAMP_ACK later in tcp_clean_rtx_queue()
Yousuk Seung [Sat, 27 Jun 2020 04:05:32 +0000 (21:05 -0700)]
tcp: stamp SCM_TSTAMP_ACK later in tcp_clean_rtx_queue()

Currently tp->delivered is updated with sacked packets but not
cumulatively acked when SCP_TSTAMP_ACK is timestamped. This patch moves
a tcp_ack_tstamp() call in tcp_clean_rtx_queue() to later in the loop so
that when a skb is fully acked OPT_STATS of SCM_TSTAMP_ACK will include
the current skb in the delivered count. When not fully acked
tcp_ack_tstamp() is a no-op and there is no change in behavior.

Signed-off-by: Yousuk Seung <ysseung@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'net-atlantic-various-non-functional-changes'
David S. Miller [Fri, 26 Jun 2020 23:32:51 +0000 (16:32 -0700)]
Merge branch 'net-atlantic-various-non-functional-changes'

Igor Russkikh says:

====================
net: atlantic: various non-functional changes

This patchset contains several non-functional changes, which were made in
out of tree driver over the time.
Mostly typos, checkpatch findings and comment fixes.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: atlantic: put ptp code under IS_REACHABLE check
Igor Russkikh [Fri, 26 Jun 2020 18:40:38 +0000 (21:40 +0300)]
net: atlantic: put ptp code under IS_REACHABLE check

A1 requires additional processing for both egress and ingress to support
PTP.
And it makes sense to get rid of this processing altogether (via ifdef),
if PTP clock is disabled globally.

This patch puts the PTP code under the corresponding IS_REACHABLE check.

Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: atlantic: add alignment checks in hw_atl2_utils_fw.c
Mark Starovoytov [Fri, 26 Jun 2020 18:40:37 +0000 (21:40 +0300)]
net: atlantic: add alignment checks in hw_atl2_utils_fw.c

This patch adds alignment checks in all the helper macros in
hw_atl2_utils_fw.c
These alignment checks are compile-time, so runtime is not affected.

All these helper macros assume the length to be aligned (multiple of 4).
If it's not aligned, then there might be issues, e.g. stack corruption.

Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: atlantic: missing space in a comment in aq_nic.h
Dmitry Bezrukov [Fri, 26 Jun 2020 18:40:36 +0000 (21:40 +0300)]
net: atlantic: missing space in a comment in aq_nic.h

This patch add a missing space in the comment in aq_nic.h

Signed-off-by: Dmitry Bezrukov <dbezrukov@marvell.com>
Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: atlantic: fix typo in aq_ring_tx_clean
Mark Starovoytov [Fri, 26 Jun 2020 18:40:35 +0000 (21:40 +0300)]
net: atlantic: fix typo in aq_ring_tx_clean

This patch fixes a typo in aq_ring_tx_clean.
stats is a union, so the typo doesn't cause any issues, but it's a typo
nonetheless.

Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: atlantic: make aq_pci_func_init static
Mark Starovoytov [Fri, 26 Jun 2020 18:40:34 +0000 (21:40 +0300)]
net: atlantic: make aq_pci_func_init static

This patch makes aq_pci_func_init() static, because it's not used anywhere
outside the file itself.

Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: atlantic: Replace ENOTSUPP usage to EOPNOTSUPP
Mark Starovoytov [Fri, 26 Jun 2020 18:40:33 +0000 (21:40 +0300)]
net: atlantic: Replace ENOTSUPP usage to EOPNOTSUPP

This patch replaces ENOTSUPP (where it was used by mistake) with
EOPNOTSUPP.

Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: atlantic: fix variable type in aq_ethtool_get_pauseparam
Nikita Danilov [Fri, 26 Jun 2020 18:40:32 +0000 (21:40 +0300)]
net: atlantic: fix variable type in aq_ethtool_get_pauseparam

This patch fixes the type for variable which is assigned from enum,
as such it should have been int, not u32.

Signed-off-by: Nikita Danilov <ndanilov@marvell.com>
Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: atlantic: MACSec offload statistics checkpatch fix
Mark Starovoytov [Fri, 26 Jun 2020 18:40:31 +0000 (21:40 +0300)]
net: atlantic: MACSec offload statistics checkpatch fix

This patch fixes a checkpatch warning.

Fixes: aec0f1aac58e ("net: atlantic: MACSec offload statistics implementation")

Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'mptcp-refactor-token-container'
David S. Miller [Fri, 26 Jun 2020 23:21:39 +0000 (16:21 -0700)]
Merge branch 'mptcp-refactor-token-container'

Paolo Abeni says:

====================
mptcp: refactor token container

Currently the msk sockets are stored in a single radix tree, protected by a
global spin_lock. This series moves to an hash table, allocated at boot time,
with per bucker spin_lock - alike inet_hashtables, but using a different key:
the token itself.

The above improves scalability, as write operations will have a far later chance
to compete for lock acquisition, allows lockless lookup, and will allow
easier msk traversing - e.g. for diag interface implementation's sake.

This also introduces trivial, related, kunit tests and move the existing in
kernel's one to kunit.

v1 -> v2:
 - fixed a few extra and sparse warns
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomptcp: introduce token KUNIT self-tests
Paolo Abeni [Fri, 26 Jun 2020 17:30:02 +0000 (19:30 +0200)]
mptcp: introduce token KUNIT self-tests

Unit tests for the internal MPTCP token APIs, using KUNIT

v1 -> v2:
 - use the correct RCU annotation when initializing icsk ulp
 - fix a few checkpatch issues

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomptcp: move crypto test to KUNIT
Paolo Abeni [Fri, 26 Jun 2020 17:30:01 +0000 (19:30 +0200)]
mptcp: move crypto test to KUNIT

currently MPTCP uses a custom hook to executed unit tests at
boot time. Let's use the KUNIT framework instead.
Additionally move the relevant code to a separate file and
export the function needed by the test when self-tests
are build as a module.

Co-developed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomptcp: refactor token container
Paolo Abeni [Fri, 26 Jun 2020 17:30:00 +0000 (19:30 +0200)]
mptcp: refactor token container

Replace the radix tree with a hash table allocated
at boot time. The radix tree has some shortcoming:
a single lock is contented by all the mptcp operation,
the lookup currently use such lock, and traversing
all the items would require a lock, too.

With hash table instead we trade a little memory to
address all the above - a per bucket lock is used.

To hash the MPTCP sockets, we re-use the msk' sk_node
entry: the MPTCP sockets are never hashed by the stack.
Replace the existing hash proto callbacks with a dummy
implementation, annotating the above constraint.

Additionally refactor the token creation to code to:

- limit the number of consecutive attempts to a fixed
maximum. Hitting a hash bucket with a long chain is
considered a failed attempt

- accept() no longer can fail to token management.

- if token creation fails at connect() time, we do
fallback to TCP (before the connection was closed)

v1 -> v2:
 - fix "no newline at end of file" - Jakub

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomptcp: add __init annotation on setup functions
Paolo Abeni [Fri, 26 Jun 2020 17:29:59 +0000 (19:29 +0200)]
mptcp: add __init annotation on setup functions

Add the missing annotation in some setup-only
functions.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'net-organize-driver-docs-by-device-type'
David S. Miller [Fri, 26 Jun 2020 23:08:45 +0000 (16:08 -0700)]
Merge branch 'net-organize-driver-docs-by-device-type'

Jakub Kicinski says:

====================
net: organize driver docs by device type

This series finishes off what I started in
commit b255e500c8dc ("net: documentation: build a directory structure for drivers").
The objective is to de-clutter our documentation folder so folks
have a chance of finding relevant info. I _think_ I got all the
driver docs from the main documentation directory this time around.

While doing this I realized that many of them are of limited relevance
these days, so I went ahead and sliced the drivers directory by
technology. Those feeling nostalgic are free to dive into the FDDI,
ATM etc. docs, but for most Ethernet is what we care about.

v1:
 - simplify Intel's docs list in MAINTAINERS.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodocs: networking: move FDDI drivers to the hw driver section
Jakub Kicinski [Fri, 26 Jun 2020 17:27:31 +0000 (10:27 -0700)]
docs: networking: move FDDI drivers to the hw driver section

Move docs for defza and skfp under device_drivers/fddi.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodocs: networking: move ATM drivers to the hw driver section
Jakub Kicinski [Fri, 26 Jun 2020 17:27:30 +0000 (10:27 -0700)]
docs: networking: move ATM drivers to the hw driver section

Move docs for cxacru, fore200e and iphase under device_drivers/atm.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodocs: networking: move AppleTalk / LocalTalk drivers to the hw driver section
Jakub Kicinski [Fri, 26 Jun 2020 17:27:29 +0000 (10:27 -0700)]
docs: networking: move AppleTalk / LocalTalk drivers to the hw driver section

Move docs for cops and ltpc under device_drivers/appletalk.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodocs: networking: move remaining Ethernet driver docs to the hw section
Jakub Kicinski [Fri, 26 Jun 2020 17:27:28 +0000 (10:27 -0700)]
docs: networking: move remaining Ethernet driver docs to the hw section

Move docs for hinic and altera_tse under device_drivers/ethernet.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodocs: networking: move ray_cs to the hw driver section
Jakub Kicinski [Fri, 26 Jun 2020 17:27:27 +0000 (10:27 -0700)]
docs: networking: move ray_cs to the hw driver section

Move ray_cs into Wi-Fi driver docs subdirectory.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodocs: networking: move baycom to the hw driver section
Jakub Kicinski [Fri, 26 Jun 2020 17:27:26 +0000 (10:27 -0700)]
docs: networking: move baycom to the hw driver section

Move baycom to hamradio.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodocs: networking: move z8530 to the hw driver section
Jakub Kicinski [Fri, 26 Jun 2020 17:27:25 +0000 (10:27 -0700)]
docs: networking: move z8530 to the hw driver section

Move z8530 docs to hamradio and wan subdirectories.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodocs: networking: reorganize driver documentation again
Jakub Kicinski [Fri, 26 Jun 2020 17:27:24 +0000 (10:27 -0700)]
docs: networking: reorganize driver documentation again

Organize driver documentation by device type. Most documents
have fairly verbose yet uninformative names, so let users
first select a well defined device type, and then search for
a particular driver.

While at it rename the section from Vendor drivers to
Hardware drivers. This seems more accurate, besides people
sometimes refer to out-of-tree drivers as vendor drivers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'net-phy-relax-PHY-and-MDIO-reset-handling'
David S. Miller [Fri, 26 Jun 2020 20:40:18 +0000 (13:40 -0700)]
Merge branch 'net-phy-relax-PHY-and-MDIO-reset-handling'

Bartosz Golaszewski says:

====================
net: phy: relax PHY and MDIO reset handling

Previously these patches were submitted as part of a larger series[1]
but since the approach in it will have to be reworked I'm resending
the ones that were non-controversial and have been reviewed for upstream.

Florian suggested a better solution for managing multiple resets. While
I will definitely try to implement something at the driver model's bus
level (together with regulator support), the 'resets' and 'reset-gpios'
DT property is a stable ABI defined in mdio.yaml so improving its support
is in order as we'll have to stick with it anyway. Current implementation
contains an unnecessary limitation where drivers without probe() can't
define resets.

Changes from the previous version:
- order forward declarations in patch 4 alphabetically
- collect review tags

[1] https://lkml.org/lkml/2020/6/22/253
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: phy: mdio: reset MDIO devices even if probe() is not implemented
Bartosz Golaszewski [Fri, 26 Jun 2020 15:53:25 +0000 (17:53 +0200)]
net: phy: mdio: reset MDIO devices even if probe() is not implemented

Similarily to PHY drivers - there's no reason to require probe() to be
implemented in order to call mdio_device_reset(). MDIO devices can have
resets defined without needing to do anything in probe().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: phy: reset the PHY even if probe() is not implemented
Bartosz Golaszewski [Fri, 26 Jun 2020 15:53:24 +0000 (17:53 +0200)]
net: phy: reset the PHY even if probe() is not implemented

Currently we only call phy_device_reset() if the PHY driver implements
the probe() callback. This is not mandatory and many drivers (e.g.
realtek) don't need probe() for most devices but still can have reset
GPIOs defined. There's no reason to depend on the presence of probe()
here so pull the reset code out of the if clause.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: mdio: add a forward declaration for reset_control to mdio.h
Bartosz Golaszewski [Fri, 26 Jun 2020 15:53:23 +0000 (17:53 +0200)]
net: mdio: add a forward declaration for reset_control to mdio.h

This header refers to struct reset_control but doesn't include any reset
header. The structure definition is probably somehow indirectly pulled in
since no warnings are reported but for the sake of correctness add the
forward declaration for struct reset_control.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: phy: arrange headers in phy_device.c alphabetically
Bartosz Golaszewski [Fri, 26 Jun 2020 15:53:22 +0000 (17:53 +0200)]
net: phy: arrange headers in phy_device.c alphabetically

Keeping the headers in alphabetical order is better for readability and
allows to easily see if given header is already included.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: phy: arrange headers in mdio_device.c alphabetically
Bartosz Golaszewski [Fri, 26 Jun 2020 15:53:21 +0000 (17:53 +0200)]
net: phy: arrange headers in mdio_device.c alphabetically

Keeping the headers in alphabetical order is better for readability and
allows to easily see if given header is already included.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: phy: arrange headers in mdio_bus.c alphabetically
Bartosz Golaszewski [Fri, 26 Jun 2020 15:53:20 +0000 (17:53 +0200)]
net: phy: arrange headers in mdio_bus.c alphabetically

Keeping the headers in alphabetical order is better for readability and
allows to easily see if given header is already included.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: mvneta: speed down the PHY, if WoL used, to save energy
Daniel González Cabanelas [Fri, 26 Jun 2020 15:18:19 +0000 (17:18 +0200)]
net: mvneta: speed down the PHY, if WoL used, to save energy

Some PHYs connected to this ethernet hardware support the WoL feature.
But when WoL is enabled and the machine is powered off, the PHY remains
waiting for a magic packet at max speed (i.e. 1Gbps), which is a waste of
energy.

Slow down the PHY speed before stopping the ethernet if WoL is enabled,
and save some energy while the machine is powered off or sleeping.

Tested using an Armada 370 based board (LS421DE) equipped with a Marvell
88E1518 PHY.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Fri, 26 Jun 2020 19:22:34 +0000 (12:22 -0700)]
Merge branch '40GbE' of git://git./linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2020-06-25

This series contains updates to i40e driver and removes the individual
driver versions from all of the Intel wired LAN drivers.

Shiraz moves the client header so that it can easily be shared between
the i40e LAN driver and i40iw RDMA driver.

Jesse cleans up the unused defines, since they are just dead weight.

Alek reduces the unreasonably long wait time for a PF reset after reboot
by using jiffies to limit the maximum wait time for the PF reset to
succeed.  Added additional logging to let the user know when the driver
transitions into recovery mode.  Adds new device support for our 5 Gbps
NICs.

Todd adds a check to see if MFS is set after warm reboot and notifies
the user when MFS is set to anything lower than the default value.

Arkadiusz fixes a possible race condition, where were holding a
spin-lock while in atomic context.

v2: removed code comments that were no longer applicable in patch 2 of
    the series.  Also removed 'inline' from patch 4 and patch 8 of the
    series.  Also re-arranged code to be able to remove the forward
    function declarations.  Dropped patch 9 of the series, while the
    author works on cleaning up the commit message.
v3: Updated patch 8 description to answer Jakub's questions
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agobonding: Remove extraneous parentheses in bond_setup
Nathan Chancellor [Fri, 26 Jun 2020 04:10:02 +0000 (21:10 -0700)]
bonding: Remove extraneous parentheses in bond_setup

Clang warns:

drivers/net/bonding/bond_main.c:4657:23: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

drivers/net/bonding/bond_main.c:4681:23: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
        if ((BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP))
             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

This warning occurs when a comparision has two sets of parentheses,
which is usually the convention for doing an assignment within an
if statement. Since equality comparisons do not need a second set of
parentheses, remove them to fix the warning.

Fixes: 18cb261afd7b ("bonding: support hardware encryption offload to slaves")
Link: https://github.com/ClangBuiltLinux/linux/issues/1066
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reported-by: kernelci.org bot <bot@kernelci.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: stmmac: dwmac-meson8b: use clk_parent_data for clock registration
Martin Blumenstingl [Thu, 25 Jun 2020 18:21:42 +0000 (20:21 +0200)]
net: stmmac: dwmac-meson8b: use clk_parent_data for clock registration

Simplify meson8b_init_rgmii_tx_clk() by using struct clk_parent_data to
initialize the clock parents. No functional changes intended.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agobnx2x: use generic power management
Vaibhav Gupta [Wed, 24 Jun 2020 17:51:17 +0000 (23:21 +0530)]
bnx2x: use generic power management

With legacy PM, drivers themselves were responsible for managing the
device's power states and takes care of register states.

After upgrading to the generic structure, PCI core will take care of
required tasks and drivers should do only device-specific operations.

The driver was also calling bnx2x_set_power_state() to set the power state
of the device by changing the device's registers' value. It is no more
needed.

Compile-tested only.

Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Acked-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoi40e: Remove scheduling while atomic possibility
Aleksandr Loktionov [Fri, 29 May 2020 21:10:39 +0000 (14:10 -0700)]
i40e: Remove scheduling while atomic possibility

In some occasions task held spinlock (mac_filter_hash_lock),
while being rescheduled due to admin queue mutex_lock.  The struct
i40e_spinlock asq_spinlock, which later expands to struct mutex
spinlock.  Moved i40e_aq_set_vsi_multicast_promiscuous(),
i40e_aq_set_vsi_unicast_promiscuous(),
i40e_aq_set_vsi_mc_promisc_on_vlan(), and
i40e_aq_set_vsi_uc_promisc_on_vlan() outside of atomic context.  Without
this patch there is a race condition, which might result in scheduling
while in atomic context.  The race condition is between the thread, which
holds mac_filter_hash_lock, while trying to acquire an admin queue mutex
and a thread, which already has said admin queue mutex. The thread, which
holds spinlock, fails to acquire the mutex, which causes this thread to
sleep.

Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
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>
3 years agoi40e: Add support for 5Gbps cards
Aleksandr Loktionov [Fri, 29 May 2020 20:01:22 +0000 (13:01 -0700)]
i40e: Add support for 5Gbps cards

Make possible for the i40e driver to bind to the new v710 for 5GBASE-T
NICs.

Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agonet/intel: remove driver versions from Intel drivers
Jeff Kirsher [Fri, 29 May 2020 07:18:33 +0000 (00:18 -0700)]
net/intel: remove driver versions from Intel drivers

As with other networking drivers, remove the unnecessary driver version
from the Intel drivers. The ethtool driver information and module version
will then report the kernel version instead.

For ixgbe, i40e and ice drivers, the driver passes the driver version to
the firmware to confirm that we are up and running.  So we now pass the
value of UTS_RELEASE to the firmware.  This adminq call is required per
the HAS document.  The Device then sends an indication to the BMC that the
PF driver is present. This is done using Host NC Driver Status Indication
in NC-SI Get Link command or via the Host Network Controller Driver Status
Change AEN.

What the BMC may do with this information is implementation-dependent, but
this is a standard NC-SI 1.1 command we honor per the HAS.

CC: Bruce Allan <bruce.w.allan@intel.com>
CC: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Alek Loktionov <aleksandr.loktionov@intel.com>
CC: Kevin Liedtke <kevin.d.liedtke@intel.com>
CC: Aaron Rowden <aaron.f.rowden@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Co-developed-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
3 years agoi40e: Add a check to see if MFS is set
Todd Fujinaka [Fri, 29 May 2020 05:27:12 +0000 (22:27 -0700)]
i40e: Add a check to see if MFS is set

A customer was chain-booting to provision his systems and one of the
steps was setting MFS. MFS isn't cleared by normal warm reboots
(clearing requires a GLOBR) and there was no indication of why Jumbo
Frame receives were failing.

Add a warning if MFS is set to anything lower than the default.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoi40e: detect and log info about pre-recovery mode
Piotr Kwapulinski [Wed, 27 May 2020 21:12:04 +0000 (14:12 -0700)]
i40e: detect and log info about pre-recovery mode

Detect and log information about pre-recovery mode when firmware
transitions to a recovery mode.
When a firmware transitions to a recovery mode it stores a number
of unexpected EMP resets in one of its registers. The number of EMP
resets ranging from 0x21 to 0x2A indicates that FW transitions
to recovery mode. Use these values to emit log entry about transition
process. Previously the pre-recovery mode may not have been detected
and there was no log entry when NIC was in pre-recovery mode.

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoi40e: make PF wait reset loop reliable
Piotr Kwapulinski [Tue, 26 May 2020 10:51:12 +0000 (12:51 +0200)]
i40e: make PF wait reset loop reliable

Use jiffies to limit max waiting time for PF reset to succeed.
Previous wait loop was unreliable. It required unreasonably long time
to wait for PF reset after reboot when NIC was about to enter
recovery mode

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoi40e: remove unused defines
Jesse Brandeburg [Tue, 7 Jan 2020 00:09:33 +0000 (16:09 -0800)]
i40e: remove unused defines

Remove all the unused defines as they are just dead weight.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoi40e: Move client header location
Shiraz Saleem [Mon, 4 May 2020 16:43:48 +0000 (09:43 -0700)]
i40e: Move client header location

Move i40e_client.h to include/linux/net/intel/*
since its shared between i40iw and i40e.

Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
3 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
David S. Miller [Fri, 26 Jun 2020 02:29:51 +0000 (19:29 -0700)]
Merge git://git./linux/kernel/git/netdev/net

Minor overlapping changes in xfrm_device.c, between the double
ESP trailing bug fix setting the XFRM_INIT flag and the changes
in net-next preparing for bonding encryption support.

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Linus Torvalds [Fri, 26 Jun 2020 01:27:40 +0000 (18:27 -0700)]
Merge git://git./linux/kernel/git/netdev/net

Pull networking fixes from David Miller:

 1) Don't insert ESP trailer twice in IPSEC code, from Huy Nguyen.

 2) The default crypto algorithm selection in Kconfig for IPSEC is out
    of touch with modern reality, fix this up. From Eric Biggers.

 3) bpftool is missing an entry for BPF_MAP_TYPE_RINGBUF, from Andrii
    Nakryiko.

 4) Missing init of ->frame_sz in xdp_convert_zc_to_xdp_frame(), from
    Hangbin Liu.

 5) Adjust packet alignment handling in ax88179_178a driver to match
    what the hardware actually does. From Jeremy Kerr.

 6) register_netdevice can leak in the case one of the notifiers fail,
    from Yang Yingliang.

 7) Use after free in ip_tunnel_lookup(), from Taehee Yoo.

 8) VLAN checks in sja1105 DSA driver need adjustments, from Vladimir
    Oltean.

 9) tg3 driver can sleep forever when we get enough EEH errors, fix from
    David Christensen.

10) Missing {READ,WRITE}_ONCE() annotations in various Intel ethernet
    drivers, from Ciara Loftus.

11) Fix scanning loop break condition in of_mdiobus_register(), from
    Florian Fainelli.

12) MTU limit is incorrect in ibmveth driver, from Thomas Falcon.

13) Endianness fix in mlxsw, from Ido Schimmel.

14) Use after free in smsc95xx usbnet driver, from Tuomas Tynkkynen.

15) Missing bridge mrp configuration validation, from Horatiu Vultur.

16) Fix circular netns references in wireguard, from Jason A. Donenfeld.

17) PTP initialization on recovery is not done properly in qed driver,
    from Alexander Lobakin.

18) Endian conversion of L4 ports in filters of cxgb4 driver is wrong,
    from Rahul Lakkireddy.

19) Don't clear bound device TX queue of socket prematurely otherwise we
    get problems with ktls hw offloading, from Tariq Toukan.

20) ipset can do atomics on unaligned memory, fix from Russell King.

21) Align ethernet addresses properly in bridging code, from Thomas
    Martitz.

22) Don't advertise ipv4 addresses on SCTP sockets having ipv6only set,
    from Marcelo Ricardo Leitner.

* git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (149 commits)
  rds: transport module should be auto loaded when transport is set
  sch_cake: fix a few style nits
  sch_cake: don't call diffserv parsing code when it is not needed
  sch_cake: don't try to reallocate or unshare skb unconditionally
  ethtool: fix error handling in linkstate_prepare_data()
  wil6210: account for napi_gro_receive never returning GRO_DROP
  hns: do not cast return value of napi_gro_receive to null
  socionext: account for napi_gro_receive never returning GRO_DROP
  wireguard: receive: account for napi_gro_receive never returning GRO_DROP
  vxlan: fix last fdb index during dump of fdb with nhid
  sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket
  tc-testing: avoid action cookies with odd length.
  bpf: tcp: bpf_cubic: fix spurious HYSTART_DELAY exit upon drop in min RTT
  tcp_cubic: fix spurious HYSTART_DELAY exit upon drop in min RTT
  net: dsa: sja1105: fix tc-gate schedule with single element
  net: dsa: sja1105: recalculate gating subschedule after deleting tc-gate rules
  net: dsa: sja1105: unconditionally free old gating config
  net: dsa: sja1105: move sja1105_compose_gating_subschedule at the top
  net: macb: free resources on failure path of at91ether_open()
  net: macb: call pm_runtime_put_sync on failure path
  ...

3 years agosch_cake: add RFC 8622 LE PHB support to CAKE diffserv handling
Kevin Darbyshire-Bryant [Thu, 25 Jun 2020 20:18:00 +0000 (22:18 +0200)]
sch_cake: add RFC 8622 LE PHB support to CAKE diffserv handling

Change tin mapping on diffserv3, 4 & 8 for LE PHB support, in essence
making LE a member of the Bulk tin.

Bulk has the least priority and minimum of 1/16th total bandwidth in the
face of higher priority traffic.

NB: Diffserv 3 & 4 swap tin 0 & 1 priorities from the default order as
found in diffserv8, in case anyone is wondering why it looks a bit odd.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
[ reword commit message slightly ]
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agords: transport module should be auto loaded when transport is set
Rao Shoaib [Thu, 25 Jun 2020 20:46:00 +0000 (13:46 -0700)]
rds: transport module should be auto loaded when transport is set

This enhancement auto loads transport module when the transport
is set via SO_RDS_TRANSPORT socket option.

Reviewed-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Reviewed-by: Håkon Bugge <haakon.bugge@oracle.com>
Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com>
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'sched-A-couple-of-fixes-for-sch_cake'
David S. Miller [Thu, 25 Jun 2020 23:24:05 +0000 (16:24 -0700)]
Merge branch 'sched-A-couple-of-fixes-for-sch_cake'

Toke Høiland-Jørgensen says:

====================
sched: A couple of fixes for sch_cake

This series contains a couple of fixes for diffserv handling in sch_cake that
provide a nice speedup (with a somewhat pedantic nit fix tacked on to the end).

Not quite sure about whether this should go to stable; it does provide a nice
speedup, but it's not strictly a fix in the "correctness" sense. I lean towards
including this in stable as well, since our most important consumer of that
(OpenWrt) is likely to backport the series anyway.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosch_cake: fix a few style nits
Toke Høiland-Jørgensen [Thu, 25 Jun 2020 20:12:09 +0000 (22:12 +0200)]
sch_cake: fix a few style nits

I spotted a few nits when comparing the in-tree version of sch_cake with
the out-of-tree one: A redundant error variable declaration shadowing an
outer declaration, and an indentation alignment issue. Fix both of these.

Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake) qdisc")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosch_cake: don't call diffserv parsing code when it is not needed
Toke Høiland-Jørgensen [Thu, 25 Jun 2020 20:12:08 +0000 (22:12 +0200)]
sch_cake: don't call diffserv parsing code when it is not needed

As a further optimisation of the diffserv parsing codepath, we can skip it
entirely if CAKE is configured to neither use diffserv-based
classification, nor to zero out the diffserv bits.

Fixes: c87b4ecdbe8d ("sch_cake: Make sure we can write the IP header before changing DSCP bits")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosch_cake: don't try to reallocate or unshare skb unconditionally
Ilya Ponetayev [Thu, 25 Jun 2020 20:12:07 +0000 (22:12 +0200)]
sch_cake: don't try to reallocate or unshare skb unconditionally

cake_handle_diffserv() tries to linearize mac and network header parts of
skb and to make it writable unconditionally. In some cases it leads to full
skb reallocation, which reduces throughput and increases CPU load. Some
measurements of IPv4 forward + NAPT on MIPS router with 580 MHz single-core
CPU was conducted. It appears that on kernel 4.9 skb_try_make_writable()
reallocates skb, if skb was allocated in ethernet driver via so-called
'build skb' method from page cache (it was discovered by strange increase
of kmalloc-2048 slab at first).

Obtain DSCP value via read-only skb_header_pointer() call, and leave
linearization only for DSCP bleaching or ECN CE setting. And, as an
additional optimisation, skip diffserv parsing entirely if it is not needed
by the current configuration.

Fixes: c87b4ecdbe8d ("sch_cake: Make sure we can write the IP header before changing DSCP bits")
Signed-off-by: Ilya Ponetayev <i.ponetaev@ndmsystems.com>
[ fix a few style issues, reflow commit message ]
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'net-phy-mscc-multiple-improvements'
David S. Miller [Thu, 25 Jun 2020 23:22:11 +0000 (16:22 -0700)]
Merge branch 'net-phy-mscc-multiple-improvements'

Antoine Tenart says:

====================
net: phy: mscc: multiple improvements

This series contains various improvements to the MSCC PHY driver, fixing
sparse and smatch warnings, using functions provided by the PHY core,
and improving the driver consistency and maintenance.

I don't think any of those improvements and fixes is worth backporting
to stable trees.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: phy: mscc: improve vsc8514/8584_config_init consistency
Antoine Tenart [Thu, 25 Jun 2020 15:42:11 +0000 (17:42 +0200)]
net: phy: mscc: improve vsc8514/8584_config_init consistency

All PHY read and write return values are checked for errors in
vsc8514_config_init and vsc8584_config_init, except for one. Fix this.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: phy: mscc: remove useless page configuration in the config init
Antoine Tenart [Thu, 25 Jun 2020 15:42:10 +0000 (17:42 +0200)]
net: phy: mscc: remove useless page configuration in the config init

In the middle of vsc8584_config_init and vsc8514_config_init, the page
is set to 'standard'. This is the default value, and the page isn't set
to another value before. Those pages configuration can be safely
removed.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>