]> Git Repo - linux.git/log
linux.git
3 years agonet/mlx5: mlx5_ifc updates for flex parser
Yevgeny Kliteynik [Sun, 28 Feb 2021 21:48:27 +0000 (23:48 +0200)]
net/mlx5: mlx5_ifc updates for flex parser

Added the required definitions for supporting more protocols by flex parsers
(GTP-U, Geneve TLV options), and for using the right flex parser that was
configured for this protocol.

Signed-off-by: Yevgeny Kliteynik <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
3 years agonet/mlx5: E-Switch, Improve error messages in term table creation
Yevgeny Kliteynik [Sat, 6 Feb 2021 13:44:53 +0000 (15:44 +0200)]
net/mlx5: E-Switch, Improve error messages in term table creation

Add error code to the error messages and removed duplicated message:
if termination table creation failed, we already get an error message
in mlx5_eswitch_termtbl_create, so no need for the additional error print
in the calling function.

Signed-off-by: Yevgeny Kliteynik <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
3 years agonet/mlx5: DR, Fix SQ/RQ in doorbell bitmask
Yevgeny Kliteynik [Sat, 6 Feb 2021 20:44:41 +0000 (22:44 +0200)]
net/mlx5: DR, Fix SQ/RQ in doorbell bitmask

QP doorbell size is 16 bits.
Fixing sw steering's QP doorbel bitmask, which had 20 bits.

Signed-off-by: Yevgeny Kliteynik <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
3 years agonet/mlx5: DR, Rename an argument in dr_rdma_segments
Yevgeny Kliteynik [Thu, 24 Sep 2020 17:58:16 +0000 (20:58 +0300)]
net/mlx5: DR, Rename an argument in dr_rdma_segments

Rename the argument to better reflect that the meaning is
not number of records, but wheather or not we should
ring the dorbell.

Signed-off-by: Yevgeny Kliteynik <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
3 years agonet/mlx5e: RX, Add checks for calculated Striding RQ attributes
Tariq Toukan [Sun, 21 Jun 2020 18:35:34 +0000 (21:35 +0300)]
net/mlx5e: RX, Add checks for calculated Striding RQ attributes

Striding RQ attributes below are mutually dependent. An unaware
change to one might take the others out of the valid range derived
by the HW caps:
- The MPWQE size in bytes
- The number of strides in a MPWQE
- The stride size

Add checks to verify they are valid and comply to the HW spec
and SW assumptions/requirements.
This is not a fix, no particular issue exists today.

Signed-off-by: Tariq Toukan <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
3 years agonet/mlx5e: Fix possible non-initialized struct usage
Vladyslav Tarasiuk [Tue, 13 Apr 2021 08:15:49 +0000 (11:15 +0300)]
net/mlx5e: Fix possible non-initialized struct usage

If mlx5e_devlink_port_register() fails, driver may try to register
devlink health TX and RX reporters on non-registered devlink port.

Instead, create health reporters only if mlx5e_devlink_port_register()
does not fail. And destroy reporters only if devlink_port is registered.

Also, change mlx5e_get_devlink_port() behavior and return NULL in case
port is not registered to replicate devlink's wrapper when ndo is not
implemented.

Signed-off-by: Vladyslav Tarasiuk <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
3 years agonet/mlx5e: Fix lost changes during code movements
Tariq Toukan [Wed, 14 Apr 2021 17:43:33 +0000 (20:43 +0300)]
net/mlx5e: Fix lost changes during code movements

The changes done in commit [1] were missed by the code movements
done in [2], as they were developed in ~parallel.
Here we re-apply them.

[1] commit e4484d9df500 ("net/mlx5e: Enable striding RQ for Connect-X IPsec capable devices")
[2] commit b3a131c2a160 ("net/mlx5e: Move params logic into its dedicated file")

Fixes: b3a131c2a160 ("net/mlx5e: Move params logic into its dedicated file")
Signed-off-by: Tariq Toukan <[email protected]>
Reviewed-by: Aya Levin <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
3 years agoethtool: add missing EEPROM to list of messages
Jakub Kicinski [Mon, 19 Apr 2021 21:52:35 +0000 (14:52 -0700)]
ethtool: add missing EEPROM to list of messages

ETHTOOL_MSG_MODULE_EEPROM_GET is missing from the list of messages.
ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY is sadly a rather long name
so we need to adjust column length.

v2: use spaces (Andrew)

Fixes: c781ff12a2f3 ("ethtool: Allow network drivers to dump arbitrary EEPROM data")
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoethtool: stats: clarify the initialization to ETHTOOL_STAT_NOT_SET
Jakub Kicinski [Mon, 19 Apr 2021 20:03:45 +0000 (13:03 -0700)]
ethtool: stats: clarify the initialization to ETHTOOL_STAT_NOT_SET

Ido suggests we add a comment about the init of stats to -1.
This is unlikely to be clear to first time readers.

Suggested-by: Ido Schimmel <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agobnxt: add more ethtool standard stats
Jakub Kicinski [Mon, 19 Apr 2021 20:02:42 +0000 (13:02 -0700)]
bnxt: add more ethtool standard stats

Michael suggest a few more stats we can expose.

$ ethtool -S eth0 --groups eth-mac
Standard stats for eth0:
eth-mac-FramesTransmittedOK: 902623288966
eth-mac-FramesReceivedOK: 28727667047
eth-mac-FrameCheckSequenceErrors: 1
eth-mac-AlignmentErrors: 0
eth-mac-OutOfRangeLengthField: 0
$ ethtool -S eth0 | grep '\(fcs\|align\|oor\)'
     rx_fcs_err_frames: 1
     rx_align_err_frames: 0
     tx_fcs_err_frames: 0

Suggested-by: Michael Chan <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoMerge branch 'tja1103-driver'
David S. Miller [Mon, 19 Apr 2021 23:19:44 +0000 (16:19 -0700)]
Merge branch 'tja1103-driver'

Radu Pirea says:

====================
TJA1103 driver

This small series adds the TJA1103 PHY driver.

Changes in v3:
 - use phy_read_mmd_poll_timeout instead of spin_until_cond
 - changed the phy name from a generic one to something specific
 - minor indentation change

Changes in v2:
 - implemented genphy_c45_pma_suspend/genphy_c45_pma_suspend
 - set default internal delays set to 2ns(90 degrees)
 - added "VEND1_" prefix to the register definitions
 - disable rxid in case of txid
 - disable txid in case of rxid
 - disable internal delays in rgmii mode
 - reduced max line length to 80 characters
 - rebased on top of net-next/master
 - use genphy_c45_loopback as .set_loopback callback
 - renamed the driver from nxp-c45 to nxp-c45-tja11xx
 - used phy phy_set_bits_mmd/phy_clear_bits_mmd instead on phy_write_mmd where
 I had to set/clear one bit.
====================

Signed-off-by: David S. Miller <[email protected]>
3 years agophy: nxp-c45: add driver for tja1103
Radu Pirea (NXP OSS) [Mon, 19 Apr 2021 16:14:00 +0000 (19:14 +0300)]
phy: nxp-c45: add driver for tja1103

Add driver for tja1103 driver and for future NXP C45 PHYs.

Signed-off-by: Radu Pirea (NXP OSS) <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: phy: add genphy_c45_pma_suspend/resume
Radu Pirea (NXP OSS) [Mon, 19 Apr 2021 16:13:59 +0000 (19:13 +0300)]
net: phy: add genphy_c45_pma_suspend/resume

Add generic PMA suspend and resume callback functions for C45 PHYs.

Signed-off-by: Radu Pirea (NXP OSS) <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: marvell: prestera: add support for AC3X 98DX3265 device
Vadym Kochan [Fri, 16 Apr 2021 23:17:51 +0000 (02:17 +0300)]
net: marvell: prestera: add support for AC3X 98DX3265 device

Add PCI match for AC3X 98DX3265 device which is supported by the current
driver and firmware.

Signed-off-by: Vadym Kochan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: stmmac: fix memory leak during driver probe
Wong Vee Khee [Mon, 19 Apr 2021 11:25:30 +0000 (19:25 +0800)]
net: stmmac: fix memory leak during driver probe

On driver probe, kmemleak reported the following memory leak which was
due to allocated bitmap that was not being freed in stmmac_dvr_probe().

