]> Git Repo - linux.git/log
linux.git
4 years agoxen/netback: fix spurious event detection for common event case
Juergen Gross [Thu, 11 Feb 2021 10:16:12 +0000 (11:16 +0100)]
xen/netback: fix spurious event detection for common event case

In case of a common event for rx and tx queue the event should be
regarded to be spurious if no rx and no tx requests are pending.

Unfortunately the condition for testing that is wrong causing to
decide a event being spurious if no rx OR no tx requests are
pending.

Fix that plus using local variables for rx/tx pending indicators in
order to split function calls and if condition.

Fixes: 23025393dbeb3b ("xen/netback: use lateeoi irq binding")
Signed-off-by: Juergen Gross <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
Reviewed-by: Paul Durrant <[email protected]>
Reviewed-by: Wei Liu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: fib_notifier: don't return positive values on fib registration
Vlad Buslov [Thu, 11 Feb 2021 10:07:59 +0000 (12:07 +0200)]
net: fib_notifier: don't return positive values on fib registration

The function fib6_walk_continue() cannot return a positive value when
called from register_fib_notifier(), but ignoring causes static analyzer to
generate warnings in users of register_fib_notifier() that try to convert
returned error code to pointer with ERR_PTR(). Handle such case by
explicitly checking for positive error values and converting them to
-EINVAL in fib6_tables_dump().

Reported-by: Dan Carpenter <[email protected]>
Suggested-by: Ido Schimmel <[email protected]>
Signed-off-by: Vlad Buslov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge tag 'mlx5-for-upstream-2021-02-10' of git://git.kernel.org/pub/scm/linux/kernel...
David S. Miller [Thu, 11 Feb 2021 22:40:25 +0000 (14:40 -0800)]
Merge tag 'mlx5-for-upstream-2021-02-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-for-upstream-2021-02-10

Misc cleanups and trivial fixes for net-next

1) spelling mistakes
2) error path checks fixes
3) unused includes and struct fields cleanup
4) build error when MLX5_ESWITCH=no
====================

Signed-off-by: David S. Miller <[email protected]>
4 years agonet: ipconfig: avoid use-after-free in ic_close_devs
Vladimir Oltean [Wed, 10 Feb 2021 23:57:03 +0000 (01:57 +0200)]
net: ipconfig: avoid use-after-free in ic_close_devs

Due to the fact that ic_dev->dev is kept open in ic_close_dev, I had
thought that ic_dev will not be freed either. But that is not the case,
but instead "everybody dies" when ipconfig cleans up, and just the
net_device behind ic_dev->dev remains allocated but not ic_dev itself.

This is a problem because in ic_close_devs, for every net device that
we're about to close, we compare it against the list of lower interfaces
of ic_dev, to figure out whether we should close it or not. But since
ic_dev itself is subject to freeing, this means that at some point in
the middle of the list of ipconfig interfaces, ic_dev will have been
freed, and we would be still attempting to iterate through its list of
lower interfaces while checking whether to bring down the remaining
ipconfig interfaces.

There are multiple ways to avoid the use-after-free: we could delay
freeing ic_dev until the very end (outside the while loop). Or an even
simpler one: we can observe that we don't need ic_dev when iterating
through its lowers, only ic_dev->dev, structure which isn't ever freed.
So, by keeping ic_dev->dev in a variable assigned prior to freeing
ic_dev, we can avoid all use-after-free issues.

Fixes: 46acf7bdbc72 ("Revert "net: ipv4: handle DSA enabled master network devices"")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Vladimir Oltean <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agor8169: disable detection of bogus xid's 308/388
Heiner Kallweit [Wed, 10 Feb 2021 21:45:51 +0000 (22:45 +0100)]
r8169: disable detection of bogus xid's 308/388

Several years ago these two entries have been added, but it's not clear
why. There's no trace that there has ever been such a chip version, and
not even the r8101 vendor driver knows these id's. So let's disable
detection, and if nobody complains remove them completely later.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'bond-3ad-200g-400g'
David S. Miller [Thu, 11 Feb 2021 22:28:21 +0000 (14:28 -0800)]
Merge branch 'bond-3ad-200g-400g'

Nikolay Aleksandrov says:

====================
bonding: 3ad: support for 200G/400G ports and more verbose warning
xk
We'd like to have proper 200G and 400G support with 3ad bond mode, so we
need to add new definitions for them in order to have separate oper keys,
aggregated bandwidth and proper operation (patches 01 and 02). In
patch 03 Ido changes the code to use pr_err_once instead of
pr_warn_once which would help future detection of unsupported speeds.

v2: patch 03: use pr_err_once instead of WARN_ONCE
====================

Signed-off-by: David S. Miller <[email protected]>
4 years agobonding: 3ad: Print an error for unknown speeds
Ido Schimmel [Wed, 10 Feb 2021 20:43:33 +0000 (22:43 +0200)]
bonding: 3ad: Print an error for unknown speeds

The bond driver needs to be patched to support new ethtool speeds.
Currently it emits a single warning [1] when it encounters an unknown
speed. As evident by the two previous patches, this is not explicit
enough. Instead, promote it to an error.

[1]
bond10: (slave swp1): unknown ethtool speed (200000) for port 1 (set it to 0)

v2:
* Use pr_err_once() instead of WARN_ONCE()

Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agobonding: 3ad: add support for 400G speed
Nikolay Aleksandrov [Wed, 10 Feb 2021 20:43:32 +0000 (22:43 +0200)]
bonding: 3ad: add support for 400G speed

In order to be able to use 3ad mode with 400G devices we need to extend
the supported speeds.

Signed-off-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agobonding: 3ad: add support for 200G speed
Nikolay Aleksandrov [Wed, 10 Feb 2021 20:43:31 +0000 (22:43 +0200)]
bonding: 3ad: add support for 200G speed

In order to be able to use 3ad mode with 200G devices we need to extend
the supported speeds.

Signed-off-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'qede-netpoll-coalesce'
David S. Miller [Thu, 11 Feb 2021 22:25:06 +0000 (14:25 -0800)]
Merge branch 'qede-netpoll-coalesce'

Bhaskar Upadhaya says:

====================
qede: add netpoll and per-queue coalesce support

This is a followup implementation after series

https://patchwork.kernel.org/project/netdevbpf/cover/1610701570[email protected]/

Patch 1: Add net poll controller support to transmit kernel printks
         over UDP
Patch 2: QLogic card support multiple queues and each queue can be
         configured with respective coalescing parameters, this patch
         add per queue rx-usecs, tx-usecs coalescing parameters
Patch 3: set default per queue rx-usecs, tx-usecs coalescing parameters and
         preserve coalesce parameters across interface up and down

v3: fixed warnings reported by Dan Carpenter
v2: comments from jakub
 - p1: remove poll_controller ndo and add budget 0 support in qede_poll
 - p3: preserve coalesce parameters across interface up and down
===================

Signed-off-by: David S. Miller <[email protected]>
4 years agoqede: preserve per queue stats across up/down of interface
Bhaskar Upadhaya [Wed, 10 Feb 2021 20:28:31 +0000 (12:28 -0800)]
qede: preserve per queue stats across up/down of interface

Here we do the initialization of coalescing values on load.
per queue coalesce values are also restored across up/down of
ethernet interface.

Signed-off-by: Bhaskar Upadhaya <[email protected]>
Signed-off-by: Igor Russkikh <[email protected]>
Signed-off-by: Ariel Elior <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoqede: add per queue coalesce support for qede driver
Bhaskar Upadhaya [Wed, 10 Feb 2021 20:28:30 +0000 (12:28 -0800)]
qede: add per queue coalesce support for qede driver

per queue coalescing allows better and more finegrained control
over interrupt rates.

Signed-off-by: Bhaskar Upadhaya <[email protected]>
Signed-off-by: Igor Russkikh <[email protected]>
Signed-off-by: Ariel Elior <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoqede: add netpoll support for qede driver
Bhaskar Upadhaya [Wed, 10 Feb 2021 20:28:29 +0000 (12:28 -0800)]
qede: add netpoll support for qede driver

handle netpoll case when qede_poll is called by
netpoll layer with budget 0

Signed-off-by: Bhaskar Upadhaya <[email protected]>
Signed-off-by: Igor Russkikh <[email protected]>
Signed-off-by: Ariel Elior <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: hns3: fix return of random stack value
Gustavo A. R. Silva [Wed, 10 Feb 2021 19:28:41 +0000 (13:28 -0600)]
net: hns3: fix return of random stack value

