platform/kernel/linux-starfive.git
4 years agonet: stmmac: Integrate it with DesignWare XPCS
Jose Abreu [Mon, 9 Mar 2020 08:36:27 +0000 (09:36 +0100)]
net: stmmac: Integrate it with DesignWare XPCS

Adds all the necessary logic so that stmmac can be used with Synopsys
DesignWare XPCS.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: phy: Add Synopsys DesignWare XPCS MDIO module
Jose Abreu [Mon, 9 Mar 2020 08:36:26 +0000 (09:36 +0100)]
net: phy: Add Synopsys DesignWare XPCS MDIO module

Synopsys DesignWare XPCS is an MMD that can manage link status,
auto-negotiation, link training, ...

In this commit we add basic support for XPCS using USXGMII interface and
Clause 73 Auto-negotiation.

This is highly tied with PHYLINK and can't be used without it. A given
ethernet driver can use the provided callbacks to add the support for
XPCS.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: phylink: Test if MAC/PCS support Autoneg
Jose Abreu [Mon, 9 Mar 2020 08:36:25 +0000 (09:36 +0100)]
net: phylink: Test if MAC/PCS support Autoneg

We may have cases where MAC or PCS do not support Autoneg. Check if it
is supported after validate callback is called.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: phylink: Add missing Backplane speeds
Jose Abreu [Mon, 9 Mar 2020 08:36:24 +0000 (09:36 +0100)]
net: phylink: Add missing Backplane speeds

USXGMII also supports these missing backplane speeds.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: stmmac: Use resolved link config in mac_link_up()
Jose Abreu [Mon, 9 Mar 2020 08:36:23 +0000 (09:36 +0100)]
net: stmmac: Use resolved link config in mac_link_up()

Convert the stmmac ethernet driver to use the finalised link parameters
in mac_link_up() rather than the parameters in mac_config().

Suggested-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: stmmac: Fallback to dev_fwnode() if needed
Jose Abreu [Mon, 9 Mar 2020 08:36:22 +0000 (09:36 +0100)]
net: stmmac: Fallback to dev_fwnode() if needed

When CONFIG_OF is not enabled, of_fwnode_handle() will return NULL, even
though we can have a FW handle from a given device.

Fallback to dev_fwnode() helper if needed.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: stmmac: Switch to linkmode_and()/linkmode_andnot()
Jose Abreu [Mon, 9 Mar 2020 08:36:21 +0000 (09:36 +0100)]
net: stmmac: Switch to linkmode_and()/linkmode_andnot()

Use the linkmode_and()/linkmode_andnot() helpers to simplify the code.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: stmmac: selftests: Do not fail if PHY is not attached
Jose Abreu [Mon, 9 Mar 2020 08:36:20 +0000 (09:36 +0100)]
net: stmmac: selftests: Do not fail if PHY is not attached

If a PHY is not attached, we can still run the tests with MAC loopback
mode. Return -EOPNOTSUPP error code in PHY loopback test so that global
status is not a failure.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge tag 'mlx5-updates-2020-03-09' of git://git.kernel.org/pub/scm/linux/kernel...
David S. Miller [Tue, 10 Mar 2020 02:40:42 +0000 (19:40 -0700)]
Merge tag 'mlx5-updates-2020-03-09' of git://git./linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-updates-2020-03-09

This series provides updates to mlx5 driver:

1) Use vport metadata matching only when mandatory
2) Introduce root flow table and ethtool steering for uplink representors
3) Expose port speed via FW when link modes are not available
3) Misc cleanups
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'hns3-next'
David S. Miller [Tue, 10 Mar 2020 02:36:13 +0000 (19:36 -0700)]
Merge branch 'hns3-next'

Huazhong Tan says:

====================
net: hns3: misc updates for -net-next

This series includes some misc updates for the HNS3 ethernet driver.

[patch 1] fixes some mixed type operation warning.
[patch 2] renames a macro to make it more readable.
[patch 3 & 4]  removes some unnecessary code.
[patch 5] adds check before assert VF reset to prevent some unsuitable
error log.
[patch 6 - 9] some modifications related to printing.

Change log:
V1->V2: fixes a wrong print format in [patch 1] suggested by Jian Shen.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: delete unnecessary logs after kzalloc fails
Yufeng Mo [Sat, 7 Mar 2020 03:42:50 +0000 (11:42 +0800)]
net: hns3: delete unnecessary logs after kzalloc fails

Since kernel already has logs after kzalloc fails,
it's unnecessary to print duplicate logs. So this
patch deletes these logs.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: synchronize some print relating to reset issue
Huazhong Tan [Sat, 7 Mar 2020 03:42:49 +0000 (11:42 +0800)]
net: hns3: synchronize some print relating to reset issue

This patch modifies some printing relating to reset issue.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: print out command code when dump fails in debugfs
Yufeng Mo [Sat, 7 Mar 2020 03:42:48 +0000 (11:42 +0800)]
net: hns3: print out command code when dump fails in debugfs

This patch adds a local variable to save the command code in
some dump cases which need to modify the command code, then
the failing command code can be print out for debugging.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: print out status register when VF receives unknown source interrupt
Huazhong Tan [Sat, 7 Mar 2020 03:42:47 +0000 (11:42 +0800)]
net: hns3: print out status register when VF receives unknown source interrupt

When received an unknown vector 0 interrupt, there is not a
helpful information for user to realize that now. So this patch
prints out the value of the status register for this case, and
uses dev_info() instead of dev_dbg() in hclge_check_event_cause().

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: add a check before PF inform VF to reset
Yonglong Liu [Sat, 7 Mar 2020 03:42:46 +0000 (11:42 +0800)]
net: hns3: add a check before PF inform VF to reset

When setting VF's MAC from PF, if the VF driver not loaded, the
firmware will return error to PF.

So PF should check whether VF is alive before sending message to
VF when setting VF's MAC.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: delete some reduandant code
Guojia Liao [Sat, 7 Mar 2020 03:42:45 +0000 (11:42 +0800)]
net: hns3: delete some reduandant code

In hclge_add_mc_addr_common() and hclge_rm_mc_addr_common(),
variable req had been set as "0" by memset(), so it's unnecessary
to set .entry_type field as "0" with hnae3_set_bit() again.

Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: remove an unnecessary resetting check in hclge_handle_hw_ras_error()
Yufeng Mo [Sat, 7 Mar 2020 03:42:44 +0000 (11:42 +0800)]
net: hns3: remove an unnecessary resetting check in hclge_handle_hw_ras_error()

In hclge_handle_hw_ras_error(), it is unnecessary to check
HCLGE_STATE_RST_HANDLING flag, because the reset priority
has been ensured by the process itself.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: rename macro HCLGE_MAX_NCL_CONFIG_LENGTH
Yufeng Mo [Sat, 7 Mar 2020 03:42:43 +0000 (11:42 +0800)]
net: hns3: rename macro HCLGE_MAX_NCL_CONFIG_LENGTH

The name of macro HCLGE_MAX_NCL_CONFIG_LENGTH is inaccurate,
this patch renames it to HCLGE_NCL_CONFIG_LENGTH_IN_EACH_CMD.

Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: hns3: fix some mixed type assignment
Guojia Liao [Sat, 7 Mar 2020 03:42:42 +0000 (11:42 +0800)]
net: hns3: fix some mixed type assignment

This patch cleans up some incorrect type in assignment reported by sparse
and compiler.
The warning as below:
- warning : restricted __le16 degrades to integer
- warning : cast from restricted __le32
- warning : cast from restricted __be32
- warning : cast from restricted __be16
and "mixed operation".

Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'ionic-updates'
David S. Miller [Tue, 10 Mar 2020 02:34:04 +0000 (19:34 -0700)]
Merge branch 'ionic-updates'