unreferenced object 0xffff9276014b13c0 (size 8):
  comm "systemd-udevd", pid 2143, jiffies 4294681112 (age 116.720s)
  hex dump (first 8 bytes):
    00 00 00 00 00 00 00 00                          ........
  backtrace:
    [<00000000c51e34b2>] stmmac_dvr_probe+0x1c0/0x440 [stmmac]
    [<00000000b530eb41>] intel_eth_pci_probe.cold+0x2b/0x14e [dwmac_intel]
    [<00000000b10f8929>] pci_device_probe+0xd2/0x150
    [<00000000fb254c74>] really_probe+0xf8/0x410
    [<0000000034128a59>] driver_probe_device+0x5d/0x150
    [<00000000016104d5>] device_driver_attach+0x53/0x60
    [<00000000cb18cd07>] __driver_attach+0x96/0x140
    [<00000000da9ffd5c>] bus_for_each_dev+0x7a/0xc0
    [<00000000af061a88>] bus_add_driver+0x184/0x1f0
    [<000000008be5c1c5>] driver_register+0x6c/0xc0
    [<0000000052b18a9e>] do_one_initcall+0x4d/0x210
    [<00000000154d4f07>] do_init_module+0x5c/0x230
    [<000000009b648d09>] load_module+0x2a5a/0x2d40
    [<000000000d86b76d>] __do_sys_finit_module+0xb5/0x120
    [<000000002b0cef95>] do_syscall_64+0x33/0x40
    [<0000000067b45bbb>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy")
Cc: Ong Boon Leong <[email protected]>
Signed-off-by: Wong Vee Khee <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoMerge branch 'korina-next'
David S. Miller [Mon, 19 Apr 2021 22:58:15 +0000 (15:58 -0700)]
Merge branch 'korina-next'

Thomas Bogendoerfer says:

====================
net: Korina improvements

While converting Mikrotik RB532 support to use device tree I stumbled
over the korina ethernet driver, which used way too many MIPS specific
hacks. This series cleans this all up and adds support for device tree.

Changes in v6:
 - remove korina from resource names and adapt DT binding to it
 - removed superfluous braces around of_get_mac_address

Changes in v5:
  - fixed email address in binding document, which prevented sending it

Changes in v4:
  - improve error returns in mdio_read further
  - added clock name and improved clk handling
  - fixed binding errors

Changes in v3:
  - use readl_poll_timeout_atomic in mdio_wait
  - return -ETIMEDOUT, if mdio_wait failed
  - added DT binding and changed name to idt,3243x-emac
  - fixed usage of of_get_mac_address for net-next

Changes in v2:
  - added device tree support to get rid of idt_cpu_freq
  - fixed compile test on 64bit archs
  - fixed descriptor current address handling by storing/using mapped
    dma addresses (dma controller modifies current address)
====================

Signed-off-by: David S. Miller <[email protected]>
3 years agodt-bindings: net: korina: Add DT bindings for IDT 79RC3243x SoCs
Thomas Bogendoerfer [Sun, 18 Apr 2021 22:19:48 +0000 (00:19 +0200)]
dt-bindings: net: korina: Add DT bindings for IDT 79RC3243x SoCs

Add device tree bindings for ethernet controller integrated into
IDT 79RC3243x SoCs.

Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: korina: Make driver COMPILE_TESTable
Thomas Bogendoerfer [Sun, 18 Apr 2021 22:19:47 +0000 (00:19 +0200)]
net: korina: Make driver COMPILE_TESTable

Move structs/defines for ethernet/dma register into driver, since they
are only used for this driver and remove any MIPS specific includes.
This makes it possible to COMPILE_TEST the driver.

Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: korina: Get mdio input clock via common clock framework
Thomas Bogendoerfer [Sun, 18 Apr 2021 22:19:46 +0000 (00:19 +0200)]
net: korina: Get mdio input clock via common clock framework

With device tree clock is provided via CCF. For non device tree
use a maximum clock value to not overclock the PHY. The non device
tree usage will go away after platform is converted to DT.

Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: korina: Add support for device tree
Thomas Bogendoerfer [Sun, 18 Apr 2021 22:19:45 +0000 (00:19 +0200)]
net: korina: Add support for device tree

If there is no mac address passed via platform data try to get it via
device tree and fall back to a random mac address, if all fail.

Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: korina: Only pass mac address via platform data
Thomas Bogendoerfer [Sun, 18 Apr 2021 22:19:44 +0000 (00:19 +0200)]
net: korina: Only pass mac address via platform data

Get rid of access to struct korina_device by just passing the mac
address via platform data and use drvdata for passing netdev to remove
function.

Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: korina: Use DMA API
Thomas Bogendoerfer [Sun, 18 Apr 2021 22:19:43 +0000 (00:19 +0200)]
net: korina: Use DMA API

Instead of messing with MIPS specific macros use DMA API for mapping
descriptors and skbs.

Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: korina: Remove nested helpers
Thomas Bogendoerfer [Sun, 18 Apr 2021 22:19:42 +0000 (00:19 +0200)]
net: korina: Remove nested helpers

Remove helpers, which are only used in one call site.

Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: korina: Remove not needed cache flushes
Thomas Bogendoerfer [Sun, 18 Apr 2021 22:19:41 +0000 (00:19 +0200)]
net: korina: Remove not needed cache flushes

Descriptors are mapped uncached so there is no need to do any cache
handling for them.

Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: korina: Use devres functions
Thomas Bogendoerfer [Sun, 18 Apr 2021 22:19:40 +0000 (00:19 +0200)]
net: korina: Use devres functions

Simplify probe/remove code by using devm_ functions.

Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: korina: Fix MDIO functions
Thomas Bogendoerfer [Sun, 18 Apr 2021 22:19:39 +0000 (00:19 +0200)]
net: korina: Fix MDIO functions

Fixed MDIO functions to work reliable and not just by accident.

Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoMerge branch 'mtk_ppe_offload-fixes'
David S. Miller [Mon, 19 Apr 2021 22:55:05 +0000 (15:55 -0700)]
Merge branch 'mtk_ppe_offload-fixes'

Pablo Neira Ayuso says:

====================
mtk_ppe_offload fixes

A few incremental fixes for the initial flowtable offload support
and this driver:

1) Fix undefined reference to `dsa_port_from_netdev' due to missing
   dependencies in Kconfig, reported by Kbuild robot.

2) Missing mutex to serialize flow events via workqueue to the driver.

3) Handle FLOW_ACTION_VLAN_POP tag action.
====================

Signed-off-by: David S. Miller <[email protected]>
3 years agonet: ethernet: mtk_eth_soc: handle VLAN pop action
Pablo Neira Ayuso [Sun, 18 Apr 2021 21:11:45 +0000 (23:11 +0200)]
net: ethernet: mtk_eth_soc: handle VLAN pop action

Do not hit EOPNOTSUPP when flowtable offload provides a VLAN pop action.

Fixes: efce49dfe6a8 ("netfilter: flowtable: add vlan pop action offload support")
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: ethernet: mtk_eth_soc: missing mutex
Pablo Neira Ayuso [Sun, 18 Apr 2021 21:11:44 +0000 (23:11 +0200)]
net: ethernet: mtk_eth_soc: missing mutex

Patch 2ed37183abb7 ("netfilter: flowtable: separate replace, destroy and
stats to different workqueues") splits the workqueue per event type. Add
a mutex to serialize updates.

Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support")
Reported-by: Frank Wunderlich <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: ethernet: mtk_eth_soc: fix undefined reference to `dsa_port_from_netdev'
Pablo Neira Ayuso [Sun, 18 Apr 2021 21:11:43 +0000 (23:11 +0200)]
net: ethernet: mtk_eth_soc: fix undefined reference to `dsa_port_from_netdev'

Caused by:

 CONFIG_NET_DSA=m
 CONFIG_NET_MEDIATEK_SOC=y

mtk_ppe_offload.c:undefined reference to `dsa_port_from_netdev'

Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
David S. Miller [Mon, 19 Apr 2021 22:49:50 +0000 (15:49 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next

Pablo Neira Ayuso says:

====================
Netfilter updates for net-next

The following patchset contains Netfilter updates for net-next:

1) Add vlan match and pop actions to the flowtable offload,
   patches from wenxu.

2) Reduce size of the netns_ct structure, which itself is
   embedded in struct net Make netns_ct a read-mostly structure.
   Patches from Florian Westphal.

3) Add FLOW_OFFLOAD_XMIT_UNSPEC to skip dst check from garbage
   collector path, as required by the tc CT action. From Roi Dayan.

4) VLAN offload fixes for nftables: Allow for matching on both s-vlan
   and c-vlan selectors. Fix match of VLAN id due to incorrect
   byteorder. Add a new routine to properly populate flow dissector
   ethertypes.