Currently, a random stack value is being returned because variable
_ret_ is not properly initialized. This variable is actually not
used anymore and it should be removed.

Fix this by removing all instances of variable ret and return 0.

Fixes: 64749c9c38a9 ("net: hns3: remove redundant return value of hns3_uninit_all_ring()")
Addresses-Coverity-ID: 1501700 ("Uninitialized scalar variable")
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: stmmac: dwmac-intel-plat: remove unnecessary initialization
Nobuhiro Iwamatsu [Wed, 10 Feb 2021 17:59:35 +0000 (02:59 +0900)]
net: stmmac: dwmac-intel-plat: remove unnecessary initialization

plat_dat is initialized by stmmac_probe_config_dt().
So, initialization is not required by priv->plat.
This removes unnecessary initialization and variables.

Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: initialize net->net_cookie at netns setup
Eric Dumazet [Wed, 10 Feb 2021 14:41:44 +0000 (06:41 -0800)]
net: initialize net->net_cookie at netns setup

It is simpler to make net->net_cookie a plain u64
written once in setup_net() instead of looping
and using atomic64 helpers.

Lorenz Bauer wants to add SO_NETNS_COOKIE socket option
and this patch would makes his patch series simpler.

Signed-off-by: Eric Dumazet <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: Lorenz Bauer <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Tested-by: Lorenz Bauer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agor8169: re-configure WOL settings on resume from hibernation
Heiner Kallweit [Wed, 10 Feb 2021 14:33:20 +0000 (15:33 +0100)]
r8169: re-configure WOL settings on resume from hibernation

So far we don't re-configure WOL-related register bits when waking up
from hibernation. I'm not aware of any problem reports, but better
play safe and call __rtl8169_set_wol() in the resume() path too.
To achieve this move calling __rtl8169_set_wol() to
rtl8169_net_resume() and rename the function to rtl8169_runtime_resume().

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'phy-icplus-next'
David S. Miller [Thu, 11 Feb 2021 21:53:26 +0000 (13:53 -0800)]
Merge branch 'phy-icplus-next'

Michael Walle says:

====================
net: phy: icplus: cleanups and new features

Cleanup the PHY drivers for IPplus devices and add PHY counters and MDIX
support for the IP101A/G.

Patch 5 adds a model detection based on the behavior of the PHY.
Unfortunately, the IP101A shares the PHY ID with the IP101G. But the latter
provides more features. Try to detect the newer model by accessing the page
selection register. If it is writeable, it is assumed, that it is a IP101G.

With this detection in place, we can now access registers >= 16 in a
correct way on the IP101G; that is by first selecting the correct page.
This might previouly worked, because no one ever set another active page
before booting linux.

The last two patches add the new features.
===================

Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: icplus: add MDI/MDIX support for IP101A/G
Michael Walle [Thu, 11 Feb 2021 07:47:50 +0000 (08:47 +0100)]
net: phy: icplus: add MDI/MDIX support for IP101A/G

Implement the operations to set desired mode and retrieve the current
mode.

This feature was tested with an IP101G.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: icplus: add PHY counter for IP101G
Michael Walle [Thu, 11 Feb 2021 07:47:49 +0000 (08:47 +0100)]
net: phy: icplus: add PHY counter for IP101G

The IP101G provides three counters: RX packets, CRC errors and symbol
errors. The error counters can be configured to clear automatically on
read. Unfortunately, this isn't true for the RX packet counter. Because
of this and because the RX packet counter is more likely to overflow,
than the error counters implement only support for the error counters.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: icplus: fix paged register access
Michael Walle [Thu, 11 Feb 2021 07:47:48 +0000 (08:47 +0100)]
net: phy: icplus: fix paged register access

Registers >= 16 are paged. Be sure to set the page. It seems this was
working for now, because the default is correct for the registers used
in the driver at the moment. But this will also assume, nobody will
change the page select register before linux is started. The page select
register is _not_ reset with a soft reset of the PHY.

To ease the function reuse between the non-paged register space of the
IP101A and the IP101G, add noop read_page()/write_page() callbacks so
the IP101G functions can also be used for the IP101A.

Signed-off-by: Michael Walle <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: icplus: don't set APS_EN bit on IP101G
Michael Walle [Thu, 11 Feb 2021 07:47:47 +0000 (08:47 +0100)]
net: phy: icplus: don't set APS_EN bit on IP101G

This bit is reserved as 'always-write-1'. While this is not a particular
error, because we are only setting it, guard it by checking the model to
prevent errors in the future.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: icplus: split IP101A/G driver
Michael Walle [Thu, 11 Feb 2021 07:47:46 +0000 (08:47 +0100)]
net: phy: icplus: split IP101A/G driver

Unfortunately, the IP101A and IP101G share the same PHY identifier.
While most of the functions are somewhat backwards compatible, there is
for example the APS_EN bit on the IP101A but on the IP101G this bit
reserved. Also, the IP101G has many more functionalities.

Deduce the model by accessing the page select register which - according
to the datasheet - is not available on the IP101A. If this register is
writable, assume we have an IP101G.

Split the combined IP101A/G driver into two separate drivers.

Signed-off-by: Michael Walle <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: icplus: use the .soft_reset() of the phy-core
Michael Walle [Thu, 11 Feb 2021 07:47:45 +0000 (08:47 +0100)]
net: phy: icplus: use the .soft_reset() of the phy-core

The PHY core already resets the PHY before .config_init() if a
.soft_reset() op is registered. Drop the open-coded ip1xx_reset().

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: icplus: drop address operator for functions
Michael Walle [Thu, 11 Feb 2021 07:47:44 +0000 (08:47 +0100)]
net: phy: icplus: drop address operator for functions

Don't sometimes use the address operator and sometimes not. Drop it and
make the code look uniform.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: icplus: use PHY_ID_MATCH_EXACT() for IP101A/G
Michael Walle [Thu, 11 Feb 2021 07:47:43 +0000 (08:47 +0100)]
net: phy: icplus: use PHY_ID_MATCH_EXACT() for IP101A/G

According to the datasheet of the IP101A/G there is no revision field
and MII_PHYSID2 always reads as 0x0c54. Use PHY_ID_MATCH_EXACT() then.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: icplus: use PHY_ID_MATCH_MODEL() macro
Michael Walle [Thu, 11 Feb 2021 07:47:42 +0000 (08:47 +0100)]
net: phy: icplus: use PHY_ID_MATCH_MODEL() macro

Simpify the initializations of the structures. There is no functional
change.

Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'dsa-hsr-offload'
David S. Miller [Thu, 11 Feb 2021 21:24:45 +0000 (13:24 -0800)]
Merge branch 'dsa-hsr-offload'

George McCollister says:

====================
add HSR offloading support for DSA switches

Add support for offloading HSR/PRP (IEC 62439-3) tag insertion, tag
removal, forwarding and duplication on DSA switches.
This series adds offloading to the xrs700x DSA driver.

Changes since RFC:
 * Split hsr and dsa patches. (Florian Fainelli)

Changes since v1:
 * Fixed some typos/wording. (Vladimir Oltean)
 * eliminate IFF_HSR and use is_hsr_master instead. (Vladimir Oltean)
 * Make hsr_handle_sup_frame handle skb_std as well (required when offloading)
 * Don't add hsr tag for HSR v0 supervisory frames.
 * Fixed tag insertion offloading for PRP.

Changes since v2:
 * Return -EOPNOTSUPP instead of 0 in dsa_switch_hsr_join and
   dsa_switch_hsr_leave. (Vladimir Oltean)
 * Only allow ports 1 and 2 to be HSR/PRP redundant ports. (Tobias Waldekranz)
 * Set and remove HSR features for both redundant ports. (Vladimir Oltean)
 * Change port_hsr_leave() to return int instead of void.
 * Remove hsr_init_skb() proto argument. (Vladimir Oltean)
===================

Signed-off-by: David S. Miller <[email protected]>
4 years agonet: dsa: xrs700x: add HSR offloading support
George McCollister [Wed, 10 Feb 2021 01:02:13 +0000 (19:02 -0600)]
net: dsa: xrs700x: add HSR offloading support

Add offloading for HSR/PRP (IEC 62439-3) tag insertion, tag removal
forwarding and duplication supported by the xrs7000 series switches.

