linux-block.git
4 months agowifi: mac80211: use cfg80211_chandef_get_width()
Johannes Berg [Tue, 11 Mar 2025 11:25:35 +0000 (12:25 +0100)]
wifi: mac80211: use cfg80211_chandef_get_width()

We can now use this helper here and simplify some code.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250311122534.0a1d24a1a763.I51a52a67587a7eee65c80b9c5cf132820ebb9dd9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: cfg80211: expose cfg80211_chandef_get_width()
Johannes Berg [Tue, 11 Mar 2025 11:25:34 +0000 (12:25 +0100)]
wifi: cfg80211: expose cfg80211_chandef_get_width()

This can be just a trivial inline, to simplify some code.
Expose it, and also use it in util.c where it wasn't
previously available.

Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250311122534.c5c3b4af9a74.Ib25cf60f634dc359961182113214e5cdc3504e9c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: use supported selectors from assoc in ML reconf
Johannes Berg [Tue, 11 Mar 2025 11:10:04 +0000 (12:10 +0100)]
wifi: mac80211: use supported selectors from assoc in ML reconf

For multi-link reconfiguration, we shouldn't have any BSS
membership selectors that are different from the association.
Track the association selectors and use them to check the new
link(s) added during reconfiguration.

Fixes: 36e05b0b8390 ("wifi: mac80211: Support dynamic link addition and removal")
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Link: https://patch.msgid.link/20250311121004.771de0c36a75.I72f87d048c8693919b99dd9d4eee39833f06d15f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: remove SSID from ML reconf
Johannes Berg [Tue, 11 Mar 2025 11:10:03 +0000 (12:10 +0100)]
wifi: mac80211: remove SSID from ML reconf

The ML reconfiguration frame shouldn't contain an SSID,
remove it.

Fixes: 36e05b0b8390 ("wifi: mac80211: Support dynamic link addition and removal")
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Link: https://patch.msgid.link/20250311121004.fdf08f90bc30.I07f88d3a6f592a0df65d48f55d65c46a4d261007@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: virt_wifi: Add __nonstring annotations for unterminated strings
Kees Cook [Tue, 11 Mar 2025 22:56:05 +0000 (15:56 -0700)]
wifi: virt_wifi: Add __nonstring annotations for unterminated strings

When a character array without a terminating NUL character has a static
initializer, GCC 15's -Wunterminated-string-initialization will only
warn if the array lacks the "nonstring" attribute[1]. Mark the arrays
with __nonstring to and correctly identify the char array as "not a C
string" and thereby eliminate the warning.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178
Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20250311225604.it.926-kees@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: zd1211rw: Add __nonstring annotations for unterminated strings
Kees Cook [Tue, 11 Mar 2025 22:55:20 +0000 (15:55 -0700)]
wifi: zd1211rw: Add __nonstring annotations for unterminated strings

When a character array without a terminating NUL character has a static
initializer, GCC 15's -Wunterminated-string-initialization will only
warn if the array lacks the "nonstring" attribute[1]. Mark the arrays
with __nonstring to and correctly identify the char array as "not a C
string" and thereby eliminate the warning.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178
Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20250311225513.it.620-kees@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mwifiex: Add __nonstring annotations for unterminated strings
Kees Cook [Mon, 10 Mar 2025 22:23:32 +0000 (15:23 -0700)]
wifi: mwifiex: Add __nonstring annotations for unterminated strings