5) Missing keys in ip{6}_route_me_harder() results in incorrect
   routes. This includes an update for selftest infra. Patches
   from Ido Schimmel.

6) Add counter hardware offload support through FLOW_CLS_STATS.
====================

Signed-off-by: David S. Miller <[email protected]>
3 years agonetlink: simplify nl_set_extack_cookie_u64(), nl_set_extack_cookie_u32()
Alexey Dobriyan [Sat, 17 Apr 2021 11:38:07 +0000 (14:38 +0300)]
netlink: simplify nl_set_extack_cookie_u64(), nl_set_extack_cookie_u32()

Taking address of a function argument directly works just fine.

Signed-off-by: Alexey Dobriyan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: ethernet: mediatek: fix a typo bug in flow offloading
DENG Qingfang [Sat, 17 Apr 2021 07:29:04 +0000 (15:29 +0800)]
net: ethernet: mediatek: fix a typo bug in flow offloading

Issue was traffic problems after a while with increased ping times if
flow offload is active. It turns out that key_offset with cookie is
needed in rhashtable_params but was re-assigned to head_offset.
Fix the assignment.

Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support")
Signed-off-by: DENG Qingfang <[email protected]>
Tested-by: Frank Wunderlich <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoMerge branch 'hns3-next'
David S. Miller [Mon, 19 Apr 2021 22:38:05 +0000 (15:38 -0700)]
Merge branch 'hns3-next'

Huazhong Tan says:

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

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

Signed-off-by: David S. Miller <[email protected]>
3 years agonet: hns3: change the value of the SEPARATOR_VALUE macro in hclgevf_main.c
Huazhong Tan [Sat, 17 Apr 2021 07:09:24 +0000 (15:09 +0800)]
net: hns3: change the value of the SEPARATOR_VALUE macro in hclgevf_main.c

The SEPARATOR_VALUE macro is used as separator when getting
the register value, but the value of this macro is different
between pf and vf, it is a bit confusing for the user, so
synchronize the value of vf with pf.

Signed-off-by: Huazhong Tan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: hns3: cleanup inappropriate spaces in struct hlcgevf_tqp_stats
Huazhong Tan [Sat, 17 Apr 2021 07:09:23 +0000 (15:09 +0800)]
net: hns3: cleanup inappropriate spaces in struct hlcgevf_tqp_stats

Modify some inappropriate spaces in comments of struct
hlcgevf_tqp_stats.

Signed-off-by: Huazhong Tan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: hns3: remove a duplicate pf reset counting
Huazhong Tan [Sat, 17 Apr 2021 07:09:22 +0000 (15:09 +0800)]
net: hns3: remove a duplicate pf reset counting

When enter suspend mode the counter of pf reset will be increased
twice, since both hclge_prepare_general() and hclge_prepare_wait()
increase this counter. So remove the duplicate counting in
hclge_prepare_general().

Signed-off-by: Huazhong Tan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: xilinx: drivers need/depend on HAS_IOMEM
Randy Dunlap [Sat, 17 Apr 2021 06:55:54 +0000 (23:55 -0700)]
net: xilinx: drivers need/depend on HAS_IOMEM

kernel test robot reports build errors in 3 Xilinx ethernet drivers.
They all use ioremap functions that are only available when HAS_IOMEM
is set/enabled. If it is not enabled, they all have build errors,
so make these 3 drivers depend on HAS_IOMEM.

ld: drivers/net/ethernet/xilinx/xilinx_emaclite.o: in function `xemaclite_of_probe':
xilinx_emaclite.c:(.text+0x9fc): undefined reference to `devm_ioremap_resource'

ld: drivers/net/ethernet/xilinx/xilinx_axienet_main.o: in function `axienet_probe':
xilinx_axienet_main.c:(.text+0x942): undefined reference to `devm_ioremap_resource'

ld: drivers/net/ethernet/xilinx/ll_temac_main.o: in function `temac_probe':
ll_temac_main.c:(.text+0x1283): undefined reference to `devm_platform_ioremap_resource_byname'
ld: ll_temac_main.c:(.text+0x13ad): undefined reference to `devm_of_iomap'
ld: ll_temac_main.c:(.text+0x162e): undefined reference to `devm_platform_ioremap_resource'

Fixes: 8a3b7a252dca ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver")
Signed-off-by: Randy Dunlap <[email protected]>
Reported-by: kernel test robot <[email protected]>
Cc: Radhey Shyam Pandey <[email protected]>
Cc: Gary Guo <[email protected]>
Cc: Zhang Changzhong <[email protected]>
Cc: Andre Przywara <[email protected]>
Cc: [email protected]
Cc: Daniel Borkmann <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: [email protected]
Signed-off-by: David S. Miller <[email protected]>
3 years agoMerge branch 'enetc-flow-control'
David S. Miller [Mon, 19 Apr 2021 22:31:45 +0000 (15:31 -0700)]
Merge branch 'enetc-flow-control'

Vladimir Oltean says:

====================
Flow control for NXP ENETC

This patch series contains logic for enabling the lossless mode on the
RX rings of the ENETC, and the PAUSE thresholds on the internal FIFO
memory.

During testing it was found that, with the default FIFO configuration,
a sender which isn't persuaded by our PAUSE frames and keeps sending
will cause some MAC RX frame errors. To mitigate this, we need to ensure
that the FIFO never runs completely full, so we need to fix up a setting
that was supposed to be configured well out of reset. Unfortunately this
requires the addition of a new mini-driver.
====================

Signed-off-by: David S. Miller <[email protected]>
3 years agonet: enetc: add support for flow control
Vladimir Oltean [Fri, 16 Apr 2021 23:42:25 +0000 (02:42 +0300)]
net: enetc: add support for flow control

In the ENETC receive path, a frame received by the MAC is first stored
in a 256KB 'FIFO' memory, then transferred to DRAM when enqueuing it to
the RX ring. The FIFO is a shared resource for all ENETC ports, but
every port keeps track of its own memory utilization, on RX and on TX.

There is a setting for RX rings through which they can either operate in
'lossy' mode (where the lack of a free buffer causes an immediate
discard of the frame) or in 'lossless' mode (where the lack of a free
buffer in the ring makes the frame stay longer in the FIFO).

In turn, when the memory utilization of the FIFO exceeds a certain
margin, the MAC can be configured to emit PAUSE frames.

There is enough FIFO memory to buffer up to 3 MTU-sized frames per RX
port while not jeopardizing the other use cases (jumbo frames), and
also not consume bytes from the port TX allocations. Also, 3 MTU-sized
frames worth of memory is enough to ensure zero loss for 64 byte packets
at 1G line rate.

Signed-off-by: Vladimir Oltean <[email protected]>
Reviewed-by: Claudiu Manoil <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoarm64: dts: ls1028a: declare the Integrated Endpoint Register Block node
Vladimir Oltean [Fri, 16 Apr 2021 23:42:24 +0000 (02:42 +0300)]
arm64: dts: ls1028a: declare the Integrated Endpoint Register Block node

Add a node describing the address in the SoC memory space for the IERB.

Signed-off-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: enetc: add a mini driver for the Integrated Endpoint Register Block
Vladimir Oltean [Fri, 16 Apr 2021 23:42:23 +0000 (02:42 +0300)]
net: enetc: add a mini driver for the Integrated Endpoint Register Block

The NXP ENETC is a 4-port Ethernet controller which 'smells' to
operating systems like 4 distinct PCIe PFs with SR-IOV, each PF having
its own driver instance, but in fact there are some hardware resources
which are shared between all ports, like for example the 256 KB SRAM
FIFO between the MACs and the Host Transfer Agent which DMAs frames to
DRAM.

To hide the stuff that cannot be neatly exposed per port, the hardware
designers came up with this idea of having a dedicated register block
which is supposed to be populated by the bootloader, and contains
everything configuration-related: MAC addresses, FIFO partitioning, etc.

When a port is reset using PCIe Function Level Reset, its defaults are
transferred from the IERB configuration. Most of the time, the settings
made through the IERB are read-only in the port's memory space (if they
are even visible), so they cannot be modified at runtime.

Linux doesn't have any advanced FIFO partitioning requirements at all,
but when reading through the hardware manual, it became clear that, even
though there are many good 'recommendations' for default values, many of
them were not actually put in practice on LS1028A. So we end up with a
default configuration that:

(a) does not have enough TX and RX byte credits to support the max MTU
    of 9600 (which the Linux driver claims already) properly (at full speed)