Only HSR v1 and PRP v1 are supported by the xrs7000 series switches (HSR
v0 is not).

Signed-off-by: George McCollister <[email protected]>
Reviewed-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: dsa: add support for offloading HSR
George McCollister [Wed, 10 Feb 2021 01:02:12 +0000 (19:02 -0600)]
net: dsa: add support for offloading HSR

Add support for offloading of HSR/PRP (IEC 62439-3) tag insertion
tag removal, duplicate generation and forwarding on DSA switches.

Add DSA_NOTIFIER_HSR_JOIN and DSA_NOTIFIER_HSR_LEAVE which trigger calls
to .port_hsr_join and .port_hsr_leave in the DSA driver for the switch.

The DSA switch driver should then set netdev feature flags for the
HSR/PRP operation that it offloads.
    NETIF_F_HW_HSR_TAG_INS
    NETIF_F_HW_HSR_TAG_RM
    NETIF_F_HW_HSR_FWD
    NETIF_F_HW_HSR_DUP

Signed-off-by: George McCollister <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Reviewed-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: hsr: add offloading support
George McCollister [Wed, 10 Feb 2021 01:02:11 +0000 (19:02 -0600)]
net: hsr: add offloading support

Add support for offloading of HSR/PRP (IEC 62439-3) tag insertion
tag removal, duplicate generation and forwarding.

For HSR, insertion involves the switch adding a 6 byte HSR header after
the 14 byte Ethernet header. For PRP it adds a 6 byte trailer.

Tag removal involves automatically stripping the HSR/PRP header/trailer
in the switch. This is possible when the switch also performs auto
deduplication using the HSR/PRP header/trailer (making it no longer
required).

Forwarding involves automatically forwarding between redundant ports in
an HSR. This is crucial because delay is accumulated as a frame passes
through each node in the ring.

Duplication involves the switch automatically sending a single frame
from the CPU port to both redundant ports. This is required because the
inserted HSR/PRP header/trailer must contain the same sequence number
on the frames sent out both redundant ports.

Export is_hsr_master so DSA can tell them apart from other devices in
dsa_slave_changeupper.

Signed-off-by: George McCollister <[email protected]>
Reviewed-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: hsr: generate supervision frame without HSR/PRP tag
George McCollister [Wed, 10 Feb 2021 01:02:10 +0000 (19:02 -0600)]
net: hsr: generate supervision frame without HSR/PRP tag

For a switch to offload insertion of HSR/PRP tags, frames must not be
sent to the CPU facing switch port with a tag. Generate supervision frames
(eth type ETH_P_PRP) without HSR v1 (ETH_P_HSR)/PRP tag and rely on
create_tagged_frame which inserts it later. This will allow skipping the
tag insertion for all outgoing frames in the future which is required for
HSR v1/PRP tag insertions to be offloaded.

HSR v0 supervision frames always contain tag information so insertion of
the tag can't be offloaded. IEC 62439-3 Ed.2.0 (HSR v1) specifically
notes that this was changed since v0 to allow offloading.

Signed-off-by: George McCollister <[email protected]>
Reviewed-by: Vladimir Oltean <[email protected]>
Tested-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: dsa: xrs700x: use of_match_ptr() on xrs700x_mdio_dt_ids
George McCollister [Tue, 9 Feb 2021 21:12:56 +0000 (15:12 -0600)]
net: dsa: xrs700x: use of_match_ptr() on xrs700x_mdio_dt_ids

Use of_match_ptr() on xrs700x_mdio_dt_ids so that NULL is substituted
when CONFIG_OF isn't defined. This will prevent unnecessary use of
xrs700x_mdio_dt_ids when CONFIG_OF isn't defined.

Signed-off-by: George McCollister <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: dsa: xrs700x: fix unused warning for of_device_id
George McCollister [Tue, 9 Feb 2021 21:12:55 +0000 (15:12 -0600)]
net: dsa: xrs700x: fix unused warning for of_device_id

Fix unused variable warning that occurs when CONFIG_OF isn't defined by
adding __maybe_unused.

>> drivers/net/dsa/xrs700x/xrs700x_i2c.c:127:34: warning: unused
variable 'xrs700x_i2c_dt_ids' [-Wunused-const-variable]
   static const struct of_device_id xrs700x_i2c_dt_ids[] = {

Reported-by: kernel test robot <[email protected]>
Signed-off-by: George McCollister <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'tcp-rfc-6056'
David S. Miller [Thu, 11 Feb 2021 21:13:05 +0000 (13:13 -0800)]
Merge branch 'tcp-rfc-6056'

Eric Dumazet says:

====================
tcp: RFC 6056 induced changes

This is based on a report from David Dworken.

First patch implements RFC 6056 3.3.4 proposal.

Second patch is adding a little bit of noise to make
attacker life a bit harder.
===================

Signed-off-by: David S. Miller <[email protected]>
4 years agotcp: add some entropy in __inet_hash_connect()
Eric Dumazet [Tue, 9 Feb 2021 19:20:28 +0000 (11:20 -0800)]
tcp: add some entropy in __inet_hash_connect()

Even when implementing RFC 6056 3.3.4 (Algorithm 4: Double-Hash
Port Selection Algorithm), a patient attacker could still be able
to collect enough state from an otherwise idle host.

Idea of this patch is to inject some noise, in the
cases __inet_hash_connect() found a candidate in the first
attempt.

This noise should not significantly reduce the collision
avoidance, and should be zero if connection table
is already well used.

Note that this is not implementing RFC 6056 3.3.5
because we think Algorithm 5 could hurt typical
workloads.

Signed-off-by: Eric Dumazet <[email protected]>
Cc: David Dworken <[email protected]>
Cc: Willem de Bruijn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agotcp: change source port randomizarion at connect() time
Eric Dumazet [Tue, 9 Feb 2021 19:20:27 +0000 (11:20 -0800)]
tcp: change source port randomizarion at connect() time

RFC 6056 (Recommendations for Transport-Protocol Port Randomization)
provides good summary of why source selection needs extra care.

David Dworken reminded us that linux implements Algorithm 3
as described in RFC 6056 3.3.3

Quoting David :
   In the context of the web, this creates an interesting info leak where
   websites can count how many TCP connections a user's computer is
   establishing over time. For example, this allows a website to count
   exactly how many subresources a third party website loaded.
   This also allows:
   - Distinguishing between different users behind a VPN based on
       distinct source port ranges.
   - Tracking users over time across multiple networks.
   - Covert communication channels between different browsers/browser
       profiles running on the same computer
   - Tracking what applications are running on a computer based on
       the pattern of how fast source ports are getting incremented.

Section 3.3.4 describes an enhancement, that reduces
attackers ability to use the basic information currently
stored into the shared 'u32 hint'.

This change also decreases collision rate when
multiple applications need to connect() to
different destinations.

Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: David Dworken <[email protected]>
Cc: Willem de Bruijn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoRevert "net-loopback: set lo dev initial state to UP"
Petr Machata [Tue, 9 Feb 2021 17:52:04 +0000 (18:52 +0100)]
Revert "net-loopback: set lo dev initial state to UP"

In commit c9dca822c729 ("net-loopback: set lo dev initial state to UP"),
linux started automatically bringing up the loopback device of a newly
created namespace. However, an existing user script might reasonably have
the following stanza when creating a new namespace -- and in fact at least
tools/testing/selftests/net/fib_nexthops.sh in Linux's very own testsuite
does:

 # set -e
 # ip netns add foo
 # ip -netns foo addr add 127.0.0.1/8 dev lo
 # ip -netns foo link set lo up
 # set +e

This will now fail, because the kernel reasonably rejects "ip addr add" of
a duplicate address. The described change of behavior therefore constitutes
a breakage. Revert it.

Fixes: c9dca822c729 ("net-loopback: set lo dev initial state to UP")
Signed-off-by: Petr Machata <[email protected]>
Reviewed-by: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agonet: phy: introduce phydev->port
Michael Walle [Tue, 9 Feb 2021 16:38:52 +0000 (17:38 +0100)]
net: phy: introduce phydev->port

At the moment, PORT_MII is reported in the ethtool ops. This is odd
because it is an interface between the MAC and the PHY and no external
port. Some network card drivers will overwrite the port to twisted pair
or fiber, though. Even worse, the MDI/MDIX setting is only used by
ethtool if the port is twisted pair.

Set the port to PORT_TP by default because most PHY drivers are copper
ones. If there is fibre support and it is enabled, the PHY driver will
set it to PORT_FIBRE.

This will change reporting PORT_MII to either PORT_TP or PORT_FIBRE;
except for the genphy fallback driver.

Suggested-by: Andrew Lunn <[email protected]>
Signed-off-by: Michael Walle <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agodevlink: Fix dmac_filter trap name, align to its documentation
Aya Levin [Tue, 9 Feb 2021 10:59:55 +0000 (12:59 +0200)]
devlink: Fix dmac_filter trap name, align to its documentation

%s/dest_mac_filter/dmac_filter/g

Fixes: e78ab164591f ("devlink: Add DMAC filter generic packet trap")
Signed-off-by: Aya Levin <[email protected]>
Reported-by: Ido Schimmel <[email protected]>
Reviewed-by: Tariq Toukan <[email protected]>
Reviewed-by: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'ibmvnic-coding-style'
David S. Miller [Thu, 11 Feb 2021 21:03:00 +0000 (13:03 -0800)]
Merge branch 'ibmvnic-coding-style'

Lijun Pan says:

====================
ibmvnic: a set of fixes of coding style

This series address several coding style problems.

v2: rebased on top of tree. Add the Reviewed-by tag from v1 reviews.
    patch 8/8 is new.
====================

Signed-off-by: David S. Miller <[email protected]>
4 years agoibmvnic: prefer strscpy over strlcpy
Lijun Pan [Thu, 11 Feb 2021 06:43:25 +0000 (00:43 -0600)]
ibmvnic: prefer strscpy over strlcpy

Fix this warning:
WARNING: Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/

Signed-off-by: Lijun Pan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoibmvnic: remove unused spinlock_t stats_lock definition
Lijun Pan [Thu, 11 Feb 2021 06:43:24 +0000 (00:43 -0600)]
ibmvnic: remove unused spinlock_t stats_lock definition

stats_lock is no longer used. So remove it.

Signed-off-by: Lijun Pan <[email protected]>
Reviewed-by: Saeed Mahameed <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoibmvnic: add comments for spinlock_t definitions
Lijun Pan [Thu, 11 Feb 2021 06:43:23 +0000 (00:43 -0600)]
ibmvnic: add comments for spinlock_t definitions

There are several spinlock_t definitions without comments.
Add them.

Signed-off-by: Lijun Pan <[email protected]>
Reviewed-by: Saeed Mahameed <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoibmvnic: fix miscellaneous checks
Lijun Pan [Thu, 11 Feb 2021 06:43:22 +0000 (00:43 -0600)]
ibmvnic: fix miscellaneous checks

Fix the following checkpatch checks:
CHECK: Macro argument 'off' may be better as '(off)' to
avoid precedence issues
CHECK: Alignment should match open parenthesis
CHECK: multiple assignments should be avoided
CHECK: Blank lines aren't necessary before a close brace '}'
CHECK: Please use a blank line after function/struct/union/enum
declarations
CHECK: Unnecessary parentheses around 'rc != H_FUNCTION'