When a character array without a terminating NUL character has a static
initializer, GCC 15's -Wunterminated-string-initialization will only
warn if the array lacks the "nonstring" attribute[1]. Mark the arrays
with __nonstring to and correctly identify the char array as "not a C
string" and thereby eliminate the warning.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178
Cc: Brian Norris <briannorris@chromium.org>
Cc: Francesco Dolcini <francesco@dolcini.it>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Allison Randal <allison@lohutok.net>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20250310222332.work.202-kees@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: avoid selecting bad links
Miri Korenblit [Sun, 9 Mar 2025 05:36:53 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: avoid selecting bad links

Currently, we don't select a link that wasn't heared in the last 5
seconds.
But if the link started to suffer from missed beacons more recent than
that, we might select this link even we really shouldn't,
leading to a disconnection instead of a link switch.

Fix this by checking if a link was heared in the last MLO scan,
if not - don't include it in the link selection.
Since we do an MLO scan on missed beacons, we will not hear that link in
that scan, and won't select it.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20250309073442.8f950497219e.I51306021fe9231a8184e89c23707be47d3c05241@changeid
[replace cast with ULL constant]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: fix bad RSSI handling
Miri Korenblit [Sun, 9 Mar 2025 05:36:52 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: fix bad RSSI handling

If the RSSI is dropping to below the threshold, we need to do a MLO
scan to try select a better link.
This is true also if the connection doesn't have EMLSR capability,
and also if we are in EMLSR.
Fix the logic to always check the RSSI (and do a MLO scan if needed).

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20250309073442.a31b95888244.If6dca30d657658fa902b19e07b6fbc86c48d69cb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: always do MLO scan before link selection
Miri Korenblit [Sun, 9 Mar 2025 05:36:51 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: always do MLO scan before link selection

According to the requirements, if the last scan isn't older than 20
seconds, we can use its results and do the link selection without
scanning before.
But this applies only when trying to get back to EMLSR, not if the link
has bad RSSI/missed beacons.
Since an MLO scan is cheap anyway, and results from 20 seconds before
are really old, always scan before links switching.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20250309073442.a4c96e5c49d4.Ie55697af49435c2c45dccf7c607de5857b370f7a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: Correctly configure the A-MSDU max lengths
Ilan Peer [Sun, 9 Mar 2025 05:36:50 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: Correctly configure the A-MSDU max lengths

Refactor the setting of the A-MSDU maximal lengths as follows:

- Move the setting of the maximal A-MSDU length in case of HT from TLC
  logic to the station logic as it is not related to TLC.
- As long as the station is not associated, set RC A-MSDU maximal
  lengths to 1, to prevent iwlmld and mac80211 from building A-MSDUs.
- Update the RC and the TID specific A-MSDU maximal lengths based on
  the FW TLC notifications.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250309073442.afc842633002.I68153b6b0c5d976f2c7525009631f8fa28e9987c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: remove AP keys only for AP STA
Johannes Berg [Sun, 9 Mar 2025 05:36:49 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: remove AP keys only for AP STA

On station interfaces we don't only have the AP STA, but also
TDLS stations. Don't try to remove AP keys for them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Tested-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250309073442.f06a4d6eed2b.Icd20af668a22bfae5328eb0ea00ce10a72ce3539@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: move the ftm initiator data to ftm-initiator.h
Avraham Stern [Sun, 9 Mar 2025 05:36:48 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: move the ftm initiator data to ftm-initiator.h

Move the FTM initiator data to the relevant header file and document
its fields.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250309073442.92830fd553ec.Icbbd0eba34c9ba318801074f7705f6d1e5af5482@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: enable OMI bandwidth reduction on 6 GHz
Johannes Berg [Sun, 9 Mar 2025 05:36:47 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: enable OMI bandwidth reduction on 6 GHz

Due to the iwl_mld_get_chandef_from_chanctx() logic, even after
the OMI handshake to reduce bandwidth the driver wouldn't apply
that to the PHY context, since it always uses the normal, not
the reduced, configuration on 6 GHz (not strictly always, but
OMI will only apply if the original bandwidth is > 80 MHz.) Fix
this by making that selection contingent on AP mode. Refactor
the code a bit to also make it clearer why the min_def isn't
used in that case (for FILS.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250309073442.2706cbd0b100.Ic34636b1aee81a140eb690fca8139909a58f8e8b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: fix OMI time protection logic
Johannes Berg [Sun, 9 Mar 2025 05:36:46 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: fix OMI time protection logic

We're allowed to enter OMI only 5 seconds after the last
exit, so the logic needs to be inverted. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250309073442.58efb4c91655.Id596fcda2fb28f5945548d780be9ff90aee76b7e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: use the right iface iterator in low_latency
Miri Korenblit [Sun, 9 Mar 2025 05:36:45 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: use the right iface iterator in low_latency

We used ieee80211_iterate_active_interfaces instead of
ieee80211_iterate_active_interfaces_mtx, which is the one to use when
the wiphy lock is held.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Daniel Gabay <daniel.gabay@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250309073442.925cdca61ed0.I34f5c52d27414cb4c301bbd24df7c3530a43fa1d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: initialize regulatory early
Johannes Berg [Sun, 9 Mar 2025 05:36:44 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: initialize regulatory early

Since iwlmld claims wiphys to be self-managed, it needs to
have a regdomain registered before the wiphy is registered
to avoid issues when trying to get the regdomain, e.g. via
"iw phy phy0 reg get".

Move the initialization early, on every FW start not just
when starting to really operate it. This also requires the
self-managed flag to be set early.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250309073442.10ab8fed94e9.I7c8dee3d14c7427a56882739f82546c6492f3b10@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: assume wiphy is locked when getting BSS ifaces
Benjamin Berg [Sun, 9 Mar 2025 05:36:43 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: assume wiphy is locked when getting BSS ifaces

The code was calling ieee80211_iterate_interfaces, however that
takes a lock of iflist_mtx, which must not be taken recursively. Fix
this by using the appropriate _mtx version that asserts that the wiphy
mutex is already held.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250309073442.6ce298d6a44f.Ibc862dfdd6cb2da63781c791b9dc601bd5ce4bdc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: refactor iwl_mld_valid_emlsr_pair
Miri Korenblit [Sun, 9 Mar 2025 05:36:42 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: refactor iwl_mld_valid_emlsr_pair

- Change reasons enum to a bitmask and rename it
- Don't use 'else if' so all reasons will be set in the reasons bitmask

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20250309073442.0a3b2f88fbbf.I0152bc39e828488451e85135feb044ce1f7a85d3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: track channel_load_not_by_us
Miri Korenblit [Sun, 9 Mar 2025 05:36:41 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: track channel_load_not_by_us

For each channel context, track the avarage channel load by others in the
driver specific phy data, to be used by EMLSR.
Due to FW limitations, this value is incorrect in EMLSR, so it is
shouldn't be used in EMLSR.
On EMLSR exit, clear it so the wrong value won't be used.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20250309073442.dd443fc5b178.I68b2fed197aae14888159b7a73bf40c2f346f41f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: fix SMPS W/A
Miri Korenblit [Sun, 9 Mar 2025 05:36:40 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: fix SMPS W/A

If the user disables power save of a vif that didn't have it enabled
(for example before association), mac80211 will not notify the driver
with BSS_CHANGED_PS. This will cause the driver to not update the
device-level power save to disabled.
Fix this by checking the vif's power save status upon authorization, and
stop considering the vif's power save status on disassociation.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250309073442.1cdeb78b19ba.I58fe02c062524029071b04b093a1b09c5e46f4ef@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mld: fix build with CONFIG_PM_SLEEP undefined
Miri Korenblit [Sun, 9 Mar 2025 05:36:39 +0000 (07:36 +0200)]
wifi: iwlwifi: mld: fix build with CONFIG_PM_SLEEP undefined

fw_status.in_d3 is only defined under CONFIG_PM_SLEEP.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20250309073442.6f7e44a27b87.I78b9311019b59477a1961cddc4640b255ceda651@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mvm: fix setting the TK when associated
Avraham Stern [Sat, 8 Mar 2025 21:19:25 +0000 (23:19 +0200)]
wifi: iwlwifi: mvm: fix setting the TK when associated

When running secured ranging and the initiator is associated with
the responder, the TK was not set in the range request command.
Fix it.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.603dc31579d9.Icd19d797e56483c08dd22c55b96fee481c4d2f3d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: don't warn when if there is a FW error
Miri Korenblit [Sat, 8 Mar 2025 21:19:23 +0000 (23:19 +0200)]
wifi: iwlwifi: don't warn when if there is a FW error

iwl_trans_reclaim is warning if it is called when the FW is not alive.
But if it is called when there is a pending restart, i.e. after a FW
error, there is no need to warn, instead - return silently.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.ba3d90b22c25.I9332506af1997faefcf0bdb51d98d5e874051722@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: bump minimum API version in BZ/SC to 93
Miri Korenblit [Sat, 8 Mar 2025 21:19:22 +0000 (23:19 +0200)]
wifi: iwlwifi: bump minimum API version in BZ/SC to 93

Stop supporting older FWs.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.73e962ca3e6c.I942fa8cafc1791b9330ad18e2599fae11d7b3336@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: bump FW API to 98 for BZ/SC/DR devices
Miri Korenblit [Sat, 8 Mar 2025 21:19:21 +0000 (23:19 +0200)]
wifi: iwlwifi: bump FW API to 98 for BZ/SC/DR devices

Start supporting API versions 97 and 98 for those devices.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.55b5455795aa.I333f1e7fa31f9da1d40f668660c1e25b93ff469e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mvm: Fix bit size calculation in iwl_dbgfs_tas_get_status_read
Pagadala Yesu Anjaneyulu [Sat, 8 Mar 2025 21:19:20 +0000 (23:19 +0200)]
wifi: iwlwifi: mvm: Fix bit size calculation in iwl_dbgfs_tas_get_status_read

Corrected the bit size calculation in the for_each_set_bit macro in
the iwl_dbgfs_tas_get_status_read(). The previous implementation used
sizeof(dyn_status), which only accounts for the number of bytes.
This has been updated to TAS_DYNA_STATUS_MAX to ensure the loop iterates
over the correct number of valid bits in dyn_status.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.65d373e4a10e.If2cea63035333b07849e5a2c2a4f5dc5c5239595@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: w/a FW SMPS mode selection
Daniel Gabay [Sat, 8 Mar 2025 21:19:19 +0000 (23:19 +0200)]
wifi: iwlwifi: w/a FW SMPS mode selection

The FW is now responsible of determining the SMPS mode.
If the user disabled power save in a certain vif, we send the vif-level
power command to clear out the POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK bit
for that vif.
But erroneously, the FW checks DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK in
the device-level command to determine the SMPS mode.

To W/A this, send also the device-level command when the power save of a
vif changes, and disable power save if there is any vif that has power
save disabled.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.7bf205efa027.I2c793ff1fc2a6779a95faaee1ded348100fd97f1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: fix debug actions order
Johannes Berg [Sat, 8 Mar 2025 21:19:18 +0000 (23:19 +0200)]
wifi: iwlwifi: fix debug actions order

The order of actions taken for debug was implemented incorrectly.
Now we implemented the dump split and do the FW reset only in the
middle of the dump (rather than the FW killing itself on error.)
As a result, some of the actions taken when applying the config
will now crash the device, so we need to fix the order.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.6de7fa8e63ed.I40632c48e2a67a8aca05def572a934b88ce7934b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mark Br device not integrated
Johannes Berg [Sat, 8 Mar 2025 21:19:17 +0000 (23:19 +0200)]
wifi: iwlwifi: mark Br device not integrated

This is a discrete device, don't mark it as integrated.
This also means we cannot set the LTR delay.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.9bb69393fcc9.I197129383e5441c8139cbb0e810ae0b71198a37c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: Add new TAS disable reason for invalid table source
Pagadala Yesu Anjaneyulu [Sat, 8 Mar 2025 21:19:16 +0000 (23:19 +0200)]
wifi: iwlwifi: Add new TAS disable reason for invalid table source

The new reason is added to the iwl_tas_statically_disabled_reason enum
and the corresponding message is updated in the
iwl_dbgfs_tas_get_status_read().

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.5e1272ef3508.I24f668ae716bee20cba15fdc73c3363693bbaf73@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: mvm: cleanup of TAS structure and enums
Pagadala Yesu Anjaneyulu [Sat, 8 Mar 2025 21:19:15 +0000 (23:19 +0200)]
wifi: iwlwifi: mvm: cleanup of TAS structure and enums

Removed mvm prefix from the following structures and enum names:
1. struct iwl_tas_status_per_mac
2. struct iwl_tas_status_resp
3. enum iwl_tas_dyna_status
4. enum iwl_tas_statically_disabled_reason
As these structures and enums are not specific to mvm.

Replaced TAS_LMAC_BAND_LB, TAS_LMAC_BAND_HB, and TAS_LMAC_BAND_UHB macros
with a generic BAND macro, as these macros are not specific to TAS.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231427.59144bee9987.Ic2678dcb5afdacc2ca234d4aa4901e7e1f6e8dbb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: fix print for ECKV
Emmanuel Grumbach [Sat, 8 Mar 2025 21:19:14 +0000 (23:19 +0200)]
wifi: iwlwifi: fix print for ECKV

The print was obviously wrong. We are handling ECKV and not WRDD in this
function.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231426.e006c6b21432.I318fed724709f9ee7a0c369e1cf5e1038ddd546a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: fix the ECKV UEFI variable name
Emmanuel Grumbach [Sat, 8 Mar 2025 21:19:13 +0000 (23:19 +0200)]
wifi: iwlwifi: fix the ECKV UEFI variable name

This UEFI variable name was badly named. Fix its name and also use the
right GUID to find it: we need to use the BT_WIFI (a.k.a. Common) GUID.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231426.78c998d0fa71.I2bc9d72c1dc2c4d7028f0265634a940c2fadbbb5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: add support for BE213
Emmanuel Grumbach [Sat, 8 Mar 2025 21:19:12 +0000 (23:19 +0200)]
wifi: iwlwifi: add support for BE213

Add the BE213 device. This is just like BE211 but with a limitation on
the bandwidth.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308231426.f02f4d7fc73b.Idaf000dd311358e3b50a511f4efc1cc720abd58b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: set WMM in ML reconfiguration
Johannes Berg [Sat, 8 Mar 2025 21:03:41 +0000 (23:03 +0200)]
wifi: mac80211: set WMM in ML reconfiguration

In the per-STA profiles for added links in multi-link reconfiguration
the WMM element should be included. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.59902f783420.I362c3101d3f523a8db37c16cd7b5f573d76a36e6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: don't include MLE in ML reconf per-STA profile
Johannes Berg [Sat, 8 Mar 2025 21:03:40 +0000 (23:03 +0200)]
wifi: mac80211: don't include MLE in ML reconf per-STA profile

In the multi-link reconfiguration frame, the per-STA profile for
added links shouldn't include the multi-link element. Set the
association ID to an invalid value, so it doesn't erroneously
match the link ID if that happens to be zero.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.8e5be244c70f.I3472cd5c347814ee3600869a88488997bcd43224@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: fix ML reconf reset in disconnect
Johannes Berg [Sat, 8 Mar 2025 21:03:39 +0000 (23:03 +0200)]
wifi: mac80211: fix ML reconf reset in disconnect

If disconnecting while ML reconfiguration is in progress,
the data isn't freed because the reset call is too late,
after the vif already switches to non-MLD. Move the call
to fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.abaea69cde42.I7e6b35731ded94fc2d68a2d4ecf81873712c268e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: Notify cfg80211 about added link addresses
Ilan Peer [Sat, 8 Mar 2025 21:03:38 +0000 (23:03 +0200)]
wifi: mac80211: Notify cfg80211 about added link addresses

When ML reconfiguration is done and new links are added, update
cfg80211 with the addresses of the newly added links.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.0c6bf8b1bef3.I2aa16801f07321a580dd7dce4a074a3486f627f1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: cfg80211: Update the link address when a link is added
Ilan Peer [Sat, 8 Mar 2025 21:03:37 +0000 (23:03 +0200)]
wifi: cfg80211: Update the link address when a link is added

When links are added, update the wireless device link addresses based
on the information provided by the driver.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.d694a9125aba.I79b010ea9aab47893e4f22c266362fde30b7f9ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: fix warning on disconnect during failed ML reconf
Johannes Berg [Sat, 8 Mar 2025 21:03:36 +0000 (23:03 +0200)]
wifi: mac80211: fix warning on disconnect during failed ML reconf

If multi-link reconfiguration fails, we can disconnect with a local link
already allocated but the BSS entry not assigned yet, which leads to a
warning in cfg80211. Add a check to avoid the warning.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.699bd9cbabe5.I599d5ff69092a65e916e2acd25137ae9df8debe8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: fix userspace_selectors corruption
Johannes Berg [Sat, 8 Mar 2025 21:03:35 +0000 (23:03 +0200)]
wifi: mac80211: fix userspace_selectors corruption

Spotted during code review, the selectors need to be large
enough for a 128-bit bitmap, not a single unsigned long,
otherwise we have stack corruption.

We should also allow passing selectors from userspace, but
that should be a separate change.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.8f1bcf96a504.Ibeb8970c82a30c97279a4cc4e68faca5df1813a5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211_hwsim: Fix MLD address translation
Ilan Peer [Sat, 8 Mar 2025 21:03:34 +0000 (23:03 +0200)]
wifi: mac80211_hwsim: Fix MLD address translation

Do address translations only between shared links. It is
possible that while an non-AP MLD station and an AP MLD
station have shared links, the frame is intended to be sent
on a link which is not shared (for example when sending a
probe response).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.1aa461270bb6.Ic21592e1b1634653f02b80628cb2152f6e9de367@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: allow 320 MHz FTM measurements
Avraham Stern [Sat, 8 Mar 2025 21:03:33 +0000 (23:03 +0200)]
wifi: mac80211: allow 320 MHz FTM measurements

Add 320 MHz to the list of allowed bandwidths for FTM measurements.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.91f4cbe66817.I9205c585fca6a54a2c5a9e4db98c7781bd1fc4e1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: cfg80211: improve supported_selector documentation
Johannes Berg [Sat, 8 Mar 2025 21:03:32 +0000 (23:03 +0200)]
wifi: cfg80211: improve supported_selector documentation

Improve the documentation for supported BSS selectors to make it more
precise.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.ba402ff47314.I502b56111b62ea0be174ae76bd03684ae1d4aefb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: fix U-APSD check in ML reconfiguration
Johannes Berg [Sat, 8 Mar 2025 21:03:31 +0000 (23:03 +0200)]
wifi: mac80211: fix U-APSD check in ML reconfiguration

If U-APSD isn't enabled by us, then IEEE80211_STA_UAPSD_ENABLED
won't be set, but the AP can still support it in that case. Only
require U-APSD from the AP if we enabled it, don't require it to
be disabled on the AP if we didn't.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.b4674be12a38.I01959e448c6a2a3e8bc5d561bbae9e8d2cca616a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: cfg80211: allow IR in 20 MHz configurations
Anjaneyulu [Sat, 8 Mar 2025 21:03:30 +0000 (23:03 +0200)]
wifi: cfg80211: allow IR in 20 MHz configurations

Some regulatory bodies doesn't allow IR (initiate radioation) on a
specific subband, but allows it for channels with a bandwidth of 20 MHz.
Add a channel flag that indicates that, and consider it in
cfg80211_reg_check_beaconing.

While on it, fix the kernel doc of enum nl80211_reg_rule_flags and
change it to use BIT().

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Co-developed-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Signed-off-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.d3ab352a73ff.I8a8f79e1c9eb74936929463960ee2a324712fe51@changeid
[fix typo]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: mac80211: mlme: support extended MLD capa/ops in assoc
Johannes Berg [Sat, 8 Mar 2025 21:03:29 +0000 (23:03 +0200)]
wifi: mac80211: mlme: support extended MLD capa/ops in assoc

Support passing the value from userspace on to the AP in the
association and ML link reconfiguration requests. We may need
to also add a driver value to or in with the field, but for
now have no feature that is controlled by the driver.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.2e555beb0a76.I623f59023b47ec202fc0c7520f2b5f575b439927@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: cfg80211: allow setting extended MLD capa/ops
Johannes Berg [Sat, 8 Mar 2025 21:03:28 +0000 (23:03 +0200)]
wifi: cfg80211: allow setting extended MLD capa/ops

Some extended MLD capabilities and operations bits (currently
the "BTM MLD Recommendataion For Multiple APs Support" bit)
may depend on userspace capabilities. Allow userspace to pass
the values for this field that it supports to the association
and link reconfiguration operations.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Link: https://patch.msgid.link/20250308225541.bd52078b5f65.I4dd8f53b0030db7ea87a2e0920989e7e2c7b5345@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: cfg80211: move link reconfig parameters into a struct
Johannes Berg [Sat, 8 Mar 2025 21:03:27 +0000 (23:03 +0200)]
wifi: cfg80211: move link reconfig parameters into a struct

Add a new struct cfg80211_ml_reconf_req to collect the link
reconfiguration parameters.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250308225541.0cf299c1fdd0.Id1a3b1092dc52d0d3731a8798522fdf2e052bf0b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: wfx: allow to enable WoWLAN using NL80211
Jérôme Pouiller [Tue, 4 Mar 2025 15:32:24 +0000 (16:32 +0100)]
wifi: wfx: allow to enable WoWLAN using NL80211

It is possible to use nl80211 to request to the driver to do allow the
required bus configuration to wake-up the host.

This patch implements the required API for nl80211.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://patch.msgid.link/20250304153224.39083-6-jerome.pouiller@silabs.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: wfx: allow SDIO device to wake up the host
Jérôme Pouiller [Tue, 4 Mar 2025 15:32:23 +0000 (16:32 +0100)]
wifi: wfx: allow SDIO device to wake up the host

If the device is connected with SDIO bus, it can wake up the host using
either the SDIO controller (that requires MMC_PM_WAKE_SDIO_IRQ
capability) or the out-of-bound IRQ. This patch allows both.

Obviously, the SDIO controller must be able to keep the SDIO device
powered on.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://patch.msgid.link/20250304153224.39083-5-jerome.pouiller@silabs.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: wfx: allow SPI device to wake up the host
Jérôme Pouiller [Tue, 4 Mar 2025 15:32:22 +0000 (16:32 +0100)]
wifi: wfx: allow SPI device to wake up the host

When the host is asleep, the device has wake up the host using the
usual SPI IRQ.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://patch.msgid.link/20250304153224.39083-4-jerome.pouiller@silabs.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: wfx: declare support for WoWLAN
Jérôme Pouiller [Tue, 4 Mar 2025 15:32:21 +0000 (16:32 +0100)]
wifi: wfx: declare support for WoWLAN

WF200 is able to keep the connection with the AP alive while the host is
asleep. So, let's expose this capability to the user.

For now, we don't provide any way to control the device filtering
features. The user has to allow wake-up on any received packets and on
disconnections.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://patch.msgid.link/20250304153224.39083-3-jerome.pouiller@silabs.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: wfx: align declarations between bus_spi.c and bus_sdio.c
Jérôme Pouiller [Tue, 4 Mar 2025 15:32:20 +0000 (16:32 +0100)]
wifi: wfx: align declarations between bus_spi.c and bus_sdio.c

Just declare fields in the same order in bus_spi.c and bus_sdio.c

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://patch.msgid.link/20250304153224.39083-2-jerome.pouiller@silabs.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlegacy: avoid size increase
Arnd Bergmann [Tue, 4 Mar 2025 14:42:07 +0000 (15:42 +0100)]
wifi: iwlegacy: avoid size increase

My previous patch caused a slight code size increase when DEBUG_FS is disabled,
as Stanislaw Gruszka pointed out.

Fix this with an added IS_ENABLED() check.

Fixes: cf6b9ba172dd ("wifi: iwlegacy: don't warn for unused variables with DEBUG_FS=n")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Link: https://patch.msgid.link/20250304144210.997531-1-arnd@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agoMerge tag 'ath-next-20250305' of git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath
Johannes Berg [Fri, 7 Mar 2025 08:17:59 +0000 (09:17 +0100)]
Merge tag 'ath-next-20250305' of git://git./linux/kernel/git/ath/ath

Jeff Johnson says:
====================
ath.git patches for v6.15

This development cycle again featured multiple patchsets to ath12k to
support the new 802.11be MLO feature. In addition, there was the usual
set of bug fixes and cleanups.
====================

Link: https://lore.kernel.org/linux-wireless/d01b1976-ebe8-48cd-8f49-32bfa00bed7e@oss.qualcomm.com/
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agowifi: iwlwifi: add iwlmld sub-driver
Miri Korenblit [Sun, 16 Feb 2025 09:42:40 +0000 (11:42 +0200)]
wifi: iwlwifi: add iwlmld sub-driver

iwlwifi is the driver of all Intel wifi devices since 2008.
Since then, the hardware has changed a lot, but the firmware
API has changed even more. The need to keep one driver that
supports all those different APIs led us to introduce a new
architecture circa 2012 which allowed us to keep the same
interface to the hardware (DMAs, Tx queues, etc...) with a
new layer to implement the mid-layer between mac80211 and
the firmware. The first component is called the 'transport'
and the latter is called 'operation_mode' a.k.a  op_mode.

In 2013 we took advantage of the new architecture to
introduce iwlmvm which allowed us to implement the, then,
new firmware API. This op_mode supports 7260 and up, those
devices supports support at least VHT.

Since then, wifi evolved and so did the firmware. It became
much bigger and took a lot of functionality from the driver.
It became increasingly hard to keep the same op_mode for the
newest devices and we experienced frequent regressions on
older devices. In order to avoid those regressions and keep
the code maintainable, we decided it was about time to start
a new op_mode.

iwlmld is a new op_mode that supports BE200 or newer if the
firmware being used is 97.ucode or newer. If the user has
an older devices or BE200 with .96.ucode, iwlmvm will be
loaded. Of course, this op_mode selection is seamless.

All the features supported in iwlmvm are supported in
iwlmld besides a few seldom used use cases: injection and
Hotspot 2.0. Those are under work.

A few points about the implementation:
 * iwlmld doesn't have any mutexes, it relies on the
   wiphy_lock
 * iwlmld is more "resource oriented": stations, links and
   interfaces are allocated and freed only after all the
   relevant flows are completed.
 * Firmware notifications' sizes are validated in a more
   structured way.

We would love to see this new op_mode merged in 6.15. The
firmware for this new driver (.97.ucode) is not yet publicly
available but it'll be sent very soon.
People eager to get an early version of this firmware can
contact Emmanuel at:
emmanuel.grumbach@intel.com

I've listed the people who directly contributed
code, but many others from various teams have
contributed in other ways.

Co-developed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Co-developed-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Co-developed-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Co-developed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Co-developed-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Co-developed-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Co-developed-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Co-developed-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://lore.kernel.org/linux-wireless/20250216094321.537988-1-miriam.rachel.korenblit@intel.com/
[fix Kconfig, fix api/phy.h includes, SPDX tag and coding
 style issues, duplicated includes per 0-day robot]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agoMerge tag 'wireless-next-2025-03-04-v2' of https://git.kernel.org/pub/scm/linux/kerne...
Jakub Kicinski [Tue, 4 Mar 2025 16:50:40 +0000 (08:50 -0800)]
Merge tag 'wireless-next-2025-03-04-v2' of https://git./linux/kernel/git/wireless/wireless-next

Johannes Berg says:

====================
First 6.15 material:
 * cfg80211/mac80211
   - remove cooked monitor support
   - strict mode for better AP testing
   - basic EPCS support
   - OMI RX bandwidth reduction support
 * rtw88
   - preparation for RTL8814AU support
 * rtw89
   - use wiphy_lock/wiphy_work
   - preparations for MLO
   - BT-Coex improvements
   - regulatory support in firmware files
 * iwlwifi
   - preparations for the new iwlmld sub-driver

* tag 'wireless-next-2025-03-04-v2' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (128 commits)
  wifi: iwlwifi: remove mld/roc.c
  wifi: mac80211: refactor populating mesh related fields in sinfo
  wifi: cfg80211: reorg sinfo structure elements for mesh
  wifi: iwlwifi: Fix spelling mistake "Increate" -> "Increase"
  wifi: iwlwifi: add Debug Host Command APIs
  wifi: iwlwifi: add IWL_MAX_NUM_IGTKS macro
  wifi: iwlwifi: add OMI bandwidth reduction APIs
  wifi: iwlwifi: remove mvm prefix from iwl_mvm_d3_end_notif
  wifi: iwlwifi: remember if the UATS table was read successfully
  wifi: iwlwifi: export iwl_get_lari_config_bitmap
  wifi: iwlwifi: add support for external 32 KHz clock
  wifi: iwlwifi: mld: add a debug level for EHT prints
  wifi: iwlwifi: mld: add a debug level for PTP prints
  wifi: iwlwifi: remove mvm prefix from iwl_mvm_esr_mode_notif
  wifi: iwlwifi: use 0xff instead of 0xffffffff for invalid
  wifi: iwlwifi: location api cleanup
  wifi: cfg80211: expose update timestamp to drivers
  wifi: mac80211: add ieee80211_iter_chan_contexts_mtx
  wifi: mac80211: fix integer overflow in hwmp_route_info_get()
  wifi: mac80211: Fix possible integer promotion issue
  ...
====================

Link: https://patch.msgid.link/20250304125605.127914-3-johannes@sipsolutions.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
4 months agoMerge branch 'netconsole-add-taskname-sysdata-support'
Paolo Abeni [Tue, 4 Mar 2025 14:28:30 +0000 (15:28 +0100)]
Merge branch 'netconsole-add-taskname-sysdata-support'

Breno Leitao says:

====================
netconsole: Add taskname sysdata support

This patchset introduces a new feature to the netconsole extradata
subsystem that enables the inclusion of the current task's name in the
sysdata output of netconsole messages.

This enhancement is particularly valuable for large-scale deployments,
such as Meta's, where netconsole collects messages from millions of
servers and stores them in a data warehouse for analysis. Engineers
often rely on these messages to investigate issues and assess kernel
health.

One common challenge we face is determining the context in which
a particular message was generated. By including the task name
(task->comm) with each message, this feature provides a direct answer to
the frequently asked question: "What was running when this message was
generated?"

This added context will significantly improve our ability to diagnose
and troubleshoot issues, making it easier to interpret output of
netconsole.

The patchset consists of seven patches that implement the following changes:

 * Refactor CPU number formatting into a separate function
 * Prefix CPU_NR sysdata feature with SYSDATA_
 * Patch to covert a bitwise operation into boolean
 * Add configfs controls for taskname sysdata feature
 * Add taskname to extradata entry count
 * Add support for including task name in netconsole's extra data output
 * Document the task name feature in Documentation/networking/netconsole.rst
 * Add test coverage for the task name feature to the existing sysdata selftest script

These changes allow users to enable or disable the task name feature via
configfs and provide additional context for kernel messages by showing
which task generated each console message.

I have tested these patches on some servers and they seem to work as
expected.

v1: https://lore.kernel.org/r/20250221-netcons_current-v1-0-21c86ae8fc0d@debian.org

Signed-off-by: Breno Leitao <leitao@debian.org>
====================

Link: https://patch.msgid.link/20250228-netcons_current-v2-0-f53ff79a0db2@debian.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonetconsole: selftest: add task name append testing
Breno Leitao [Fri, 28 Feb 2025 12:50:24 +0000 (04:50 -0800)]
netconsole: selftest: add task name append testing

Add test coverage for the netconsole task name feature to the existing
sysdata selftest script. This extends the test infrastructure to verify
that task names are correctly appended when enabled and absent when
disabled.

The test validates that:
  - Task names appear in the expected format "taskname=<name>"
  - Task names are included when the feature is enabled
  - Task names are excluded when the feature is disabled
  - The feature works correctly alongside other sysdata fields like CPU

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonetconsole: docs: document the task name feature
Breno Leitao [Fri, 28 Feb 2025 12:50:23 +0000 (04:50 -0800)]
netconsole: docs: document the task name feature

Add documentation for the netconsole task name feature in
Documentation/networking/netconsole.rst. This explains how to enable
task name via configfs and demonstrates the output format.

The documentation includes:
- How to enable/disable the feature via taskname_enabled
- The format of the task name in the output
- An example showing the task name appearing in messages

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonetconsole: add task name to extra data fields
Breno Leitao [Fri, 28 Feb 2025 12:50:22 +0000 (04:50 -0800)]
netconsole: add task name to extra data fields

This is the core patch for this whole patchset. Add support for
including the current task's name in netconsole's extra data output.
This adds a new append_taskname() function that writes the task name
(from current->comm) into the target's extradata buffer, similar to how
CPU numbers are handled.

The task name is included when the SYSDATA_TASKNAME field is set,
appearing in the format "taskname=<name>" in the output. This additional
context can help with debugging by showing which task generated each
console message.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonetconsole: add configfs controls for taskname sysdata feature
Breno Leitao [Fri, 28 Feb 2025 12:50:21 +0000 (04:50 -0800)]
netconsole: add configfs controls for taskname sysdata feature

Add configfs interface to enable/disable the taskname sysdata feature.
This adds the following functionality:

The implementation follows the same pattern as the existing CPU number
feature, ensuring consistent behavior and error handling across sysdata
features.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonetconsole: add taskname to extradata entry count
Breno Leitao [Fri, 28 Feb 2025 12:50:20 +0000 (04:50 -0800)]
netconsole: add taskname to extradata entry count

New SYSDATA_TASKNAME feature flag to track when taskname append is enabled.

Additional check in count_extradata_entries() to include taskname in
total, counting it as an entry in extradata. This function is used to
check if we are not overflowing the number of extradata items.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonetconsole: refactor CPU number formatting into separate function
Breno Leitao [Fri, 28 Feb 2025 12:50:19 +0000 (04:50 -0800)]
netconsole: refactor CPU number formatting into separate function

Extract CPU number formatting logic from prepare_extradata() into a new
append_cpu_nr() function.

This refactoring improves code organization by isolating CPU number
formatting into its own function while reducing the complexity of
prepare_extradata().

The change prepares the codebase for the upcoming taskname feature by
establishing a consistent pattern for handling sysdata features.

The CPU number formatting logic itself remains unchanged; only its
location has moved to improve maintainability.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonetconsole: Make boolean comparison consistent
Breno Leitao [Fri, 28 Feb 2025 12:50:18 +0000 (04:50 -0800)]
netconsole: Make boolean comparison consistent

Convert the current state assignment to use explicit boolean conversion,
making the code more robust and easier to read. This change adds a
double-negation operator to ensure consistent boolean conversion as
suggested by Paolo[1].

This approach aligns with the existing pattern used in
sysdata_cpu_nr_enabled_show().

Link: https://lore.kernel.org/all/7309e760-63b0-4b58-ad33-2fb8db361141@redhat.com/
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonetconsole: prefix CPU_NR sysdata feature with SYSDATA_
Breno Leitao [Fri, 28 Feb 2025 12:50:17 +0000 (04:50 -0800)]
netconsole: prefix CPU_NR sysdata feature with SYSDATA_

Rename the CPU_NR enum value to SYSDATA_CPU_NR to establish a consistent
naming convention for sysdata features. This change prepares for
upcoming additions to the sysdata feature set by clearly grouping
related features under the SYSDATA prefix.

This change is purely cosmetic and does not modify any functionality.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agowifi: iwlwifi: remove mld/roc.c
Johannes Berg [Tue, 4 Mar 2025 12:47:59 +0000 (13:47 +0100)]
wifi: iwlwifi: remove mld/roc.c

This file should never have been part of the commit, remove it.

Fixes: af3be9088404 ("wifi: iwlwifi: support ROC version 6")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4 months agoMerge branch 'support-some-enhances-features-for-the-hibmcge-driver'
Paolo Abeni [Tue, 4 Mar 2025 12:45:36 +0000 (13:45 +0100)]
Merge branch 'support-some-enhances-features-for-the-hibmcge-driver'

Jijie Shao says:

====================
Support some enhances features for the HIBMCGE driver

In this patch set, we mainly implement some enhanced features.
It mainly includes the statistics, diagnosis, and ioctl to
improve fault locating efficiency,
abnormal irq and MAC link exception handling feature
to enhance driver robustness,
and rx checksum offload feature to improve performance
(tx checksum feature has been implemented).

v3: https://lore.kernel.org/all/20250221115526.1082660-2-shaojijie@huawei.com/
v2: https://lore.kernel.org/all/20250218085829.3172126-1-shaojijie@huawei.com/
v1: https://lore.kernel.org/all/20250213035529.2402283-1-shaojijie@huawei.com/
====================

Link: https://patch.msgid.link/20250228115411.1750803-1-shaojijie@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: hibmcge: Add support for ioctl
Jijie Shao [Fri, 28 Feb 2025 11:54:11 +0000 (19:54 +0800)]
net: hibmcge: Add support for ioctl

This patch implements the .ndo_eth_ioctl() to
read and write the PHY register.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: hibmcge: Add support for BMC diagnose feature
Jijie Shao [Fri, 28 Feb 2025 11:54:10 +0000 (19:54 +0800)]
net: hibmcge: Add support for BMC diagnose feature

The MAC hardware is on the BMC side, and the driver is on the host side.
When the driver is abnormal, the BMC cannot directly detect the
exception cause.
Therefore, this patch implements the BMC diagnosis feature.

When users query driver diagnosis information on the BMC, the driver
detects the query request in the scheduled task and reports
driver statistics and link status to the BMC through the bar space.
The BMC collects logs to analyze exception causes.

Currently, the scheduled task is executed every 30 seconds
To quickly respond to user query requests,
this patch changes the scheduled task to once every second.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: hibmcge: Add support for mac link exception handling feature
Jijie Shao [Fri, 28 Feb 2025 11:54:09 +0000 (19:54 +0800)]
net: hibmcge: Add support for mac link exception handling feature

If the rate changed frequently, the PHY link ok,
but the MAC link maybe fails.
As a result, the network port is unavailable.

According to the documents of the chip,
core_reset needs to do to fix the fault.

In hw_adjus_link(), the core_reset is added to try to
ensure that MAC link status is normal.
In addition, MAC link failure detection is added.
If the MAC link fails after core_reset, driver invokes
the phy_stop() and phy_start() to re-link.

Due to phydev->lock, re-link cannot be triggered
in adjust_link(). Therefore, this operation
is invoked in a scheduled task.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: hibmcge: Add support for abnormal irq handling feature
Jijie Shao [Fri, 28 Feb 2025 11:54:08 +0000 (19:54 +0800)]
net: hibmcge: Add support for abnormal irq handling feature

the hardware error was reported by interrupt,
and need be fixed by doing function reset,
but the whole reset flow takes a long time,
should not do it in irq handler,
so do it in scheduled task.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: hibmcge: Add support for checksum offload
Jijie Shao [Fri, 28 Feb 2025 11:54:07 +0000 (19:54 +0800)]
net: hibmcge: Add support for checksum offload

This patch implements the rx checksum offload feature.

The tx checksum offload processing in .ndo_start_xmit()
has been accepted. This patch also adds the tx checksum
feature, including NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: hibmcge: Add support for dump statistics
Jijie Shao [Fri, 28 Feb 2025 11:54:06 +0000 (19:54 +0800)]
net: hibmcge: Add support for dump statistics

The driver supports many hw statistics. This patch supports
dump statistics through ethtool_ops and ndo.get_stats64().

The type of hw statistics register is u32,
To prevent the statistics register from overflowing,
the driver dump the statistics every 30 seconds.
in a scheduled task.

Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agoMerge branch 'introduce-flowtable-hw-offloading-in-airoha_eth-driver'
Paolo Abeni [Tue, 4 Mar 2025 12:22:12 +0000 (13:22 +0100)]
Merge branch 'introduce-flowtable-hw-offloading-in-airoha_eth-driver'

Lorenzo Bianconi says:

====================
Introduce flowtable hw offloading in airoha_eth driver

Introduce netfilter flowtable integration in airoha_eth driver to
offload 5-tuple flower rules learned by the PPE module if the user
accelerates them using a nft configuration similar to the one reported
below:

table inet filter {
flowtable ft {
hook ingress priority filter
devices = { lan1, lan2, lan3, lan4, eth1 }
flags offload;
}
chain forward {
type filter hook forward priority filter; policy accept;
meta l4proto { tcp, udp } flow add @ft
}
}

Packet Processor Engine (PPE) module available on EN7581 SoC populates
the PPE table with 5-tuples flower rules learned from traffic forwarded
between the GDM ports connected to the Packet Switch Engine (PSE) module.
airoha_eth driver configures and collects data from the PPE module via a
Network Processor Unit (NPU) RISC-V module available on the EN7581 SoC.
Move airoha_eth driver in a dedicated folder
(drivers/net/ethernet/airoha).

v7: https://lore.kernel.org/r/20250224-airoha-en7581-flowtable-offload-v7-0-b4a22ad8364e@kernel.org
v6: https://lore.kernel.org/r/20250221-airoha-en7581-flowtable-offload-v6-0-d593af0e9487@kernel.org
v5: https://lore.kernel.org/r/20250217-airoha-en7581-flowtable-offload-v5-0-28be901cb735@kernel.org
v4: https://lore.kernel.org/r/20250213-airoha-en7581-flowtable-offload-v4-0-b69ca16d74db@kernel.org
v3: https://lore.kernel.org/r/20250209-airoha-en7581-flowtable-offload-v3-0-dba60e755563@kernel.org
v2: https://lore.kernel.org/r/20250207-airoha-en7581-flowtable-offload-v2-0-3a2239692a67@kernel.org
v1: https://lore.kernel.org/r/20250205-airoha-en7581-flowtable-offload-v1-0-d362cfa97b01@kernel.org
====================

Link: https://patch.msgid.link/20250228-airoha-en7581-flowtable-offload-v8-0-01dc1653f46e@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Introduce PPE debugfs support
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:23 +0000 (11:54 +0100)]
net: airoha: Introduce PPE debugfs support

Similar to PPE support for Mediatek devices, introduce PPE debugfs
in order to dump binded and unbinded flows.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Add loopback support for GDM2
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:22 +0000 (11:54 +0100)]
net: airoha: Add loopback support for GDM2

Enable hw redirection for traffic received on GDM2 port to GDM{3,4}.
This is required to apply Qdisc offloading (HTB or ETS) for traffic to
and from GDM{3,4} port.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Introduce flowtable offload support
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:21 +0000 (11:54 +0100)]
net: airoha: Introduce flowtable offload support

Introduce netfilter flowtable integration in order to allow airoha_eth
driver to offload 5-tuple flower rules learned by the PPE module if the
user accelerates them using a nft configuration similar to the one reported
below:

table inet filter {
flowtable ft {
hook ingress priority filter
devices = { lan1, lan2, lan3, lan4, eth1 }
flags offload;
}
chain forward {
type filter hook forward priority filter; policy accept;
meta l4proto { tcp, udp } flow add @ft
}
}

Tested-by: Sayantan Nandy <sayantan.nandy@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Introduce Airoha NPU support
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:20 +0000 (11:54 +0100)]
net: airoha: Introduce Airoha NPU support

Packet Processor Engine (PPE) module available on EN7581 SoC populates
the PPE table with 5-tuples flower rules learned from traffic forwarded
between the GDM ports connected to the Packet Switch Engine (PSE) module.
The airoha_eth driver can enable hw acceleration of learned 5-tuples
rules if the user configure them in netfilter flowtable (netfilter
flowtable support will be added with subsequent patches).
airoha_eth driver configures and collects data from the PPE module via a
Network Processor Unit (NPU) RISC-V module available on the EN7581 SoC.
Introduce basic support for Airoha NPU module.

Tested-by: Sayantan Nandy <sayantan.nandy@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agodt-bindings: net: airoha: Add airoha,npu phandle property
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:19 +0000 (11:54 +0100)]
dt-bindings: net: airoha: Add airoha,npu phandle property

Introduce the airoha,npu property for the NPU node available on
EN7581 SoC. The airoha Network Processor Unit (NPU) is used to
offload network traffic forwarded between Packet Switch Engine
(PSE) ports.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agodt-bindings: net: airoha: Add the NPU node for EN7581 SoC
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:18 +0000 (11:54 +0100)]
dt-bindings: net: airoha: Add the NPU node for EN7581 SoC

This patch adds the NPU document binding for EN7581 SoC.
The Airoha Network Processor Unit (NPU) provides a configuration interface
to implement wired and wireless hardware flow offloading programming Packet
Processor Engine (PPE) flow table.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Rename airoha_set_gdm_port_fwd_cfg() in airoha_set_vip_for_gdm_port()
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:17 +0000 (11:54 +0100)]
net: airoha: Rename airoha_set_gdm_port_fwd_cfg() in airoha_set_vip_for_gdm_port()

Rename airoha_set_gdm_port() in airoha_set_vip_for_gdm_port().
Get rid of airoha_set_gdm_ports routine.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Move REG_GDM_FWD_CFG() initialization in airoha_dev_init()
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:16 +0000 (11:54 +0100)]
net: airoha: Move REG_GDM_FWD_CFG() initialization in airoha_dev_init()

Move REG_GDM_FWD_CFG() register initialization in airoha_dev_init
routine. Moreover, always send traffic PPE module in order to be
processed by hw accelerator.
This is a preliminary patch to enable netfilter flowtable hw offloading
on EN7581 SoC.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Enable support for multiple net_devices
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:15 +0000 (11:54 +0100)]
net: airoha: Enable support for multiple net_devices

In the current codebase airoha_eth driver supports just a single
net_device connected to the Packet Switch Engine (PSE) lan port (GDM1).
As shown in commit 23020f049327 ("net: airoha: Introduce ethernet
support for EN7581 SoC"), PSE can switch packets between four GDM ports.
Enable the capability to create a net_device for each GDM port of the
PSE module. Moreover, since the QDMA blocks can be shared between
net_devices, do not stop TX/RX DMA in airoha_dev_stop() if there are
active net_devices for this QDMA block.
This is a preliminary patch to enable flowtable hw offloading for EN7581
SoC.

Co-developed-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: dsa: mt7530: Enable Rx sptag for EN7581 SoC
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:14 +0000 (11:54 +0100)]
net: dsa: mt7530: Enable Rx sptag for EN7581 SoC

Packet Processor Engine (PPE) module used for hw acceleration on EN7581
mac block, in order to properly parse packets, requires DSA untagged
packets on TX side and read DSA tag from DMA descriptor on RX side.
For this reason, enable RX Special Tag (SPTAG) for EN7581 SoC.
This is a preliminary patch to enable netfilter flowtable hw offloading
on EN7581 SoC.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Move DSA tag in DMA descriptor
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:13 +0000 (11:54 +0100)]
net: airoha: Move DSA tag in DMA descriptor

Packet Processor Engine (PPE) module reads DSA tags from the DMA descriptor
and requires untagged DSA packets to properly parse them. Move DSA tag
in the DMA descriptor on TX side and read DSA tag from DMA descriptor
on RX side. In order to avoid skb reallocation, store tag in skb_dst on
RX side.
This is a preliminary patch to enable netfilter flowtable hw offloading
on EN7581 SoC.

Tested-by: Sayantan Nandy <sayantan.nandy@airoha.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Move register definitions in airoha_regs.h
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:12 +0000 (11:54 +0100)]
net: airoha: Move register definitions in airoha_regs.h

Move common airoha_eth register definitions in airoha_regs.h in order
to reuse them for Packet Processor Engine (PPE) codebase.
PPE module is used to enable support for flowtable hw offloading in
airoha_eth driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Move reg/write utility routines in airoha_eth.h
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:11 +0000 (11:54 +0100)]
net: airoha: Move reg/write utility routines in airoha_eth.h

This is a preliminary patch to introduce flowtable hw offloading
support for airoha_eth driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Move definitions in airoha_eth.h
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:10 +0000 (11:54 +0100)]
net: airoha: Move definitions in airoha_eth.h

Move common airoha_eth definitions in airoha_eth.h in order to reuse
them for Packet Processor Engine (PPE) codebase.
PPE module is used to enable support for flowtable hw offloading in
airoha_eth driver.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: airoha: Move airoha_eth driver in a dedicated folder
Lorenzo Bianconi [Fri, 28 Feb 2025 10:54:09 +0000 (11:54 +0100)]
net: airoha: Move airoha_eth driver in a dedicated folder

The airoha_eth driver has no codebase shared with mtk_eth_soc one.
Moreover, the upcoming features (flowtable hw offloading, PCS, ..) will
not reuse any code from MediaTek driver. Move the Airoha driver in a
dedicated folder.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agoMerge branch 'net-notify-users-when-an-iface-cannot-change-its-netns'
Paolo Abeni [Tue, 4 Mar 2025 11:44:51 +0000 (12:44 +0100)]
Merge branch 'net-notify-users-when-an-iface-cannot-change-its-netns'

Nicolas Dichtel says:

====================
net: notify users when an iface cannot change its netns

This series adds a way to see if an interface cannot be moved to another netns.

 Documentation/netlink/specs/rt_link.yaml           |  3 ++
 .../networking/net_cachelines/net_device.rst       |  2 +-
 Documentation/networking/switchdev.rst             |  2 +-
 drivers/net/amt.c                                  |  2 +-
 drivers/net/bonding/bond_main.c                    |  2 +-
 drivers/net/ethernet/adi/adin1110.c                |  2 +-
 .../net/ethernet/marvell/prestera/prestera_main.c  |  2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  4 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |  2 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c     |  2 +-
 drivers/net/ethernet/rocker/rocker_main.c          |  2 +-
 drivers/net/ethernet/ti/cpsw_new.c                 |  2 +-
 drivers/net/loopback.c                             |  2 +-
 drivers/net/net_failover.c                         |  2 +-
 drivers/net/team/team_core.c                       |  2 +-
 drivers/net/vrf.c                                  |  2 +-
 include/linux/netdevice.h                          |  9 +++--
 include/uapi/linux/if_link.h                       |  1 +
 net/batman-adv/soft-interface.c                    |  2 +-
 net/bridge/br_device.c                             |  2 +-
 net/core/dev.c                                     | 45 +++++++++++++++++-----
 net/core/rtnetlink.c                               |  5 ++-
 net/hsr/hsr_device.c                               |  2 +-
 net/ieee802154/6lowpan/core.c                      |  2 +-
 net/ieee802154/core.c                              | 10 ++---
 net/ipv4/ip_tunnel.c                               |  2 +-
 net/ipv4/ipmr.c                                    |  2 +-
 net/ipv6/ip6_gre.c                                 |  2 +-
 net/ipv6/ip6_tunnel.c                              |  2 +-
 net/ipv6/ip6mr.c                                   |  2 +-
 net/ipv6/sit.c                                     |  2 +-
 net/openvswitch/vport-internal_dev.c               |  2 +-
 net/wireless/core.c                                | 10 ++---
 tools/testing/selftests/net/forwarding/README      |  2 +-
 34 files changed, 86 insertions(+), 53 deletions(-)

Comments are welcome.

Regards,
Nicolas
====================

Link: https://patch.msgid.link/20250228102144.154802-1-nicolas.dichtel@6wind.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: plumb extack in __dev_change_net_namespace()
Nicolas Dichtel [Fri, 28 Feb 2025 10:20:58 +0000 (11:20 +0100)]
net: plumb extack in __dev_change_net_namespace()

It could be hard to understand why the netlink command fails. For example,
if dev->netns_immutable is set, the error is "Invalid argument".

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: advertise netns_immutable property via netlink
Nicolas Dichtel [Fri, 28 Feb 2025 10:20:57 +0000 (11:20 +0100)]
net: advertise netns_immutable property via netlink

Since commit 05c1280a2bcf ("netdev_features: convert NETIF_F_NETNS_LOCAL to
dev->netns_local"), there is no way to see if the netns_immutable property
s set on a device. Let's add a netlink attribute to advertise it.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: rename netns_local to netns_immutable
Nicolas Dichtel [Fri, 28 Feb 2025 10:20:56 +0000 (11:20 +0100)]
net: rename netns_local to netns_immutable

The name 'netns_local' is confusing. A following commit will export it via
netlink, so let's use a more explicit name.

Reported-by: Eric Dumazet <edumazet@google.com>
Suggested-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agoMerge branch 'some-pktgen-fixes-improvments-part-ii'
Paolo Abeni [Tue, 4 Mar 2025 09:58:00 +0000 (10:58 +0100)]
Merge branch 'some-pktgen-fixes-improvments-part-ii'

Peter Seiderer says:

====================
Some pktgen fixes/improvments (part II)

While taking a look at '[PATCH net] pktgen: Avoid out-of-range in
get_imix_entries' ([1]) and '[PATCH net v2] pktgen: Avoid out-of-bounds
access in get_imix_entries' ([2], [3]) and doing some tests and code review
I detected that the /proc/net/pktgen/... parsing logic does not honour the
user given buffer bounds (resulting in out-of-bounds access).

This can be observed e.g. by the following simple test (sometimes the
old/'longer' previous value is re-read from the buffer):

        $ echo add_device lo@0 > /proc/net/pktgen/kpktgend_0

        $ echo "min_pkt_size 12345" > /proc/net/pktgen/lo\@0 && grep min_pkt_size /proc/net/pktgen/lo\@0
Params: count 1000  min_pkt_size: 12345  max_pkt_size: 0
Result: OK: min_pkt_size=12345

        $ echo -n "min_pkt_size 123" > /proc/net/pktgen/lo\@0 && grep min_pkt_size /proc/net/pktgen/lo\@0
Params: count 1000  min_pkt_size: 12345  max_pkt_size: 0
Result: OK: min_pkt_size=12345

        $ echo "min_pkt_size 123" > /proc/net/pktgen/lo\@0 && grep min_pkt_size /proc/net/pktgen/lo\@0
Params: count 1000  min_pkt_size: 123  max_pkt_size: 0
Result: OK: min_pkt_size=123

So fix the out-of-bounds access (and some minor findings) and add a simple
proc_net_pktgen selftest...

Patch set splited into part I (now already applied to net-next)

- net: pktgen: replace ENOTSUPP with EOPNOTSUPP
- net: pktgen: enable 'param=value' parsing
- net: pktgen: fix hex32_arg parsing for short reads
- net: pktgen: fix 'rate 0' error handling (return -EINVAL)
- net: pktgen: fix 'ratep 0' error handling (return -EINVAL)
- net: pktgen: fix ctrl interface command parsing
- net: pktgen: fix access outside of user given buffer in pktgen_thread_write()

nd part II (this one):

- net: pktgen: use defines for the various dec/hex number parsing digits lengths
- net: pktgen: fix mix of int/long
- net: pktgen: remove extra tmp variable (re-use len instead)
- net: pktgen: remove some superfluous variable initializing
- net: pktgen: fix mpls maximum labels list parsing
- net: pktgen: fix access outside of user given buffer in pktgen_if_write()
- net: pktgen: fix mpls reset parsing
- net: pktgen: remove all superfluous index assignements
- selftest: net: add proc_net_pktgen

[1] https://lore.kernel.org/netdev/20241006221221.3744995-1-artem.chernyshev@red-soft.ru/
[2] https://lore.kernel.org/netdev/20250109083039.14004-1-pchelkin@ispras.ru/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76201b5979768500bca362871db66d77cb4c225e
====================

Link: https://patch.msgid.link/20250227135604.40024-1-ps.report@gmx.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agoselftest: net: add proc_net_pktgen
Peter Seiderer [Thu, 27 Feb 2025 13:56:04 +0000 (14:56 +0100)]
selftest: net: add proc_net_pktgen

Add some test for /proc/net/pktgen/... interface.

- enable 'CONFIG_NET_PKTGEN=m' in tools/testing/selftests/net/config

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: pktgen: remove all superfluous index assignements
Peter Seiderer [Thu, 27 Feb 2025 13:56:03 +0000 (14:56 +0100)]
net: pktgen: remove all superfluous index assignements

Remove all superfluous index ('i += len') assignements (value not used
afterwards).

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
4 months agonet: pktgen: fix mpls reset parsing
Peter Seiderer [Thu, 27 Feb 2025 13:56:02 +0000 (14:56 +0100)]
net: pktgen: fix mpls reset parsing

Fix mpls list reset parsing to work as describe in
Documentation/networking/pktgen.rst:

  pgset "mpls 0"    turn off mpls (or any invalid argument works too!)

- before the patch

$ echo "mpls 00000001,00000002" > /proc/net/pktgen/lo\@0
$ grep mpls /proc/net/pktgen/lo\@0
     mpls: 0000000100000002
Result: OK: mpls=00000001,00000002

$ echo "mpls 00000001,00000002" > /proc/net/pktgen/lo\@0
$ echo "mpls 0" > /proc/net/pktgen/lo\@0
$ grep mpls /proc/net/pktgen/lo\@0
     mpls: 00000000
Result: OK: mpls=00000000

$ echo "mpls 00000001,00000002" > /proc/net/pktgen/lo\@0
$ echo "mpls invalid" > /proc/net/pktgen/lo\@0
$ grep mpls /proc/net/pktgen/lo\@0
Result: OK: mpls=

- after the patch

$ echo "mpls 00000001,00000002" > /proc/net/pktgen/lo\@0
$ grep mpls /proc/net/pktgen/lo\@0
     mpls: 0000000100000002
Result: OK: mpls=00000001,00000002

$ echo "mpls 00000001,00000002" > /proc/net/pktgen/lo\@0
$ echo "mpls 0" > /proc/net/pktgen/lo\@0
$ grep mpls /proc/net/pktgen/lo\@0
Result: OK: mpls=

$ echo "mpls 00000001,00000002" > /proc/net/pktgen/lo\@0
$ echo "mpls invalid" > /proc/net/pktgen/lo\@0
$ grep mpls /proc/net/pktgen/lo\@0
Result: OK: mpls=

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>