(b) allows the FIFO to be overrun with RX traffic, potentially
    overwriting internal data structures.

The last part sounds a bit catastrophic, but it isn't. Frames are
supposed to transit the FIFO for a very short time, but they can
actually accumulate there under 2 conditions:

(a) there is very severe congestion on DRAM memory, or
(b) the RX rings visible to the operating system were configured for
    lossless operation, and they just ran out of free buffers to copy
    the frame to. This is what is used to put backpressure onto the MAC
    with flow control.

So since ENETC has not supported flow control thus far, RX FIFO overruns
were never seen with Linux. But with the addition of flow control, we
should configure some registers to prevent this from happening. What we
are trying to protect against are bad actors which continue to send us
traffic despite the fact that we have signaled a PAUSE condition. Of
course we can't be lossless in that case, but it is best to configure
the FIFO to do tail dropping rather than letting it overrun.

So in a nutshell, this driver is a fixup for all the IERB default values
that should have been but aren't.

The IERB configuration needs to be done _before_ the PFs are enabled.
So every PF searches for the presence of the "fsl,ls1028a-enetc-ierb"
node in the device tree, and if it finds it, it "registers" with the
IERB, which means that it requests the IERB to fix up its default
values. This is done through -EPROBE_DEFER. The IERB driver is part of
the fsl_enetc module, but is technically a platform driver, since the
IERB is a good old fashioned MMIO region, as opposed to ENETC ports
which pretend to be PCIe devices.

The driver was already configuring ENETC_PTXMBAR (FIFO allocation for
TX) because due to an omission, TXMBAR is a read/write register in the
PF memory space. But the manual is quite clear that the formula for this
should depend upon the TX byte credits (TXBCR). In turn, the TX byte
credits are only readable/writable through the IERB. So if we want to
ensure that the TXBCR register also has a value that is correct and in
line with TXMBAR, there is simply no way this can be done from the PF
driver, access to the IERB is needed.

I could have modified U-Boot to fix up the IERB values, but that is
quite undesirable, as old U-Boot versions are likely to be floating
around for quite some time from now.

Signed-off-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agodt-bindings: net: fsl: enetc: add the IERB documentation
Vladimir Oltean [Fri, 16 Apr 2021 23:42:22 +0000 (02:42 +0300)]
dt-bindings: net: fsl: enetc: add the IERB documentation

Mention the required compatible string and base address for the
Integrated Endpoint Register Block node.

Signed-off-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: enetc: create a common enetc_pf_to_port helper
Vladimir Oltean [Fri, 16 Apr 2021 23:42:21 +0000 (02:42 +0300)]
net: enetc: create a common enetc_pf_to_port helper

Even though ENETC interfaces are exposed as individual PCIe PFs with
their own driver instances, the ENETC is still fundamentally a
multi-port Ethernet controller, and some parts of the IP take a port
number (as can be seen in the PSFP implementation).

Create a common helper that can be used outside of the TSN code for
retrieving the ENETC port number based on the PF number. This is only
correct for LS1028A, the only Linux-capable instantiation of ENETC thus
far.

Note that ENETC port 3 is PF 6. The TSN code did not care about this
because ENETC port 3 does not support TSN, so the wrong mapping done by
enetc_get_port for PF 6 could have never been hit.

Signed-off-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoethtool: ioctl: Fix out-of-bounds warning in store_link_ksettings_for_user()
Gustavo A. R. Silva [Fri, 16 Apr 2021 20:15:40 +0000 (15:15 -0500)]
ethtool: ioctl: Fix out-of-bounds warning in store_link_ksettings_for_user()

Fix the following out-of-bounds warning:

net/ethtool/ioctl.c:492:2: warning: 'memcpy' offset [49, 84] from the object at 'link_usettings' is out of the bounds of referenced subobject 'base' with type 'struct ethtool_link_settings' at offset 0 [-Warray-bounds]

The problem is that the original code is trying to copy data into a
some struct members adjacent to each other in a single call to
memcpy(). This causes a legitimate compiler warning because memcpy()
overruns the length of &link_usettings.base. Fix this by directly
using &link_usettings and _from_ as destination and source addresses,
instead.

This helps with the ongoing efforts to globally enable -Warray-bounds
and get us closer to being able to tighten the FORTIFY_SOURCE routines
on memcpy().

Link: https://github.com/KSPP/linux/issues/109
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonet: mana: Add a driver for Microsoft Azure Network Adapter (MANA)
Dexuan Cui [Fri, 16 Apr 2021 20:11:59 +0000 (13:11 -0700)]
net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)

Add a VF driver for Microsoft Azure Network Adapter (MANA) that will be
available in the future.

Co-developed-by: Haiyang Zhang <[email protected]>
Signed-off-by: Haiyang Zhang <[email protected]>
Co-developed-by: Shachar Raindel <[email protected]>
Signed-off-by: Shachar Raindel <[email protected]>
Signed-off-by: Dexuan Cui <[email protected]>
Reviewed-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agomld: remove unnecessary prototypes
Taehee Yoo [Fri, 16 Apr 2021 17:41:48 +0000 (17:41 +0000)]
mld: remove unnecessary prototypes

Some prototypes are unnecessary, so delete it.

Signed-off-by: Taehee Yoo <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoMerge branch 'nh-flushing'
David S. Miller [Mon, 19 Apr 2021 22:20:35 +0000 (15:20 -0700)]
Merge branch 'nh-flushing'

Ido Schimmel says:

====================
nexthop: Support large scale nexthop flushing

Patch #1 fixes a day-one bug in the nexthop code and allows "ip nexthop
flush" to work correctly with large number of nexthops that do not fit
in a single-part dump.

Patch #2 adds a test case.

Targeting at net-next since this use case never worked, the flow is
pretty obscure and such a large number of nexthops is unlikely to be
used in any real-world scenario.

Tested with fib_nexthops.sh:

Tests passed: 219
Tests failed:   0
====================

Signed-off-by: David S. Miller <[email protected]>
3 years agoselftests: fib_nexthops: Test large scale nexthop flushing
Ido Schimmel [Fri, 16 Apr 2021 15:55:35 +0000 (18:55 +0300)]
selftests: fib_nexthops: Test large scale nexthop flushing

Test that all the nexthops are flushed when a multi-part nexthop dump is
required for the flushing.

Without previous patch:

 # ./fib_nexthops.sh
 TEST: Large scale nexthop flushing                                  [FAIL]

With previous patch:

 # ./fib_nexthops.sh
 TEST: Large scale nexthop flushing                                  [ OK ]

Signed-off-by: Ido Schimmel <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Reviewed-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agonexthop: Restart nexthop dump based on last dumped nexthop identifier
Ido Schimmel [Fri, 16 Apr 2021 15:55:34 +0000 (18:55 +0300)]
nexthop: Restart nexthop dump based on last dumped nexthop identifier

Currently, a multi-part nexthop dump is restarted based on the number of
nexthops that have been dumped so far. This can result in a lot of
nexthops not being dumped when nexthops are simultaneously deleted:

 # ip nexthop | wc -l
 65536
 # ip nexthop flush
 Dump was interrupted and may be inconsistent.
 Flushed 36040 nexthops
 # ip nexthop | wc -l
 29496

Instead, restart the dump based on the nexthop identifier (fixed number)
of the last successfully dumped nexthop:

 # ip nexthop | wc -l
 65536
 # ip nexthop flush
 Dump was interrupted and may be inconsistent.
 Flushed 65536 nexthops
 # ip nexthop | wc -l
 0

Reported-by: Maksym Yaremchuk <[email protected]>
Tested-by: Maksym Yaremchuk <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Reviewed-by: Petr Machata <[email protected]>
Reviewed-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoMerge tag 'wireless-drivers-next-2021-04-18' of git://git.kernel.org/pub/scm/linux...
David S. Miller [Mon, 19 Apr 2021 21:35:05 +0000 (14:35 -0700)]
Merge tag 'wireless-drivers-next-2021-04-18' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for v5.13

Second set of patches for v5.13. A lot of iwlwifi and mt76 patches
this time, and also smaller features and fixes all over.

mt76

* mt7915/mt7615 decapsulation offload support

* threaded NAPI support

* new device IDs

* mt7921 device reset support

* rx timestamp support

iwlwifi

* passive scan support for 6GHz

* new hardware support

wilc1000

* CRC support for SPI bus
====================