Shannon Nelson says:

====================
ionic updates

This is a set of small updates for the Pensando ionic driver, some
from internal work, some a result of mailing list discussions.

v4 - don't register mgmt device netdev
v3 - changed __attribute__(packed)) to __packed
v2 - removed print from ionic_init_module()
====================

Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoionic: drop ethtool driver version
Shannon Nelson [Sat, 7 Mar 2020 01:04:08 +0000 (17:04 -0800)]
ionic: drop ethtool driver version

Use the default kernel version in ethtool drv_info output
and drop the module version.

Cc: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoionic: add support for device id 0x1004
Shannon Nelson [Sat, 7 Mar 2020 01:04:07 +0000 (17:04 -0800)]
ionic: add support for device id 0x1004

Add support for the management port device id.  This is to
capture the device and set it up for devlink use, but not set
it up for network operations.  We still use a netdev object
in order to use the napi infrasucture for processing adminq
and notifyq messages, we just don't register the netdev.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoionic: print pci bus lane info
Shannon Nelson [Sat, 7 Mar 2020 01:04:06 +0000 (17:04 -0800)]
ionic: print pci bus lane info

Print the PCI bus lane information so people can keep an
eye out for poor configurations that might not support
the advertised speed.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoionic: support ethtool rxhash disable
Shannon Nelson [Sat, 7 Mar 2020 01:04:05 +0000 (17:04 -0800)]
ionic: support ethtool rxhash disable

We can disable rxhashing by setting rss_types to 0.  The user
can toggle this with "ethtool -K <ethX> rxhash off|on",
which calls into the .ndo_set_features callback with the
NETIF_F_RXHASH feature bit set or cleared.  This patch adds
a check for that bit and updates the FW if necessary.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoionic: clean up bitflag usage
Shannon Nelson [Sat, 7 Mar 2020 01:04:04 +0000 (17:04 -0800)]
ionic: clean up bitflag usage

Remove the unused flags field and and fix the bitflag names
to include the _F_ flag hint.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoionic: improve irq numa locality
Shannon Nelson [Sat, 7 Mar 2020 01:04:03 +0000 (17:04 -0800)]
ionic: improve irq numa locality

Spreading the interrupts across the CPU cores is good for load
balancing, but not necessarily as good when using a CPU/core
that is not part of the NUMA local CPU.  If it can be localized,
the kernel's cpumask_local_spread() service will pick a core
that is on the node close to the PCI device.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoionic: remove pragma packed
Shannon Nelson [Sat, 7 Mar 2020 01:04:02 +0000 (17:04 -0800)]
ionic: remove pragma packed

Replace the misguided "#pragma packed" with tags on each
struct/union definition that actually needs it.  This is safer
and more efficient on the various compilers and architectures.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoionic: keep ionic dev on lif init fail
Shannon Nelson [Sat, 7 Mar 2020 01:04:01 +0000 (17:04 -0800)]
ionic: keep ionic dev on lif init fail

If the basic ionic interface works but the lif creation fails,
don't fail the probe.  This will allow us to use the driver to
help inspect the hw/fw/pci interface for debugging purposes.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'mptcp-don-t-auto-adjust-rcvbuf-size-if-locked'
David S. Miller [Tue, 10 Mar 2020 02:30:08 +0000 (19:30 -0700)]
Merge branch 'mptcp-don-t-auto-adjust-rcvbuf-size-if-locked'

Florian Westphal says:

====================
mptcp: don't auto-adjust rcvbuf size if locked

The mptcp receive buffer is auto-sized based on the subflow receive
buffer.  Don't do this if userspace specfied a value via SO_RCVBUF
setsockopt.

Also update selftest program to provide a new option to set a fixed
size.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomptcp: don't grow mptcp socket receive buffer when rcvbuf is locked
Florian Westphal [Fri, 6 Mar 2020 20:29:46 +0000 (21:29 +0100)]
mptcp: don't grow mptcp socket receive buffer when rcvbuf is locked

The mptcp rcvbuf size is adjusted according to the subflow rcvbuf size.
This should not be done if userspace did set a fixed value.

Fixes: 600911ff5f72bae ("mptcp: add rmem queue accounting")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agomptcp: selftests: add rcvbuf set option
Florian Westphal [Fri, 6 Mar 2020 20:29:45 +0000 (21:29 +0100)]
mptcp: selftests: add rcvbuf set option

allows to run the tests with fixed receive buffer by passing
"-R <value>" to mptcp_connect.sh.

While at it, add a default 10 second poll timeout so the "-t"
becomes optional -- this makes mptcp_connect simpler to use
during manual testing.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: mt7530: add support for port mirroring
DENG Qingfang [Fri, 6 Mar 2020 12:35:35 +0000 (20:35 +0800)]
net: dsa: mt7530: add support for port mirroring

Add support for configuring port mirroring through the cls_matchall
classifier. We do a full ingress and/or egress capture towards a
capture port.
MT7530 supports one monitor port and multiple mirrored ports.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge tag 'batadv-next-for-davem-20200306' of git://git.open-mesh.org/linux-merge
David S. Miller [Tue, 10 Mar 2020 02:14:18 +0000 (19:14 -0700)]
Merge tag 'batadv-next-for-davem-20200306' of git://git.open-mesh.org/linux-merge

Simon Wunderlich says:

====================
This cleanup patchset includes the following patches:

 - bump version strings, by Simon Wunderlich

 - Avoid RCU list-traversal in spinlock, by Sven Eckelmann

 - Replace zero-length array with flexible-array member,
   by Gustavo A. R. Silva
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'r8169-series-with-improvements-to-rtl_tx'
David S. Miller [Tue, 10 Mar 2020 02:07:42 +0000 (19:07 -0700)]
Merge branch 'r8169-series-with-improvements-to-rtl_tx'

Heiner Kallweit says:

====================
r8169: series with improvements to rtl_tx

This series includes few improvements to rtl_tx().
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: remove now unneeded barrier in rtl_tx
Heiner Kallweit [Fri, 6 Mar 2020 22:58:50 +0000 (23:58 +0100)]
r8169: remove now unneeded barrier in rtl_tx