Signed-off-by: Lijun Pan <[email protected]>
Reviewed-by: Saeed Mahameed <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoibmvnic: avoid multiple line dereference
Lijun Pan [Thu, 11 Feb 2021 06:43:21 +0000 (00:43 -0600)]
ibmvnic: avoid multiple line dereference

Fix the following checkpatch warning:
WARNING: Avoid multiple line dereference

Signed-off-by: Lijun Pan <[email protected]>
Reviewed-by: Saeed Mahameed <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoibmvnic: fix braces
Lijun Pan [Thu, 11 Feb 2021 06:43:20 +0000 (00:43 -0600)]
ibmvnic: fix braces

Fix the following checkpatch warning:
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Lijun Pan <[email protected]>
Reviewed-by: Saeed Mahameed <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoibmvnic: fix block comments
Lijun Pan [Thu, 11 Feb 2021 06:43:19 +0000 (00:43 -0600)]
ibmvnic: fix block comments

Fix the following checkpatch warning:
WARNING: networking block comments don't use an empty /* line, use /* Comment...

Signed-off-by: Lijun Pan <[email protected]>
Reviewed-by: Saeed Mahameed <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoibmvnic: prefer 'unsigned long' over 'unsigned long int'
Lijun Pan [Thu, 11 Feb 2021 06:43:18 +0000 (00:43 -0600)]
ibmvnic: prefer 'unsigned long' over 'unsigned long int'

Fix the following checkpatch warnings:
WARNING: Prefer 'unsigned long' over 'unsigned long int' as the int is unnecessary
WARNING: Prefer 'long' over 'long int' as the int is unnecessary

Signed-off-by: Lijun Pan <[email protected]>
Reviewed-by: Saeed Mahameed <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next...
David S. Miller [Thu, 11 Feb 2021 20:59:29 +0000 (12:59 -0800)]
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
40GbE Intel Wired LAN Driver Updates 2021-02-10

This series contains updates to i40e driver only.

Arkadiusz adds support for software controlled DCB. Upon disabling of the
firmware LLDP agent, the driver configures DCB with default values
(only one Traffic Class). At the same time, it allows a software based
LLDP agent - userspace application i.e. lldpad) to receive DCB TLVs
and set desired DCB configuration through DCB related netlink callbacks.

Aleksandr implements get and set ethtool ops for Energy Efficient
Ethernet.

Przemyslaw extends support for ntuple filters allowing for Flow Director
IPv6 and VLAN filters.

Kaixu Xia removes an unneeded assignment.
====================

Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Thu, 11 Feb 2021 18:44:32 +0000 (20:44 +0200)]
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git

ath.git patches for v5.12. Major changes:

wil6210

* add support for extended DMG MCS 12.1 rate