Signed-off-by: David S. Miller <[email protected]>
3 years agocfg80211: scan: drop entry from hidden_list on overflow
Johannes Berg [Fri, 16 Apr 2021 07:42:14 +0000 (09:42 +0200)]
cfg80211: scan: drop entry from hidden_list on overflow

If we overflow the maximum number of BSS entries and free the
new entry, drop it from any hidden_list that it may have been
added to in the code above or in cfg80211_combine_bsses().

Reported-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/20210416094212.5de7d1676ad7.Ied283b0bc5f504845e7d6ab90626bdfa68bb3dc0@changeid
Cc: [email protected]
Signed-off-by: Johannes Berg <[email protected]>
3 years agowireless: fix spelling of A-MSDU in HE capabilities
Johannes Berg [Fri, 9 Apr 2021 09:40:24 +0000 (12:40 +0300)]
wireless: fix spelling of A-MSDU in HE capabilities

In the HE capabilities, spell A-MSDU correctly, not "A-MDSU".

Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.9e6ff1af1181.If6868bc6902ccd9a95c74c78f716c4b41473ef14@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agowireless: align HE capabilities A-MPDU Length Exponent Extension
Johannes Berg [Fri, 9 Apr 2021 09:40:20 +0000 (12:40 +0300)]
wireless: align HE capabilities A-MPDU Length Exponent Extension

The A-MPDU length exponent extension is defined differently in
802.11ax D6.1, align with that.

Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.c2a257d3e2df.I3455245d388c52c61dace7e7958dbed7e807cfb6@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agowireless: align some HE capabilities with the spec
Johannes Berg [Fri, 9 Apr 2021 09:40:17 +0000 (12:40 +0300)]
wireless: align some HE capabilities with the spec

Some names were changed, align that with the spec as of
802.11ax-D6.1.

Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.b1e5fbab0d8c.I3eb6076cb0714ec6aec6b8f9dee613ce4a05d825@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agomac80211: drop the connection if firmware crashed while in CSA
Naftali Goldstein [Fri, 9 Apr 2021 09:40:14 +0000 (12:40 +0300)]
mac80211: drop the connection if firmware crashed while in CSA

Don't bother keeping the link in that case. It is way
too complicated to keep the connection.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Naftali Goldstein <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.a126c8833398.I677bdac314dd50d90474a90593902c17f9410cc4@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agonl80211: Add new RSNXE related nl80211 extended features
Ilan Peer [Fri, 9 Apr 2021 09:40:15 +0000 (12:40 +0300)]
nl80211: Add new RSNXE related nl80211 extended features

Draft P802.11ax_D2.5 defines the following capabilities that
can be negotiated using RSNXE capabilities:

- Secure LTF measurement exchange protocol.
- Secure RTT measurement exchange protocol.
- Management frame protection for all management frames exchanged
  during the negotiation and range measurement procedure.

Extend the nl80211 API to allow drivers to declare support for
these new capabilities as part of extended feature.

Signed-off-by: Ilan Peer <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.8280e31d8091.Ifcb29f84f432290338f80c8378aa5c9e0a390c93@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agomac80211: properly drop the connection in case of invalid CSA IE
Emmanuel Grumbach [Fri, 9 Apr 2021 09:40:16 +0000 (12:40 +0300)]
mac80211: properly drop the connection in case of invalid CSA IE

In case the frequency is invalid, ieee80211_parse_ch_switch_ie
will fail and we may not even reach the check in
ieee80211_sta_process_chanswitch. Drop the connection
in case ieee80211_parse_ch_switch_ie failed, but still
take into account the CSA mode to remember not to send
a deauth frame in case if it is forbidden to.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.34712ef96a0a.I75d7ad7f1d654e8b0aa01cd7189ff00a510512b3@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agomac80211: make ieee80211_vif_to_wdev work when the vif isn't in the driver
Emmanuel Grumbach [Fri, 9 Apr 2021 09:40:19 +0000 (12:40 +0300)]
mac80211: make ieee80211_vif_to_wdev work when the vif isn't in the driver

This will allow the low level driver to get the wdev during
the add_interface flow.
In order to do that, remove a few checks from there and do
not return NULL for vifs that were not yet added to the
driver. Note that all the current callers of this helper
function assume that the vif already exists:
 - The callers from the drivers already have a vif pointer.
 Before this change, ieee80211_vif_to_wdev would return NULL
 in some cases, but those callers don't even check they
 get a non-NULL pointer from ieee80211_vif_to_wdev.
 - The callers from net/mac80211/cfg.c assume the vif is
 already added to the driver as well.

So, this change has no impact on existing callers of this
helper function.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.6078d3517095.I1907a45f267a62dab052bcc44428aa7a2005ffc9@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agonl80211/cfg80211: add a flag to negotiate for LMR feedback in NDP ranging
Avraham Stern [Fri, 9 Apr 2021 09:40:25 +0000 (12:40 +0300)]
nl80211/cfg80211: add a flag to negotiate for LMR feedback in NDP ranging

Add a flag that indicates that the ISTA shall indicate support for
LMR feedback in NDP ranging negotiation.

Signed-off-by: Avraham Stern <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.eff546283504.I2606161e700ac24d94d0b50c8edcdedd4c0395c2@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agoieee80211: add the values of ranging parameters max LTF total field
Avraham Stern [Fri, 9 Apr 2021 09:40:26 +0000 (12:40 +0300)]
ieee80211: add the values of ranging parameters max LTF total field

Add an enum with the values of the ranging parameters max LTF total
field, as defined in IEEE802.11az_D2.6, table Table 9-322h23fc.

Signed-off-by: Avraham Stern <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.d2588ebb1974.I9424c8ade13c4c938cb9999d8ce99d0d4c1cc198@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agomac80211: aes_cmac: check crypto_shash_setkey() return value
Johannes Berg [Fri, 9 Apr 2021 09:40:28 +0000 (12:40 +0300)]
mac80211: aes_cmac: check crypto_shash_setkey() return value

As crypto_shash_setkey() can fail, we should check the return value.

Addresses-Coverity-ID: 1401813 ("Unchecked return value")
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210409123755.533ff7acf1d2.I034bafa201c4a6823333f8410aeaa60cca5ee9e0@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agomac80211: minstrel_ht: remove extraneous indentation on if statement
Colin Ian King [Fri, 16 Apr 2021 09:51:37 +0000 (10:51 +0100)]
mac80211: minstrel_ht: remove extraneous indentation on if statement

The increment of idx is indented one level too deeply, clean up the
code by removing the extraneous tab.

Signed-off-by: Colin Ian King <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
3 years agomac80211: properly process TXQ management frames
Johannes Berg [Fri, 16 Apr 2021 11:47:04 +0000 (13:47 +0200)]
mac80211: properly process TXQ management frames

My previous commit to not apply flow control to management frames
that are going over TXQs (which is currently only the case for
iwlwifi, I think) broke things, with iwlwifi firmware crashing on
certain frames. As it turns out, that was due to the frame being
too short: space for the MIC wasn't added at the end of encrypted
management frames.

Clearly, this is due to using the 'frags' queue - this is meant
only for frames that have already been processed for TX, and the
code in ieee80211_tx_dequeue() just returns them. This caused all
management frames to now not get any TX processing.

To fix this, use IEEE80211_TX_INTCFL_NEED_TXPROCESSING (which is
currently used only in other circumstances) to indicate that the
frames need processing, and clear it immediately after so that,
at least in theory, MMPDUs can be fragmented.

Fixes: 73bc9e0af594 ("mac80211: don't apply flow control on management frames")
Acked-by: Toke Høiland-Jørgensen <[email protected]>
Link: https://lore.kernel.org/r/20210416134702.ef8486a64293.If0a9025b39c71bb91b11dd6ac45547aba682df34@changeid
Signed-off-by: Johannes Berg <[email protected]>
3 years agocfg80211: constify ieee80211_get_response_rate return
Joe Perches [Sun, 18 Apr 2021 08:39:53 +0000 (01:39 -0700)]
cfg80211: constify ieee80211_get_response_rate return

It's not modified so make it const with the eventual goal of moving
data to text for various static struct ieee80211_rate arrays.

Signed-off-by: Joe Perches <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
3 years agocfg80211: fix a few kernel-doc warnings
Randy Dunlap [Sat, 17 Apr 2021 06:01:42 +0000 (23:01 -0700)]
cfg80211: fix a few kernel-doc warnings

Fix multiple kernel-doc warnings in cfg80211.h.

cfg80211.h:363: warning: missing initial short description on line:
 * struct ieee80211_sband_iftype_data