Until ae84bc187337 ("r8169: don't use bit LastFrag in tx descriptor
after send") we used to access another bit in the descriptor, therefore
it seems the barrier was needed. Since this commit DescOwn is the
only bit we're interested in, so the barrier isn't needed any longer.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: simplify usage of rtl8169_unmap_tx_skb
Heiner Kallweit [Fri, 6 Mar 2020 22:56:38 +0000 (23:56 +0100)]
r8169: simplify usage of rtl8169_unmap_tx_skb

Simplify the parameters taken by rtl8169_unmap_tx_skb, this makes
usage of this function easier to read and understand.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: ensure tx_skb is fully reset after calling rtl8169_unmap_tx_skb
Heiner Kallweit [Fri, 6 Mar 2020 22:55:42 +0000 (23:55 +0100)]
r8169: ensure tx_skb is fully reset after calling rtl8169_unmap_tx_skb

So far tx_skb->skb is the only member of the two structs that is not
reset. Make understanding the code easier by resetting both structs
completely in rtl8169_unmap_tx_skb.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agor8169: convert while to for loop in rtl_tx
Heiner Kallweit [Fri, 6 Mar 2020 22:54:47 +0000 (23:54 +0100)]
r8169: convert while to for loop in rtl_tx

Slightly improve the code by converting this while to a for loop.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 's390-qeth-next'
David S. Miller [Tue, 10 Mar 2020 01:16:06 +0000 (18:16 -0700)]
Merge branch 's390-qeth-next'

Julian Wiedmann says:

====================
s390/qeth: updates 2020-03-06

please apply the following patch series for qeth to netdev's net-next
tree.

Just a small update to take care of a regression wrt to IRQ handling in
net-next, reported by Qian Cai. The fix needs some qdio layer changes,
so you will find Vasily's Acked-by in that patch.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agos390/qeth: remove VNICC callback parameter struct
Julian Wiedmann [Fri, 6 Mar 2020 08:13:11 +0000 (09:13 +0100)]
s390/qeth: remove VNICC callback parameter struct

After recent cleanups this is just a complicated wrapper around an u32*.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agos390/qdio: add tighter controls for IRQ polling
Julian Wiedmann [Fri, 6 Mar 2020 08:13:10 +0000 (09:13 +0100)]
s390/qdio: add tighter controls for IRQ polling

Once the call to qdio_establish() has completed, qdio is free to deliver
data IRQs to the device driver's IRQ poll handler.

For qeth (the only qdio driver that currently uses IRQ polling) this is
problematic, since the IRQs can arrive before its NAPI instance is
even registered. Calling napi_schedule() from qeth_qdio_start_poll()
then crashes in various nasty ways.

Until recently qeth checked for IFF_UP to drop such early interrupts,
but that's fragile as well since it doesn't enforce any ordering.

Fix this properly by bringing up the qdio device in IRQS_DISABLED mode,
and have the driver explicitly opt-in to receive data IRQs.
qeth does so from qeth_open(), which kick-starts a NAPI poll and then
calls qdio_start_irq() from qeth_poll().

Also add a matching qdio_stop_irq() in qeth_stop() to switch the qdio
dataplane back into a disabled state.

Fixes: 3d35dbe6224e ("s390/qeth: don't check for IFF_UP when scheduling napi")
CC: Qian Cai <cai@lca.pw>
Reported-by: Qian Cai <cai@lca.pw>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: sched: pie: change tc_pie_xstats->prob
Leslie Monis [Mon, 9 Mar 2020 19:10:33 +0000 (00:40 +0530)]
net: sched: pie: change tc_pie_xstats->prob

Commit 105e808c1da2 ("pie: remove pie_vars->accu_prob_overflows")
changes the scale of probability values in PIE from (2^64 - 1) to
(2^56 - 1). This affects the precision of tc_pie_xstats->prob in
user space.

This patch ensures user space is unaffected.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Leslie Monis <lesliemonis@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agotcp: add bytes not sent to SCM_TIMESTAMPING_OPT_STATS
Yousuk Seung [Mon, 9 Mar 2020 20:16:40 +0000 (13:16 -0700)]
tcp: add bytes not sent to SCM_TIMESTAMPING_OPT_STATS

Add TCP_NLA_BYTES_NOTSENT to SCM_TIMESTAMPING_OPT_STATS that reports
bytes in the write queue but not sent. This is the same metric as
what is exported with tcp_info.tcpi_notsent_bytes.

Signed-off-by: Yousuk Seung <ysseung@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/mlx5e: Show/set Rx network flow classification rules on ul rep
Vlad Buslov [Fri, 10 May 2019 17:42:49 +0000 (20:42 +0300)]
net/mlx5e: Show/set Rx network flow classification rules on ul rep

Reuse infrastructure that already exists for pf in legacy mode to show/set
Rx network flow classification rules for uplink representors.

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
4 years agonet/mlx5e: Init ethtool steering for representors
Vlad Buslov [Fri, 10 May 2019 17:19:29 +0000 (20:19 +0300)]
net/mlx5e: Init ethtool steering for representors

During transition to uplink representors the code responsible for
initializing ethtool steering functionality wasn't added to representor
init rx routine. This causes NULL pointer dereference during configuration
of network flow classification rule with ethtool (only possible to
reproduce with next commit in this series which registers necessary ethtool
callbacks).

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
4 years agonet/mlx5e: Show/set Rx flow indir table and RSS hash key on ul rep
Vlad Buslov [Fri, 10 May 2019 12:19:35 +0000 (15:19 +0300)]
net/mlx5e: Show/set Rx flow indir table and RSS hash key on ul rep

Reuse infrastructure that already exists for pf in legacy mode to show/set
Rx flow hash indirection table and RSS hash key for uplink representors.

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
4 years agonet/mlx5e: Introduce root ft concept for representors netdevs
Saeed Mahameed [Wed, 15 May 2019 09:21:35 +0000 (02:21 -0700)]
net/mlx5e: Introduce root ft concept for representors netdevs

Uplink representor traffic will be redirected to an empty root ft rather
than directly to a direct tir or ttc table, this root ft will be empty and
will be used as a link for auto-chaining with ttc table or ethtool tables
in downstream patches.

On load, fs core will connect uplink rep root_ft with ttc table.  In case
ethtool steering will be used, fs core will auto connect root_ft with
the ethtool bypass tables, which will be connected with the ttc table.

vport_rx_rule[uplink_rep]->root_ft->ethtool->ttc.

For non-uplink representors, for simplicity root_ft will always point at
ttc table, hence the replace vport_rx rule logic is removed.

vport_rx_rule[non_uplink_rep]->root_ft(ttc).

For now ethtool steering support can only be available on uplink rep.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
4 years agonet/mlx5: E-switch, make query inline mode a static function
Parav Pandit [Wed, 18 Dec 2019 09:08:38 +0000 (03:08 -0600)]
net/mlx5: E-switch, make query inline mode a static function

mlx5_eswitch_inline_mode_get() is used only in eswitch_offloads.c.
Hence, make it static and adjacent to its caller function.

Reviewed-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Bodong Wang <bodong@mellanox.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
4 years agonet/mlx5: Allocate smaller size tables for ft offload
Paul Blakey [Wed, 8 Jan 2020 12:31:53 +0000 (14:31 +0200)]
net/mlx5: Allocate smaller size tables for ft offload

Instead of giving ft tables one of the largest tables available - 4M,
give it a more reasonable size - 64k. Especially since it will
always be created as a miss hook in the following patch.

Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
4 years agonet/mlx5e: Fix an IS_ERR() vs NULL check
Dan Carpenter [Wed, 4 Mar 2020 14:22:24 +0000 (17:22 +0300)]
net/mlx5e: Fix an IS_ERR() vs NULL check

The esw_vport_tbl_get() function returns error pointers on error.

Fixes: 96e326878fa5 ("net/mlx5e: Eswitch, Use per vport tables for mirroring")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
4 years agonet/mlx5: Verify goto chain offload support
Eli Cohen [Tue, 18 Feb 2020 09:59:53 +0000 (11:59 +0200)]
net/mlx5: Verify goto chain offload support

According to PRM, forward to flow table along with either packet
reformat or decap is supported only if reformat_and_fwd_to_table
capability is set for the flow table.

Add dependency on the capability and pack all the conditions for "goto
chain" in a single function.

Fix language in error message in case of not supporting forward to a
lower numbered flow table.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
4 years agonet/mlx5: E-Switch, Use vport metadata matching only when mandatory
Majd Dibbiny [Mon, 27 Jan 2020 13:50:29 +0000 (15:50 +0200)]
net/mlx5: E-Switch, Use vport metadata matching only when mandatory

Multi-port RoCE mode requires tagging traffic that passes through the
vport.
This matching can cause performance degradation, therefore disable it
and use the legacy matching on vhca_id and source_port when possible.

Fixes: 92ab1eb392c6 ("net/mlx5: E-Switch, Enable vport metadata matching if firmware supports it")
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
4 years agonet/mlx5: Tidy up and fix reverse christmas ordring
Mark Bloch [Tue, 25 Feb 2020 19:24:54 +0000 (19:24 +0000)]
net/mlx5: Tidy up and fix reverse christmas ordring

Use reverse chirstmas tree inside mlx5e_ethtool_get_link_ksettings.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
4 years agonet/mlx5: Expose port speed when possible
Mark Bloch [Tue, 25 Feb 2020 18:04:40 +0000 (18:04 +0000)]
net/mlx5: Expose port speed when possible

When port speed can't be reported based on ext_eth_proto_capability
or eth_proto_capability instead of reporting speed as unknown check
if the port's speed can be inferred based on the data_rate_oper field.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
4 years agoMerge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox...
Saeed Mahameed [Mon, 9 Mar 2020 20:01:26 +0000 (13:01 -0700)]
Merge branch 'mlx5-next' of git://git./linux/kernel/git/mellanox/linux

This series adds some HW bits and definitions for mlx5 driver, to be
used by downstream features in both rdma and netdev branches.

* 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux:
  net/mlx5: HW bit for goto chain offload support
  net/mlx5: Expose link speed directly
  net/mlx5: Introduce TLS and IPSec objects enums
  net/mlx5: Introduce egress acl forward-to-vport capability
  net/mlx5: Expose raw packet pacing APIs
  net/mlx5e: Replace zero-length array with flexible-array member
  net/mlx5: fix spelling mistake "reserverd" -> "reserved"

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
4 years agonet: sgi: ioc3-eth: Remove phy workaround
Thomas Bogendoerfer [Mon, 9 Mar 2020 12:32:40 +0000 (13:32 +0100)]
net: sgi: ioc3-eth: Remove phy workaround

Commit a8d0f11ee50d ("MIPS: SGI-IP27: Enable ethernet phy on second
Origin 200 module") fixes the root cause of not detected PHYs.
Therefore the workaround can go away now.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'net-introduce-Qualcomm-IPA-driver'
David S. Miller [Mon, 9 Mar 2020 05:07:10 +0000 (22:07 -0700)]
Merge branch 'net-introduce-Qualcomm-IPA-driver'

Alex Elder says:

====================
net: introduce Qualcomm IPA driver (UPDATED)

This series presents the driver for the Qualcomm IP Accelerator (IPA).

This is version 2 of this updated series.  It includes the following
small changes since the previous version:
  - Now based on net-next instead of v5.6-rc
  - Config option now named CONFIG_QCOM_IPA
  - Some minor cleanup in the GSI code
  - Small change to replenish logic
  - No longer depends on remoteproc bug fixes
What follows is the basically same explanation as was posted previously.

-Alex

I have posted earlier versions of this code previously, but it has
undergone quite a bit of development since the last time, so rather
than calling it "version 3" I'm just treating it as a new series
(indicating it's been updated in this message).  The fast/data path
is the same as before.  But the driver now (nearly) supports a
second platform, its transaction handling has been generalized
and improved, and modem activities are now handled in a more
unified way.

This series is available (based on net-next in branch "ipa_updated-v2"
in this git repository:
  https://git.linaro.org/people/alex.elder/linux.git

The branch depends on other one other small patch that I sent out
for review earlier.
  https://lore.kernel.org/lkml/20200306042302.17602-1-elder@linaro.org/

I want to address some of the discussion that arose last time.

First, there was the WWAN discussion.  Here's the history:
  - This was last posted nine months ago.
  - Reviewers at that time favored developing a new WWAN subsystem that
    would be used for managing devices like this.  And the suggestion
    was to not accept this driver until that could be developed.
  - Along the way, Apple acquired much of Intel's modem business.
    And as a result, the generic framework became less pressing.
  - I did participate in the WWAN subsystem design however, and
    although it went dormant for a while it's been resurrected:
      https://lore.kernel.org/netdev/20200225100053.16385-1-johannes@sipsolutions.net/
  - Unfortunately the proposed WWAN design was not an easy fit
    with Qualcomm's integrated modem interfaces.  Given that
    rmnet is a supported link type for in the upstream "iproute2"
    package (more on this below), I have opted not to integrate
    with any WWAN subsystem.

So in summary, this driver does not integrate with a generic WWAN
framework.  And I'd like it to be accepted upstream despite that.

Next, Arnd Bergmann had some concerns about flow control.  (Note:
some of my discussions with Arnd about this were offline.) The
overall architecture here also involves the "rmnet" driver:
  drivers/net/ethernet/qualcomm/rmnet

The rmnet driver presents a network device for use.  It connects
with another network device presented, by the IPA driver.  The
rmnet driver wraps (and unwraps) packets transferred to (and from)
the IPA driver with QMAP headers.

   ---------------
   | rmnet_data0 |    <-- "real" netdev
   ---------------
          ||       }- QMAP spoken here
   --------------
   | rmnet_ipa0 |     <-- also netdev, transporting QMAP packets
   --------------
          ||
   --------------
  ( IPA hardware )
   --------------

Arnd's concern was that the rmnet_data0 network device does not
have the benefit of information about the state of the underlying
IPA hardware in order to be effective in controlling TX flow.
The feared result is over-buffering of TX packets (bufferbloat).
I began working on some simple experiments to see whether (or how
much) his concern was warranted.  But it turned out that completing
these experiments was much more work than had been hoped.

The rmnet driver is present in the upstream kernel.  There is also
support for the rmnet link type in the upstream "ip" user space
command in the "iproute2" package.  Changing the layering of rmnet
over IPA likely involves deprecating the rmnet driver and its
support in "iproute2".  I would really rather not go down that
path.

There is precedent for this sort of layering of network devices
(L2TP, VLAN).  And any architecture like this would suffer the
issues Arnd mentioned; the problem is not limited to rmnet and IPA.
I do think this is a problem worth solving, but the prudent thing
to do might be to try to solve it more generally.

So to summarize on this issue, this driver does not attempt to
change the way the rmnet and IPA drivers work together.  And even
though I think Arnd's concerns warrant more investigation, I'd like
this driver to to be accepted upstream without any change to this
architecture.

Finally, a more technical description for the series, and some
acknowledgements to some people who contributed to it.

The IPA is a component present in some Qualcomm SoCs that allows
network functions such as aggregation, filtering, routing, and NAT
to be performed without active involvement of the main application
processor (AP).

In this initial patch series these advanced features are not
implemented.  The IPA driver simply provides a network interface
that makes the modem's LTE network available in Linux.  This initial
series supports only the Qualcomm SDM845 SoC.  The Qualcomm SC7180
SoC is partially supported, and support for other platforms will
follow.

This code is derived from a driver developed by Qualcomm.  A version
of the original source can be seen here:
  https://source.codeaurora.org/quic/la/kernel/msm-4.9/tree
in the "drivers/platform/msm/ipa" directory.  Many were involved in
developing this, but the following individuals deserve explicit
acknowledgement for their substantial contributions:

    Abhishek Choubey
    Ady Abraham
    Chaitanya Pratapa
    David Arinzon
    Ghanim Fodi
    Gidon Studinski
    Ravi Gummadidala
    Shihuan Liu
    Skylar Chang
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoarm64: dts: sdm845: add IPA information
Alex Elder [Fri, 6 Mar 2020 04:28:31 +0000 (22:28 -0600)]
arm64: dts: sdm845: add IPA information

Add IPA-related nodes and definitions to "sdm845.dtsi".

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMAINTAINERS: add entry for the Qualcomm IPA driver
Alex Elder [Fri, 6 Mar 2020 04:28:30 +0000 (22:28 -0600)]
MAINTAINERS: add entry for the Qualcomm IPA driver

Add an entry in the MAINTAINERS file for the Qualcomm IPA driver

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: support build of IPA code
Alex Elder [Fri, 6 Mar 2020 04:28:29 +0000 (22:28 -0600)]
soc: qcom: ipa: support build of IPA code

Add build and Kconfig support for the Qualcomm IPA driver.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: AP/modem communications
Alex Elder [Fri, 6 Mar 2020 04:28:28 +0000 (22:28 -0600)]
soc: qcom: ipa: AP/modem communications

This patch implements two forms of out-of-band communication between
the AP and modem.

  - QMI is a mechanism that allows clients running on the AP
    interact with services running on the modem (and vice-versa).
    The AP IPA driver uses QMI to communicate with the corresponding
    IPA driver resident on the modem, to agree on parameters used
    with the IPA hardware and to ensure both sides are ready before
    entering operational mode.

  - SMP2P is a more primitive mechanism available for the modem and
    AP to communicate with each other.  It provides a means for either
    the AP or modem to interrupt the other, and furthermore, to provide
    32 bits worth of information.  The IPA driver uses SMP2P to tell
    the modem what the state of the IPA clock was in the event of a
    crash.  This allows the modem to safely access the IPA hardware
    (or avoid doing so) when a crash occurs, for example, to access
    information within the IPA hardware.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: modem and microcontroller
Alex Elder [Fri, 6 Mar 2020 04:28:27 +0000 (22:28 -0600)]
soc: qcom: ipa: modem and microcontroller

This patch includes code implementing the modem functionality.
There are several communication paths between the AP and modem,
separate from the main data path provided by IPA.  SMP2P provides
primitive messaging and interrupt capability, and QMI allows more
complex out-of-band messaging to occur between entities on the AP
and modem.  (SMP2P and QMI support are added by the next patch.)
Management of these (plus the network device implementing the data
path) is done by code within "ipa_modem.c".

Sort of unrelated, this patch also includes the code supporting the
microcontroller CPU present on the IPA.  The microcontroller can be
used to implement special handling of packets, but at this time we
don't support that.  Still, it is a component that needs to be
initialized, and in the event of a crash we need to do some
synchronization between the AP and the microcontroller.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: immediate commands
Alex Elder [Fri, 6 Mar 2020 04:28:26 +0000 (22:28 -0600)]
soc: qcom: ipa: immediate commands

One TX endpoint (per EE) is used for issuing immediate commands to
the IPA.  These commands request activites beyond simple data
transfers to be done by the IPA hardware.  For example, the IPA is
able to manage routing packets among endpoints, and immediate commands
are used to configure tables used for that routing.

Immediate commands are built on top of GSI transactions.  They are
different from normal transfers (in that they use a special endpoint,
and their "payload" is interpreted differently), so separate functions
are used to issue immediate command transactions.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: filter and routing tables
Alex Elder [Fri, 6 Mar 2020 04:28:25 +0000 (22:28 -0600)]
soc: qcom: ipa: filter and routing tables

This patch contains code implementing filter and routing tables for
the IPA.  A filter table allows rules to be used for filtering
packets that depart the AP at an endpoint.  A filter table entry
contains the address of a set of rules to apply for each endpoint
that supports filtering.

A routing table allows packets to be routed to an endpoint based
on packet metadata.  It is also a table whose entries each contain
the address of a set of routing rules to apply.

Neither filtering nor routing is supported by the current driver.
All table entries refer to rules that mean "no filtering" and "no
routing."

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: IPA endpoints
Alex Elder [Fri, 6 Mar 2020 04:28:24 +0000 (22:28 -0600)]
soc: qcom: ipa: IPA endpoints

This patch includes the code implementing an IPA endpoint.  This is
the primary abstraction implemented by the IPA.  An endpoint is one
end of a network connection between two entities physically
connected to the IPA.  Specifically, the AP and the modem implement
endpoints, and an (AP endpoint, modem endpoint) pair implements the
transfer of network data in one direction between the AP and modem.

Endpoints are built on top of GSI channels, but IPA endpoints
represent the higher-level functionality that the IPA provides.
Data can be sent through a GSI channel, but it is the IPA endpoint
that represents what is on the "other end" to receive that data.
Other functionality, including aggregation, checksum offload and
(at some future date) IP routing and filtering are all associated
with the IPA endpoint.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: GSI transactions
Alex Elder [Fri, 6 Mar 2020 04:28:23 +0000 (22:28 -0600)]
soc: qcom: ipa: GSI transactions

This patch implements GSI transactions.  A GSI transaction is a
structure that represents a single request (consisting of one or
more TREs) sent to the GSI hardware.  The last TRE in a transaction
includes a flag requesting that the GSI interrupt the AP to notify
that it has completed.

TREs are executed and completed strictly in order.  For this reason,
the completion of a single TRE implies that all previous TREs (in
particular all of those "earlier" in a transaction) have completed.

Whenever there is a need to send a request (a set of TREs) to the
IPA, a GSI transaction is allocated, specifying the number of TREs
that will be required.  Details of the request (e.g. transfer offsets
and length) are represented by in a Linux scatterlist array that is
incorporated in the transaction structure.

Once all commands (TREs) are added to a transaction it is committed.
When the hardware signals that the request has completed, a callback
function allows for cleanup or followup activity to be performed
before the transaction is freed.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: IPA interface to GSI
Alex Elder [Fri, 6 Mar 2020 04:28:22 +0000 (22:28 -0600)]
soc: qcom: ipa: IPA interface to GSI

This patch provides interface functions supplied by the IPA layer
that are called from the GSI layer.  One function is called when a
GSI transaction has completed.  The others allow the GSI layer to
inform the IPA layer when the hardware has been told it has new TREs
to execute, and when the hardware has indicated transactions have
completed.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: the generic software interface
Alex Elder [Fri, 6 Mar 2020 04:28:21 +0000 (22:28 -0600)]
soc: qcom: ipa: the generic software interface

This patch includes "gsi.c", which implements the generic software
interface (GSI) for IPA.  The generic software interface abstracts
channels, which provide a means of transferring data either from the
AP to the IPA, or from the IPA to the AP.  A ring buffer of "transfer
elements" (TREs) is used to describe data transfers to perform.  The
AP writes a doorbell register associated with a channel to let it know
it has added new entries (for an AP->IPA channel) or has finished
processing entries (for an IPA->AP channel).

Each channel also has an event ring buffer, used by the IPA to
communicate information about events related to a channel (for
example, the completion of TREs).  The IPA writes its own doorbell
register, which triggers an interrupt on the AP, to signal that
new event information has arrived.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: GSI headers
Alex Elder [Fri, 6 Mar 2020 04:28:20 +0000 (22:28 -0600)]
soc: qcom: ipa: GSI headers

The Generic Software Interface is a layer of the IPA driver that
abstracts the underlying hardware.  The next patch includes the
main code for GSI (including some additional documentation).  This
patch just includes three GSI header files.

  - "gsi.h" is the top-level GSI header file.  This structure is
    is embedded within the IPA structure.  The main abstraction
    implemented by the GSI code is the channel, and this header
    exposes several operations that can be performed on a GSI channel.

  - "gsi_private.h" exposes some definitions that are intended to be
    private, used only by the main GSI code and the GSI transaction
    code (defined in an upcoming patch).

  - Like "ipa_reg.h", "gsi_reg.h" defines the offsets of the 32-bit
    registers used by the GSI layer, along with masks that define the
    position and width of fields less than 32 bits located within
    these registers.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: clocking, interrupts, and memory
Alex Elder [Fri, 6 Mar 2020 04:28:19 +0000 (22:28 -0600)]
soc: qcom: ipa: clocking, interrupts, and memory

This patch incorporates three source files (and their headers).  They're
grouped into one patch mainly for the purpose of making the number and
size of patches in this series somewhat reasonable.

  - "ipa_clock.c" and "ipa_clock.h" implement clocking for the IPA device.
    The IPA has a single core clock managed by the common clock framework.
    In addition, the IPA has three buses whose bandwidth is managed by the
    Linux interconnect framework.  At this time the core clock and all
    three buses are either on or off; we don't yet do any more fine-grained
    management than that.  The core clock and interconnects are enabled
    and disabled as a unit, using a unified clock-like abstraction,
    ipa_clock_get()/ipa_clock_put().

  - "ipa_interrupt.c" and "ipa_interrupt.h" implement IPA interrupts.
    There are two hardware IRQs used by the IPA driver (the other is
    the GSI interrupt, described in a separate patch).  Several types
    of interrupt are handled by the IPA IRQ handler; these are not part
    of data/fast path.

  - The IPA has a region of local memory that is accessible by the AP
    (and modem).  Within that region are areas with certain defined
    purposes.  "ipa_mem.c" and "ipa_mem.h" define those regions, and
    implement their initialization.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: configuration data
Alex Elder [Fri, 6 Mar 2020 04:28:18 +0000 (22:28 -0600)]
soc: qcom: ipa: configuration data

This patch defines configuration data that is used to specify some
of the details of IPA hardware supported by the driver.  It is built
as Device Tree match data, discovered at boot time.  The driver
supports the Qualcomm SDM845 SoC.  Data for the Qualcomm SC7180 is
also defined here, but it is not yet completely supported.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agosoc: qcom: ipa: main code
Alex Elder [Fri, 6 Mar 2020 04:28:17 +0000 (22:28 -0600)]
soc: qcom: ipa: main code

This patch includes three source files that represent some basic "main
program" code for the IPA driver.  They are:
  - "ipa.h" defines the top-level IPA structure which represents an IPA
     device throughout the code.
  - "ipa_main.c" contains the platform driver probe function, along with
    some general code used during initialization.
  - "ipa_reg.h" defines the offsets of the 32-bit registers used for the
    IPA device, along with masks that define the position and width of
    fields within these registers.
  - "version.h" defines some symbolic IPA version numbers.

Each file includes some documentation that provides a little more
overview of how the code is organized and used.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodt-bindings: soc: qcom: add IPA bindings
Alex Elder [Fri, 6 Mar 2020 04:28:16 +0000 (22:28 -0600)]
dt-bindings: soc: qcom: add IPA bindings

Add the binding definitions for the "qcom,ipa" device tree node.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoremoteproc: add IPA notification to q6v5 driver
Alex Elder [Fri, 6 Mar 2020 04:28:15 +0000 (22:28 -0600)]
remoteproc: add IPA notification to q6v5 driver

Set up a subdev in the q6v5 modem remoteproc driver that generates
event notifications for the IPA driver to use for initialization and
recovery following a modem shutdown or crash.

A pair of new functions provides a way for the IPA driver to register
and deregister a notification callback function that will be called
whenever modem events (about to boot, running, about to shut down,
etc.) occur.  A void pointer value (provided by the IPA driver at
registration time) and an event type are supplied to the callback
function.

One event, MODEM_REMOVING, is signaled whenever the q6v5 driver is
about to remove the notification subdevice.  It requires the IPA
driver de-register its callback.

This sub-device is only used by the modem subsystem (MSS) driver,
so the code that adds the new subdev and allows registration and
deregistration of the notifier is found in "qcom_q6v6_mss.c".

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'QorIQ-DPAA-Use-random-MAC-address-when-none-is-given'
David S. Miller [Mon, 9 Mar 2020 05:02:54 +0000 (22:02 -0700)]
Merge branch 'QorIQ-DPAA-Use-random-MAC-address-when-none-is-given'

Sascha Hauer says:

====================
QorIQ DPAA: Use random MAC address when none is given

Use random MAC addresses when they are not provided in the device tree.
Tested on LS1046ARDB.

Changes in v3:
 addressed all MAC types, removed some redundant code in dtsec in
 the process
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodpaa_eth: Use random MAC address when none is given
Madalin Bucur [Thu, 5 Mar 2020 17:08:58 +0000 (19:08 +0200)]
dpaa_eth: Use random MAC address when none is given

If there is no valid MAC address in the device tree, use a random
MAC address.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agofsl/fman: tolerate missing MAC address in device tree
Madalin Bucur [Thu, 5 Mar 2020 17:08:57 +0000 (19:08 +0200)]
fsl/fman: tolerate missing MAC address in device tree

Allow the initialization of the MAC to be performed even if the
device tree does not provide a valid MAC address. Later a random
MAC address should be assigned by the Ethernet driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agofsl/fman: reuse set_mac_address() in dtsec init()
Madalin Bucur [Thu, 5 Mar 2020 17:08:56 +0000 (19:08 +0200)]
fsl/fman: reuse set_mac_address() in dtsec init()

Reuse the set_mac_address() in the init() function.

Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'bnxt_en-Updates'
David S. Miller [Mon, 9 Mar 2020 04:54:46 +0000 (21:54 -0700)]
Merge branch 'bnxt_en-Updates'

Michael Chan says:

====================
bnxt_en: Updates.

This series includes simplification and improvement of NAPI polling
logic in bnxt_poll_p5().  The improvements will prevent starving the
async events from firmware if we are in continuous NAPI polling.
The rest of the patches include cleanups, a better return code for
firmware busy, and to clear devlink port type more properly.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobnxt_en: Call devlink_port_type_clear() in remove()
Vasundhara Volam [Sun, 8 Mar 2020 22:45:54 +0000 (18:45 -0400)]
bnxt_en: Call devlink_port_type_clear() in remove()

Similar to other drivers, properly clear the devlink port type when
removing the device before unregistration.

Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobnxt_en: Return -EAGAIN if fw command returns BUSY
Vasundhara Volam [Sun, 8 Mar 2020 22:45:53 +0000 (18:45 -0400)]
bnxt_en: Return -EAGAIN if fw command returns BUSY

If firmware command returns error code as HWRM_ERR_CODE_BUSY, which
means it cannot handle the command due to a conflicting command
from another function, convert it to -EAGAIN.  If it is an ethtool
operation, this error code will be returned to userspace.

Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobnxt_en: Modify some bnxt_hwrm_*_free() functions to void.
Vasundhara Volam [Sun, 8 Mar 2020 22:45:52 +0000 (18:45 -0400)]
bnxt_en: Modify some bnxt_hwrm_*_free() functions to void.

Return code is not needed in some of these functions, as the return
code from firmware message is ignored. Remove the unused rc variable
and also convert functions to void.

Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobnxt_en: Remove unnecessary assignment of return code
Vasundhara Volam [Sun, 8 Mar 2020 22:45:51 +0000 (18:45 -0400)]
bnxt_en: Remove unnecessary assignment of return code

As part of converting error code in firmware message to standard
code, checking for firmware return code is removed in most of the
places. Remove the assignment of return code where the function
can directly return.

Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobnxt_en: Clear DCB settings after firmware reset.
Michael Chan [Sun, 8 Mar 2020 22:45:50 +0000 (18:45 -0400)]
bnxt_en: Clear DCB settings after firmware reset.

The driver stores a copy of the DCB settings that have been applied to
the firmware.  After firmware reset, the firmware settings are gone and
will revert back to default.  Clear the driver's copy so that if there
is a DCBNL request to get the settings, the driver will retrieve the
current settings from the firmware.  lldpad keeps the DCB settings in
userspace and will re-apply the settings if it is running.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobnxt_en: Process the NQ under NAPI continuous polling.
Michael Chan [Sun, 8 Mar 2020 22:45:49 +0000 (18:45 -0400)]
bnxt_en: Process the NQ under NAPI continuous polling.

When we are in continuous NAPI polling mode, the current code in
bnxt_poll_p5() will only process the completion rings and will not
process the NQ until interrupt is re-enabled.  Tis logic works and
will not cause RX or TX starvation, but async events in the NQ may
be delayed for the duration of continuous NAPI polling.  These
async events may be firmware or VF events.

Continue to handle the NQ after we are done polling the completion
rings.  This actually simplies the code in bnxt_poll_p5().

Acknowledge the NQ so these async events will not overflow.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobnxt_en: Simplify __bnxt_poll_cqs_done().
Michael Chan [Sun, 8 Mar 2020 22:45:48 +0000 (18:45 -0400)]
bnxt_en: Simplify __bnxt_poll_cqs_done().

Simplify the function by removing tha 'all' parameter.  In the current
code, the caller has to specify whether to update/arm both completion
rings with the 'all' parameter.

Instead of this, we can just update/arm all the completion rings
that have been polled.  By setting cpr->had_work_done earlier in
__bnxt_poll_work(), we know which completion ring has been polled
and can just update/arm all the completion rings with
cpr->had_work_done set.

This simplifies the function with one less parameter and works just
as well.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobnxt_en: Handle all NQ notifications in bnxt_poll_p5().
Michael Chan [Sun, 8 Mar 2020 22:45:47 +0000 (18:45 -0400)]
bnxt_en: Handle all NQ notifications in bnxt_poll_p5().

In bnxt_poll_p5(), the logic polls for up to 2 completion rings (RX and
TX) for work.  In the current code, if we reach budget polling the
first completion ring, we will stop.  If the other completion ring
has work to do, we will handle it when NAPI calls us back.

This is not optimal.  We potentially leave an unproceesed entry in
the NQ.  When we are finally done with NAPI polling and re-enable
interrupt, the remaining entry in the NQ will cause interrupt to
be triggered immediately for no reason.

Modify the code in bnxt_poll_p5() to keep looping until all NQ
entries are handled even if the first completion ring has reached
budget.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet/sched: act_ct: fix lockdep splat in tcf_ct_flow_table_get
Eric Dumazet [Sun, 8 Mar 2020 21:27:48 +0000 (14:27 -0700)]
net/sched: act_ct: fix lockdep splat in tcf_ct_flow_table_get

Convert zones_lock spinlock to zones_mutex mutex,
and struct (tcf_ct_flow_table)->ref to a refcount,
so that control path can use regular GFP_KERNEL allocations
from standard process context. This is more robust
in case of memory pressure.

The refcount is needed because tcf_ct_flow_table_put() can
be called from RCU callback, thus in BH context.

The issue was spotted by syzbot, as rhashtable_init()
was called with a spinlock held, which is bad since GFP_KERNEL
allocations can sleep.

Note to developers : Please make sure your patches are tested
with CONFIG_DEBUG_ATOMIC_SLEEP=y

BUG: sleeping function called from invalid context at mm/slab.h:565
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 9582, name: syz-executor610
2 locks held by syz-executor610/9582:
 #0: ffffffff8a34eb80 (rtnl_mutex){+.+.}, at: rtnl_lock net/core/rtnetlink.c:72 [inline]
 #0: ffffffff8a34eb80 (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x3f9/0xad0 net/core/rtnetlink.c:5437
 #1: ffffffff8a3961b8 (zones_lock){+...}, at: spin_lock_bh include/linux/spinlock.h:343 [inline]
 #1: ffffffff8a3961b8 (zones_lock){+...}, at: tcf_ct_flow_table_get+0xa3/0x1700 net/sched/act_ct.c:67
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 0 PID: 9582 Comm: syz-executor610 Not tainted 5.6.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 ___might_sleep.cold+0x1f4/0x23d kernel/sched/core.c:6798
 slab_pre_alloc_hook mm/slab.h:565 [inline]
 slab_alloc_node mm/slab.c:3227 [inline]
 kmem_cache_alloc_node_trace+0x272/0x790 mm/slab.c:3593
 __do_kmalloc_node mm/slab.c:3615 [inline]
 __kmalloc_node+0x38/0x60 mm/slab.c:3623
 kmalloc_node include/linux/slab.h:578 [inline]
 kvmalloc_node+0x61/0xf0 mm/util.c:574
 kvmalloc include/linux/mm.h:645 [inline]
 kvzalloc include/linux/mm.h:653 [inline]
 bucket_table_alloc+0x8b/0x480 lib/rhashtable.c:175
 rhashtable_init+0x3d2/0x750 lib/rhashtable.c:1054
 nf_flow_table_init+0x16d/0x310 net/netfilter/nf_flow_table_core.c:498
 tcf_ct_flow_table_get+0xe33/0x1700 net/sched/act_ct.c:82
 tcf_ct_init+0xba4/0x18a6 net/sched/act_ct.c:1050
 tcf_action_init_1+0x697/0xa20 net/sched/act_api.c:945
 tcf_action_init+0x1e9/0x2f0 net/sched/act_api.c:1001
 tcf_action_add+0xdb/0x370 net/sched/act_api.c:1411
 tc_ctl_action+0x366/0x456 net/sched/act_api.c:1466
 rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5440
 netlink_rcv_skb+0x15a/0x410 net/netlink/af_netlink.c:2478
 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
 netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329
 netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:672
 ____sys_sendmsg+0x6b9/0x7d0 net/socket.c:2343
 ___sys_sendmsg+0x100/0x170 net/socket.c:2397
 __sys_sendmsg+0xec/0x1b0 net/socket.c:2430
 do_syscall_64+0xf6/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4403d9
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd719af218 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 00000000004403d9
RDX: 0000000000000000 RSI: 0000000020000300 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000000000005 R09: 00000000004002c8
R10: 0000000000000008 R11: 00000000000

Fixes: c34b961a2492 ("net/sched: act_ct: Create nf flow table per zone")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Paul Blakey <paulb@mellanox.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: rmnet: set NETIF_F_LLTX flag
Taehee Yoo [Sun, 8 Mar 2020 13:47:06 +0000 (13:47 +0000)]
net: rmnet: set NETIF_F_LLTX flag

The rmnet_vnd_setup(), which is the callback of ->ndo_start_xmit() is
allowed to call concurrently because it uses RCU protected data.
So, it doesn't need tx lock.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'bareudp-several-code-cleanup-for-bareudp-module'
David S. Miller [Mon, 9 Mar 2020 04:22:29 +0000 (21:22 -0700)]
Merge branch 'bareudp-several-code-cleanup-for-bareudp-module'

Taehee Yoo says:

====================
bareudp: several code cleanup for bareudp module

This patchset is to cleanup bareudp module code.

1. The first patch is to add module alias
In the current bareudp code, there is no module alias.
So, RTNL couldn't load bareudp module automatically.

2. The second patch is to add extack message.
The extack error message is useful for noticing specific errors
when command is failed.

3. The third patch is to remove unnecessary udp_encap_enable().
In the bareudp_socket_create(), udp_encap_enable() is called.
But, the it's already called in the setup_udp_tunnel_sock().
So, it could be removed.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobareudp: remove unnecessary udp_encap_enable() in bareudp_socket_create()
Taehee Yoo [Sun, 8 Mar 2020 01:19:30 +0000 (01:19 +0000)]
bareudp: remove unnecessary udp_encap_enable() in bareudp_socket_create()

In the current code, udp_encap_enable() is called in
bareudp_socket_create().
But, setup_udp_tunnel_sock() internally calls udp_encap_enable().
So, udp_encap_enable() is unnecessary.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobareudp: print error message when command fails
Taehee Yoo [Sun, 8 Mar 2020 01:19:17 +0000 (01:19 +0000)]
bareudp: print error message when command fails

When bareudp netlink command fails, it doesn't print any error message.
So, users couldn't know the exact reason.
In order to tell the exact reason to the user, the extack error message
is used in this patch.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agobareudp: add module alias
Taehee Yoo [Sun, 8 Mar 2020 01:19:07 +0000 (01:19 +0000)]
bareudp: add module alias

In the current bareudp code, there is no module alias.
So, RTNL couldn't load bareudp module automatically.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'cxgb4-chcr-ktls-tx-ofld-support-on-T6-adapter'
David S. Miller [Mon, 9 Mar 2020 04:16:24 +0000 (21:16 -0700)]
Merge branch 'cxgb4-chcr-ktls-tx-ofld-support-on-T6-adapter'

Rohit Maheshwari says:

====================
cxgb4/chcr: ktls tx ofld support on T6 adapter

This series of patches add support for kernel tls offload in Tx direction,
over Chelsio T6 NICs. SKBs marked as decrypted will be treated as tls plain
text packets and then offloaded to encrypt using network device (chelsio T6
adapter).

This series is broken down as follows:

Patch 1 defines a new macro and registers tls_dev_add and tls_dev_del
callbacks. When tls_dev_add gets called we send a connection request to
our hardware and to make HW understand about tls offload. Its a partial
connection setup and only ipv4 part is done.

Patch 2 handles the HW response of the connection request and then we
request to update TCB and handle it's HW response as well. Also we save
crypto key locally. Only supporting TLS_CIPHER_AES_GCM_128_KEY_SIZE.

Patch 3 handles tls marked skbs (decrypted bit set) and sends it to ULD for
crypto handling. This code has a minimal portion of tx handler, to handle
only one complete record per skb.

Patch 4 hanldes partial end part of records. Also added logic to handle
multiple records in one single skb. It also adds support to send out tcp
option(/s) if exists in skb. If a record is partial but has end part of a
record, we'll fetch complete record and then only send it to HW to generate
HASH on complete record.

Patch 5 handles partial first or middle part of record, it uses AES_CTR to
encrypt the partial record. If we are trying to send middle record, it's
start should be 16 byte aligned, so we'll fetch few earlier bytes from the
record and then send it to HW for encryption.

Patch 6 enables ipv6 support and also includes ktls startistics.

v1->v2:
- mark tcb state to close in tls_dev_del.
- u_ctx is now picked from adapter structure.
- clear atid in case of failure.
- corrected ULP_CRYPTO_KTLS_INLINE value.
- optimized tcb update using control queue.
- state machine handling when earlier states received.
- chcr_write_cpl_set_tcb_ulp  function is shifted to patch3.
- un-necessary updating left variable.

v2->v3:
- add empty line after variable declaration.
- local variable declaration in reverse christmas tree ordering.

v3->v4:
- replaced kfree_skb with dev_kfree_skb_any.
- corrected error message reported by kbuild test robot <lkp@intel.com>
- mss calculation logic.
- correct place for Alloc skb check.
- Replaced atomic_t with atomic64_t
- added few more statistics counters.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agocxgb4/chcr: Add ipv6 support and statistics
Rohit Maheshwari [Sat, 7 Mar 2020 14:36:08 +0000 (20:06 +0530)]
cxgb4/chcr: Add ipv6 support and statistics

Adding ipv6 support and ktls related statistics.

v1->v2:
- added blank lines at 2 places.

v3->v4:
- Replaced atomic_t with atomic64_t
- added few necessary stat counters.

Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agochcr: Handle first or middle part of record
Rohit Maheshwari [Sat, 7 Mar 2020 14:36:07 +0000 (20:06 +0530)]
chcr: Handle first or middle part of record

This patch contains handling of first part or middle part of the record.
When we get a middle record, we will fetch few already sent bytes to
make packet start 16 byte aligned.
And if the packet has only the header part, we don't need to send it for
packet encryption, send that packet as a plaintext.

v1->v2:
- un-necessary updating left variable.

v3->v4:
- replaced kfree_skb with dev_kfree_skb_any.

Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agochcr: handle partial end part of a record
Rohit Maheshwari [Sat, 7 Mar 2020 14:36:06 +0000 (20:06 +0530)]
chcr: handle partial end part of a record

TCP segment can chop a record in any order. Record can either be
complete or it can be partial (first part which contains header,
middle part which doesn't have header or TAG, and the end part
which contains TAG. This patch handles partial end part of a tx
record. In case of partial end part's, driver will send complete
record to HW, so that HW will calculate GHASH (TAG) of complete
packet.
Also added support to handle multiple records in a segment.

v1->v2:
- miner change in calling chcr_write_cpl_set_tcb_ulp.
- no need of checking return value of chcr_ktls_write_tcp_options.

v3->v4:
- replaced kfree_skb with dev_kfree_skb_any.

Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agocxgb4/chcr: complete record tx handling
Rohit Maheshwari [Sat, 7 Mar 2020 14:36:05 +0000 (20:06 +0530)]
cxgb4/chcr: complete record tx handling

Added tx handling in this patch. This includes handling of segments
contain single complete record.

v1->v2:
- chcr_write_cpl_set_tcb_ulp is added in this patch.

v3->v4:
- mss calculation logic.
- replaced kfree_skb with dev_kfree_skb_any.
- corrected error message reported by kbuild test robot <lkp@intel.com>

Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agocxgb4/chcr: Save tx keys and handle HW response
Rohit Maheshwari [Sat, 7 Mar 2020 14:36:04 +0000 (20:06 +0530)]
cxgb4/chcr: Save tx keys and handle HW response

As part of this patch generated and saved crypto keys, handled HW
response of act_open_req and set_tcb_req. Defined connection state
update.

v1->v2:
- optimized tcb update using control queue.
- state machine handling when earlier states received.

v2->v3:
- Added one empty line after function declaration.

Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agocxgb4/chcr : Register to tls add and del callback
Rohit Maheshwari [Sat, 7 Mar 2020 14:36:03 +0000 (20:06 +0530)]
cxgb4/chcr : Register to tls add and del callback

A new macro is defined to enable ktls tx offload support on Chelsio
T6 adapter. And if this macro is enabled, cxgb4 will send mailbox to
enable or disable ktls settings on HW.
In chcr, enabled tx offload flag in netdev and registered tls_dev_add
and tls_dev_del.

v1->v2:
- mark tcb state to close in tls_dev_del.
- u_ctx is now picked from adapter structure.
- clear atid in case of failure.
- corrected ULP_CRYPTO_KTLS_INLINE value.

v2->v3:
- add empty line after variable declaration.
- local variable declaration in reverse christmas tree ordering.

Signed-off-by: Rohit Maheshwari <rohitm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>