4 years agoMerge tag 'iwlwifi-next-for-kalle-2021-02-10' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Thu, 11 Feb 2021 18:41:02 +0000 (20:41 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2021-02-10' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

Second set of iwlwifi patches intended for v5.12

* Add some device IDs that got lost in a rebase;
* A bunch of fixes in the PPAG code;
* A few fixes in the debugging framework;
* Fix a couple of potential crashes in error paths;
* More HW IDs for new HW;
* Add one more value to the device configuration code;
* Support new scan config FW API;
* Some more CSA fixes;
* Support for RF interference mitigation (RFI);
* Improvements in the NVM flows;
* Bump the FW API support version;
* Implement support for PNVM from BIOS;
* Fix PM status when a FW crash happens;
* Some other small fixes, clean-ups and improvements.

# gpg: Signature made Thu 11 Feb 2021 02:02:34 AM EET using RSA key ID 1A3CC5FA
# gpg: Good signature from "Luciano Roth Coelho (Luca) <[email protected]>"
# gpg:                 aka "Luciano Roth Coelho (Intel) <[email protected]>"

4 years agoath11k: qmi: add debug message for allocated memory segment addresses and sizes
Kalle Valo [Thu, 11 Feb 2021 11:05:49 +0000 (13:05 +0200)]
ath11k: qmi: add debug message for allocated memory segment addresses and sizes

This helps debugging firmware memory allocation problems.

Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1

Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
4 years agoath11k: pci: remove experimental warning
Kalle Valo [Thu, 11 Feb 2021 10:51:37 +0000 (12:51 +0200)]
ath11k: pci: remove experimental warning

I have received feedback that QCA6390 PCI support is working for many, and I'm
also using QCA6390 on my daily driver^Hlaptop. While there are issues still
to be resolved it's not really experimental anymore, so remove the experimental
warning from driver initialisation.

Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1

Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
4 years agoath10k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()
Shuah Khan [Wed, 10 Feb 2021 21:21:07 +0000 (14:21 -0700)]
ath10k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()

ieee80211_find_sta_by_ifaddr() must be called under the RCU lock and
the resulting pointer is only valid under RCU lock as well.

Fix ath10k_wmi_tlv_op_pull_peer_stats_info() to hold RCU lock before it
calls ieee80211_find_sta_by_ifaddr() and release it when the resulting
pointer is no longer needed.

This problem was found while reviewing code to debug RCU warn from
ath10k_wmi_tlv_parse_peer_stats_info().

Link: https://lore.kernel.org/linux-wireless/[email protected]/
Signed-off-by: Shuah Khan <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
4 years agoath10k: change ath10k_offchan_tx_work() peer present msg to a warn
Shuah Khan [Wed, 10 Feb 2021 00:42:24 +0000 (17:42 -0700)]
ath10k: change ath10k_offchan_tx_work() peer present msg to a warn

Based on the comment block in this function and the FIXME for this, peer
being present for the offchannel tx is unlikely. Peer is deleted once tx
is complete. Change peer present msg to a warn to detect this condition.

Signed-off-by: Shuah Khan <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/3b1f71272d56ee1d7f567fbce13bdb56cc06d342.1612915444.git.skhan@linuxfoundation.org
4 years agoath9k: fix data bus crash when setting nf_override via debugfs
Linus Lüssing [Wed, 10 Feb 2021 07:53:44 +0000 (09:53 +0200)]
ath9k: fix data bus crash when setting nf_override via debugfs

When trying to set the noise floor via debugfs, a "data bus error"
crash like the following can happen:

[   88.433133] Data bus error, epc == 80221c28, ra == 83314e60
[   88.438895] Oops[#1]:
[   88.441246] CPU: 0 PID: 7263 Comm: sh Not tainted 4.14.195 #0
[   88.447174] task: 838a1c20 task.stack: 82d5e000
[   88.451847] $ 0   : 00000000 00000030 deadc0de 83141de4
[   88.457248] $ 4   : b810a2c4 0000a2c4 83230fd4 00000000
[   88.462652] $ 8   : 0000000a 00000000 00000001 00000000
[   88.468055] $12   : 7f8ef318 00000000 00000000 77f802a0
[   88.473457] $16   : 83230080 00000002 0000001b 83230080
[   88.478861] $20   : 83a1c3f8 00841000 77f7adb0 ffffff92
[   88.484263] $24   : 00000fa4 77edd860
[   88.489665] $28   : 82d5e000 82d5fda8 00000000 83314e60
[   88.495070] Hi    : 00000000
[   88.498044] Lo    : 00000000
[   88.501040] epc   : 80221c28 ioread32+0x8/0x10
[   88.505671] ra    : 83314e60 ath9k_hw_loadnf+0x88/0x520 [ath9k_hw]
[   88.512049] Status: 1000fc03 KERNEL EXL IE
[   88.516369] Cause : 5080801c (ExcCode 07)
[   88.520508] PrId  : 00019374 (MIPS 24Kc)
[   88.524556] Modules linked in: ath9k ath9k_common pppoe ppp_async l2tp_ppp cdc_mbim batman_adv ath9k_hw ath sr9700 smsc95xx sierra_net rndis_host qmi_wwan pppox ppp_generic pl2303 nf_conntrack_ipv6 mcs7830 mac80211 kalmia iptable_nat ipt_REJECT ipt_MASQUERADE huawei_cdc_ncm ftdi_sio dm9601 cfg80211 cdc_subset cdc_ncm cdc_ether cdc_eem ax88179_178a asix xt_time xt_tcpudp xt_tcpmss xt_statistic xt_state xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_ecn xt_dscp xt_conntrack xt_comment xt_TCPMSS xt_REDIRECT xt_NETMAP xt_LOG xt_HL xt_FLOWOFFLOAD xt_DSCP xt_CLASSIFY usbserial usbnet usbhid slhc rtl8150 r8152 pegasus nf_reject_ipv4 nf_nat_redirect nf_nat_masquerade_ipv4 nf_conntrack_ipv4 nf_nat_ipv4 nf_nat nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack
[   88.597894]  libcrc32c kaweth iptable_mangle iptable_filter ipt_ECN ipheth ip_tables hso hid_generic crc_ccitt compat cdc_wdm cdc_acm br_netfilter hid evdev input_core nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 l2tp_netlink l2tp_core udp_tunnel ip6_udp_tunnel xfrm6_mode_tunnel xfrm6_mode_transport xfrm6_mode_beet ipcomp6 xfrm6_tunnel esp6 ah6 xfrm4_tunnel xfrm4_mode_tunnel xfrm4_mode_transport xfrm4_mode_beet ipcomp esp4 ah4 tunnel6 tunnel4 tun xfrm_user xfrm_ipcomp af_key xfrm_algo sha256_generic sha1_generic jitterentropy_rng drbg md5 hmac echainiv des_generic deflate zlib_inflate zlib_deflate cbc authenc crypto_acompress ehci_platform ehci_hcd gpio_button_hotplug usbcore nls_base usb_common crc16 mii aead crypto_null cryptomgr crc32c_generic
[   88.671671]  crypto_hash
[   88.674292] Process sh (pid: 7263, threadinfo=82d5e000, task=838a1c20, tls=77f81efc)
[   88.682279] Stack : 00008060 00000008 00000200 00000000 00000000 00000000 00000000 00000002
[   88.690916]         80500000 83230080 82d5fe22 00841000 77f7adb0 00000000 00000000 83156858
[   88.699553]         00000000 8352fa00 83ad62b0 835302a8 00000000 300a00f8 00000003 82d5fe38
[   88.708190]         82d5fef4 00000001 77f54dc4 77f80000 77f7adb0 c79fe901 00000000 00000000
[   88.716828]         80510000 00000002 00841000 77f54dc4 77f80000 801ce4cc 0000000b 41824292
[   88.725465]         ...
[   88.727994] Call Trace:
[   88.730532] [<80221c28>] ioread32+0x8/0x10
[   88.734765] Code: 00000000  8c820000  0000000f <03e0000800000000  08088708  00000000  aca40000  03e00008
[   88.744846]
[   88.746464] ---[ end trace db226b2de1b69b9e ]---
[   88.753477] Kernel panic - not syncing: Fatal exception
[   88.759981] Rebooting in 3 seconds..

The "REG_READ(ah, AR_PHY_AGC_CONTROL)" in ath9k_hw_loadnf() does not
like being called when the hardware is asleep, leading to this crash.

The easiest way to reproduce this is trying to set nf_override while
the hardware is down:

  $ ip link set down dev wlan0
  $ echo "-85" > /sys/kernel/debug/ieee80211/phy0/ath9k/nf_override

Fixing this crash by waking the hardware up before trying to set the
noise floor. Similar to what other ath9k debugfs files do.

Tested on a Lima board from 8devices, which has a QCA 4531 chipset.

Fixes: b90189759a7f ("ath9k: add noise floor override option")
Cc: Simon Wunderlich <[email protected]>
Signed-off-by: Linus Lüssing <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
4 years agoath11k: add support to configure spatial reuse parameter set
Rajkumar Manoharan [Wed, 10 Feb 2021 07:53:29 +0000 (09:53 +0200)]
ath11k: add support to configure spatial reuse parameter set

The SPR parameter set comprises OBSS PD threshold for SRG
and non SRG and Bitmap of BSS color and partial BSSID. This adds
support to configure fields of SPR element to firmware.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01164-QCAHKSWPL_SILICONZ-1
Tested-by: Muna Sinada <[email protected]>
Signed-off-by: Rajkumar Manoharan <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
4 years agoath10k: restore tx sk_buff of htt header for SDIO
Wen Gong [Wed, 10 Feb 2021 07:53:24 +0000 (09:53 +0200)]
ath10k: restore tx sk_buff of htt header for SDIO

ieee80211_report_used_skb of mac80211 use the frame_control of
ieee80211_hdr in sk_buff and indicate it to another function
ieee80211_mgd_conn_tx_status, then it queue work ieee80211_sta_work,
but ieee80211_is_auth(fc) in ieee80211_sta_work check fail when the
authentication has transmitted by ath10k.

When the ath10k report it with HTT_TX_COMPL_STATE_DISCARD, it will be
set without flag IEEE80211_TX_STAT_ACK, then mac80211 should try the
next authentication immeditely, but in fact mac80211 wait 1 second for
it, the reason is ieee80211_is_auth(fc) in ieee80211_sta_work check
fail for the sk_buff which is not restored, the data of sk_buff is not
the begin of ieee80211_hdr, in fact it is the begin of htt_cmd_hdr.

dmesg without this patch, it wait 1 second for the next retry when
ath10k report without IEEE80211_TX_STAT_ACK for authentication:
[ 6973.883116] wlan0: send auth to 5e:6f:2b:0d:fb:d7 (try 1/3)
[ 6974.705471] wlan0: send auth to 5e:6f:2b:0d:fb:d7 (try 2/3)
[ 6975.712962] wlan0: send auth to 5e:6f:2b:0d:fb:d7 (try 3/3)

Restore the sk_buff make mac8011 retry the next authentication
immeditely which meet logic of mac80211.

dmesg with this patch, it retry the next immeditely when ath10k
report without IEEE80211_TX_STAT_ACK for authentication:
[  216.734813] wlan0: send auth to 5e:6f:2b:0d:fb:d7 (try 1/3)
[  216.739914] wlan0: send auth to 5e:6f:2b:0d:fb:d7 (try 2/3)
[  216.745874] wlan0: send auth to 5e:6f:2b:0d:fb:d7 (try 3/3)

Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049

Signed-off-by: Wen Gong <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
4 years agowilc1000: Fix use of void pointer as a wrong struct type
Vsevolod Kozlov [Wed, 10 Feb 2021 18:40:24 +0000 (20:40 +0200)]
wilc1000: Fix use of void pointer as a wrong struct type

ac_classify() expects a struct sk_buff* as its second argument, which is
a member of struct tx_complete_data. priv happens to be a pointer to
struct tx_complete_data, so passing it directly to ac_classify() leads
to wrong behaviour and occasional panics.

Since there is only one caller of wilc_wlan_txq_add_net_pkt and it
already knows the type behind this pointer, and the structure is already
in the header file, change the function signature to use the real type
instead of void* in order to prevent confusion.

Signed-off-by: Vsevolod Kozlov <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
4 years agobrcmsmac: Fix the spelling configation to configuration in the file d11.h
Bhaskar Chowdhury [Tue, 9 Feb 2021 23:29:21 +0000 (04:59 +0530)]
brcmsmac: Fix the spelling configation to configuration in the file d11.h

s/configation/configuration/

Signed-off-by: Bhaskar Chowdhury <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
4 years agonet/mlx5: SF, Fix error return code in mlx5_sf_dev_probe()
Wei Yongjun [Wed, 10 Feb 2021 07:54:17 +0000 (07:54 +0000)]
net/mlx5: SF, Fix error return code in mlx5_sf_dev_probe()

Fix to return negative error code -ENOMEM from the ioremap() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agonet/mlx5e: Fix error return code in mlx5e_tc_esw_init()
Wei Yongjun [Wed, 10 Feb 2021 07:46:05 +0000 (07:46 +0000)]
net/mlx5e: Fix error return code in mlx5e_tc_esw_init()

Fix to return negative error code from the mlx5e_tc_tun_init() error
handling case instead of 0, as done elsewhere in this function.

This commit also using 0 instead of 'ret' when success since it is
always equal to 0.

Fixes: 8914add2c9e5 ("net/mlx5e: Handle FIB events to update tunnel endpoint device")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agonet/mlx5: Fix a NULL vs IS_ERR() check
Dan Carpenter [Wed, 10 Feb 2021 11:06:28 +0000 (14:06 +0300)]
net/mlx5: Fix a NULL vs IS_ERR() check

The mlx5_chains_get_table() function doesn't return NULL, it returns
error pointers so we need to fix this condition.

Fixes: 34ca65352ddf ("net/mlx5: E-Switch, Indirect table infrastructure")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Vlad Buslov <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agonet/mlx5: docs: correct section reference in table of contents
Lukas Bulwahn [Fri, 5 Feb 2021 09:55:06 +0000 (10:55 +0100)]
net/mlx5: docs: correct section reference in table of contents

Commit 142d93d12dc1 ("net/mlx5: Add devlink subfunction port
documentation") refers to a section 'mlx5 port function' in the table of
contents, but includes a section 'mlx5 function attributes' instead.

Hence, make htmldocs warns:

  mlx5.rst:16: WARNING: Unknown target name: "mlx5 port function".

Correct the section reference in table of contents to the actual name of
section in the documentation.

Also, tune another section underline while visiting this document.

Signed-off-by: Lukas Bulwahn <[email protected]>
Reviewed-by: Parav Pandit <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agonet/mlx5e: Fix tc_tun.h to verify MLX5_ESWITCH config
Vlad Buslov [Tue, 9 Feb 2021 08:11:45 +0000 (10:11 +0200)]
net/mlx5e: Fix tc_tun.h to verify MLX5_ESWITCH config

Exclude contents of tc_tun.h header when CONFIG_MLX5_ESWITCH is disabled to
prevent compile-time errors when compiling with such config.

Fixes: 0d9f96471493 ("net/mlx5e: Extract tc tunnel encap/decap code to dedicated file")
Signed-off-by: Vlad Buslov <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agonet/mlx5: Assign boolean values to a bool variable
Jiapeng Zhong [Mon, 25 Jan 2021 07:50:37 +0000 (15:50 +0800)]
net/mlx5: Assign boolean values to a bool variable

Fix the following coccicheck warnings:

./drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:575:2-14: WARNING:
Assignment of 0/1 to bool variable.

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Zhong <[email protected]>
Reviewed-by: Saeed Mahameed <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agonet/mlx5e: Fix spelling mistake "Unknouwn" -> "Unknown"
Colin Ian King [Wed, 3 Feb 2021 11:10:49 +0000 (11:10 +0000)]
net/mlx5e: Fix spelling mistake "Unknouwn" -> "Unknown"

There is a spelling mistake in a netdev_warn message. Fix it.

Signed-off-by: Colin Ian King <[email protected]>
Reviewed-by: Jesse Brandeburg <[email protected]>
Reviewed-by: Saeed Mahameed <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agonet/mlx5e: Fix spelling mistake "channles" -> "channels"
Colin Ian King [Thu, 4 Feb 2021 09:32:32 +0000 (09:32 +0000)]
net/mlx5e: Fix spelling mistake "channles" -> "channels"

There is a spelling mistake in a netdev_warn message. Fix it.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agonet/mlx5: Delete device list leftover
Leon Romanovsky [Mon, 4 Jan 2021 07:38:57 +0000 (09:38 +0200)]
net/mlx5: Delete device list leftover

Device list is not stored in mlx5_priv anymore, so delete it as it's not
used.

Signed-off-by: Leon Romanovsky <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agonet/mlx5_core: remove unused including <generated/utsrelease.h>
Zou Wei [Wed, 9 Dec 2020 07:01:32 +0000 (15:01 +0800)]
net/mlx5_core: remove unused including <generated/utsrelease.h>

Remove including <generated/utsrelease.h> that don't need it.

Fixes: 17a7612b99e6 ("net/mlx5_core: Clean driver version and name")
Signed-off-by: Zou Wei <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agonet/mlx5: fix spelling mistake in Kconfig "accelaration" -> "acceleration"
Colin Ian King [Tue, 15 Dec 2020 14:49:46 +0000 (14:49 +0000)]
net/mlx5: fix spelling mistake in Kconfig "accelaration" -> "acceleration"

There are some spelling mistakes in the Kconfig. Fix these.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
4 years agoiwlwifi: bump FW API to 62 for AX devices
Luca Coelho [Wed, 10 Feb 2021 15:23:55 +0000 (17:23 +0200)]
iwlwifi: bump FW API to 62 for AX devices

Start supporting API version 62 for AX devices.

Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210172142.8c2e4ebd947e.Id1be235baad632e9ba1c07590e62184fc2f07c04@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: pnvm: implement reading PNVM from UEFI
Luca Coelho [Wed, 10 Feb 2021 23:50:41 +0000 (01:50 +0200)]
iwlwifi: pnvm: implement reading PNVM from UEFI

We now support fetching the PNVM data from a UEFI variable.  Add the
code to read this variable first and use it.  If it's not available,
we fall back to reading the data from the filesystem, as before.

Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210211015026.289084803334.Ie234805047df3be84f4235f9dafaf4cdecf0db9a@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: pnvm: move file loading code to a separate function
Luca Coelho [Wed, 10 Feb 2021 15:23:53 +0000 (17:23 +0200)]
iwlwifi: pnvm: move file loading code to a separate function

In preparation to support loading the PNVM from UEFI, move the
function that loads the PNVM from the filesystem to a separate
function.  This will make it easier to try to load from both places
later on.

Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210172142.072aa2e8bbc5.Ib351ee5da47a4cee60d44e66d32d2f6bba6f3150@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: pnvm: increment the pointer before checking the TLV
Luca Coelho [Wed, 10 Feb 2021 15:23:52 +0000 (17:23 +0200)]
iwlwifi: pnvm: increment the pointer before checking the TLV

If the SKU_ID doesn't match, we don't increment the pointer and keep
checking the same TLV over and over again.

We need to increment the pointer in all situtations, namely if the TLV
is not a SKU_ID, if the SKU_ID matched or if the SKU_ID didn't match.
So we can increment the pointer already before checking for these
conditions to solve the problem.

Signed-off-by: Luca Coelho <[email protected]>
Fixes: 6972592850c0 ("iwlwifi: read and parse PNVM file")
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210172142.de94d366f3ff.I9a5a54906cf0f4ec8af981d6066bfd771152ffb9@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: pcie: define FW_RESET_TIMEOUT for clarity
Matti Gottlieb [Wed, 10 Feb 2021 15:23:51 +0000 (17:23 +0200)]
iwlwifi: pcie: define FW_RESET_TIMEOUT for clarity

Move fw reset timeout to a FW_RESET_TIMEOUT macro
for better readability.

Signed-off-by: Matti Gottlieb <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210172142.f71c99f461ff.If32fe0afed277ec99ba0d7e2615c27a8a80a0d29@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: pnvm: set the PNVM again if it was already loaded
Luca Coelho [Wed, 10 Feb 2021 15:23:50 +0000 (17:23 +0200)]
iwlwifi: pnvm: set the PNVM again if it was already loaded

When the interface goes up, we have already loaded the PNVM during
init, so we don't load it anymore.  But we still need to set the PNVM
values in the context so that the FW can load it again.

Call set_pnvm when the PNVM is already loaded and change the
trans_pcie implementation to accept a second call to set_pnvm when we
have already allocated and, in this case, only set the values without
allocating again.

Signed-off-by: Luca Coelho <[email protected]>
Fixes: 6972592850c0 ("iwlwifi: read and parse PNVM file")
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210172142.622546a3566f.I659a8b9aa944d213c4ba446e142d74f3f6db9c64@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: mvm: global PM mode does not reset after FW crash
Ravi Darsi [Wed, 10 Feb 2021 15:23:49 +0000 (17:23 +0200)]
iwlwifi: mvm: global PM mode does not reset after FW crash

When The driver in D3 and FW crash happens, trans->system_pm_mode
is  not reset to IWL_PLAT_PM_MODE_DISABLED which causes the driver
not to send INIT conmmands and D3 resume fails.

This patch contains the fix for resetting trans->system_pm_mode to
IWL_PLAT_PM_MODE_DISABLED and D3 resume is successful.

Signed-off-by: Ravi Darsi <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210172142.ad170ad48409.Ifc6b10e8b3f235876af91d0e23e90b462d270eff@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: mvm: reduce the print severity of failing getting NIC temp
Golan Ben Ami [Wed, 10 Feb 2021 15:23:48 +0000 (17:23 +0200)]
iwlwifi: mvm: reduce the print severity of failing getting NIC temp

Currently, for all devices and families, failing getting the temp
from the fw is indicated in the log as ERR.
This is too severe for two reasons:
1. The driver has a fall back - and schedules the next temp
read immediately after failing to read temp from the fw.
2. The temp read implementation in the fw is different between
HWs, and on older devices the flow is a-sync and may timeout.

Reducing the print severity from ERR to WARN will allow to
track the issue if it will appear many times, but not frighten users
if it appears once.

Signed-off-by: Golan Ben Ami <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210172142.dfd423b2b2ef.Icd576dc3e2e7174d3ed9c1c32f48ea0013699e72@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: mvm: get NVM later in the mvm_start flow
Emmanuel Grumbach [Wed, 10 Feb 2021 15:15:14 +0000 (17:15 +0200)]
iwlwifi: mvm: get NVM later in the mvm_start flow

We don't need the NVM until fairly late in the flow and
since this flow will be split soon, get the NVM later to
unite it with the parts that really need it.
Gather all what needs the NVM into a function.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.bab0e65c4909.I789f3eb577b216ad1688269e036ce9fa4880f532@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlmvm: set properly NIC_NOT_ACK_ENABLED flag
Shaul Triebitz [Wed, 10 Feb 2021 15:15:13 +0000 (17:15 +0200)]
iwlmvm: set properly NIC_NOT_ACK_ENABLED flag

The STA_CTXT_HE_NIC_NOT_ACK_ENABLED flag tells the firmware
whether *we* support ack-enabled.
So what should be checked is our *own* capability and not
the *peer's* capability.

Signed-off-by: Shaul Triebitz <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.59f44e210096.I8f31968f6f7303255e212d869ca0131becd309aa@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: remove max_ht_ampdu_exponent config parameter
Johannes Berg [Wed, 10 Feb 2021 15:15:12 +0000 (17:15 +0200)]
iwlwifi: remove max_ht_ampdu_exponent config parameter

This always has the same value, since we don't have any
devices with different values; remove the parameter.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.50d11cbb073f.Ia44d022a4c549eb5fe0254fb20c62aa8d0bba634@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: remove max_vht_ampdu_exponent config parameter
Johannes Berg [Wed, 10 Feb 2021 15:15:11 +0000 (17:15 +0200)]
iwlwifi: remove max_vht_ampdu_exponent config parameter

This is not (or no longer) used, so remove it.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.ed18d7c8e7b8.Ic3fdf7c8636f332e3d5ee5841b03bf85e3bc4855@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: mvm: Check ret code for iwl_mvm_load_nvm_to_nic
Abhishek Naik [Wed, 10 Feb 2021 15:15:10 +0000 (17:15 +0200)]
iwlwifi: mvm: Check ret code for iwl_mvm_load_nvm_to_nic

Return value of the iwl_mvm_load_nvm_to_nic func is not analyzed. If load
NVM to nic func fails and NVM is not loaded to fw properly, then fw may
behave badly and lead to some strange issue. This commit will analyze
return value and if load NVM to nic has failed, then the error code is
sent to the previous func, which will trigger WRT log collection.
iwl_fw_dbg_error_collect() func collects dump only if tri type is
FW_DBG_TRIGGER_ALIVE_TIMEOUT. But when Load NVM to nic function fails
trig_type is FW_DBG_TRIGGER_DRIVER. This commit also has code changes to
collect dump when trig_type is FW_DBG_TRIGGER_DRIVER.

Signed-off-by: Abhishek Naik <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.32998850192a.Ic58d08cb6944ca55e343ff0032c82cfa7821e588@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: mvm: don't check if CSA event is running before removing
Sara Sharon [Wed, 10 Feb 2021 15:15:09 +0000 (17:15 +0200)]
iwlwifi: mvm: don't check if CSA event is running before removing

We may want to remove it before it started (i.e. before the
actual switch time).

Signed-off-by: Sara Sharon <[email protected]>
Fixes: 58ddd9b6d194 ("iwlwifi: mvm: don't send a CSA command the firmware doesn't know")
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.835db8987b8a.Ic6c5d28d744302db1bc6c4314bd3138ba472f834@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: mvm: Support SCAN_CFG_CMD version 5
Ilan Peer [Wed, 10 Feb 2021 15:15:08 +0000 (17:15 +0200)]
iwlwifi: mvm: Support SCAN_CFG_CMD version 5

Since the firmware support for internal station for auxiliary
activities, there is no need to configure an auxiliary station
as part of SCAN_CFG_CMD. Thus, this configuration was removed
from the corresponding structure.

Align the code accordingly.

Signed-off-by: Ilan Peer <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.9b8da8408692.I7fe99d73cd67ffc817c2ef6af4c9932ce9fc50b2@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: mvm: isolate the get nvm flow
Emmanuel Grumbach [Wed, 10 Feb 2021 15:15:07 +0000 (17:15 +0200)]
iwlwifi: mvm: isolate the get nvm flow

This will soon be a bit more complicated. Take it out
to a function.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.431f31a86ea0.I9db96647eb9c7142051e26cd5be3f52c5ffc5534@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: mvm: simplify iwl_mvm_dbgfs_register
Emmanuel Grumbach [Wed, 10 Feb 2021 15:15:06 +0000 (17:15 +0200)]
iwlwifi: mvm: simplify iwl_mvm_dbgfs_register

No need to pass the dbgfs_dir just to assign it to mvm.
Assign to mvm and then call iwl_mvm_dbgfs_register.

This is a preparation towards the addition of a delayed
op_mode_start flow.
This will allow to split the op_mode_start flow.
Registration to debugfs must happen after we register to
mac80211 and the registration to mac80211 will soon be
delayed in certain cases. In order not to have to remember
the debugfs_dir in a separate variable, just set it into
the mvm structure so that it can be usable later.

Declare mvm->debugfs_dir in the iwl_mvm structure even when
IWLWIFI_DEBUGFS isn't enabled to simplify the source code.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.a92ee491863d.I047923aa3598fbf4fb6fce2cdff75a4969fedd76@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: mvm: register to mac80211 last
Emmanuel Grumbach [Wed, 10 Feb 2021 15:15:05 +0000 (17:15 +0200)]
iwlwifi: mvm: register to mac80211 last

All the actions that were taken after the registration can
be taken before the registration to mac80211.
This will help to defer part of the op_mode_mvm_start
function to a later stage in case the device is not
available.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.c03cc5db67c1.Ia928ca34d25a73d959a345ffbe4f1217c3f17394@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: acpi: add support for DSM RFI
Gregory Greenman [Wed, 10 Feb 2021 15:15:04 +0000 (17:15 +0200)]
iwlwifi: acpi: add support for DSM RFI

BIOS provides RFI feature enable/disable state via WiFi DSM ACPI
object. By default the feature should be disabled.
The GUID for this feature is different from the one driver currently
uses, so need to provide a set of new definitions.

Signed-off-by: Gregory Greenman <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.242bfe368981.Iaccce1e2fa3986b174d0b08942aa4fbf8bb94a95@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agoiwlwifi: mvm: add RFI-M support
Gregory Greenman [Wed, 10 Feb 2021 15:15:03 +0000 (17:15 +0200)]
iwlwifi: mvm: add RFI-M support

RF Interference Mitigation is a new feature targeted to handle the
problem of interference between DDR memory and WiFi. The role of
the driver is to configure FW with the table holding a mapping
between problematic channels/bands and the corresponding frequencies.

This patch adds RFI infrastructure and adds two debugfs hooks:
- send RFI configuration command (currently with a default table) which
  will reset feature in the FW
- read the table, used by the FW (which can be a subset of the table
  that driver sent).

Signed-off-by: Gregory Greenman <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.2cea55a09bc7.I634b79795abad499ce442631d6672ffef8fc6d41@changeid
Signed-off-by: Luca Coelho <[email protected]>
4 years agonet: mvpp2: add an entry to skip parser
Stefan Chulski [Wed, 10 Feb 2021 14:17:13 +0000 (16:17 +0200)]
net: mvpp2: add an entry to skip parser

This entry used when skipping the parser needed,
for example, the custom header pretended to ethernet header.

Suggested-by: Liron Himi <[email protected]>
Signed-off-by: Stefan Chulski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agorxrpc: Fix missing dependency on NET_UDP_TUNNEL
David Howells [Tue, 9 Feb 2021 15:02:05 +0000 (15:02 +0000)]
rxrpc: Fix missing dependency on NET_UDP_TUNNEL

The changes to make rxrpc create the udp socket missed a bit to add the
Kconfig dependency on the udp tunnel code to do this.

Fix this by adding making AF_RXRPC select NET_UDP_TUNNEL.

Fixes: 1a9b86c9fd95 ("rxrpc: use udp tunnel APIs instead of open code in rxrpc_open_socket")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Vadim Fedorenko <[email protected]>
Signed-off-by: David Howells <[email protected]>
Reviewed-by: Xin Long <[email protected]>
cc: [email protected]
cc: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoMerge branch 'octeon-ethtool'
David S. Miller [Wed, 10 Feb 2021 23:19:54 +0000 (15:19 -0800)]
Merge branch 'octeon-ethtool'

Hariprasad Kelam says:

====================
ethtool support for fec and link configuration

This series of patches add support for forward error correction(fec) and
physical link configuration. Patches 1&2 adds necessary mbox handlers for fec
mode configuration request and to fetch stats. Patch 3 registers driver
callbacks for fec mode configuration and display. Patch 4&5 adds support of mbox
handlers for configuring link parameters like speed/duplex and autoneg etc.
Patche 6&7 registers driver callbacks for physical link configuration.

Change-log:
v2:
- Fixed review comments
- Corrected indentation issues
        - Return -ENOMEM incase of mbox allocation failure
- added validation for input fecparams bitmask values
        - added more comments

V3:
- Removed inline functions
        - Make use of ethtool helpers APIs to display supported
          advertised modes
        - corrected indentation issues
        - code changes such that return early in case of failure
          to aid branch prediction
v4:
- Corrected indentation issues
- Use FEC_OFF if user requests for FEC_AUTO mode
- Do not clear fec stats in case of user changes
  fec mode
- dont hide fec stats depending on interface mode
  selection
====================

Signed-off-by: David S. Miller <[email protected]>
4 years agoocteontx2-pf: ethtool physical link configuration
Christina Jacob [Tue, 9 Feb 2021 10:35:31 +0000 (16:05 +0530)]
octeontx2-pf: ethtool physical link configuration

Register set_link_ksetting callback with driver such that
link configurations parameters like advertised mode,speed, duplex
and autoneg can be configured.

below command
ethtool -s eth0 advertise 0x1 speed 10 duplex full autoneg on

Signed-off-by: Christina Jacob <[email protected]>
Signed-off-by: Sunil Goutham <[email protected]>
Signed-off-by: Hariprasad Kelam <[email protected]>
Reviewed-by: Jesse Brandeburg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoocteontx2-pf: ethtool physical link status
Christina Jacob [Tue, 9 Feb 2021 10:35:30 +0000 (16:05 +0530)]
octeontx2-pf: ethtool physical link status

Register get_link_ksettings callback to get link status information
from the driver. As virtual function (vf) shares same physical link
same API is used for both the drivers and for loop back drivers
simply returns the fixed values as its does not have physical link.

ethtool eth3
Settings for eth3:
        Supported ports: [ ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
                                10000baseKR/Full
                                1000baseX/Full
        Supports auto-negotiation: No
        Supported FEC modes: BaseR RS
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Advertised FEC modes: None

ethtool lbk0
Settings for lbk0:
Speed: 100000Mb/s
        Duplex: Full

Signed-off-by: Christina Jacob <[email protected]>
Signed-off-by: Sunil Goutham <[email protected]>
Signed-off-by: Hariprasad Kelam <[email protected]>
Reviewed-by: Jesse Brandeburg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoocteontx2-af: advertised link modes support on cgx
Christina Jacob [Tue, 9 Feb 2021 10:35:29 +0000 (16:05 +0530)]
octeontx2-af: advertised link modes support on cgx

CGX supports setting advertised link modes on physical link.
This patch adds support to derive cgx mode from ethtool
link mode and pass it to firmware to configure the same.

Signed-off-by: Christina Jacob <[email protected]>
Signed-off-by: Sunil Goutham <[email protected]>
Signed-off-by: Hariprasad Kelam <[email protected]>
Reviewed-by: Jesse Brandeburg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoocteontx2-af: Physical link configuration support
Christina Jacob [Tue, 9 Feb 2021 10:35:28 +0000 (16:05 +0530)]
octeontx2-af: Physical link configuration support

CGX LMAC, the physical interface support link configuration parameters
like speed, auto negotiation, duplex  etc. Firmware saves these into
memory region shared between firmware and this driver.

This patch adds mailbox handler set_link_mode, fw_data_get to
configure and read these parameters.

Signed-off-by: Christina Jacob <[email protected]>
Signed-off-by: Sunil Goutham <[email protected]>
Signed-off-by: Hariprasad Kelam <[email protected]>
Reviewed-by: Jesse Brandeburg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
4 years agoocteontx2-pf: ethtool fec mode support
Christina Jacob [Tue, 9 Feb 2021 10:35:27 +0000 (16:05 +0530)]
octeontx2-pf: ethtool fec mode support

Add ethtool support to configure fec modes baser/rs and
support to fecth FEC stats from CGX as well PHY.

Configure fec mode
- ethtool --set-fec eth0 encoding rs/baser/off/auto
Query fec mode
- ethtool --show-fec eth0

Signed-off-by: Christina Jacob <[email protected]>
Signed-off-by: Sunil Goutham <[email protected]>
Signed-off-by: Hariprasad Kelam <[email protected]>
Reviewed-by: Jesse Brandeburg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This page took 0.119733 seconds and 4 git commands to generate.