cfg80211.h:6743: warning: missing initial short description on line:
 * cfg80211_vendor_cmd_get_sender

Signed-off-by: Randy Dunlap <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
3 years agocfg80211: fix an htmldoc warning
Emmanuel Grumbach [Tue, 13 Apr 2021 11:38:50 +0000 (14:38 +0300)]
cfg80211: fix an htmldoc warning

The htmldoc produces this warning which was introduced
bu the commit below.

include/net/cfg80211.h:6643: warning: expecting prototype for wiphy_rfkill_set_hw_state().
Prototype was for wiphy_rfkill_set_hw_state_reason() instead

Fixes: 6f779a66dc84 ("cfg80211: allow specifying a reason for hw_rfkill")
Signed-off-by: Emmanuel Grumbach <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
3 years agonetfilter: nftables: counter hardware offload support
Pablo Neira Ayuso [Thu, 15 Apr 2021 18:10:18 +0000 (20:10 +0200)]
netfilter: nftables: counter hardware offload support

This patch adds the .offload_stats operation to synchronize hardware
stats with the expression data. Update the counter expression to use
this new interface. The hardware stats are retrieved from the netlink
dump path via FLOW_CLS_STATS command to the driver.

Signed-off-by: Pablo Neira Ayuso <[email protected]>
3 years agoselftests: fib_tests: Add test cases for interaction with mangling
Ido Schimmel [Wed, 14 Apr 2021 08:20:33 +0000 (11:20 +0300)]
selftests: fib_tests: Add test cases for interaction with mangling

Test that packets are correctly routed when netfilter mangling rules are
present.

Without previous patch:

 # ./fib_tests.sh -t ipv4_mangle

 IPv4 mangling tests
     TEST:     Connection with correct parameters                        [ OK ]
     TEST:     Connection with incorrect parameters                      [ OK ]
     TEST:     Connection with correct parameters - mangling             [FAIL]
     TEST:     Connection with correct parameters - no mangling          [ OK ]
     TEST:     Connection check - server side                            [FAIL]

 Tests passed:   3
 Tests failed:   2

 # ./fib_tests.sh -t ipv6_mangle

 IPv6 mangling tests
     TEST:     Connection with correct parameters                        [ OK ]
     TEST:     Connection with incorrect parameters                      [ OK ]
     TEST:     Connection with correct parameters - mangling             [FAIL]
     TEST:     Connection with correct parameters - no mangling          [ OK ]
     TEST:     Connection check - server side                            [FAIL]

 Tests passed:   3
 Tests failed:   2

With previous patch:

 # ./fib_tests.sh -t ipv4_mangle

 IPv4 mangling tests
     TEST:     Connection with correct parameters                        [ OK ]
     TEST:     Connection with incorrect parameters                      [ OK ]
     TEST:     Connection with correct parameters - mangling             [ OK ]
     TEST:     Connection with correct parameters - no mangling          [ OK ]
     TEST:     Connection check - server side                            [ OK ]

 Tests passed:   5
 Tests failed:   0

 # ./fib_tests.sh -t ipv6_mangle

 IPv6 mangling tests
     TEST:     Connection with correct parameters                        [ OK ]
     TEST:     Connection with incorrect parameters                      [ OK ]
     TEST:     Connection with correct parameters - mangling             [ OK ]
     TEST:     Connection with correct parameters - no mangling          [ OK ]
     TEST:     Connection check - server side                            [ OK ]

 Tests passed:   5
 Tests failed:   0

Signed-off-by: Ido Schimmel <[email protected]>
Reviewed-by: David Ahern <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
3 years agonetfilter: Dissect flow after packet mangling
Ido Schimmel [Wed, 14 Apr 2021 08:20:32 +0000 (11:20 +0300)]
netfilter: Dissect flow after packet mangling

Netfilter tries to reroute mangled packets as a different route might
need to be used following the mangling. When this happens, netfilter
does not populate the IP protocol, the source port and the destination
port in the flow key. Therefore, FIB rules that match on these fields
are ignored and packets can be misrouted.

Solve this by dissecting the outer flow and populating the flow key
before rerouting the packet. Note that flow dissection only happens when
FIB rules that match on these fields are installed, so in the common
case there should not be a penalty.

Reported-by: Michal Soltys <[email protected]>
Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
3 years agonetfilter: nftables_offload: special ethertype handling for VLAN
Pablo Neira Ayuso [Mon, 12 Apr 2021 12:20:55 +0000 (14:20 +0200)]
netfilter: nftables_offload: special ethertype handling for VLAN

The nftables offload parser sets FLOW_DISSECTOR_KEY_BASIC .n_proto to the
ethertype field in the ethertype frame. However:

- FLOW_DISSECTOR_KEY_BASIC .n_proto field always stores either IPv4 or IPv6
  ethertypes.
- FLOW_DISSECTOR_KEY_VLAN .vlan_tpid stores either the 802.1q and 802.1ad
  ethertypes. Same as for FLOW_DISSECTOR_KEY_CVLAN.

This function adjusts the flow dissector to handle two scenarios:

1) FLOW_DISSECTOR_KEY_VLAN .vlan_tpid is set to 802.1q or 802.1ad.
   Then, transfer:
   - the .n_proto field to FLOW_DISSECTOR_KEY_VLAN .tpid.
   - the original FLOW_DISSECTOR_KEY_VLAN .tpid to the
     FLOW_DISSECTOR_KEY_CVLAN .tpid
   - the original FLOW_DISSECTOR_KEY_CVLAN .tpid to the .n_proto field.

2) .n_proto is set to 802.1q or 802.1ad. Then, transfer:
   - the .n_proto field to FLOW_DISSECTOR_KEY_VLAN .tpid.
   - the original FLOW_DISSECTOR_KEY_VLAN .tpid to the .n_proto field.

Fixes: a82055af5959 ("netfilter: nft_payload: add VLAN offload support")
Signed-off-by: Pablo Neira Ayuso <[email protected]>
3 years agonetfilter: nftables_offload: VLAN id needs host byteorder in flow dissector
Pablo Neira Ayuso [Mon, 12 Apr 2021 12:20:15 +0000 (14:20 +0200)]
netfilter: nftables_offload: VLAN id needs host byteorder in flow dissector

The flow dissector representation expects the VLAN id in host byteorder.
Add the NFT_OFFLOAD_F_NETWORK2HOST flag to swap the bytes from nft_cmp.

Fixes: a82055af5959 ("netfilter: nft_payload: add VLAN offload support")
Signed-off-by: Pablo Neira Ayuso <[email protected]>
3 years agonetfilter: nft_payload: fix C-VLAN offload support
Pablo Neira Ayuso [Mon, 12 Apr 2021 12:11:39 +0000 (14:11 +0200)]
netfilter: nft_payload: fix C-VLAN offload support

- add another struct flow_dissector_key_vlan for C-VLAN
- update layer 3 dependency to allow to match on IPv4/IPv6

Fixes: 89d8fd44abfb ("netfilter: nft_payload: add C-VLAN offload support")
Signed-off-by: Pablo Neira Ayuso <[email protected]>
3 years agortw88: 8822c: add CFO tracking
Po-Hao Huang [Fri, 16 Apr 2021 03:09:01 +0000 (11:09 +0800)]
rtw88: 8822c: add CFO tracking

Add CFO tracking, which stands for central frequency offset tracking, to
adjust oscillator to align central frequency of connected AP. Then, it can
yield better performance.

Signed-off-by: Po-Hao Huang <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agoiwlwifi: pcie: don't enable BHs with IRQs disabled
Johannes Berg [Thu, 15 Apr 2021 13:48:46 +0000 (16:48 +0300)]
iwlwifi: pcie: don't enable BHs with IRQs disabled

After the fix from Jiri that disabled local IRQs instead of
just BHs (necessary to fix an issue with submitting a command
with IRQs already disabled), there was still a situation in
which we could deep in there enable BHs, if the device config
sets the apmg_wake_up_wa configuration, which is true on all
7000 series devices.

To fix that, but not require reverting commit 1ed08f6fb5ae
("iwlwifi: remove flags argument for nic_access"), split up
nic access into a version with BH manipulation to use most
of the time, and without it for this specific case where the
local IRQs are already disabled.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20210415164821.d0f2edda1651.I75f762e0bed38914d1300ea198b86dd449b4b206@changeid
3 years agobcma: remove unused function
Jiapeng Chong [Wed, 14 Apr 2021 06:39:14 +0000 (14:39 +0800)]
bcma: remove unused function

