RubenKelevra [Tue, 24 Jun 2025 16:57:11 +0000 (18:57 +0200)]
uapi: net_dropmon: drop unused is_drop_point_hw macro
Commit 4ea7e38696c7 ("dropmon: add ability to detect when hardware
drops rx packets") introduced is_drop_point_hw, but the symbol was
never referenced anywhere in the kernel tree and is currently not used
by dropwatch. I could not find, to the best of my abilities, a current
out-of-tree user of this macro.
The definition also contains a syntax error in its for-loop, so any
project that tried to compile against it would fail. Removing the
macro therefore eliminates dead code without breaking existing
users.
Nathan Lynch [Tue, 24 Jun 2025 13:50:44 +0000 (08:50 -0500)]
lib: packing: Include necessary headers
packing.h uses ARRAY_SIZE(), BUILD_BUG_ON_MSG(), min(), max(), and
sizeof_field() without including the headers where they are defined,
potentially causing build failures.
Next step on the path to moving RSS config to Netlink. With the
refactoring of the driver-facing API for ETHTOOL_GRXFH/ETHTOOL_SRXFH
out of the way we can move on to more interesting work.
Add Netlink notifications for changes in RSS configuration.
As a reminder (part) of rss-get was introduced in previous releases
when input-xfrm (symmetric hashing) was added. rss-set isn't
implemented, yet, but we can implement rss-ntf and hook it into
the changes done via the IOCTL path (same as other ethtool-nl
notifications do).
Most of the series is concerned with passing arguments to notifications.
So far none of the notifications needed to be parametrized, but RSS can
have multiple contexts per device, and since GET operates on a single
context at a time, the notification needs to also be scoped to a context.
Patches 2-5 add support for passing arguments to notifications thru
ethtool-nl generic infra.
The notification handling itself is pretty trivial, it's mostly
hooking in the right entries into the ethool-nl op tables.
Jakub Kicinski [Mon, 23 Jun 2025 23:17:20 +0000 (16:17 -0700)]
selftests: drv-net: test RSS Netlink notifications
Test that changing the RSS config generates Netlink notifications.
# ./tools/testing/selftests/drivers/net/hw/rss_api.py
TAP version 13
1..2
ok 1 rss_api.test_rxfh_indir_ntf
ok 2 rss_api.test_rxfh_indir_ctx_ntf
# Totals: pass:2 fail:0 xfail:0 xpass:0 skip:0 error:0
Jakub Kicinski [Mon, 23 Jun 2025 23:17:19 +0000 (16:17 -0700)]
doc: ethtool: mark ETHTOOL_GRXFHINDIR as reimplemented
The ETHTOOL_GRXFHINDIR reimplementation has been completed around
a year ago. We have been tweaking it so a bit hard to point
to a single commit that completed it, but all the fields available
in IOCTL are reported via Netlink.
Jakub Kicinski [Mon, 23 Jun 2025 23:17:18 +0000 (16:17 -0700)]
net: ethtool: rss: add notifications
In preparation for RSS_SET handling in ethnl introduce Netlink
notifications for RSS. Only cover modifications, not creation
and not removal of a context, because the latter may deserve
a different notification type. We should cross that bridge
when we add the support for context add / remove via Netlink.
Jakub Kicinski [Mon, 23 Jun 2025 23:17:17 +0000 (16:17 -0700)]
net: ethtool: copy req_info from SET to NTF
Copy information parsed for SET with .req_parse to NTF handling
and therefore the GET-equivalent that it ends up executing.
This way if the SET was on a sub-object (like RSS context)
the notification will also be appropriately scoped.
Also copy the phy_index, Maxime suggests this will help PLCA
commands generate accurate notifications as well.
Jakub Kicinski [Mon, 23 Jun 2025 23:17:16 +0000 (16:17 -0700)]
net: ethtool: remove the data argument from ethtool_notify()
ethtool_notify() takes a const void *data argument, which presumably
was intended to pass information from the call site to the subcommand
handler. This argument currently has no users.
Expecting the data to be subcommand-specific has two complications.
Complication #1 is that its not plumbed thru any of the standardized
callbacks. It gets propagated to ethnl_default_notify() where it
remains unused. Coming from the ethnl_default_set_doit() side we pass
in NULL, because how could we have a command specific attribute in
a generic handler.
Complication #2 is that we expect the ethtool_notify() callers to
know what attribute type to pass in. Again, the data pointer is
untyped.
RSS will need to pass the context ID to the notifications.
I think it's a better design if the "subcommand" exports its own
typed interface and constructs the appropriate argument struct
(which will be req_info). Remove the unused data argument from
ethtool_notify() but retain it in a new internal helper which
subcommands can use to build a typed interface.
Jakub Kicinski [Mon, 23 Jun 2025 23:17:15 +0000 (16:17 -0700)]
net: ethtool: call .parse_request for SET handlers
In preparation for using req_info to carry parameters between SET
and NTF - call .parse_request during ethnl_default_set_doit().
The main question here is whether .parse_request is intended to be
GET-specific. Originally the SET handling was delegated to each subcommand
directly - ethnl_default_set_doit() and .set callbacks in ethnl_request_ops
did not exist. Looking at existing users does not shed much light, all
of the following subcommands use .parse_request but have no SET handler
(and no NTF):
where .parse_request handling is used to select which statistics to query.
Not relevant for SET but also harmless.
Going back to RSS (which doesn't have SET today) .parse_request parses
the rss_context ID. Using the req_info struct to pass the context ID
from SET to NTF will be very useful.
Switch to ethnl_default_parse(), effectively adding the .parse_request
for SET handlers.
Jakub Kicinski [Mon, 23 Jun 2025 23:17:14 +0000 (16:17 -0700)]
net: ethtool: dynamically allocate full req size req
In preparation for using req_info to carry parameters between
SET and NTF allocate a full request info struct. Since the size
depends on the subcommand we need to allocate it on the heap.
syszbot reports various ordering issues for lower instance locks and
team lock. Switch to using rtnl lock for protecting team device,
similar to bonding. Based on the patch by Tetsuo Handa.
Cc: Jiri Pirko <jiri@resnulli.us> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reported-by: syzbot+705c61d60b091ef42c04@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=705c61d60b091ef42c04 Reported-by: syzbot+71fd22ae4b81631e22fd@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=71fd22ae4b81631e22fd Fixes: 6b1d3c5f675c ("team: grab team lock during team_change_rx_flags") Link: https://lkml.kernel.org/r/ZoZ2RH9BcahEB9Sb@nanopsycho.orion Signed-off-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20250623153147.3413631-1-sdf@fomichev.me Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Rand Deeb [Wed, 13 Mar 2024 10:17:55 +0000 (13:17 +0300)]
wifi: iwlwifi: dvm: fix potential overflow in rs_fill_link_cmd()
The 'index' variable in the rs_fill_link_cmd() function can reach
LINK_QUAL_MAX_RETRY_NUM during the execution of the inner loop. This
variable is used as an index for the lq_cmd->rs_table array, which has a
size of LINK_QUAL_MAX_RETRY_NUM, without proper validation.
Modify the condition of the inner loop to ensure that the 'index' variable
does not exceed LINK_QUAL_MAX_RETRY_NUM - 1, thereby preventing any
potential overflow issues.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Xiu Jianfeng [Wed, 9 Nov 2022 03:52:13 +0000 (11:52 +0800)]
wifi: iwlwifi: Fix memory leak in iwl_mvm_init()
When iwl_opmode_register() fails, it does not unregster rate control,
which will cause a memory leak issue, this patch fixes it.
Fixes: 9f66a397c877 ("iwlwifi: mvm: rs: add ops for the new rate scaling in the FW") Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Link: https://patch.msgid.link/20221109035213.570-1-xiujianfeng@huawei.com Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Miri Korenblit [Thu, 12 Jun 2025 11:48:57 +0000 (14:48 +0300)]
wifi: iwlwifi: mld: don't exit EMLSR when we shouldn't
There is a requirement to exit EMLSR if there wasn't enough throughput
in the secondary link.
This is checked in check_tpt_wk, which runs every 5 seconds in a high
throughput scenario (when the throughput blocker isn't set)
It can happen that this worker is running immediately after we entered
EMLSR, and in that case the secondary link didn't have a chance to have
throughput. In that case we will exit EMLSR for no good reason.
Fix this by tracking the time we entered EMLSR, and in the worker make
sure that 5 seconds passed from when we entered EMLSR. If not, don't
check the secondary link throughput.
Rotem Kerem [Thu, 12 Jun 2025 11:48:53 +0000 (14:48 +0300)]
wifi: iwlwifi: pcie: move iwl_trans_pcie_dump_regs() to utils.c
Move the iwl_trans_pcie_dump_regs() function to utils.c in the PCIe
directory since it operates on PCIe registers and is not
hardware-dependent.
Refactor the pcie_dbg_dumped_once indicator, previously part of the
iwl_trans_pcie struct, into a static variable within the
iwl_trans_pcie_dump_regs() function, where it is used.
Benjamin Berg [Thu, 12 Jun 2025 11:48:52 +0000 (14:48 +0300)]
wifi: iwlwifi: mld: advertise support for TTLM changes
The iwlmld driver is able to handle TTLM changes as long as all TIDs
have the same TID to Link Mapping. Add the corresponding code so that
mac80211 will accept and trigger the TTLM change.
Ilan Peer [Thu, 12 Jun 2025 11:48:51 +0000 (14:48 +0300)]
wifi: iwlwifi: mld: Block EMLSR when scanning on P2P Device
Temporarily block EMLSR when scanning on a P2P Device interface,
as this is an indication that P2P activity is about to start, e.g.,
P2P client connection to a P2P GO.
Since a P2P scan while a station interface connection is active might
be long, increase the EMLSR blocking timeout to 10 seconds.
Benjamin Berg [Thu, 12 Jun 2025 11:48:50 +0000 (14:48 +0300)]
wifi: iwlwifi: mld: use the correct struct size for tracing
For the iwlmld driver the RX command is using struct iwl_rx_mpdu_desc
and not the much older struct iwl_rx_mpdu_res_start. Adjust the value of
rx_mpdu_cmd_hdr_size accordingly so that the trace data is correct.
Johannes Berg [Wed, 11 Jun 2025 19:26:28 +0000 (22:26 +0300)]
wifi: iwlwifi: defer MLO scan after link activation
Doing a scan right after link activation can be less reliable
than at other times, as the firmware is still busy trying to
catch beacons from the just activated link, etc. In case a new
MLO scan request comes in, defer it for a few seconds after a
link activation.
Johannes Berg [Wed, 11 Jun 2025 19:26:26 +0000 (22:26 +0300)]
wifi: iwlwifi: mld: remove special FW error resume handling
The (applicable) firmware versions will send an error interrupt as
part of the resume process, so there's no need now to check for it
explicitly. Simplify the code. This also fixes an issue where any
dump taken during the resume isn't able to do the reset handshake
as part of the dump (since interrupts are disabled) and then there
isn't all the correct data and we get more errors later.
Johannes Berg [Wed, 11 Jun 2025 19:26:25 +0000 (22:26 +0300)]
wifi: iwlwifi: mld: add timer host wakeup debugfs
Add a debugfs file to be able to control how long, at most,
the device will sleep before waking up the host. This will
be useful to test certain "assert during suspend" scenarios
for the previous change.
Johannes Berg [Wed, 11 Jun 2025 19:26:20 +0000 (22:26 +0300)]
wifi: iwlwifi: pcie: abort D3 handshake on error
The D3 handshake can be interrupted by an error, especially
on resume where we no longer want to check explicitly for
errors. Expand the sx_complete to sx_state and handle any
errors occurring during the handshake.
Johannes Berg [Mon, 9 Jun 2025 18:21:17 +0000 (21:21 +0300)]
wifi: iwlwifi: pcie: initiate TOP reset if requested
At load time, the firmware may request a TOP reset via
bit 6 in the IPC status register. Handle that and set
TOP reset in that case. Since the init will be retried,
there's no need to do anything else.
Miri Korenblit [Mon, 9 Jun 2025 18:21:16 +0000 (21:21 +0300)]
wifi: iwlwifi: pcie: move generation specific files to a folder
As a new generation of pcie is going to be written, we will need a
folder for each generation.
Since gen1 and gen2 code is tightly coupled and has with shared logic -
it is not really separable.
Put the code of both in one folder.
This patch set adds all the supported FLEXCOMs for the SAMA7D65 SoC.
This also adds the GMAC interfaces and enables GMAC0 interface for
the SAMA7D65 SoC.
With the FLEXCOMs added to the SoC the MCP16502 and the MAC address
EEPROM are both added to flexcom10.
The dt-binding for USART is here [1]. And the dt-binding for DMA has
been applied here [2].
The original thread for this is here [3]. The applied changes have been
removed for this resend
Jason Xing [Mon, 23 Jun 2025 12:01:59 +0000 (20:01 +0800)]
net: xsk: dpaa2: avoid repeatedly updating the global consumer
This patch avoids another update of the consumer at the end of
dpaa2_xsk_tx().
In the zero copy xmit path, two versions (batched and non-batched)
regarding how the consumer of tx ring changes are implemented in
xsk_tx_peek_release_desc_batch() that eventually updates the local
consumer to the global consumer in either of the following call trace:
1) batched mode:
xsk_tx_peek_release_desc_batch()
__xskq_cons_release()
2) non-batched mode:
xsk_tx_peek_release_desc_batch()
xsk_tx_peek_release_fallback()
xsk_tx_release()
As we can see, dpaa2_xsk_tx() doesn't need to call extra release function
to handle the sync of consumer itself.
Peiyang Wang [Mon, 23 Jun 2025 04:00:43 +0000 (12:00 +0800)]
net: hns3: clear hns alarm: comparison of integer expressions of different signedness
A static alarm exists in the hns and needs to be cleared.
The alarm is comparison of integer expressions of different
signedness including 's64' and 'long unsigned int',
'int' and 'long unsigned int', 'u32' and 'int',
'int' and 'unsigned int'.
Jijie Shao [Mon, 23 Jun 2025 04:00:39 +0000 (12:00 +0800)]
net: hns3: use hns3_get_ops() helper to reduce the unnecessary middle layer conversion
There are too many indirection layers in the HNS3 driver code,
This issue was previously discussed with the maintainer,
who suggested adding a helper function to fix the issue.
In fact, the hns3_get_ops() helper is already defined
and can fix this issue.
This patch uses hns3_get_ops() helper to reduce the unnecessary
middle layer conversion. Apply it to the whole HNS3 driver.
The former discusstion can be checked from the link.
Jijie Shao [Mon, 23 Jun 2025 04:00:38 +0000 (12:00 +0800)]
net: hns3: use hns3_get_ae_dev() helper to reduce the unnecessary middle layer conversion
There are too many indirection layers in the HNS3 driver code.
This issue was previously discussed with the maintainer,
who suggested adding a helper function to fix the issue.
In fact, the hns3_get_ae_dev() helper is already defined
and can fix this issue.
This patch uses hns3_get_ae_dev() helper to reduce the unnecessary
middle layer conversion. Apply it to the whole HNS3 driver.
The former discusstion can be checked from the link.
Qingfang Deng [Mon, 23 Jun 2025 03:34:31 +0000 (11:34 +0800)]
pppoe: drop PACKET_OTHERHOST before skb_share_check()
Align with ip_rcv() by dropping PACKET_OTHERHOST packets before
calling skb_share_check(). This avoids unnecessary skb processing
for packets that will be discarded anyway.
Paolo Abeni [Mon, 23 Jun 2025 10:53:55 +0000 (12:53 +0200)]
udp_tunnel: fix deadlock in udp_tunnel_nic_set_port_priv()
While configuring a vxlan tunnel in a system with a i40e NIC driver, I
observe the following deadlock:
WARNING: possible recursive locking detected
6.16.0-rc2.net-next-6.16_92d87230d899+ #13 Tainted: G E
--------------------------------------------
kworker/u256:4/1125 is trying to acquire lock: ffff88921ab9c8c8 (&utn->lock){+.+.}-{4:4}, at: i40e_udp_tunnel_set_port (/home/pabeni/net-next/include/net/udp_tunnel.h:343 /home/pabeni/net-next/drivers/net/ethernet/intel/i40e/i40e_main.c:13013) i40e
but task is already holding lock: ffff88921ab9c8c8 (&utn->lock){+.+.}-{4:4}, at: udp_tunnel_nic_device_sync_work (/home/pabeni/net-next/net/ipv4/udp_tunnel_nic.c:739) udp_tunnel
other info that might help us debug this:
Possible unsafe locking scenario:
Johannes Berg [Tue, 24 Jun 2025 15:39:15 +0000 (17:39 +0200)]
Merge tag 'ath-next-20250624' of git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath
Jeff Johnson says:
==================
ath.git patches for v6.17
All ath drivers:
Add "#include <linux/export.h>" to all files that use EXPORT_SYMBOL()
to fix a newly introduced 'make W=1' check. Note that check has
subsequently been changed to only test when W=2, but keep the fixes to
suppress the warning for 'make W=2'.
ath12k:
Properly handle scan requests on multi-radio wiphy devices.
Perform the usual set of bug fixes and cleanups.
==================
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
wifi: mac80211: Set RTS threshold on per-radio basis
Add support to get the radio for which RTS threshold needs to be changed
from userspace. Pass on this radio index to underlying drivers as an
additional argument.
A value of -1 indicates radio index is not mentioned and that the
configuration applies to all radio(s) of the wiphy.
wifi: cfg80211: Report per-radio RTS threshold to userspace
In case of multi-radio wiphys, with per-radio RTS threshold brought
into use, RTS threshold for each radio in a wiphy can be recorded in
wiphy parameter - wiphy_radio_cfg, as an array. Add a new attribute -
NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD in nested parameter -
NL80211_ATTR_WIPHY_RADIOS. When a request for getting RTS threshold
for a particular radio is received, parse the radio id and get the
required data. Add this data to the newly added nested attribute
NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD. Add support to report this
data to userspace.
wifi: cfg80211: Add Support to Set RTS Threshold for each Radio
Currently, setting RTS threshold is based on per-phy basis, i.e., all the
radios present in a wiphy will take RTS threshold value to be the one sent
from userspace. But each radio in a multi-radio wiphy can have different
RTS threshold requirements.
To extend support to set RTS threshold for each radio, get the radio for
which RTS threshold needs to be changed from the user. Use the attribute
in NL - NL80211_ATTR_WIPHY_RADIO_INDEX, to identify the radio of interest.
Create a new structure - wiphy_radio_cfg and add rts_threshold in it as a
u32 value to store RTS threshold of each radio in a wiphy and allocate
memory for it during wiphy register based on the wiphy.n_radio updated by
drivers. Pass radio id received from the user to mac80211 drivers along
with its corresponding RTS threshold.
wifi: cfg80211/mac80211: Add support to get radio index
Currently, per-radio attributes are set on per-phy basis, i.e., all the
radios present in a wiphy will take attributes values sent from user. But
each radio in a wiphy can get different values from userspace based on
its requirement.
To extend support to set per-radio attributes, add support to get radio
index from userspace. Add an NL attribute - NL80211_ATTR_WIPHY_RADIO_INDEX,
to get user specified radio index for which attributes should be changed.
Pass this to individual drivers, so that the drivers can use this radio
index to change per-radio attributes when necessary. Currently, per-radio
attributes identified are:
NL80211_ATTR_WIPHY_TX_POWER_LEVEL
NL80211_ATTR_WIPHY_ANTENNA_TX
NL80211_ATTR_WIPHY_ANTENNA_RX
NL80211_ATTR_WIPHY_RETRY_SHORT
NL80211_ATTR_WIPHY_RETRY_LONG
NL80211_ATTR_WIPHY_FRAG_THRESHOLD
NL80211_ATTR_WIPHY_RTS_THRESHOLD
NL80211_ATTR_WIPHY_COVERAGE_CLASS
NL80211_ATTR_TXQ_LIMIT
NL80211_ATTR_TXQ_MEMORY_LIMIT
NL80211_ATTR_TXQ_QUANTUM
By default, the radio index is set to -1. This means the attribute should
be treated as a global configuration. If the user has not specified any
index, then the radio index passed to individual drivers would be -1. This
would indicate that the attribute applies to all radios in that wiphy.
Sarika Sharma [Wed, 28 May 2025 05:44:20 +0000 (11:14 +0530)]
wifi: mac80211: add link_sta_statistics ops to fill link station statistics
Currently, link station statistics for MLO are filled by mac80211.
But there are some statistics that kept by mac80211 might not be
accurate, so let the driver pre-fill the link statistics. The driver
can fill the values (indicating which field is filled, by setting the
filled bitmapin in link_station structure).
Statistics that driver don't fill are filled by mac80211.
Hence, add link_sta_statistics callback to fill link station statistics
for MLO in sta_set_link_sinfo() by drivers.
Sarika Sharma [Wed, 28 May 2025 05:44:19 +0000 (11:14 +0530)]
wifi: mac80211: correct RX stats packet increment for multi-link
Currently, RX stats packets are incremented for deflink member for
non-ML and multi-link(ML) station case. However, for ML station,
packets should be incremented based on the specific link.
Therefore, if a valid link_id is present, fetch the corresponding
link station information and increment the RX packets for that link.
For non-MLO stations, the deflink will still be used.
Sarika Sharma [Wed, 28 May 2025 05:44:18 +0000 (11:14 +0530)]
wifi: mac80211: extend support to fill link level sinfo structure
Currently, sinfo structure is supported to fill information at
deflink( or one of the links) level for station. This has problems
when applied to fetch multi-link(ML) station information.
Hence, if valid_links are present, support filling link_station
structure for each link.
This will be helpful to check the link related statistics during MLO.
Additionally, TXQ stats for pertid are applicable at station level
not at link level. Therefore check link_id is less then 0, before
filling TXQ stats in pertid stats.
Sarika Sharma [Wed, 28 May 2025 05:44:17 +0000 (11:14 +0530)]
wifi: cfg80211: clear sinfo->filled for MLO station statistics
Currently, sinfo->filled is for set in sta_set_sinfo() after filling
the corresponding fields in station_info structure for station statistics.
For non-ML stations, the fields are correctly filled from sta->deflink
and corresponding sinfo->filled bit are set, but for MLO any one of
link's data is filled and corresponding sinfo->filled bit is set.
For MLO before embed NL message, fields of sinfo structure like
bytes, packets, signal are updated with accumulated, best, least of all
links data. But some of fields like rssi, pertid don't make much sense
at MLO level.
Hence, to prevent misinterpretation, clear sinfo->filled for fields
which don't make much sense at MLO level. This will prevent filling
misleading values in NL message.
Sarika Sharma [Wed, 28 May 2025 05:44:16 +0000 (11:14 +0530)]
wifi: mac80211: add support to accumulate removed link statistics
Currently, if a link gets removed in between for a station then
directly accumulated data will fall down to sum of other active links.
This will bring inconsistency in station dump statistics.
For instance, let's take Tx packets
- at t=0-> link-0:2 link-1:3 Tx packets => accumulated = 5
- at t=1-> link-0:4 link-1:6 Tx packets => accumulated = 10
let say at t=2, link-0 went down => link-0:0 link-1:7 => accumulated = 7
Here, suddenly accumulated Tx packets will come down to 7 from 10.
This is showing inconsistency.
Therefore, store link-0 data when it went down and add to accumulated
Tx packet = 11.
Hence, store the removed link statistics data in sta structure and
add it in accumulated statistics for consistency.
Sarika Sharma [Wed, 28 May 2025 05:44:15 +0000 (11:14 +0530)]
wifi: cfg80211: allocate memory for link_station info structure
Currently, station_info structure is passed to fill station statistics
from mac80211/drivers. After NL message send to user space for requested
station statistics, memory for station statistics is freed in cfg80211.
Therefore, memory allocation/free for link station statistics should
also happen in cfg80211 only.
Hence, allocate the memory for link_station structure for all
possible links and free in cfg80211_sinfo_release_content().
Sarika Sharma [Wed, 28 May 2025 05:44:14 +0000 (11:14 +0530)]
wifi: cfg80211: add statistics for providing overview for MLO station
Currently statistics are handled at link level for multi-link
operation(MLO). There is no provision to check accumulated statistics
for a multi-link(ML) station. Other statistics, such as signal, rates,
are also managed at the link level only.
Statistics such as packets, bytes, signal, rates, etc are useful to
provide overall overview for the ML stations.
Statistics such as packets, bytes are accumulated statistics at MLO level.
However, MLO statistics for rates and signal can not be accumulated since
it won't make much sense. Hence, handle other statistics such as signal,
rates, etc bit differently at MLO level.
The signal could be the best of all links-
e.g. if Link 1 has a signal strength of -70 dBm and Link 2 has -65 dBm,
the signal for MLO will be -65 dBm.
The rate could be determined based on the most recently updated link-
e.g. if link 1 has a rate of 300 Mbps and link 2 has a rate of 450 Mbps,
the MLO rate can be calculated based on the inactivity of each link.
If the inactive time for link 1 is 20 seconds and for link 2 is 10 seconds,
the MLO rate will be the most recently updated rate, which is link 2's
rate of 450 Mbps.
The inactive time, dtim_period and beacon_interval can be taken as the
least value of field from link level.
Similarly, other MLO level applicable fields are handled and the fields
which don't make much sense at MLO level, a subsequent change will handle
to embed NL message.
Hence, add accumulated and other statistics for MLO station if valid links
are present to represent comprehensive overview for the ML stations.
Sarika Sharma [Wed, 28 May 2025 05:44:13 +0000 (11:14 +0530)]
wifi: cfg80211: extend to embed link level statistics in NL message
Currently, statistics is supported at deflink( or one of the links)
level for station. This has problems when applied to multi-link(ML)
connections.
Hence, add changes to support link level statistics to embed NL message
with link related information if valid links are present.
This will be helpful to check the link related statistics during MLO.
The statistics will be embedded into NL message as below:
For non-ML:
cmd->
NL80211_ATTR_IFINDEX
NL80211_ATTR_MAC
NL80211_ATTR_GENERATION
....etc
NL80211_ATTR_STA_INFO | nested
NL80211_STA_INFO_CONNECTED_TIME,
NL80211_STA_INFO_STA_FLAGS,
NL80211_STA_INFO_RX_BYTES,
NL80211_STA_INFO_TX_BYTES,
.........etc
Sarika Sharma [Wed, 28 May 2025 05:44:12 +0000 (11:14 +0530)]
wifi: cfg80211: add link_station_info structure to support MLO statistics
Current implementation of NL80211_GET_STATION does not work for
multi-link operation(MLO) since in case of MLO only deflink (or one
of the links) is considered and not all links.
Therefore to support for MLO, add link_station_info structure
to account link level statistics for station.
Additionally, add valid_links in station_info structure to indicate
bitmap of valid links for MLO. This will be helpful to check the link
related statistics during MLO.
Sarika Sharma [Wed, 28 May 2025 05:44:11 +0000 (11:14 +0530)]
wifi: mac80211: add support towards MLO handling of station statistics
Currently, in supporting API's to fill sinfo structure from sta
structure, is mapped to fill the fields from sta->deflink. However,
for multi-link (ML) station, sinfo structure should be filled from
corresponding link_id.
Therefore, add link_id as an additional argument in supporting API's
for filling sinfo structure correctly. Link_id is set to -1 for non-ML
station and corresponding link_id for ML stations. In supporting API's
for filling sinfo structure, check for link_id, if link_id < 0, fill
the sinfo structure from sta->deflink, otherwise fill from
sta->link[link_id].
Current, changes are done at the deflink level i.e, pass -1 as link_id.
Actual link_id will be added in subsequent patches to support
station statistics for MLO.
wifi: mac80211: update radar_required in channel context after channel switch
Currently, when a non-DFS channel is brought up and the bandwidth is
expanded from 80 MHz to 160 MHz, where the primary 80 MHz is non-DFS
and the secondary 80 MHz consists of DFS channels, radar detection
fails if radar occurs in the secondary 80 MHz.
When the channel is switched from 80 MHz to 160 MHz, with the primary
80 MHz being non-DFS and the secondary 80 MHz consisting of DFS
channels, the radar required flag in the channel switch parameters
is set to true. However, when using a reserved channel context,
it is not updated in sdata, which disables radar detection in the
secondary 80 MHz DFS channels.
Update the radar required flag in sdata to fix this issue when using
a reserved channel context.
Ting-Ying Li [Fri, 6 Jun 2025 09:34:44 +0000 (04:34 -0500)]
wifi: brcmfmac: don't allow arp/nd offload to be enabled if ap mode exists
Add a check to determine whether arp/nd offload enabling
request is allowed. If there is any interface acts as ap
mode and is operating, reject the request of arp offload
enabling from cfg80211.
Signed-off-by: Ting-Ying Li <tingying.li@cypress.com> Signed-off-by: Ian Lin <ian.lin@infineon.com> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Link: https://patch.msgid.link/20250606093444.15753-1-ian.lin@infineon.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Thanks to new PSE driver being proposed on the mailinglist figured out
there was some unclear documentation, which lead the developer on the
wrong path. Clarify these documentation.
The changes focus on clarifying the setup_pi_matrix callback behavior
and improving device tree binding descriptions, particularly around
channel-to-PI mapping relationships that are critical for proper PSE
controller integration.
Improve the setup_pi_matrix callback documentation to clarify its purpose
and usage. The enhanced description explains that PSE PI devicetree nodes
are pre-parsed before this callback is invoked, and drivers should utilize
pcdev->pi[x]->pairset[y].np to map PSE controller hardware ports to their
corresponding Power Interfaces.
This clarification helps driver implementers understand the callback's
role in establishing the hardware-to-PI relationship mapping.