Ryder Lee [Tue, 2 Feb 2021 13:57:59 +0000 (21:57 +0800)]
mt76: use PCI_VENDOR_ID_MEDIATEK to avoid open coded
Use PCI standard defines.
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Lorenzo Bianconi [Fri, 12 Feb 2021 19:30:04 +0000 (20:30 +0100)]
mt76: mt7915: always check return value from mt7915_mcu_alloc_wtbl_req
As done for mt76_connac_mcu_alloc_wtbl_req, even if this is not a real
bug since mt7915_mcu_alloc_wtbl_req routine can fails just if nskb is NULL,
always check return value from mt7915_mcu_alloc_wtbl_req in order to avoid
possible future mistake.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Lorenzo Bianconi [Fri, 12 Feb 2021 11:51:05 +0000 (12:51 +0100)]
mt76: connac: always check return value from mt76_connac_mcu_alloc_wtbl_req
Even if this is not a real bug since mt76_connac_mcu_alloc_wtbl_req routine
can fails just if nskb is NULL , always check return value from
mt76_connac_mcu_alloc_wtbl_req in order to avoid possible future
mistake.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
David Bauer [Sun, 7 Feb 2021 15:09:17 +0000 (16:09 +0100)]
mt76: mt76x0: disable GTK offloading
When operating two VAP on a MT7610 with encryption (PSK2, SAE, OWE),
only the first one to be created will transmit properly encrypteded
frames.
All subsequently created VAPs will sent out frames with the payload left
unencrypted, breaking multicast traffic (ICMP6 NDP) and potentially
disclosing information to a third party.
Disable GTK offloading and encrypt these frames in software to
circumvent this issue. THis only seems to be necessary on MT7610 chips,
as MT7612 is not affected from our testing.
Signed-off-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Ryder Lee [Fri, 5 Feb 2021 05:13:01 +0000 (13:13 +0800)]
mt76: always use WTBL_MAX_SIZE for tlv allocation
Simplify WTBL defines.
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Lorenzo Bianconi [Sat, 6 Feb 2021 10:35:41 +0000 (11:35 +0100)]
mt76: mt7921: removed unused definitions in mcu.h
Get rid of the following definitions in mt7921/mcu.h since they are not
actually used:
- MT7921_WTBL_UPDATE_MAX_SIZE
- MT7921_STA_UPDATE_MAX_SIZE
- MT7921_WTBL_UPDATE_BA_SIZE
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Nigel Christian [Sun, 14 Feb 2021 03:02:37 +0000 (22:02 -0500)]
mt76: mt7921: remove unnecessary variable
In mt7921_pm_set() the variable "ret" is initialized to zero
and then returned. Remove it and return zero.
Signed-off-by: Nigel Christian <nigel.l.christian@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Lorenzo Bianconi [Sat, 30 Jan 2021 12:28:36 +0000 (13:28 +0100)]
mt76: mt7921: enable random mac addr during scanning
Notify mac80211 mt7921 devices support random mac address during hw
frequency scanning
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Sander Vanheule [Tue, 2 Feb 2021 08:59:53 +0000 (09:59 +0100)]
mt76: mt7615: support loading EEPROM for MT7613BE
EEPROM blobs for MT7613BE radios start with (little endian) 0x7663,
which is also the PCI device ID for this device. The EEPROM is required
for the radio to work at useful power levels, otherwise only the lowest
power level is available.
Suggested-by: Georgi Vlaev <georgi.vlaev@konsulko.com>
Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Sat, 13 Feb 2021 17:44:10 +0000 (18:44 +0100)]
mt76: mt7915: fix tx skb dma unmap
The first pointer in the txp needs to be unmapped as well, otherwise it will
leak DMA mapping entries
Reported-by: Ben Greear <greearb@candelatech.com>
Fixes:
27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Sat, 13 Feb 2021 17:42:15 +0000 (18:42 +0100)]
mt76: mt7615: fix tx skb dma unmap
The first pointer in the txp needs to be unmapped as well, otherwise it will
leak DMA mapping entries
Fixes:
27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Mon, 8 Feb 2021 16:07:27 +0000 (17:07 +0100)]
mt76: mt7615: fix key set/delete issues
There were multiple issues in the current key set/remove code:
- deleting a key with the previous key index deletes the current key
- BIP key would only be uploaded correctly initially and corrupted on rekey
Rework the code to better keep track of multiple keys and check for the
key index before deleting the current key
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Wed, 16 Dec 2020 20:13:13 +0000 (21:13 +0100)]
mt76: mt7915: add support for rx decapsulation offload
For AP and Client mode, the hardware can pass received packets as 802.3 frames
that can be passed to the network stack as-is.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Wed, 16 Dec 2020 18:04:24 +0000 (19:04 +0100)]
mt76: mt7915: add rx checksum offload support
Set skb->ip_summed to CHECKSUM_UNNECESSARY if the hardware has validated
the IP and TCP/UDP checksum
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Lorenzo Bianconi [Sun, 11 Oct 2020 21:37:12 +0000 (23:37 +0200)]
mt76: mt7915: enable hw rx-amsdu de-aggregation
Enable hw rx-amsdu de-aggregation support available in 7915 devices.
This is a preliminary patch to enable rx checksum offload
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Wed, 16 Dec 2020 15:05:51 +0000 (16:05 +0100)]
mt76: add support for 802.3 rx frames
Do not try to access the header when receiving them
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Arnd Bergmann [Mon, 22 Mar 2021 10:43:33 +0000 (11:43 +0100)]
iwlegacy: avoid -Wempty-body warning
There are a couple of warnings in this driver when building with W=1:
drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_power_set_mode':
drivers/net/wireless/intel/iwlegacy/common.c:1195:60: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
1195 | il->chain_noise_data.state);
| ^
drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_do_scan_abort':
drivers/net/wireless/intel/iwlegacy/common.c:1343:57: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
Change the empty debug macros to no_printk(), which avoids the
warnings and adds useful format string checks.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210322104343.948660-3-arnd@kernel.org
Lorenzo Bianconi [Sun, 28 Feb 2021 18:23:09 +0000 (19:23 +0100)]
mt7601u: enable TDLS support
Notify mac80211 the mt7601u chipset support 802.11 TDLS. The feature has
been tested with a mt7610u peer.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/8f9fd662cdbbb70ba896f1bea80e696b15011d3f.1614536496.git.lorenzo@kernel.org
Colin Ian King [Thu, 25 Feb 2021 18:32:41 +0000 (18:32 +0000)]
mt7601u: fix always true expression
Currently the expression ~nic_conf1 is always true because nic_conf1
is a u16 and according to 6.5.3.3 of the C standard the ~ operator
promotes the u16 to an integer before flipping all the bits. Thus
the top 16 bits of the integer result are all set so the expression
is always true. If the intention was to flip all the bits of nic_conf1
then casting the integer result back to a u16 is a suitabel fix.
Interestingly static analyzers seem to thing a bitwise ! should be
used instead of ~ for this scenario, so I think the original intent
of the expression may need some extra consideration.
Addresses-Coverity: ("Logical vs. bitwise operator")
Fixes:
c869f77d6abb ("add mt7601u driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210225183241.1002129-1-colin.king@canonical.com
Dan Carpenter [Mon, 15 Mar 2021 09:23:37 +0000 (12:23 +0300)]
rtw88: Fix an error code in rtw_debugfs_set_rsvd_page()
The sscanf() function returns the number of matches (0 or 1 in this
case). It doesn't return error codes. We should return -EINVAL if the
string is invalid
Fixes:
c376c1fc87b7 ("rtw88: add h2c command in debugfs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/YE8nmatMDBDDWkjq@mwanda
Ching-Te Ku [Fri, 19 Mar 2021 05:42:18 +0000 (13:42 +0800)]
rtw88: coex: fix A2DP stutters while WL busy + WL scan
While WL scan, WL is more high priority than BT. The packets from AP
will be a big interference to A2DP. It will lead to A2DP stutters. Stop
answering CTS to AP to decrease AP's packets Tx while WL scan + WL busy.
Enable BT AFH feature to make BT leave away from WL channel.
Desired BT firmware BT-COEX version: 0x1c
Desired WL firmware version: 9.9.x
Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210319054218.3319-8-pkshih@realtek.com
Po-Hao Huang [Fri, 19 Mar 2021 05:42:16 +0000 (13:42 +0800)]
rtw88: 8822c: add LC calibration for RTL8822C
Fix power tracking issue by replacing unnecessary IQ calibration
with LC calibration.
When thermal difference exceeds limitation, let RF circuit adjsut
its characteristic to fit in current environment.
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210319054218.3319-6-pkshih@realtek.com
Zong-Zhe Yang [Fri, 19 Mar 2021 05:42:15 +0000 (13:42 +0800)]
rtw88: 8822c: update tx power limit table to RF v40.1
update tx power limits to RF v40 and apply fix on FCC's channel 12 and 13,
so change the patch level to 1.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210319054218.3319-5-pkshih@realtek.com
Zong-Zhe Yang [Fri, 19 Mar 2021 05:42:14 +0000 (13:42 +0800)]
rtw88: fix DIG min setting
DIG min is expected to be set according to chip. And actually we assigned
it under each chip information. However, we didn't use the setting when we
did DIG process. It is unexpected, so we fix it.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210319054218.3319-4-pkshih@realtek.com
Zong-Zhe Yang [Fri, 19 Mar 2021 05:42:12 +0000 (13:42 +0800)]
rtw88: add flush hci support
Though mac queue flushing has been supported, sometimes data may be waiting
on interface from host to chip. If it occurs, there may still be data that
flows into mac just after we do flush. To avoid that, we add the hci part
of flushing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210319054218.3319-2-pkshih@realtek.com
Zong-Zhe Yang [Tue, 9 Mar 2021 06:01:21 +0000 (14:01 +0800)]
rtw88: 8822c: support FW crash dump when FW crash
Although FW crash logs are already supported for dumping in driver, the
logs may not be sufficient to analyze field issues. To improve this part,
we add a support to dump FW memory.
When driver receives FW crash notifications, driver uses DDMA, which is a
HW ability, to copy specified FW memory to FW fifo. Driver can then dump
these information from FW fifo. With this support, not only FW crash log
but also specified FW memory will be dumped while FW crash. Besides,
specified registers are also dumped.
This feature is implemeted on 8822C first due to difference of FW layouts
between ICs. In addition, we add a debugfs to trigger FW crash. It can
simulate the process of crash, dump and reset. Through it, we can also
check if a reset is ongoing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210309060121.9099-1-pkshih@realtek.com
Ajay Singh [Thu, 25 Feb 2021 04:23:10 +0000 (04:23 +0000)]
wilc1000: use wilc handler as cookie in request_threaded_irq()
Use same cookie for request_threaded_irq() & free_irq() to properly free
IRQ during module unload. free_irq() already uses *wilc* handler so the
changes are required for request_threaded_irq().
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210225042302.17048-1-ajay.kathat@microchip.com
Marcus Folkesson [Wed, 24 Feb 2021 16:37:06 +0000 (17:37 +0100)]
wilc1000: write value to WILC_INTR2_ENABLE register
Write the value instead of reading it twice.
Fixes:
c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210224163706.519658-1-marcus.folkesson@gmail.com
David Mosberger-Tang [Wed, 24 Feb 2021 03:33:23 +0000 (03:33 +0000)]
wilc1000: Support chip sleep over SPI
chip_allow_sleep() only supported wakeup via SDIO, which made the
driver unusable over SPI. This code is a straight forward port from
the driver in the linux-at91 repository.
Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
Acked-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210224033317.1507603-1-davidm@egauge.net
wengjianfeng [Tue, 23 Feb 2021 07:54:38 +0000 (15:54 +0800)]
rtw88: remove unnecessary variable
The variable ret is defined at the beginning and initialized
to 0 until the function returns ret, and the variable ret is
not reassigned.Therefore, we do not need to define the variable
ret, just return 0 directly at the end of the function.
Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210223075438.13676-1-samirweng1979@163.com
Ping-Ke Shih [Fri, 19 Feb 2021 05:41:40 +0000 (13:41 +0800)]
rtw88: coex: add power off setting
Clear WL/BT on/off bit in scoreboard register that is used to exchange
WL/BT status. Since the status is preserved after warm reboot, we must
clear it when WL is going to down.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210219054140.7835-1-pkshih@realtek.com
Kalle Valo [Mon, 15 Mar 2021 08:12:41 +0000 (10:12 +0200)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git
ath.git patches for v5.13. Major changes:
ath11k
* add initial support for QCN9074, but not enabled yet due to firmware problems
* enable radar detection for 160MHz secondary segment
* handle beacon misses in station mode
David S. Miller [Sun, 14 Mar 2021 22:00:44 +0000 (15:00 -0700)]
Merge branch 'psample-Add-additional-metadata-attributes'
Ido Schimmel says:
====================
psample: Add additional metadata attributes
This series extends the psample module to expose additional metadata to
user space for packets sampled via act_sample. The new metadata (e.g.,
transit delay) can then be consumed by applications such as hsflowd [1]
for better network observability.
netdevsim is extended with a dummy psample implementation that
periodically reports "sampled" packets to the psample module. In
addition to testing of the psample module, it enables the development
and demonstration of user space applications (e.g., hsflowd) that are
interested in the new metadata even without access to specialized
hardware (e.g., Spectrum ASIC) that can provide it.
mlxsw is also extended to provide the new metadata to psample.
A Wireshark dissector for psample netlink packets [2] will be submitted
upstream after the kernel patches are accepted. In addition, a libpcap
capture module for psample is currently in the works. Eventually, users
should be able to run:
# tshark -i psample
In order to consume sampled packets along with their metadata.
Series overview:
Patch #1 makes it easier to extend the metadata provided to psample
Patch #2 adds the new metadata attributes to psample
Patch #3 extends netdevsim to periodically report "sampled" packets to
psample. Various debugfs knobs are added to control the reporting
Patch #4 adds a selftest over netdevsim
Patches #5-#10 gradually add support for the new metadata in mlxsw
Patch #11 adds a selftest over mlxsw
[1] https://sflow.org/draft4_sflow_transit.txt
[2] https://gitlab.com/amitcohen1/wireshark/-/commit/
3d711143024e032aef1b056dd23f0266c54fab56
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:40 +0000 (14:19 +0200)]
selftests: mlxsw: Add tc sample tests
Test that packets are sampled when tc-sample is used and that reported
metadata is correct. Two sets of hosts (with and without LAG) are used,
since metadata extraction in mlxsw is a bit different when LAG is
involved.
# ./tc_sample.sh
TEST: tc sample rate (forward) [ OK ]
TEST: tc sample rate (local receive) [ OK ]
TEST: tc sample maximum rate [ OK ]
TEST: tc sample group conflict test [ OK ]
TEST: tc sample iif [ OK ]
TEST: tc sample lag iif [ OK ]
TEST: tc sample oif [ OK ]
TEST: tc sample lag oif [ OK ]
TEST: tc sample out-tc [ OK ]
TEST: tc sample out-tc-occ [ OK ]
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:39 +0000 (14:19 +0200)]
mlxsw: spectrum: Report extra metadata to psample module
Make use of the previously added metadata and report it to the psample
module. The metadata is read from the skb's control block, which was
initialized by the bus driver (i.e., 'mlxsw_pci') after decoding the
packet's Completion Queue Element (CQE).
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:38 +0000 (14:19 +0200)]
mlxsw: spectrum: Remove mlxsw_sp_sample_receive()
The function resolves the psample sampling group from the Rx port
because this is the only form of sampling the driver currently supports.
Subsequent patches are going to add support for Tx-based and
policy-based sampling, in which case the sampling group would not be
resolved from the Rx port.
Therefore, move this code to the Rx-specific sampling listener.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:37 +0000 (14:19 +0200)]
mlxsw: spectrum: Remove unnecessary RCU read-side critical section
Since commit
7d8e8f3433dc ("mlxsw: core: Increase scope of RCU read-side
critical section"), all Rx handlers are called from an RCU read-side
critical section.
Remove the unnecessary rcu_read_lock() / rcu_read_unlock().
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:36 +0000 (14:19 +0200)]
mlxsw: pci: Set extra metadata in skb control block
Packets that are mirrored / sampled to the CPU have extra metadata
encoded in their corresponding Completion Queue Element (CQE). Retrieve
this metadata from the CQE and set it in the skb control block so that
it could be accessed by the switch driver (i.e., 'mlxsw_spectrum').
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:35 +0000 (14:19 +0200)]
mlxsw: Create dedicated field for Rx metadata in skb control block
Next patch will need to encode more Rx metadata in the skb control
block, so create a dedicated field for it and move the cookie index
there.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:34 +0000 (14:19 +0200)]
mlxsw: pci: Add more metadata fields to CQEv2
The Completion Queue Element version 2 (CQEv2) includes various metadata
fields for packets that are mirrored / sampled to the CPU.
Add these fields so that they could be used by a later patch.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:33 +0000 (14:19 +0200)]
selftests: netdevsim: Test psample functionality
Test various aspects of psample functionality over netdevsim and in
particular test that the psample module correctly reports the provided
metadata.
Example:
# ./psample.sh
TEST: psample enable / disable [ OK ]
TEST: psample group number [ OK ]
TEST: psample metadata [ OK ]
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:32 +0000 (14:19 +0200)]
netdevsim: Add dummy psample implementation
Allow netdevsim to report "sampled" packets to the psample module by
periodically generating packets from a work queue. The behavior can be
enabled / disabled (default) and the various meta data attributes can be
controlled via debugfs knobs.
This implementation enables both testing of the psample module with all
the optional attributes as well as development of user space
applications on top of psample such as hsflowd and a Wireshark dissector
for psample generic netlink packets.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:31 +0000 (14:19 +0200)]
psample: Add additional metadata attributes
Extend psample to report the following attributes when available:
* Output traffic class as a 16-bit value
* Output traffic class occupancy in bytes as a 64-bit value
* End-to-end latency of the packet in nanoseconds resolution
* Software timestamp in nanoseconds resolution (always available)
* Packet's protocol. Needed for packet dissection in user space (always
available)
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Sun, 14 Mar 2021 12:19:30 +0000 (14:19 +0200)]
psample: Encapsulate packet metadata in a struct
Currently, callers of psample_sample_packet() pass three metadata
attributes: Ingress port, egress port and truncated size. Subsequent
patches are going to add more attributes (e.g., egress queue occupancy),
which also need an indication whether they are valid or not.
Encapsulate packet metadata in a struct in order to keep the number of
arguments reasonable.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sun, 14 Mar 2021 21:48:26 +0000 (14:48 -0700)]
Merge branch 'skbuff-micro-optimize-flow-dissection'
Alexander Lobakin says:
====================
skbuff: micro-optimize flow dissection
This little number makes all of the flow dissection functions take
raw input data pointer as const (1-5) and shuffles the branches in
__skb_header_pointer() according to their hit probability.
The result is +20 Mbps per flow/core with one Flow Dissector pass
per packet. This affects RPS (with software hashing), drivers that
use eth_get_headlen() on their Rx path and so on.
From v2 [1]:
- reword some commit messages as a potential fix for NIPA;
- no functional changes.
From v1 [0]:
- rebase on top of the latest net-next. This was super-weird, but
I double-checked that the series applies with no conflicts, and
then on Patchwork it didn't;
- no other changes.
[0] https://lore.kernel.org/netdev/
20210312194538.337504-1-alobakin@pm.me
[1] https://lore.kernel.org/netdev/
20210313113645.5949-1-alobakin@pm.me
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Lobakin [Sun, 14 Mar 2021 11:11:50 +0000 (11:11 +0000)]
skbuff: micro-optimize {,__}skb_header_pointer()
{,__}skb_header_pointer() helpers exist mainly for preventing
accesses-beyond-end of the linear data.
In the vast majorify of cases, they bail out on the first condition.
All code going after is mostly a fallback.
Mark the most common branch as 'likely' one to move it in-line.
Also, skb_copy_bits() can return negative values only when the input
arguments are invalid, e.g. offset is greater than skb->len. It can
be safely marked as 'unlikely' branch, assuming that hotpath code
provides sane input to not fail here.
These two bump the throughput with a single Flow Dissector pass on
every packet (e.g. with RPS or driver that uses eth_get_headlen())
on 20 Mbps per flow/core.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Lobakin [Sun, 14 Mar 2021 11:11:41 +0000 (11:11 +0000)]
ethernet: constify eth_get_headlen()'s data argument
It's used only for flow dissection, which now takes constant data
pointers.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Lobakin [Sun, 14 Mar 2021 11:11:32 +0000 (11:11 +0000)]
linux/etherdevice.h: misc trailing whitespace cleanup
Caught by the text editor. Fix it separately from the actual changes.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Lobakin [Sun, 14 Mar 2021 11:11:23 +0000 (11:11 +0000)]
flow_dissector: constify raw input data argument
Flow Dissector code never modifies the input buffer, neither skb nor
raw data.
Make 'data' argument const for all of the Flow dissector's functions.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Lobakin [Sun, 14 Mar 2021 11:11:14 +0000 (11:11 +0000)]
skbuff: make __skb_header_pointer()'s data argument const
The function never modifies the input buffer, so 'data' argument
can be marked as const.
This implies one harmless cast-away.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Lobakin [Sun, 14 Mar 2021 11:11:00 +0000 (11:11 +0000)]
flow_dissector: constify bpf_flow_dissector's data pointers
BPF Flow dissection programs are read-only and don't touch input
buffers.
Mark 'data' and 'data_end' in struct bpf_flow_dissector as const
in preparation for global input constifying.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sun, 14 Mar 2021 21:41:09 +0000 (14:41 -0700)]
Merge branch 'gro-micro-optimize-dev_gro_receive'
Alexander Lobakin says:
====================
gro: micro-optimize dev_gro_receive()
This random series addresses some of suboptimal constructions used
in the main GRO entry point.
The main body is gro_list_prepare() simplification and pointer usage
optimization in dev_gro_receive() itself. Being mostly cosmetic, it
gives like +10 Mbps on my setup to both TCP and UDP (both single- and
multi-flow).
Since v1 [0]:
- drop the replacement of bucket index calculation with
reciprocal_scale() since it makes absolutely no sense (Eric);
- improve stack usage in dev_gro_receive() (Eric);
- reverse the order of patches to avoid changes superseding.
[0] https://lore.kernel.org/netdev/
20210312162127.239795-1-alobakin@pm.me
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Lobakin [Sat, 13 Mar 2021 20:30:14 +0000 (20:30 +0000)]
gro: give 'hash' variable in dev_gro_receive() a less confusing name
'hash' stores not the flow hash, but the index of the GRO bucket
corresponding to it.
Change its name to 'bucket' to avoid confusion while reading lines
like '__set_bit(hash, &napi->gro_bitmask)'.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Lobakin [Sat, 13 Mar 2021 20:30:10 +0000 (20:30 +0000)]
gro: consistentify napi->gro_hash[x] access in dev_gro_receive()
GRO bucket index doesn't change through the entire function.
Store a pointer to the corresponding bucket instead of its member
and use it consistently through the function.
It is performance-safe since &gro_list->list == gro_list.
Misc: remove superfluous braces around single-line branches.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Lobakin [Sat, 13 Mar 2021 20:30:05 +0000 (20:30 +0000)]
gro: simplify gro_list_prepare()
gro_list_prepare() always returns &napi->gro_hash[bucket].list,
without any variations. Moreover, it uses 'napi' argument only to
have access to this list, and calculates the bucket index for the
second time (firstly it happens at the beginning of
dev_gro_receive()) to do that.
Given that dev_gro_receive() already has an index to the needed
list, just pass it as the first argument to eliminate redundant
calculations, and make gro_list_prepare() return void.
Also, both arguments of gro_list_prepare() can be constified since
this function can only modify the skbs from the bucket list.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Florian Fainelli [Fri, 12 Mar 2021 21:11:01 +0000 (13:11 -0800)]
net: dsa: bcm_sf2: Fill in BCM4908 CFP entries
The BCM4908 switch has 256 CFP entrie, update that setting so CFP can be
used.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Shachar Raindel [Fri, 12 Mar 2021 23:45:27 +0000 (15:45 -0800)]
hv_netvsc: Add a comment clarifying batching logic
The batching logic in netvsc_send is non-trivial, due to
a combination of the Linux API and the underlying hypervisor
interface. Add a comment explaining why the code is written this
way.
Signed-off-by: Shachar Raindel <shacharr@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sun, 14 Mar 2021 21:22:38 +0000 (14:22 -0700)]
Merge branch 'pktgen-scripts-improvements'
Igor Russkikh says:
====================
pktgen: scripts improvements
Please consider small improvements to pktgen scripts we use in our environment.
Adding delay parameter through command line,
Adding new -a (append) parameter to make flex runs
v3: change us to ns in docs
v2: Review comments from Jesper
CC: Jesper Dangaard Brouer <brouer@redhat.com>
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Igor Russkikh [Thu, 11 Mar 2021 10:32:53 +0000 (11:32 +0100)]
samples: pktgen: new append mode
To configure various complex flows we for sure can create custom
pktgen init scripts, but sometimes thats not that easy.
New "-a" (append) option in all the existing sample scripts allows
to append more "devices" into pktgen threads.
The most straightforward usecases for that are:
- using multiple devices. We have to generate full linerate on
all physical functions (ports) of our multiport device.
- pushing multiple flows (with different packet options)
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Igor Russkikh [Thu, 11 Mar 2021 10:32:52 +0000 (11:32 +0100)]
samples: pktgen: allow to specify delay parameter via new opt
DELAY may now be explicitly specified via common parameter -w
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Sat, 13 Mar 2021 00:30:26 +0000 (16:30 -0800)]
docs: net: add missing devlink health cmd - trigger
Documentation is missing and it's not very clear what
this callback is for - presumably testing the recovery?
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jakub Kicinski [Sat, 13 Mar 2021 00:30:25 +0000 (16:30 -0800)]
docs: net: tweak devlink health documentation
Minor tweaks and improvement of wording about the diagnose callback.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jonathan McDowell [Sat, 13 Mar 2021 13:18:26 +0000 (13:18 +0000)]
net: stmmac: Set FIFO sizes for ipq806x
Commit
eaf4fac47807 ("net: stmmac: Do not accept invalid MTU values")
started using the TX FIFO size to verify what counts as a valid MTU
request for the stmmac driver. This is unset for the ipq806x variant.
Looking at older patches for this it seems the RX + TXs buffers can be
up to 8k, so set appropriately.
(I sent this as an RFC patch in June last year, but received no replies.
I've been running with this on my hardware (a MikroTik RB3011) since
then with larger MTUs to support both the internal qca8k switch and
VLANs with no problems. Without the patch it's impossible to set the
larger MTU required to support this.)
Signed-off-by: Jonathan McDowell <noodles@earth.li>
Signed-off-by: David S. Miller <davem@davemloft.net>
Sanjana Srinidhi [Sat, 13 Mar 2021 08:36:49 +0000 (14:06 +0530)]
drivers: net: vxlan.c: Fix declaration issue
Added a blank line after structure declaration.
This is done to maintain code uniformity.
Signed-off-by: Sanjana Srinidhi <sanjanasrinidhi1810@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Bhaskar Chowdhury [Sat, 13 Mar 2021 05:45:36 +0000 (11:15 +0530)]
net: ethernet: marvell: Fixed typo in the file sky2.c
s/calclation/calculation/
Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 13 Mar 2021 22:30:48 +0000 (14:30 -0800)]
Merge branch 'dsa-hewllcreek-dumps'
Kurt Kanzenbach says:
====================
net: dsa: hellcreek: Add support for dumping tables
add support for dumping the VLAN and FDB table via devlink. As the driver uses
internal VLANs and static FDB entries, this is a useful debugging feature.
Changes since v1:
* Drop memory reporting as there are better APIs to expose this
* Move comment to VLAN patch
Previous versions:
* https://lkml.kernel.org/netdev/
20210311175344.3084-1-kurt@kmk-computers.de/
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Kurt Kanzenbach [Sat, 13 Mar 2021 09:39:39 +0000 (10:39 +0100)]
net: dsa: hellcreek: Add devlink FDB region
Allow to dump the FDB table via devlink. This is a useful debugging feature.
Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Kurt Kanzenbach [Sat, 13 Mar 2021 09:39:38 +0000 (10:39 +0100)]
net: dsa: hellcreek: Move common code to helper
There are two functions which need to populate fdb entries. Move that to a
helper function.
Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Kurt Kanzenbach [Sat, 13 Mar 2021 09:39:37 +0000 (10:39 +0100)]
net: dsa: hellcreek: Use boolean value
hellcreek_select_vlan() takes a boolean instead of an integer.
So, use false accordingly.
Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Kurt Kanzenbach [Sat, 13 Mar 2021 09:39:36 +0000 (10:39 +0100)]
net: dsa: hellcreek: Add devlink VLAN region
Allow to dump the VLAN table via devlink. This especially useful, because the
driver internally leverages VLANs for the port separation. These are not visible
via the bridge utility.
Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 13 Mar 2021 22:27:56 +0000 (14:27 -0800)]
Merge tag 'batadv-next-pullrequest-
20210312' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says:
====================
There is only a single patch this time:
- Use netif_rx_any_context(), by Sebastian Andrzej Siewior
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 13 Mar 2021 22:18:10 +0000 (14:18 -0800)]
Merge branch 'pps-policing'
Simon Horman says:
====================
net/sched: act_police: add support for packet-per-second policing
This series enhances the TC policer action implementation to allow a
policer action instance to enforce a rate-limit based on
packets-per-second, configurable using a packet-per-second rate and burst
parameters.
In the hope of aiding review this is broken up into three patches.
* [PATCH 1/3] flow_offload: add support for packet-per-second policing
Add support for this feature to the flow_offload API that is used to allow
programming flows, including TC rules and their actions, into hardware.
* [PATCH 2/3] flow_offload: reject configuration of packet-per-second policing in offload drivers
Teach all exiting users of the flow_offload API that allow offload of
policer action instances to reject offload if packet-per-second rate
limiting is configured: none support it at this time
* [PATCH 3/3] net/sched: act_police: add support for packet-per-second policing
With the above ground-work in place add the new feature to the TC policer
action itself
With the above in place the feature may be used.
As follow-ups we plan to provide:
* Corresponding updates to iproute2
* Corresponding self tests (which depend on the iproute2 changes)
* Hardware offload support for the NFP driver
Key changes since v2:
* Added patches 1 and 2, which makes adding patch 3 safe for existing
hardware offload of the policer action
* Re-worked patch 3 so that a TC policer action instance may be configured
for packet-per-second or byte-per-second rate limiting, but not both.
* Corrected kdoc usage
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Baowen Zheng [Fri, 12 Mar 2021 14:08:31 +0000 (15:08 +0100)]
net/sched: act_police: add support for packet-per-second policing
Allow a policer action to enforce a rate-limit based on packets-per-second,
configurable using a packet-per-second rate and burst parameters.
e.g.
tc filter add dev tap1 parent ffff: u32 match \
u32 0 0 police pkts_rate 3000 pkts_burst 1000
Testing was unable to uncover a performance impact of this change on
existing features.
Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Louis Peens <louis.peens@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Baowen Zheng [Fri, 12 Mar 2021 14:08:30 +0000 (15:08 +0100)]
flow_offload: reject configuration of packet-per-second policing in offload drivers
A follow-up patch will allow users to configures packet-per-second policing
in the software datapath. In preparation for this, teach all drivers that
support offload of the policer action to reject such configuration as
currently none of them support it.
Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Louis Peens <louis.peens@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Xingfeng Hu [Fri, 12 Mar 2021 14:08:29 +0000 (15:08 +0100)]
flow_offload: add support for packet-per-second policing
Allow flow_offload API to configure packet-per-second policing using rate
and burst parameters.
Dummy implementations of tcf_police_rate_pkt_ps() and
tcf_police_burst_pkt() are supplied which return 0, the unconfigured state.
This is to facilitate splitting the offload, driver, and TC code portion of
this feature into separate patches with the aim of providing a logical flow
for review. And the implementation of these helpers will be filled out by a
follow-up patch.
Signed-off-by: Xingfeng Hu <xingfeng.hu@corigine.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Louis Peens <louis.peens@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 13 Mar 2021 22:11:29 +0000 (14:11 -0800)]
Merge branch 'hns3-imp-phys'
Huazhong Tan says:
====================
net: hns3: support imp-controlled PHYs
This series adds support for imp-controlled PHYs in the HNS3
ethernet driver.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Guangbin Huang [Fri, 12 Mar 2021 08:50:16 +0000 (16:50 +0800)]
net: hns3: add phy loopback support for imp-controlled PHYs
If the imp-controlled PHYs feature is enabled, driver can not
call phy driver interface to set loopback anymore and needs
to send command to firmware to start phy loopback.
Driver reuses the existing firmware command 0x0315 to start
phy loopback, just add a setting bit in this command. As this
command is not only for serdes loopback anymore, rename this
command to "xxx_COMMON_LOOPBACK", and modify function name,
macro name and logs related to it.
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Guangbin Huang [Fri, 12 Mar 2021 08:50:15 +0000 (16:50 +0800)]
net: hns3: add ioctl support for imp-controlled PHYs
When the imp-controlled PHYs feature is enabled, driver will not
register mdio bus. In order to support ioctl ops for phy tool to
read or write phy register in this case, the firmware implement
a new command for driver and driver implement ioctl by using this
new command.
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Guangbin Huang [Fri, 12 Mar 2021 08:50:14 +0000 (16:50 +0800)]
net: hns3: add get/set pause parameters support for imp-controlled PHYs
When the imp-controlled PHYs feature is enabled, phydev is NULL.
In this case, the autoneg is always off when user uses ethtool -a
command to get pause parameters because hclge_get_pauseparam()
uses phydev to check whether device is TP port. To fit this new
feature, use media type to check whether device is TP port.
And when user set pause parameters, these parameters need to
always set to mac, no matter whether autoneg is off.
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Guangbin Huang [Fri, 12 Mar 2021 08:50:13 +0000 (16:50 +0800)]
net: hns3: add support for imp-controlled PHYs
IMP(Intelligent Management Processor) firmware add a new feature
to take control of PHYs for some new devices, PF driver adds
support for this feature.
Driver queries device's capability to check whether IMP supports
this feature, it will tell IMP to enable this feature by firmware
compatible command if it is supported.
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 13 Mar 2021 01:50:42 +0000 (17:50 -0800)]
Merge branch 'sh_eth-reg-defs'
Sergey Shtylyov says:
====================
sh_eth: Improve the register/bit definitions in the Ether driver
Here are 4 patches against DaveM's 'net-next' repo. Mainly I'm renaming the register *enum*
tags/entries to match the SoC manuals,and also moving the RX-TX descriptor *enum*s closer to
the corresponding *struct*s...
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Sergey Shtylyov [Fri, 12 Mar 2021 20:47:02 +0000 (23:47 +0300)]
sh_eth: place RX/TX descriptor *enum*s after their *struct*s
Place the RX/TX descriptor bit *enum*s where they belong -- after the
corresponding RX/TX descriptor *struct*s and, while at it, switch to
declaring one *enum* entry per line...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Sergey Shtylyov [Fri, 12 Mar 2021 20:45:48 +0000 (23:45 +0300)]
sh_eth: rename *enum*s still not matching register names
Finally, rename the rest of the *enum* tags still not (exactly) matching
the abbreviated register names from the manuals...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Sergey Shtylyov [Fri, 12 Mar 2021 20:44:53 +0000 (23:44 +0300)]
sh_eth: rename PSR bits
In all the SoC manuals (except R-Car gen2) the PHY status register's name
is abbreviated to PSR with the only valid bit 0 named LMON. Follow the
suit and rename the corresponding *enum* tag/entry.
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Sergey Shtylyov [Fri, 12 Mar 2021 20:43:46 +0000 (23:43 +0300)]
sh_eth: rename TRSCER bits
In all the SoC manuals the TRSCER register bits match the corresponding
EESR registers's bits, but only on the R-Car gen2 SoC those are named
RINT<n> and TINT<n>. Follow the suit and rename the *enum* tag/entries
from DESC_I_* to TRSCER_*.
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 13 Mar 2021 01:47:46 +0000 (17:47 -0800)]
Merge branch 'mptcp-Include-multiple-address-ids-in-RM_ADDR'
Mat Martineau says:
====================
mptcp: Include multiple address ids in RM_ADDR
Here's a patch series from the MPTCP tree that extends the capabilities
of the MPTCP RM_ADDR header.
MPTCP peers can exchange information about their IP addresses that are
available for additional MPTCP subflows. IP addresses are advertised
with an ADD_ADDR header type, and those advertisements are revoked with
the RM_ADDR header type. RFC 8684 allows the RM_ADDR header to include
more than one address ID, so multiple advertisements can be revoked in a
single header. Previous kernel versions have only used RM_ADDR with a
single address ID, so multiple removals required multiple packets.
Patches 1-4 plumb address id list structures around the MPTCP code,
where before only a single address ID was passed.
Patches 5-8 make use of the address lists at the path manager layer that
tracks available addresses for both peers.
Patches 9-11 update the selftests to cover the new use of RM_ADDR with
multiple address IDs.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:21 +0000 (17:16 -0800)]
selftests: mptcp: add testcases for removing addrs
This patch added the testcases for removing a list of addresses. Used
the netlink to flush the addresses in the testcases.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:20 +0000 (17:16 -0800)]
selftests: mptcp: set addr id for removing testcases
The removing testcases can only delete the addresses from id 1, this
patch added the support for deleting the addresses from any id that user
set.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:19 +0000 (17:16 -0800)]
selftests: mptcp: add invert argument for chk_rm_nr
Some of the removing testcases used two zeros as arguments for chk_rm_nr
like this: chk_rm_nr 0 0. This doesn't mean that no RM_ADDR has been sent.
It only means that RM_ADDR had been sent in the opposite direction that
chk_rm_nr is checking.
This patch added a new argument invert for chk_rm_nr to allow it can
check the RM_ADDR from the opposite direction.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:18 +0000 (17:16 -0800)]
mptcp: remove a list of addrs when flushing
This patch invoked mptcp_nl_remove_addrs_list to remove a list of addresses
when the netlink flushes addresses, instead of using
mptcp_nl_remove_subflow_and_signal_addr to remove them one by one.
And dropped the unused parameter net in __flush_addrs too.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:17 +0000 (17:16 -0800)]
mptcp: remove multi addresses and subflows in PM
This patch implemented the function to remove a list of addresses and
subflows, named mptcp_nl_remove_addrs_list, which had a input parameter
rm_list as the removing addresses list.
In mptcp_nl_remove_addrs_list, traverse all the existing msk sockets to
invoke mptcp_pm_remove_addrs_and_subflows to remove a list of addresses
for each msk socket.
In mptcp_pm_remove_addrs_and_subflows, traverse all the addresses in the
removing addresses list, to find whether this address is in the conn_list
or anno_list. If it is, put the address ID into the removing address list
or the removing subflow list, and pass the two lists to
mptcp_pm_remove_addr and mptcp_pm_remove_subflow.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:16 +0000 (17:16 -0800)]
mptcp: remove multi subflows in PM
This patch dealt with removing multi subflows in PM:
In mptcp_pm_remove_subflow, changed the input parameter local_id as an
list of removing address ids, and passed the list to
mptcp_pm_nl_rm_subflow_received.
In mptcp_pm_nl_rm_subflow_received, iterated each address id from the
received ids list. Then shut down and closed each address id's subsocket.
In mptcp_nl_remove_subflow_and_signal_addr, put the single address id into
an ids list, and passed it to mptcp_pm_remove_subflow.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:15 +0000 (17:16 -0800)]
mptcp: remove multi addresses in PM
This patch dropped the member rm_id of struct mptcp_pm_data. Use
rm_list_rx in mptcp_pm_nl_rm_addr_received instead of using rm_id.
In mptcp_pm_nl_rm_addr_received, iterated each address id from
pm.rm_list_rx, then shut down and closed each address id's subsocket.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:14 +0000 (17:16 -0800)]
mptcp: add rm_list_rx in mptcp_pm_data
This patch added a new member rm_list_rx for struct mptcp_pm_data as an
list of the removing address ids on the incoming direction. Initialized
its nr field to zero in mptcp_pm_data_init.
In mptcp_pm_rm_addr_received, set it as the input rm_list.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:13 +0000 (17:16 -0800)]
mptcp: add rm_list in mptcp_options_received
This patch changed the member rm_id in struct mptcp_options_received as a
list of the removing address ids, and renamed it to rm_list.
In mptcp_parse_option, parsed the RM_ADDR suboption and filled them into
the rm_list in struct mptcp_options_received.
In mptcp_incoming_options, passed this rm_list to the function
mptcp_pm_rm_addr_received.
It also changed the parameter type of mptcp_pm_rm_addr_received.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:12 +0000 (17:16 -0800)]
mptcp: add rm_list_tx in mptcp_pm_data
This patch added a new member rm_list_tx for struct mptcp_pm_data as the
removing address list on the outgoing direction. Initialize its nr field
to zero in mptcp_pm_data_init.
In mptcp_pm_remove_anno_addr, put the single address id into an removing
list, and passed it to mptcp_pm_remove_addr.
In mptcp_pm_remove_addr, save the input rm_list to rm_list_tx in struct
mptcp_pm_data.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Geliang Tang [Sat, 13 Mar 2021 01:16:11 +0000 (17:16 -0800)]
mptcp: add rm_list in mptcp_out_options
This patch defined a new struct mptcp_rm_list, the ids field was an
array of the removing address ids, the nr field was the valid number of
removing address ids in the array. The array size was definced as a new
macro MPTCP_RM_IDS_MAX. Changed the member rm_id of struct
mptcp_out_options to rm_list.
In mptcp_established_options_rm_addr, invoked mptcp_pm_rm_addr_signal to
get the rm_list. According the number of addresses in it, calculated
the padded RM_ADDR suboption length. And saved the ids array in struct
mptcp_out_options's rm_list member.
In mptcp_write_options, iterated each address id from struct
mptcp_out_options's rm_list member, set the invalid ones as TCPOPT_NOP,
then filled them into the RM_ADDR suboption.
Changed TCPOLEN_MPTCP_RM_ADDR_BASE from 4 to 3.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 13 Mar 2021 01:44:10 +0000 (17:44 -0800)]
Merge branch 'resil-nhgroups-netdevsim-selftests'
Petr Machata says:
====================
net: Resilient NH groups: netdevsim, selftests
Support for resilient next-hop groups was added in a previous patch set.
Resilient next hop groups add a layer of indirection between the SKB hash
and the next hop. Thus the hash is used to reference a hash table bucket,
which is then used to reference a particular next hop. This allows the
system more flexibility when assigning SKB hash space to next hops.
Previously, each next hop had to be assigned a continuous range of SKB hash
space. With a hash table as an intermediate layer, it is possible to
reassign next hops with a hash table bucket granularity. In turn, this
mends issues with traffic flow redirection resulting from next hop removal
or adjustments in next-hop weights.
This patch set introduces mock offloading of resilient next hop groups by
the netdevsim driver, and a suite of selftests.
- Patch #1 adds a netdevsim-specific lock to protect next-hop hashtable.
Previously, netdevsim relied on RTNL to maintain mutual exclusion.
Patch #2 extracts a helper to make the following patches clearer.
- Patch #3 implements the support for offloading of resilient next-hop
groups.
- Patch #4 introduces a new debugfs interface to set activity on a selected
next-hop bucket. This simulates how HW can periodically report bucket
activity, and buckets thus marked are expected to be exempt from
migration to new next hops when the group changes.
- Patches #5 and #6 clean up the fib_nexthop selftests.
- Patches #7, #8 and #9 add tests for resilient next hop groups. Patch #7
adds resilient-hashing counterparts to fib_nexthops.sh. Patch #8 adds a
new traffic test for resilient next-hop groups. Patch #9 adds a new
traffic test for tunneling.
- Patch #10 actually leverages the netdevsim offload to implement a suite
of algorithmic tests that verify how and when buckets are migrated under
various simulated workload scenarios.
The overall plan is to contribute approximately the following patchsets:
1) Nexthop policy refactoring (already pushed)
2) Preparations for resilient next hop groups (already pushed)
3) Implementation of resilient next hop group (already pushed)
4) Netdevsim offload plus a suite of selftests (this patchset)
5) Preparations for mlxsw offload of resilient next-hop groups
6) mlxsw offload including selftests
Interested parties can look at the complete code at [2].
[1] https://tools.ietf.org/html/rfc2992
[2] https://github.com/idosch/linux/commits/submit/res_integ_v1
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Fri, 12 Mar 2021 16:50:26 +0000 (17:50 +0100)]
selftests: netdevsim: Add test for resilient nexthop groups offload API
Test various aspects of the resilient nexthop group offload API on top
of the netdevsim implementation. Both good and bad flows are tested.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Co-developed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel [Fri, 12 Mar 2021 16:50:25 +0000 (17:50 +0100)]
selftests: forwarding: Add resilient multipath tunneling nexthop test
Add a resilient nexthop objects version of gre_multipath_nh.sh. Test
that both IPv4 and IPv6 overlays work with resilient nexthop groups
where the nexthops are two GRE tunnels.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>