Fix the following clang warning:

drivers/bcma/driver_mips.c:55:20: warning: unused function
'mips_write32' [-Wunused-function].

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agowil6210: wmi: Remove useless code
Jiapeng Chong [Wed, 7 Apr 2021 09:46:06 +0000 (17:46 +0800)]
wil6210: wmi: Remove useless code

Fix the following whitescan warning:

An unsigned value can never be less than 0.

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/1617788766-91433-1-git-send-email-jiapeng.chong@linux.alibaba.com
3 years agocarl9170: remove get_tid_h
Christophe JAILLET [Fri, 2 Apr 2021 21:31:00 +0000 (23:31 +0200)]
carl9170: remove get_tid_h

'get_tid_h()' is the same as 'ieee80211_get_tid()'.
So this function can be removed to save a few lines of code.

Signed-off-by: Christophe JAILLET <[email protected]>
Acked-by: Christian Lamparter <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/68efad7a597159e22771d37fc8b4a8a613866d60.1617399010.git.christophe.jaillet@wanadoo.fr
3 years agomwl8k: Fix a double Free in mwl8k_probe_hw
Lv Yunlong [Fri, 2 Apr 2021 18:26:27 +0000 (11:26 -0700)]
mwl8k: Fix a double Free in mwl8k_probe_hw

In mwl8k_probe_hw, hw->priv->txq is freed at the first time by
dma_free_coherent() in the call chain:
if(!priv->ap_fw)->mwl8k_init_txqs(hw)->mwl8k_txq_init(hw, i).

Then in err_free_queues of mwl8k_probe_hw, hw->priv->txq is freed
at the second time by mwl8k_txq_deinit(hw, i)->dma_free_coherent().

My patch set txq->txd to NULL after the first free to avoid the
double free.

Fixes: a66098daacee2 ("mwl8k: Marvell TOPDOG wireless driver")
Signed-off-by: Lv Yunlong <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agortw88: Fix array overrun in rtw_get_tx_power_params()
Ping-Ke Shih [Thu, 1 Apr 2021 19:27:17 +0000 (14:27 -0500)]
rtw88: Fix array overrun in rtw_get_tx_power_params()

Using a kernel with the Undefined Behaviour Sanity Checker (UBSAN) enabled, the
following array overrun is logged:

================================================================================
UBSAN: array-index-out-of-bounds in /home/finger/wireless-drivers-next/drivers/net/wireless/realtek/rtw88/phy.c:1789:34
index 5 is out of range for type 'u8 [5]'
CPU: 2 PID: 84 Comm: kworker/u16:3 Tainted: G           O      5.12.0-rc5-00086-gd88bba47038e-dirty #651
Hardware name: TOSHIBA TECRA A50-A/TECRA A50-A, BIOS Version 4.50   09/29/2014
Workqueue: phy0 ieee80211_scan_work [mac80211]
Call Trace:
 dump_stack+0x64/0x7c
 ubsan_epilogue+0x5/0x40
 __ubsan_handle_out_of_bounds.cold+0x43/0x48
 rtw_get_tx_power_params+0x83a/drivers/net/wireless/realtek/rtw88/0xad0 [rtw_core]
 ? rtw_pci_read16+0x20/0x20 [rtw_pci]
 ? check_hw_ready+0x50/0x90 [rtw_core]
 rtw_phy_get_tx_power_index+0x4d/0xd0 [rtw_core]
 rtw_phy_set_tx_power_level+0xee/0x1b0 [rtw_core]
 rtw_set_channel+0xab/0x110 [rtw_core]
 rtw_ops_config+0x87/0xc0 [rtw_core]
 ieee80211_hw_config+0x9d/0x130 [mac80211]
 ieee80211_scan_state_set_channel+0x81/0x170 [mac80211]
 ieee80211_scan_work+0x19f/0x2a0 [mac80211]
 process_one_work+0x1dd/0x3a0
 worker_thread+0x49/0x330
 ? rescuer_thread+0x3a0/0x3a0
 kthread+0x134/0x150
 ? kthread_create_worker_on_cpu+0x70/0x70
 ret_from_fork+0x22/0x30
================================================================================

The statement where an array is being overrun is shown in the following snippet:

if (rate <= DESC_RATE11M)
tx_power = pwr_idx_2g->cck_base[group];
else
====> tx_power = pwr_idx_2g->bw40_base[group];

The associated arrays are defined in main.h as follows:

struct rtw_2g_txpwr_idx {
u8 cck_base[6];
u8 bw40_base[5];
struct rtw_2g_1s_pwr_idx_diff ht_1s_diff;
struct rtw_2g_ns_pwr_idx_diff ht_2s_diff;
struct rtw_2g_ns_pwr_idx_diff ht_3s_diff;
struct rtw_2g_ns_pwr_idx_diff ht_4s_diff;
};

The problem arises because the value of group is 5 for channel 14. The trivial
increase in the dimension of bw40_base fails as this struct must match the layout of
efuse. The fix is to add the rate as an argument to rtw_get_channel_group() and set
the group for channel 14 to 4 if rate <= DESC_RATE11M.

This patch fixes commit fa6dfe6bff24 ("rtw88: resolve order of tx power setting routines")

Fixes: fa6dfe6bff24 ("rtw88: resolve order of tx power setting routines")
Reported-by: Богдан Пилипенко <[email protected]>
Signed-off-by: Larry Finger <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
Cc: Stable <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agowilc1000: Remove duplicate struct declaration
Wan Jiabing [Wed, 31 Mar 2021 02:35:51 +0000 (10:35 +0800)]
wilc1000: Remove duplicate struct declaration

struct wilc is declared twice. One has been declared
at 352nd line. Remove the duplicate.

Signed-off-by: Wan Jiabing <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agobrcmfmac: Remove duplicate struct declaration
Wan Jiabing [Wed, 31 Mar 2021 02:35:50 +0000 (10:35 +0800)]
brcmfmac: Remove duplicate struct declaration

struct brcmf_bus is declared twice. One has been declared
at 37th line. Remove the duplicate.

Signed-off-by: Wan Jiabing <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agowl3501: fix typo of 'Networks' in comment
Eric Lin [Wed, 31 Mar 2021 01:04:18 +0000 (09:04 +0800)]
wl3501: fix typo of 'Networks' in comment

Signed-off-by: Eric Lin <[email protected]>
Reported-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agorsi: Use resume_noirq for SDIO
Marek Vasut [Sat, 27 Mar 2021 23:59:32 +0000 (00:59 +0100)]
rsi: Use resume_noirq for SDIO

The rsi_resume() does access the bus to enable interrupts on the RSI
SDIO WiFi card, however when calling sdio_claim_host() in the resume
path, it is possible the bus is already claimed and sdio_claim_host()
spins indefinitelly. Enable the SDIO card interrupts in resume_noirq
instead to prevent anything else from claiming the SDIO bus first.

Fixes: 20db07332736 ("rsi: sdio suspend and resume support")
Signed-off-by: Marek Vasut <[email protected]>
Cc: Amitkumar Karwar <[email protected]>
Cc: Angus Ainslie <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: Karun Eagalapati <[email protected]>
Cc: Martin Kepplinger <[email protected]>
Cc: Sebastian Krzyszkowiak <[email protected]>
Cc: Siva Rebbagondla <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agortw88: update statistics to fw for fine-tuning performance
Po-Hao Huang [Fri, 26 Mar 2021 09:21:47 +0000 (17:21 +0800)]
rtw88: update statistics to fw for fine-tuning performance

Since firmware can't have proper statistics, driver update the statistics
periodically to firmware to assist in tuning performance.

Signed-off-by: Po-Hao Huang <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agolibertas: struct lbs_private is declared duplicately
Wan Jiabing [Thu, 25 Mar 2021 06:41:51 +0000 (14:41 +0800)]
libertas: struct lbs_private is declared duplicately

struct lbs_private has been declared at 22nd line.
Remove the duplicate.

Signed-off-by: Wan Jiabing <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agobrcmfmac: A typo fix
Bhaskar Chowdhury [Tue, 23 Mar 2021 04:36:57 +0000 (10:06 +0530)]
brcmfmac: A typo fix

s/revsion/revision/

Signed-off-by: Bhaskar Chowdhury <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agorsi: fix comment syntax in file headers
Aditya Srivastava [Mon, 15 Mar 2021 17:32:59 +0000 (23:02 +0530)]
rsi: fix comment syntax in file headers

The opening comment mark '/**' is used for highlighting the beginning of
kernel-doc comments.
There are some files in drivers/net/wireless/rsi which follow this syntax
in their file headers, i.e. start with '/**' like comments, which causes
unexpected warnings from kernel-doc.

E.g., running scripts/kernel-doc -none on drivers/net/wireless/rsi/rsi_coex.h
causes this warning:
"warning: wrong kernel-doc identifier on line:
 * Copyright (c) 2018 Redpine Signals Inc."

Similarly for other files too.

Provide a simple fix by replacing such occurrences with general comment
format, i.e., "/*", to prevent kernel-doc from parsing it.

Signed-off-by: Aditya Srivastava <[email protected]>
Reviewed-by: Randy Dunlap <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agor8169: keep pause settings on interface down/up cycle
Heiner Kallweit [Thu, 15 Apr 2021 18:59:47 +0000 (20:59 +0200)]
r8169: keep pause settings on interface down/up cycle

Currently, if the user changes the pause settings, the default settings
will be restored after an interface down/up cycle, and also when
resuming from suspend. This doesn't seem to provide the best user
experience. Change this to keep user settings, and just ensure that in
jumbo mode pause is disabled.
Small drawback: When switching back mtu from jumbo to non-jumbo then
pause remains disabled (but user can enable it using ethtool).
I think that's a not too common scenario and acceptable.

Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
3 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Jakub Kicinski [Sat, 17 Apr 2021 17:42:54 +0000 (10:42 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 - keep the ZC code, drop the code related to reinit
net/bridge/netfilter/ebtables.c
 - fix build after move to net_generic

Signed-off-by: Jakub Kicinski <[email protected]>
3 years agoairo: work around stack usage warning
Arnd Bergmann [Tue, 23 Mar 2021 13:16:28 +0000 (14:16 +0100)]
airo: work around stack usage warning

gcc-11 with KASAN on 32-bit arm produces a warning about a function
that needs a lot of stack space:

drivers/net/wireless/cisco/airo.c: In function 'setup_card.constprop':
drivers/net/wireless/cisco/airo.c:3960:1: error: the frame size of 1512 bytes is larger than 1400 bytes [-Werror=frame-larger-than=]

Most of this is from a single large structure that could be dynamically
allocated or moved into the per-device structure.  However, as the callers
all seem to have a fairly well bounded call chain, the easiest change
is to pull out the part of the function that needs the large variables
into a separate function and mark that as noinline_for_stack. This does
not reduce the total stack usage, but it gets rid of the warning and
requires minimal changes otherwise.

Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agowlcore: fix overlapping snprintf arguments in debugfs
Arnd Bergmann [Tue, 23 Mar 2021 12:57:14 +0000 (13:57 +0100)]
wlcore: fix overlapping snprintf arguments in debugfs

gcc complains about undefined behavior in calling snprintf()
with the same buffer as input and output:

drivers/net/wireless/ti/wl18xx/debugfs.c: In function 'diversity_num_of_packets_per_ant_read':
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:3: error: 'snprintf' argument 4 overlaps destination object 'buf' [-Werror=restrict]
   86 |   snprintf(buf, sizeof(buf), "%s[%d] = %d\n",  \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   87 |     buf, i, stats->sub.name[i]);   \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ti/wl18xx/debugfs.c:24:2: note: in expansion of macro 'DEBUGFS_FWSTATS_FILE_ARRAY'
   24 |  DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c, wl18xx_acx_statistics)
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ti/wl18xx/debugfs.c:159:1: note: in expansion of macro 'WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY'
  159 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(diversity, num_of_packets_per_ant,

There are probably other ways of handling the debugfs file, without
using on-stack buffers, but a simple workaround here is to remember the
current position in the buffer and just keep printing in there.

Fixes: bcca1bbdd412 ("wlcore: add debugfs macro to help print fw statistics arrays")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agolibertas: avoid -Wempty-body warning
Arnd Bergmann [Mon, 22 Mar 2021 10:43:34 +0000 (11:43 +0100)]
libertas: avoid -Wempty-body warning

Building without mesh supports shows a couple of warnings with
'make W=1':

drivers/net/wireless/marvell/libertas/main.c: In function 'lbs_start_card':
drivers/net/wireless/marvell/libertas/main.c:1068:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
 1068 |                 lbs_start_mesh(priv);

Change the macros to use the usual "do { } while (0)" instead to shut up
the warnings and make the code a litte more robust.

Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agortl8xxxu: Simplify locking of a skb list accesses
Christophe JAILLET [Mon, 5 Apr 2021 09:09:14 +0000 (11:09 +0200)]
rtl8xxxu: Simplify locking of a skb list accesses

The 'c2hcmd_lock' spinlock is only used to protect some __skb_queue_tail()
and __skb_dequeue() calls.
Use the lock provided in the skb itself and call skb_queue_tail() and
skb_dequeue(). These functions already include the correct locking.

Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/8bcec6429615aeb498482dc7e1955ce09b456585.1617613700.git.christophe.jaillet@wanadoo.fr
3 years agowilc1000: fix a loop timeout condition
Dan Carpenter [Fri, 19 Mar 2021 14:47:31 +0000 (17:47 +0300)]
wilc1000: fix a loop timeout condition

If the loop fails, the "while(trials--) {" loop will exit with "trials"
set to -1.  The test for that expects it to end with "trials" set to 0
so the warning message will not be printed.

Fix this by changing from a post-op to a pre-op.  This does mean that
we only make 99 attempts instead of 100 but that's okay.

Fixes: f135a1571a05 ("wilc1000: Support chip sleep over SPI")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Ajay Singh <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/YFS5gx/gi70zlIaO@mwanda
3 years agomwifiex: Remove unneeded variable: "ret"
zuoqilin [Wed, 17 Mar 2021 06:33:53 +0000 (14:33 +0800)]
mwifiex: Remove unneeded variable: "ret"

Remove unneeded variable: "ret"

Signed-off-by: zuoqilin <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agortl8xxxu: Fix fall-through warnings for Clang
Gustavo A. R. Silva [Fri, 5 Mar 2021 09:48:50 +0000 (03:48 -0600)]
rtl8xxxu: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix
multiple warnings by replacing /* fall through */ comments with
the new pseudo-keyword macro fallthrough; instead of letting the
code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as
implicit fall-through markings.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/20210305094850.GA141221@embeddedor
3 years agowilc1000: Bring MAC address setting in line with typical Linux behavior
David Mosberger-Tang [Wed, 3 Mar 2021 19:50:07 +0000 (19:50 +0000)]
wilc1000: Bring MAC address setting in line with typical Linux behavior

Linux network drivers normally disallow changing the MAC address when
the interface is up.  This driver has been different in that it allows
to change the MAC address *only* when it's up.  This patch brings
wilc1000 behavior more in line with other network drivers.  We could
have replaced wilc_set_mac_addr() with eth_mac_addr() but that would
break existing documentation on how to change the MAC address.
Likewise, return -EADDRNOTAVAIL (not -EINVAL) when the specified MAC
address is invalid or unavailable.

Signed-off-by: David Mosberger-Tang <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agowilc1000: Add support for enabling CRC
David Mosberger-Tang [Sat, 27 Feb 2021 17:31:38 +0000 (17:31 +0000)]
wilc1000: Add support for enabling CRC

The driver so far has always disabled CRC protection.  This means any
data corruption that occurrs during the SPI transfers could go
undetected.  This patch adds module parameters enable_crc7 and
enable_crc16 to selectively turn on CRC7 (for command transfers) and
CRC16 (for data transfers), respectively.

The default configuration remains unchanged, with both CRC7 and CRC16
off.

The performance impact of CRC was measured by running ttcp -t four
times in a row on a SAMA5 device:

 CRC7 CRC16 Throughput: Standard deviation:
 ---- ----- ----------- -------------------
  off   off 1720  +/- 48 KB/s
   on   off 1658  +/- 58 KB/s
   on    on 1579  +/- 84 KB/s

Signed-off-by: David Mosberger-Tang <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
3 years agowilc1000: Check for errors at end of DMA write
David Mosberger-Tang [Sat, 27 Feb 2021 17:29:46 +0000 (17:29 +0000)]
wilc1000: Check for errors at end of DMA write

After a DMA write to the WILC chip, check for and report any errors.

This is based on code from the wilc driver in the linux-at91
repository.

Signed-off-by: David Mosberger-Tang <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
This page took 0.130004 seconds and 4 git commands to generate.