linux-block.git
2 months agoMerge tag 'iwlwifi-next-2025-05-15' of https://git.kernel.org/pub/scm/linux/kernel...
Johannes Berg [Thu, 15 May 2025 11:56:38 +0000 (13:56 +0200)]
Merge tag 'iwlwifi-next-2025-05-15' of https://git./linux/kernel/git/iwlwifi/iwlwifi-next

Miri Korenblit says:
====================
iwlwifi features, notably a rework of the transport configuration
====================

Link: https://patch.msgid.link/MW5PR11MB5810DD2655DE461E98A618DDA390A@MW5PR11MB5810.namprd11.prod.outlook.com/
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: iwlwifi: mld: allow 2 ROCs on the same vif
Miri Korenblit [Sun, 11 May 2025 16:53:21 +0000 (19:53 +0300)]
wifi: iwlwifi: mld: allow 2 ROCs on the same vif

In the current code, if an ROC is started on a vif that already has an
active ROC we reject it and warn.

But really there is no such limitation. The actual limitation is to not
have 2 ROCs of the same type simultaneously.

Add a helper function to find a vif that has an active ROC of a given
type, and only if one exist - reject the ROC.

This allows also to remove bss_roc_vif.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.1f8c55198578.I17cb191596ed4e97a4854108f8ca5ca197662a62@changeid
2 months agowifi: iwlwifi: fw: api: include required headers in rs/location
Johannes Berg [Sun, 11 May 2025 16:53:20 +0000 (19:53 +0300)]
wifi: iwlwifi: fw: api: include required headers in rs/location

Various headers are required for these to build properly.
Include the needed files.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.956281013349.I4c537dffb82f5e5042e4a880cde3c6da38a56cbc@changeid
2 months agowifi: iwlwifi: rename ctx-info-gen3 to ctx-info-v2
Miri Korenblit [Sun, 11 May 2025 16:53:19 +0000 (19:53 +0300)]
wifi: iwlwifi: rename ctx-info-gen3 to ctx-info-v2

Context info was introduced in 22000, and was significantly changed in
ax210. The new version of context info was called 'gen3',
probably because in 22000, the gen2 transport was added.

But this name is just wrong:
- if 'gen' enumerates transports, there was not a gen3 transport, just a
  few modifications to gen1/2 transports needed for ax210.
- if 'gen' enumerates devices, then we can just use the device names.

Also, context info will soon become a lib, agnostic of the transport
generations.
Simply replace 'gen3' with 'v2'.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.a580bd8d4f74.Ie413a02233f1a5ad538e13071c09760b9d97be3b@changeid
2 months agowifi: iwlwifi: fix a wrong comment
Miri Korenblit [Sun, 11 May 2025 16:53:18 +0000 (19:53 +0300)]
wifi: iwlwifi: fix a wrong comment

iwl_pcie_apply_destination is used in all generation.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.7eaf79a07226.I615cfd21001208b366c94a5fcb8e30a7d97f0ac2@changeid
2 months agowifi: iwlwifi: map iwl_context_info to the matching struct
Miri Korenblit [Sun, 11 May 2025 16:53:17 +0000 (19:53 +0300)]
wifi: iwlwifi: map iwl_context_info to the matching struct

Map iwl_context_info to the matching struct in the FW.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.a7240935006e.I75e2e13421b5dac2c1bdbd01fdfd34c38f2d3d8c@changeid
2 months agowifi: iwlwifi: remove unused macro
Miri Korenblit [Sun, 11 May 2025 16:53:16 +0000 (19:53 +0300)]
wifi: iwlwifi: remove unused macro

TFD_QUEUE_SIZE_MAX_GEN3 is not used, remove it.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.a0154cca6afb.Ifb4915e0acd51be6a75d33a8b96b3f7b0928b312@changeid
2 months agowifi: iwlwifi: unify iwlagn_scd_bc_tbl_entry and iwl_gen3_bc_tbl_entry
Miri Korenblit [Sun, 11 May 2025 16:53:15 +0000 (19:53 +0300)]
wifi: iwlwifi: unify iwlagn_scd_bc_tbl_entry and iwl_gen3_bc_tbl_entry

As those are now the same, unify and adjust the documentation.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.b7ddfade8fec.I2bf97252c4bd751077ade204767eed02d815614d@changeid
2 months agowifi: iwlwifi: use bc entries instead of bc table also for pre-ax210
Miri Korenblit [Sun, 11 May 2025 16:53:14 +0000 (19:53 +0300)]
wifi: iwlwifi: use bc entries instead of bc table also for pre-ax210

iwlagn_scd_bc_tbl is used for pre-ax210 devices,
and iwl_gen3_bc_tbl_entry is used for ax210 and on. But there is no
difference between the the 22000 version and the AX210+ one.

In order to unify the two, as first step make iwlagn_scd_bc_tbl an entry
as well, and adjust the code. In a later patch both structures will be
unified.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.645cd82ebf48.Iaa7e88179372d60ef31157e379737b5babe54012@changeid
2 months agowifi: iwlwifi: remove GEN3 from a couple of macros
Miri Korenblit [Sun, 11 May 2025 16:53:13 +0000 (19:53 +0300)]
wifi: iwlwifi: remove GEN3 from a couple of macros

'GEN3' here really means 'AX210'. Rename.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.b7fb5b854ded.Ib52b84c6e36e312b2eeb84a3cf71c6185fb52ee7@changeid
2 months agowifi: iwlwifi: use normal versioning convention for iwl_tx_cmd
Miri Korenblit [Sun, 11 May 2025 16:53:12 +0000 (19:53 +0300)]
wifi: iwlwifi: use normal versioning convention for iwl_tx_cmd

We have iwl_tx_cmd for devices older than 22000, iwl_tx_cmd_gen2 for
22000 devices, and iwl_tx_cmd_gen3 ax210 and up.

But the convention for all other APIs is to have the latest version
without any prefix and the older ones - with a _vX prefix,
where X is the highest version that this struct support.

The  term 'gen' was introduced as the name of the (back then) new
transport, and should not be used as a device name (for that we have the
actual names: 22000, ax210, etc.)

Now as a new transport, called 'gen3', is going to be written and it can
be confused with this API.

Move iwl_tx_cmd to use the regular versioning convention.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.806e40c8f767.Ibc0e95e43a6fa6d47f72823bf804314d5db84618@changeid
2 months agowifi: iwlwifi: stop supporting TX_CMD_API_S_VER_8
Miri Korenblit [Sun, 27 Apr 2025 19:22:45 +0000 (22:22 +0300)]
wifi: iwlwifi: stop supporting TX_CMD_API_S_VER_8

This version is not used on any device. Don't support it.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: reduce configuration struct size
Johannes Berg [Sun, 11 May 2025 16:53:10 +0000 (19:53 +0300)]
wifi: iwlwifi: cfg: reduce configuration struct size

We don't need the CORES() match nor jacket (which really doesn't
even make sense to match to the RF anyway), and since the subdevice
masks we care about are contiguous, we can encode them as highest
and lowest bit set (automatically.) By encoding whether to match or
not as separate flags and taking advantage of the limited range of
the RF type, step and ID we can reduce the amount of memory needed
for the table, while also making the logic (apart perhaps from the
subdevice mask) easier to understand.

This reduces the size of the module by about 1.5KiB on x86-64.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.38a805a7c96f.Ieece00476cea6054b0827cd075eb8ba5943373df@changeid
2 months agowifi: iwlwifi: cfg: clean up dr/br configs
Johannes Berg [Sun, 11 May 2025 16:53:09 +0000 (19:53 +0300)]
wifi: iwlwifi: cfg: clean up dr/br configs

We don't need the configs that won't end up being used, such as
the "br" config for discrete devices, remove them. Also remove
the module firmware for test chips, that's never needed.

For now keep the iwl_dr_mac_cfg even if it's unused, we'll add
platforms with it once we have their PCI IDs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.15e2056ec40f.I75a6ce4ad0b14d2b4413615f05523a8f62f08954@changeid
2 months agowifi: iwlwifi: Add helper function to extract device ID
Pagadala Yesu Anjaneyulu [Sun, 11 May 2025 16:53:08 +0000 (19:53 +0300)]
wifi: iwlwifi: Add helper function to extract device ID

Add iwl_trans_get_device_id() to extract the device ID
from the hw_id member in the iwl_trans structure.
hw_id member contains both sub-device ID and device ID,
with the device ID occupying bits 16 to 31.

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/20250511195137.4411402701f2.I81cde20de05e3bb993977f8d4bbf90707819347f@changeid
2 months agowifi: iwlwifi: cfg: mark Ty devices as discrete
Johannes Berg [Sun, 11 May 2025 16:53:07 +0000 (19:53 +0300)]
wifi: iwlwifi: cfg: mark Ty devices as discrete

Looks like these were never marked discrete, since they always
used the iwl_so_mac_cfg (earlier iwl_so_trans_cfg). Mark them
as discrete since they are.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
PerCI-Ready: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Tested-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.f3a75ae80f28.I79964f4426389f04798b70841a9e847be48bf9c3@changeid
2 months agowifi: iwlwifi: cfg: remove MAC type/step matching
Johannes Berg [Sat, 10 May 2025 18:48:27 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: remove MAC type/step matching

Now that it's all split into MAC and RF configs, remove
the matching on MAC type and step. If we ever need to do
something based on the MAC step, we'll have to find some
new mechanism (since the MAC type is known already from
the PCI IDs table, but not the step), or just handle the
(likely small) differences in code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.fca99a5ab315.Iae27b781221fd29845493adf2c29d9e4f7a9c33b@changeid
2 months agowifi: iwlwifi: cfg: add a couple of older devices
Johannes Berg [Sat, 10 May 2025 18:48:26 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: add a couple of older devices

There are some devices that are misidentified, such as 7265-N
and Killer 1435 variants. Add their names, and for some of them
also add the PCI IDs to match at all.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.ca03a90c294e.I04d64964c664d49ab16760d754968f09c607f36a@changeid
2 months agowifi: iwlwifi: cfg: fix PE RF names
Johannes Berg [Sat, 10 May 2025 18:48:25 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: fix PE RF names

There are a couple of variants of this, match them correctly
to their names and clean up a bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.d03eaad5be56.I276a09f0cad364e51ed4730ca81fbe504e61f2c7@changeid
2 months agowifi: iwlwifi: cfg: fix and clean up FM/WH device matching
Johannes Berg [Sat, 10 May 2025 18:48:24 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: fix and clean up FM/WH device matching

We only need a few entries, and there don't seem to be any
such devices actually limited to 160 MHz.

Also add PCI IDs for the new Killer device on LNL platforms.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.ba2964bee671.If7aaaf10b236115e39b17d37296341de6c821069@changeid
2 months agowifi: iwlwifi: cfg: clean up GF device matching
Johannes Berg [Sat, 10 May 2025 18:48:23 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: clean up GF device matching

Again some names don't actually exist, and we only need a
few entries to cover Ty (discrete) and AX211/AX411.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.8888f6798581.If332ebfc3b3f4a335a79ccee13e90f93b1ee4df7@changeid
2 months agowifi: iwlwifi: cfg: clean up JF device matching
Johannes Berg [Sat, 10 May 2025 18:48:22 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: clean up JF device matching

This really only needs to be distinguished based on the
RF type, bandwidth limit and possibly diversity (JF1).
Some of the names that are defined don't even exist.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.bca83604aa92.I35301d2d8b57c072284fff7bf6682b4a9424e56c@changeid
2 months agowifi: iwlwifi: tests: make subdev match test more precise
Johannes Berg [Sat, 10 May 2025 18:48:21 +0000 (21:48 +0300)]
wifi: iwlwifi: tests: make subdev match test more precise

It's OK to match with subdevice_mask as long as that doesn't
overlap the RF ID/BW limit/cores fields in 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/20250510214621.87cc0ad360a8.I9be361caedd7258e8e817d4100c549681396f307@changeid
2 months agowifi: iwlwifi: cfg: clean up HR device matching
Johannes Berg [Sat, 10 May 2025 18:48:20 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: clean up HR device matching

We only need a few entries on top of the Killer ones.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.fa0cde465de0.I6a3f9ed9a7341e2c58c69af50a9f126992a745f2@changeid
2 months agowifi: iwlwifi: cfg: unify and add some Killer devices
Johannes Berg [Sat, 10 May 2025 18:48:19 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: unify and add some Killer devices

Unify a number of Killer devices now that we no longer
need to distinguish the MAC type, and add a few more
that wouldn't have gotten the right name before.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.a16b1c2740f8.I147b97ef2c8e99451806ea0e34a9eb5bff37c326@changeid
2 months agowifi: iwlwifi: cfg: fix and unify Killer/JF configs
Johannes Berg [Sat, 10 May 2025 18:48:18 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: fix and unify Killer/JF configs

All of these should be 160 MHz, and they can be recognised
by just the subdevice ID. Unify all the Killer/JF entries.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.a93788f159ec.I114f09a0f61849ac3b75d12d7def35be842e5b7c@changeid
2 months agowifi: iwlwifi: cfg: fix Ma device configs
Johannes Berg [Sat, 10 May 2025 18:48:17 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: fix Ma device configs

These should be according to their RF type, not just use
GF unconditionally. 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/20250510214621.4dd365eb76cd.I91f368df691a3ce6c545d9cdc44676e7883efa16@changeid
2 months agowifi: iwlwifi: cfg: fix some device names
Johannes Berg [Sat, 10 May 2025 18:48:16 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: fix some device names

Officially, the device names have dashes ("Wireless-N"),
so add them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.4f7bbd57680f.Ida19b5e696723db5839c13341d6ca7085e8c2568@changeid
2 months agowifi: iwlwifi: cfg: remove some unused names
Johannes Berg [Sat, 10 May 2025 18:48:15 +0000 (21:48 +0300)]
wifi: iwlwifi: cfg: remove some unused names

There are a couple of old names that don't actually get used.
Remove them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.1ed5fc197ba0.I52d7bb49db24523ad93ad83a89c8e846d9a43241@changeid
2 months agowifi: iwlwifi: mld: add debug log instead of warning
Somashekhar Puttagangaiah [Sat, 10 May 2025 18:48:14 +0000 (21:48 +0300)]
wifi: iwlwifi: mld: add debug log instead of warning

During link selection if the links does not meet the valid grade
criteria then add debug log instead of warning.

Signed-off-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.2593268ca988.I9786126cd1078caec8587b166a7f8735300c951d@changeid
2 months agowifi: iwlwifi: dbg: fix dump trigger split check
Johannes Berg [Sat, 10 May 2025 18:48:13 +0000 (21:48 +0300)]
wifi: iwlwifi: dbg: fix dump trigger split check

Evidently, I confused the fields here, apply_policy should
be checked for IWL_FW_INI_APPLY_POLICY_SPLIT_DUMP_RESET.
Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Eilon Rinat <eilon.rinat@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250510214621.c802d5cc1312.I0cf5d74f91349499ab35eef0ebdc604961e492ef@changeid
2 months agowifi: iwlwifi: mvm/mld: allow puncturing use in 5 GHz
Johannes Berg [Fri, 9 May 2025 10:44:53 +0000 (13:44 +0300)]
wifi: iwlwifi: mvm/mld: allow puncturing use in 5 GHz

It was decided this was supported after all, so remove
the restriction.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-15-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: mld: add support for ROC on BSS
Pagadala Yesu Anjaneyulu [Fri, 9 May 2025 10:44:52 +0000 (13:44 +0300)]
wifi: iwlwifi: mld: add support for ROC on BSS

add support for remain on channel on BSS vif for iwlmld.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-14-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: mld: Block EMLSR only when ready to enter ROC
Pagadala Yesu Anjaneyulu [Fri, 9 May 2025 10:44:51 +0000 (13:44 +0300)]
wifi: iwlwifi: mld: Block EMLSR only when ready to enter ROC

If one of the stages in starting a ROC failed,
the ROC will not start nor end so EMLSR will stay blocked forever.

Block EMLSR once all ROC conditions are validated and
clear EMLSR blocked reasons in mld_vif cleanup.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-13-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: mld: move aux_sta member from iwl_mld_link to iwl_mld_vif
Pagadala Yesu Anjaneyulu [Fri, 9 May 2025 10:44:50 +0000 (13:44 +0300)]
wifi: iwlwifi: mld: move aux_sta member from iwl_mld_link to iwl_mld_vif

This change reflects the correct ownership of aux_sta,
as it is not a property of the link but rather of the virtual interface.
Updated the initialization, cleanup and access logic for the aux_sta member
to align with its new location within iwl_mld_vif.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-12-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: mld: Fix ROC activity cleanup in iwl_mld_vif
Pagadala Yesu Anjaneyulu [Fri, 9 May 2025 10:44:49 +0000 (13:44 +0300)]
wifi: iwlwifi: mld: Fix ROC activity cleanup in iwl_mld_vif

The roc_activity member in the iwl_mld_vif structure was previously
set to zero during cleanup as was present in struct_group, which
incorrectly indicated ROC_ACTIVITY_HOTSPOT.
To fix this issue, remove roc_activity member from struct_group.
Notify mac80211 of ROC expiration during vif cleanup to maintain
synchronization between the driver and mac80211.
While on it, update it's type to enum iwl_roc_activity.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-11-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: mld: Correct comments for cleanup functions
Pagadala Yesu Anjaneyulu [Fri, 9 May 2025 10:44:48 +0000 (13:44 +0300)]
wifi: iwlwifi: mld: Correct comments for cleanup functions

Update comments to accurately reflect the purpose of the
iwl_mld_cleanup_link and iwl_cleanup_mld functions.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Somashekhar Puttagangaiah <somashekhar.puttagangaiah@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-10-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: rename iwl_cfg to iwl_rf_cfg
Johannes Berg [Fri, 9 May 2025 10:44:47 +0000 (13:44 +0300)]
wifi: iwlwifi: rename iwl_cfg to iwl_rf_cfg

With all the cleanups now, we can rename the structure to
better indicate the functionality. For older devices this
isn't quite accurate, of course, but it's better to have a
name that reflects future use for maintenance.

Add some kernel-doc while at it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-9-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: clean up Sc/Dr/Br configs
Johannes Berg [Fri, 9 May 2025 10:44:46 +0000 (13:44 +0300)]
wifi: iwlwifi: cfg: clean up Sc/Dr/Br configs

For now, the WH and PE radios require the same config as
FM, so just add a #define for those instead of copying
the data. Since this is true, Sc/Dr/Br all used the same
configs for all RF types, but that's confusing, so now
use the defined WH/PE names for the correct combinations.

We can also now enable the unit test that ensures we have
no duplicate RF configs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-8-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: add FM RF config
Johannes Berg [Fri, 9 May 2025 10:44:45 +0000 (13:44 +0300)]
wifi: iwlwifi: cfg: add FM RF config

The Bz configs really should be FM for the RF, so
move that around.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-7-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: add GF RF config
Johannes Berg [Fri, 9 May 2025 10:44:44 +0000 (13:44 +0300)]
wifi: iwlwifi: cfg: add GF RF config

This is equivalent to just the previous iwl_cfg_ma, but
really should also be used for Bz/Gf and Sc/Gf, instead
of those using EHT sizes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-6-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: unify HR configs
Johannes Berg [Fri, 9 May 2025 10:44:43 +0000 (13:44 +0300)]
wifi: iwlwifi: cfg: unify HR configs

Unify the HR configs to just one HR RF config. All the fields
were the same already, so this doesn't do anything.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-5-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: unify JF configs
Johannes Berg [Fri, 9 May 2025 10:44:42 +0000 (13:44 +0300)]
wifi: iwlwifi: cfg: unify JF configs

Unify the JF configs to just one JF RF config. This can be
done because the differing fields (thermal and DCCM offsets)
won't be used for Qu MACs (and up) due to firmware support.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-4-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: unify num_rbds config
Johannes Berg [Fri, 9 May 2025 10:44:41 +0000 (13:44 +0300)]
wifi: iwlwifi: cfg: unify num_rbds config

This should depend on both the RF (VHT/HE/EHT support) and
the MAC (<=22000 can put multiple frames into one buffer),
so unify the config in the struct iwl_cfg to just have it
sized according to the RF, and then double it for all the
MACs starting from AX210 (So/Ty).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-3-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: add ucode API min/max to MAC config
Johannes Berg [Fri, 9 May 2025 10:44:40 +0000 (13:44 +0300)]
wifi: iwlwifi: cfg: add ucode API min/max to MAC config

In some older devices, the min/max firmware API supported by
the driver depends on the specific device, when sharing the
the same MAC (config). For most newer devices, it really is
dependent on the MAC instead, since the firmware was frozen
for certain MAC types. However, in the future we expect also
freezes for RF types there.

To handle this most generally, add an API min/max to the MAC
config and then use the narrowest range prescribed by both,
if set.

For the newer MACs since 9000, move the configuration, there
was only a freeze on MAC+RF lines so far.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250509104454.2582160-2-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: remove unused high_temp from iwl_cfg
Johannes Berg [Thu, 8 May 2025 12:13:06 +0000 (15:13 +0300)]
wifi: iwlwifi: remove unused high_temp from iwl_cfg

This value is never read, so it's not needed. Remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-16-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: move MAC parameters to MAC data
Johannes Berg [Thu, 8 May 2025 12:13:05 +0000 (15:13 +0300)]
wifi: iwlwifi: cfg: move MAC parameters to MAC data

There are a number of MAC parameters that are in the iwl_cfg
(which is the last config matched to the MAC/RF combination).
This isn't necessary, there are many more of those than MACs,
so move (most of) the data into the MAC family config struct.

Note that DCCM information remains for use by older devices,
and on 9000 series it'll be in struct iwl_cfg but be ignored
when the CRF is in a Qu/So platform.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-15-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: remove DCCM offsets from new devices
Johannes Berg [Thu, 8 May 2025 12:13:04 +0000 (15:13 +0300)]
wifi: iwlwifi: cfg: remove DCCM offsets from new devices

This is only used with old-style debug dump, which isn't
supported on newer devices, so remove the data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-14-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: remove eeprom_size from new devices
Johannes Berg [Thu, 8 May 2025 12:13:03 +0000 (15:13 +0300)]
wifi: iwlwifi: cfg: remove eeprom_size from new devices

Since 22000 series, the data is read by the firmware and the
driver doesn't need to know, remove the useless setting.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-13-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: rename struct iwl_base_params
Johannes Berg [Thu, 8 May 2025 12:13:02 +0000 (15:13 +0300)]
wifi: iwlwifi: rename struct iwl_base_params

These are (going to be) base MAC parameters that are identical
even for different platforms with the same MAC, so rename the
structure accordingly, calling it iwl_family_base_params.

Also rename the pointer to it so the dereferencing is a bit
shorter.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-12-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: remove rf_id field
Johannes Berg [Thu, 8 May 2025 12:13:01 +0000 (15:13 +0300)]
wifi: iwlwifi: cfg: remove rf_id field

This field is always set for >= 9000 series, but then we
already check that, so it's not needed. Remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-11-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: remove dbgc_supported field
Johannes Berg [Thu, 8 May 2025 12:13:00 +0000 (15:13 +0300)]
wifi: iwlwifi: cfg: remove dbgc_supported field

This field is unused, remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-10-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: rename cfg_trans_params to mac_cfg
Johannes Berg [Thu, 8 May 2025 12:12:59 +0000 (15:12 +0300)]
wifi: iwlwifi: rename cfg_trans_params to mac_cfg

Since 9000 series devices, the devices are split into MAC and
CRF parts. Currently, "struct iwl_cfg" reflects some MAC and
some RF parameters, but we want to clean this up and move the
MAC data to what's now "struct iwl_cfg_trans_params". As the
first step, to reflect the intent, rename this structure.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-9-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: pass trans to iwl_parse_nvm_mcc_info()
Johannes Berg [Thu, 8 May 2025 12:12:58 +0000 (15:12 +0300)]
wifi: iwlwifi: pass trans to iwl_parse_nvm_mcc_info()

There's no need to pass various different pointers when
the transport is already established, so just pass that
instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-8-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: remove nvm_hw_section_num from new devices
Johannes Berg [Thu, 8 May 2025 12:12:57 +0000 (15:12 +0300)]
wifi: iwlwifi: cfg: remove nvm_hw_section_num from new devices

This value hasn't been used since unified firmware in 22000
series, so there's no need to set the value for that or
newer devices. Remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-7-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: handle cc firmware dynamically
Johannes Berg [Thu, 8 May 2025 12:12:56 +0000 (15:12 +0300)]
wifi: iwlwifi: cfg: handle cc firmware dynamically

Instead of using fw_name_pre, handle the cc firmware file
name specially in iwl_drv_get_fwname_pre() for the cc MAC
type.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-6-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: build ax210 family FW names dynamically
Johannes Berg [Thu, 8 May 2025 12:12:55 +0000 (15:12 +0300)]
wifi: iwlwifi: cfg: build ax210 family FW names dynamically

Add support for the TY MAC (discrete device) and GF4 RF to
the list of MAC/RF types, and use that to remove fw_name_pre
for the ax210 family devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-5-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: remove 'cdb' value
Johannes Berg [Thu, 8 May 2025 12:12:54 +0000 (15:12 +0300)]
wifi: iwlwifi: cfg: remove 'cdb' value

This is never used, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-4-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: remove QuZ/JF special cases
Johannes Berg [Thu, 8 May 2025 12:12:53 +0000 (15:12 +0300)]
wifi: iwlwifi: cfg: remove QuZ/JF special cases

Since JF RF always uses b0 step and QuZ MAC always uses
a0 step for firmware, there's no need for these configs
that just force the steps to those values. Remove them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-3-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: build 9000 series FW filenames dynamically
Johannes Berg [Thu, 8 May 2025 12:12:52 +0000 (15:12 +0300)]
wifi: iwlwifi: build 9000 series FW filenames dynamically

This is more maintainable than the fw_name_pre prefix, and
requires fewer duplicate structs as well. Since only b0 FW
exists, override the MAC/RF steps for these devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250508121306.1277801-2-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: add JF1/JF2 RF for dynamic FW building
Johannes Berg [Tue, 6 May 2025 19:41:02 +0000 (22:41 +0300)]
wifi: iwlwifi: add JF1/JF2 RF for dynamic FW building

This is needed, otherwise we don't know what to do and will
not find the correct firmware.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-16-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: pcie: remove 0x2726 devices
Johannes Berg [Tue, 6 May 2025 19:41:01 +0000 (22:41 +0300)]
wifi: iwlwifi: pcie: remove 0x2726 devices

These are test chips, not available to users, and not even listed
in the PCI IDs table (so the driver won't bind them). There's no
reason to list specific devices with them in the driver.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-15-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: inline HT params
Johannes Berg [Tue, 6 May 2025 19:41:00 +0000 (22:41 +0300)]
wifi: iwlwifi: cfg: inline HT params

With just a handful of values in two bytes, the params are
smaller than the pointer to them. Inline them and save some
space.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-14-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: cfg: remove 6 GHz from ht40_bands
Johannes Berg [Tue, 6 May 2025 19:40:59 +0000 (22:40 +0300)]
wifi: iwlwifi: cfg: remove 6 GHz from ht40_bands

Since there's no HT on 6 GHz, only HE, the HT capabilities
are never initialized, and so the ht40_bands value is never
checked for the 6 GHz band. Remove the misleading value.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-13-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: mld: call thermal exit without wiphy lock held
Benjamin Berg [Tue, 6 May 2025 19:40:58 +0000 (22:40 +0300)]
wifi: iwlwifi: mld: call thermal exit without wiphy lock held

The driver must not hold the wiphy mutex when unregistering the thermal
devices. Do not hold the lock for the call to iwl_mld_thermal_exit and
only do a lock/unlock to cancel the ct_kill_exit_wk work.

The problem is that iwl_mld_tzone_get_temp needs to take the wiphy lock
while the thermal code is holding its own locks already. When
unregistering the device, the reverse would happen as the driver was
calling thermal_cooling_device_unregister with the wiphy mutex already
held.

It is not likely to trigger this deadlock as it can only happen if the
thermal code is polling the temperature while the driver is being
unloaded. However, lockdep reported it so fix it.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-12-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: mld: avoid init-after-queue
Miri Korenblit [Tue, 6 May 2025 19:40:57 +0000 (22:40 +0300)]
wifi: iwlwifi: mld: avoid init-after-queue

rx_omi::finished_work is initialized when the containing link is.
If the worker was queued and then an error happened, we will get to
iwl_mld_init_link from the reconfig and initialize the work after it was
queued.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-11-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: mld: use a radio/system specific power budget
Benjamin Berg [Tue, 6 May 2025 19:40:56 +0000 (22:40 +0300)]
wifi: iwlwifi: mld: use a radio/system specific power budget

Different hardware has a different maximum power consumption and the
BIOS can also define a power limit for the device. Add code to select
an appropriate maximum power budget for the device and configure that
instead of using a hardcoded table.

This removes the old table. It does not work with the variable upper
limit and the there should be no consumer that requires these exact step
values.

This considerably increases the power budget for some devices and can
prevent throttling in high traffic situations.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-10-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: mvm: use a radio/system specific power budget
Benjamin Berg [Tue, 6 May 2025 19:40:55 +0000 (22:40 +0300)]
wifi: iwlwifi: mvm: use a radio/system specific power budget

Different hardware has a different maximum power consumption and the
BIOS can also define a power limit for the device. Add code to select
an appropriate maximum power budget for the device and configure that
instead of using a hardcoded table.

This removes the old table. It does not work with the variable upper
limit and the there should be no consumer that requires these exact step
values.

This considerably increases the power budget for some devices and can
prevent throttling in high traffic situations.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-9-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: fix thermal code compilation with -Werror=cast-qual
Benjamin Berg [Tue, 6 May 2025 19:40:54 +0000 (22:40 +0300)]
wifi: iwlwifi: fix thermal code compilation with -Werror=cast-qual

The compare_temps function in both mvm and mld dropped the const
qualifier in a cast in a way that makes -Werror=cast-qual unhappy. Add
the const to the cast to fix this.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-8-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: pcie: remove iwl_trans_pcie_gen2_send_hcmd
Miri Korenblit [Tue, 6 May 2025 19:40:53 +0000 (22:40 +0300)]
wifi: iwlwifi: pcie: remove iwl_trans_pcie_gen2_send_hcmd

This function is not implemented nor called. Remove its declaration.

Link: https://patch.msgid.link/20250506194102.3407967-7-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: Add support for a new version for link config command
Yedidya Benshimol [Tue, 6 May 2025 19:40:52 +0000 (22:40 +0300)]
wifi: iwlwifi: Add support for a new version for link config command

Add support for a new version of link configuration command
which includes NPCA and high priority TX traffic support for wifi8.

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-6-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: Add a new version for mac config command
Yedidya Benshimol [Tue, 6 May 2025 19:40:51 +0000 (22:40 +0300)]
wifi: iwlwifi: Add a new version for mac config command

Add a new version of mac configuration command
which includes UHR support indication.

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-5-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: Add a new version for sta config command
Yedidya Benshimol [Tue, 6 May 2025 19:40:50 +0000 (22:40 +0300)]
wifi: iwlwifi: Add a new version for sta config command

Add a new version of sta configuration command
which includes these wifi8 features:

1. LDPC X2 CW size support indication
2. Indication if ICF frame is needed instead of RTS
3. support for MIC padding delays for protected control frames

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-4-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: add range response version 10 support
Avraham Stern [Tue, 6 May 2025 19:40:49 +0000 (22:40 +0300)]
wifi: iwlwifi: add range response version 10 support

Range response version 10 removes the rx and tx rates fields.
These fields aren't used by the driver anyway, so no change is
needed to support it.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-3-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowifi: iwlwifi: mld: remove one more error in unallocated BAID
Miri Korenblit [Tue, 6 May 2025 19:40:48 +0000 (22:40 +0300)]
wifi: iwlwifi: mld: remove one more error in unallocated BAID

Since the FW is the one to assign an ID to a BA, it can happen that
the FW sends a bar_frame_release_notif before the driver had the chance to
allocate the BAID.

Convert the IWL_FW_CHECK into a regular debug print.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250506194102.3407967-2-miriam.rachel.korenblit@intel.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
2 months agowireless: purelifi: plfxlc: fix memory leak in plfxlc_usb_wreq_asyn()
Salah Triki [Sun, 27 Apr 2025 09:57:45 +0000 (10:57 +0100)]
wireless: purelifi: plfxlc: fix memory leak in plfxlc_usb_wreq_asyn()

Add usb_free_urb() in the error path to prevent memory leak.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
Link: https://patch.msgid.link/aA3_maPlEJzO7wrL@pc
[fix subject]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: mac80211: Update MCS15 support in link_conf
Mohan Kumar G [Mon, 5 May 2025 15:28:36 +0000 (20:58 +0530)]
wifi: mac80211: Update MCS15 support in link_conf

As per IEEE 802.11be-2024 - 9.4.2.321, EHT operation element
contains MCS15 Disable subfield as the sixth bit, which is set when
MCS15 support is not enabled.

Get MCS15 support from EHT operation params and add it in link_conf
so that driver can use this value to know if EHT-MCS 15 reception
is enabled.

Co-developed-by: Dhanavandhana Kannan <quic_dhanavan1@quicinc.com>
Signed-off-by: Dhanavandhana Kannan <quic_dhanavan1@quicinc.com>
Signed-off-by: Mohan Kumar G <quic_mkumarg@quicinc.com>
Link: https://patch.msgid.link/20250505152836.3266829-1-quic_mkumarg@quicinc.com
[remove pointless !! for bool assignment]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: brcmfmac: Fix structure size for WPA3 external SAE
Ting-Ying Li [Fri, 25 Apr 2025 08:55:19 +0000 (10:55 +0200)]
wifi: brcmfmac: Fix structure size for WPA3 external SAE

Add pmkid parameter in "brcmf_auth_req_status_le" structure to
align the buffer size defined in firmware "wl_auth_req_status"
structure.

Signed-off-by: Ting-Ying Li <tingying.li@infineon.com>
[arend: adapted path to apply to per-vendor variant]
[arend: added kerneldoc for new struct field]
Tested-by: James Prestwood <prestwoj@gmail.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20250425085519.492267-5-arend.vanspriel@broadcom.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: brcmfmac: cyw: support external SAE authentication in station mode
Arend van Spriel [Fri, 25 Apr 2025 08:55:18 +0000 (10:55 +0200)]
wifi: brcmfmac: cyw: support external SAE authentication in station mode

Firmware has SME functionality but would like the userspace to handle
SAE authentication. This patch adds support for such an external SAE
authentication mechanism in station mode.

Signed-off-by: Chung-Hsien Hsu <chung-hsien.hsu@infineon.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@infineon.com>
[arend: rework patch for per-vendor framework]
Tested-by: James Prestwood <prestwoj@gmail.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20250425085519.492267-4-arend.vanspriel@broadcom.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: brcmfmac: make per-vendor event map const
Arend van Spriel [Fri, 25 Apr 2025 08:55:17 +0000 (10:55 +0200)]
wifi: brcmfmac: make per-vendor event map const

The event map is not intended to change so make it const.

Tested-by: James Prestwood <prestwoj@gmail.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20250425085519.492267-3-arend.vanspriel@broadcom.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: brcmfmac: support per-vendor cfg80211 callbacks and firmware events
Arend van Spriel [Fri, 25 Apr 2025 08:55:16 +0000 (10:55 +0200)]
wifi: brcmfmac: support per-vendor cfg80211 callbacks and firmware events

Adding two vendor operations that can be used to provide per-vendor
cfg80211 callbacks and per-vendor handlers for firmware events. These
two are often related to handling interactions from user-space through
nl80211. Exporting brcmf_fweh_register() for registering the per-vendor
event handler callbacks. Some other exports for get event name string
and allowing use of brcmf_dbg() in per-vendor module.

Tested-by: James Prestwood <prestwoj@gmail.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Link: https://patch.msgid.link/20250425085519.492267-2-arend.vanspriel@broadcom.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agowifi: mac80211: do not offer a mesh path if forwarding is disabled
Benjamin Berg [Wed, 30 Apr 2025 19:10:42 +0000 (21:10 +0200)]
wifi: mac80211: do not offer a mesh path if forwarding is disabled

When processing a PREQ the code would always check whether we have a
mesh path locally and reply accordingly. However, when forwarding is
disabled then we should not reply with this information as we will not
forward data packets down that path.

Move the check for dot11MeshForwarding up in the function and skip the
mesh path lookup in that case. In the else block, set forward to false
so that the rest of the function becomes a no-op and the
dot11MeshForwarding check does not need to be duplicated.

This explains an effect observed in the Freifunk community where mesh
forwarding is disabled. In that case a mesh with three STAs and only bad
links in between them, individual STAs would occionally have indirect
mpath entries. This should not have happened.

Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
Reviewed-by: Rouven Czerwinski <rouven@czerwinskis.de>
Link: https://patch.msgid.link/20250430191042.3287004-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 months agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Jakub Kicinski [Thu, 8 May 2025 15:56:12 +0000 (08:56 -0700)]
Merge git://git./linux/kernel/git/netdev/net

Cross-merge networking fixes after downstream PR (net-6.15-rc6).

No conflicts.

Adjacent changes:

net/core/dev.c:
  08e9f2d584c4 ("net: Lock netdevices during dev_shutdown")
  a82dc19db136 ("net: avoid potential race between netdev_get_by_index_lock() and netns switch")

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agoMerge tag 'net-6.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Linus Torvalds [Thu, 8 May 2025 15:33:56 +0000 (08:33 -0700)]
Merge tag 'net-6.15-rc6' of git://git./linux/kernel/git/netdev/net

Pull networking fixes from Paolo Abeni:
 "Including fixes from CAN, WiFi and netfilter.

  We have still a comple of regressions open due to the recent
  drivers locking refactor. The patches are in-flight, but not
  ready yet.

  Current release - regressions:

   - core: lock netdevices during dev_shutdown

   - sch_htb: make htb_deactivate() idempotent

   - eth: virtio-net: don't re-enable refill work too early

  Current release - new code bugs:

   - eth: icssg-prueth: fix kernel panic during concurrent Tx queue
     access

  Previous releases - regressions:

   - gre: fix again IPv6 link-local address generation.

   - eth: b53: fix learning on VLAN unaware bridges

  Previous releases - always broken:

   - wifi: fix out-of-bounds access during multi-link element
     defragmentation

   - can:
       - initialize spin lock on device probe
       - fix order of unregistration calls

   - openvswitch: fix unsafe attribute parsing in output_userspace()

   - eth:
       - virtio-net: fix total qstat values
       - mtk_eth_soc: reset all TX queues on DMA free
       - fbnic: firmware IPC mailbox fixes"

* tag 'net-6.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (55 commits)
  virtio-net: fix total qstat values
  net: export a helper for adding up queue stats
  fbnic: Do not allow mailbox to toggle to ready outside fbnic_mbx_poll_tx_ready
  fbnic: Pull fbnic_fw_xmit_cap_msg use out of interrupt context
  fbnic: Improve responsiveness of fbnic_mbx_poll_tx_ready
  fbnic: Cleanup handling of completions
  fbnic: Actually flush_tx instead of stalling out
  fbnic: Add additional handling of IRQs
  fbnic: Gate AXI read/write enabling on FW mailbox
  fbnic: Fix initialization of mailbox descriptor rings
  net: dsa: b53: do not set learning and unicast/multicast on up
  net: dsa: b53: fix learning on VLAN unaware bridges
  net: dsa: b53: fix toggling vlan_filtering
  net: dsa: b53: do not program vlans when vlan filtering is off
  net: dsa: b53: do not allow to configure VLAN 0
  net: dsa: b53: always rejoin default untagged VLAN on bridge leave
  net: dsa: b53: fix VLAN ID for untagged vlan on bridge leave
  net: dsa: b53: fix flushing old pvid VLAN on pvid change
  net: dsa: b53: fix clearing PVID of a port
  net: dsa: b53: keep CPU port always tagged again
  ...

2 months agoMerge tag 's390-6.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Thu, 8 May 2025 15:29:13 +0000 (08:29 -0700)]
Merge tag 's390-6.15-4' of git://git./linux/kernel/git/s390/linux

Pull s390 fixes from Heiko Carstens:

 - Fix potential use-after-free bug and missing error handling in PCI
   code

 - Fix dcssblk build error

 - Fix last breaking event handling in case of stack corruption to allow
   for better error reporting

 - Update defconfigs

* tag 's390-6.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/pci: Fix duplicate pci_dev_put() in disable_slot() when PF has child VFs
  s390/pci: Fix missing check for zpci_create_device() error return
  s390: Update defconfigs
  s390/dcssblk: Fix build error with CONFIG_DAX=m and CONFIG_DCSSBLK=y
  s390/entry: Fix last breaking event handling in case of stack corruption
  s390/configs: Enable options required for TC flow offload
  s390/configs: Enable VDPA on Nvidia ConnectX-6 network card

2 months agoMerge tag 'v6.15-rc5-ksmbd-server-fixes' of git://git.samba.org/ksmbd
Linus Torvalds [Thu, 8 May 2025 15:22:35 +0000 (08:22 -0700)]
Merge tag 'v6.15-rc5-ksmbd-server-fixes' of git://git.samba.org/ksmbd

Pull smb server fixes from Steve French:

 - Fix UAF closing file table (e.g. in tree disconnect)

 - Fix potential out of bounds write

 - Fix potential memory leak parsing lease state in open

 - Fix oops in rename with empty target

* tag 'v6.15-rc5-ksmbd-server-fixes' of git://git.samba.org/ksmbd:
  ksmbd: Fix UAF in __close_file_table_ids
  ksmbd: prevent out-of-bounds stream writes by validating *pos
  ksmbd: fix memory leak in parse_lease_state()
  ksmbd: prevent rename with empty string

2 months agoMerge branch 'virtio-net-fix-total-qstat-values'
Paolo Abeni [Thu, 8 May 2025 09:56:13 +0000 (11:56 +0200)]
Merge branch 'virtio-net-fix-total-qstat-values'

Jakub Kicinski says:

====================
virtio-net: fix total qstat values

Another small fix discovered after we enabled virtio multi-queue
in netdev CI. The queue stat test fails:

  # Exception| Exception: Qstats are lower, fetched later
  not ok 3 stats.pkt_byte_sum

The queue stats from disabled queues are supposed to be reported
in the "base" stats.
====================

Link: https://patch.msgid.link/20250507003221.823267-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agovirtio-net: fix total qstat values
Jakub Kicinski [Wed, 7 May 2025 00:32:21 +0000 (17:32 -0700)]
virtio-net: fix total qstat values

NIPA tests report that the interface statistics reported
via qstat are lower than those reported via ip link.
Looks like this is because some tests flip the queue
count up and down, and we end up with some of the traffic
accounted on disabled queues.

Add up counters from disabled queues.

Fixes: d888f04c09bb ("virtio-net: support queue stat")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250507003221.823267-3-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agonet: export a helper for adding up queue stats
Jakub Kicinski [Wed, 7 May 2025 00:32:20 +0000 (17:32 -0700)]
net: export a helper for adding up queue stats

Older drivers and drivers with lower queue counts often have a static
array of queues, rather than allocating structs for each queue on demand.
Add a helper for adding up qstats from a queue range. Expectation is
that driver will pass a queue range [netdev->real_num_*x_queues, MAX).
It was tempting to always use num_*x_queues as the end, but virtio
seems to clamp its queue count after allocating the netdev. And this
way we can trivaly reuse the helper for [0, real_..).

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250507003221.823267-2-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agoMerge branch 'fbnic-fw-ipc-mailbox-fixes'
Paolo Abeni [Thu, 8 May 2025 09:33:32 +0000 (11:33 +0200)]
Merge branch 'fbnic-fw-ipc-mailbox-fixes'

Alexander Duyck says:

====================
fbnic: FW IPC Mailbox fixes

This series is meant to address a number of issues that have been found in
the FW IPC mailbox over the past several months.

The main issues addressed are:
1. Resolve a potential race between host and FW during initialization that
can cause the FW to only have the lower 32b of an address.
2. Block the FW from issuing DMA requests after we have closed the mailbox
and before we have started issuing requests on it.
3. Fix races in the IRQ handlers that can cause the IRQ to unmask itself if
it is being processed while we are trying to disable it.
4. Cleanup the Tx flush logic so that we actually lock down the Tx path
before we start flushing it instead of letting it free run while we are
shutting it down.
5. Fix several memory leaks that could occur if we failed initialization.
6. Cleanup the mailbox completion if we are flushing Tx since we are no
longer processing Rx.
7. Move several allocations out of a potential IRQ/atomic context.

There have been a few optimizations we also picked up since then. Rather
than split them out I just folded them into these diffs. They mostly
address minor issues such as how long it takes to initialize and/or fail so
I thought they could probably go in with the rest of the patches. They
consist of:
1. Do not sleep more than 20ms waiting on FW to respond as the 200ms value
likely originated from simulation/emulation testing.
2. Use jiffies to determine timeout instead of sleep * attempts for better
accuracy.

Reviewed-by: Jakub Kicinski <kuba@kernel.org>
====================

Link: https://patch.msgid.link/174654659243.499179.11194817277075480209.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agofbnic: Do not allow mailbox to toggle to ready outside fbnic_mbx_poll_tx_ready
Alexander Duyck [Tue, 6 May 2025 16:00:25 +0000 (09:00 -0700)]
fbnic: Do not allow mailbox to toggle to ready outside fbnic_mbx_poll_tx_ready

We had originally thought to have the mailbox go to ready in the background
while we were doing other things. One issue with this though is that we
can't disable it by clearing the ready state without also blocking
interrupts or calls to mbx_poll as it will just pop back to life during an
interrupt.

In order to prevent that from happening we can pull the code for toggling
to ready out of the interrupt path and instead place it in the
fbnic_mbx_poll_tx_ready path so that it becomes the only spot where the
Rx/Tx can toggle to the ready state. By doing this we can prevent races
where we disable the DMA and/or free buffers only to have an interrupt fire
and undo what we have done.

Fixes: da3cde08209e ("eth: fbnic: Add FW communication mechanism")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/174654722518.499179.11612865740376848478.stgit@ahduyck-xeon-server.home.arpa
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agofbnic: Pull fbnic_fw_xmit_cap_msg use out of interrupt context
Alexander Duyck [Tue, 6 May 2025 16:00:18 +0000 (09:00 -0700)]
fbnic: Pull fbnic_fw_xmit_cap_msg use out of interrupt context

This change pulls the call to fbnic_fw_xmit_cap_msg out of
fbnic_mbx_init_desc_ring and instead places it in the polling function for
getting the Tx ready. Doing that we can avoid the potential issue with an
interrupt coming in later from the firmware that causes it to get fired in
interrupt context.

Fixes: 20d2e88cc746 ("eth: fbnic: Add initial messaging to notify FW of our presence")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/174654721876.499179.9839651602256668493.stgit@ahduyck-xeon-server.home.arpa
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agofbnic: Improve responsiveness of fbnic_mbx_poll_tx_ready
Alexander Duyck [Tue, 6 May 2025 16:00:12 +0000 (09:00 -0700)]
fbnic: Improve responsiveness of fbnic_mbx_poll_tx_ready

There were a couple different issues found in fbnic_mbx_poll_tx_ready.
Among them were the fact that we were sleeping much longer than we actually
needed to as the actual FW could respond in under 20ms. The other issue was
that we would just keep polling the mailbox even if the device itself had
gone away.

To address the responsiveness issues we can decrease the sleeps to 20ms and
use a jiffies based timeout value rather than just counting the number of
times we slept and then polled.

To address the hardware going away we can move the check for the firmware
BAR being present from where it was and place it inside the loop after the
mailbox descriptor ring is initialized and before we sleep so that we just
abort and return an error if the device went away during initialization.

With these two changes we see a significant improvement in boot times for
the driver.

Fixes: da3cde08209e ("eth: fbnic: Add FW communication mechanism")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/174654721224.499179.2698616208976624755.stgit@ahduyck-xeon-server.home.arpa
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agofbnic: Cleanup handling of completions
Alexander Duyck [Tue, 6 May 2025 16:00:05 +0000 (09:00 -0700)]
fbnic: Cleanup handling of completions

There was an issue in that if we were to shutdown we could be left with
a completion in flight as the mailbox went away. To address that I have
added an fbnic_mbx_evict_all_cmpl function that is meant to essentially
create a "broken pipe" type response so that all callers will receive an
error indicating that the connection has been broken as a result of us
shutting down the mailbox.

Fixes: 378e5cc1c6c6 ("eth: fbnic: hwmon: Add completion infrastructure for firmware requests")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/174654720578.499179.380252598204530873.stgit@ahduyck-xeon-server.home.arpa
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agofbnic: Actually flush_tx instead of stalling out
Alexander Duyck [Tue, 6 May 2025 15:59:59 +0000 (08:59 -0700)]
fbnic: Actually flush_tx instead of stalling out

The fbnic_mbx_flush_tx function had a number of issues.

First, we were waiting 200ms for the firmware to process the packets. We
can drop this to 20ms and in almost all cases this should be more than
enough time. So by changing this we can significantly reduce shutdown time.

Second, we were not making sure that the Tx path was actually shut off. As
such we could still have packets added while we were flushing the mailbox.
To prevent that we can now clear the ready flag for the Tx side and it
should stay down since the interrupt is disabled.

Third, we kept re-reading the tail due to the second issue. The tail should
not move after we have started the flush so we can just read it once while
we are holding the mailbox Tx lock. By doing that we are guaranteed that
the value should be consistent.

Fourth, we were keeping a count of descriptors cleaned due to the second
and third issues called out. That count is not a valid reason to be exiting
the cleanup, and with the tail only being read once we shouldn't see any
cases where the tail moves after the disable so the tracking of count can
be dropped.

Fifth, we were using attempts * sleep time to determine how long we would
wait in our polling loop to flush out the Tx. This can be very imprecise.
In order to tighten up the timing we are shifting over to using a jiffies
value of jiffies + 10 * HZ + 1 to determine the jiffies value we should
stop polling at as this should be accurate within once sleep cycle for the
total amount of time spent polling.

Fixes: da3cde08209e ("eth: fbnic: Add FW communication mechanism")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/174654719929.499179.16406653096197423749.stgit@ahduyck-xeon-server.home.arpa
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agofbnic: Add additional handling of IRQs
Alexander Duyck [Tue, 6 May 2025 15:59:52 +0000 (08:59 -0700)]
fbnic: Add additional handling of IRQs

We have two issues that need to be addressed in our IRQ handling.

One is the fact that we can end up double-freeing IRQs in the event of an
exception handling error such as a PCIe reset/recovery that fails. To
prevent that from becoming an issue we can use the msix_vector values to
indicate that we have successfully requested/freed the IRQ by only setting
or clearing them when we have completed the given action.

The other issue is that we have several potential races in our IRQ path due
to us manipulating the mask before the vector has been truly disabled. In
order to handle that in the case of the FW mailbox we need to not
auto-enable the IRQ and instead will be enabling/disabling it separately.
In the case of the PCS vector we can mitigate this by unmapping it and
synchronizing the IRQ before we clear the mask.

The general order of operations after this change is now to request the
interrupt, poll the FW mailbox to ready, and then enable the interrupt. For
the shutdown we do the reverse where we disable the interrupt, flush any
pending Tx, and then free the IRQ. I am renaming the enable/disable to
request/free to be equivilent with the IRQ calls being used. We may see
additions in the future to enable/disable the IRQs versus request/free them
for certain use cases.

Fixes: da3cde08209e ("eth: fbnic: Add FW communication mechanism")
Fixes: 69684376eed5 ("eth: fbnic: Add link detection")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/174654719271.499179.3634535105127848325.stgit@ahduyck-xeon-server.home.arpa
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agofbnic: Gate AXI read/write enabling on FW mailbox
Alexander Duyck [Tue, 6 May 2025 15:59:46 +0000 (08:59 -0700)]
fbnic: Gate AXI read/write enabling on FW mailbox

In order to prevent the device from throwing spurious writes and/or reads
at us we need to gate the AXI fabric interface to the PCIe until such time
as we know the FW is in a known good state.

To accomplish this we use the mailbox as a mechanism for us to recognize
that the FW has acknowledged our presence and is no longer sending any
stale message data to us.

We start in fbnic_mbx_init by calling fbnic_mbx_reset_desc_ring function,
disabling the DMA in both directions, and then invalidating all the
descriptors in each ring.

We then poll the mailbox in fbnic_mbx_poll_tx_ready and when the interrupt
is set by the FW we pick it up and mark the mailboxes as ready, while also
enabling the DMA.

Once we have completed all the transactions and need to shut down we call
into fbnic_mbx_clean which will in turn call fbnic_mbx_reset_desc_ring for
each ring and shut down the DMA and once again invalidate the descriptors.

Fixes: 3646153161f1 ("eth: fbnic: Add register init to set PCIe/Ethernet device config")
Fixes: da3cde08209e ("eth: fbnic: Add FW communication mechanism")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/174654718623.499179.7445197308109347982.stgit@ahduyck-xeon-server.home.arpa
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agofbnic: Fix initialization of mailbox descriptor rings
Alexander Duyck [Tue, 6 May 2025 15:59:39 +0000 (08:59 -0700)]
fbnic: Fix initialization of mailbox descriptor rings

Address to issues with the FW mailbox descriptor initialization.

We need to reverse the order of accesses when we invalidate an entry versus
writing an entry. When writing an entry we write upper and then lower as
the lower 32b contain the valid bit that makes the entire address valid.
However for invalidation we should write it in the reverse order so that
the upper is marked invalid before we update it.

Without this change we may see FW attempt to access pages with the upper
32b of the address set to 0 which will likely result in DMAR faults due to
write access failures on mailbox shutdown.

Fixes: da3cde08209e ("eth: fbnic: Add FW communication mechanism")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/174654717972.499179.8083789731819297034.stgit@ahduyck-xeon-server.home.arpa
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 months agoMerge branch 'net-dsa-b53-accumulated-fixes'
Jakub Kicinski [Thu, 8 May 2025 02:30:37 +0000 (19:30 -0700)]
Merge branch 'net-dsa-b53-accumulated-fixes'

Jonas Gorski says:

====================
net: dsa: b53: accumulated fixes

This patchset aims at fixing most issues observed while running the
vlan_unaware_bridge, vlan_aware_bridge and local_termination selftests.

Most tests succeed with these patches on BCM53115, connected to a
BCM6368.

It took me a while to figure out that a lot of tests will fail if all
ports have the same MAC address, as the switches drop any frames with
DA == SA. Luckily BCM63XX boards often have enough MACs allocated for
all ports, so I just needed to assign them.

The still failing tests are:

FDB learning, both vlan aware aware and unaware:

This is expected, as b53 currently does not implement changing the
ageing time, and both the bridge code and DSA ignore that, so the
learned entries don't age out as expected.

ping and ping6 in vlan unaware:

These fail because of the now fixed learning, the switch trying to
forward packet ingressing on one of the standalone ports to the learned
port of the mac address when the packets ingressed on the bridged port.

The port VLAN masks only prevent forwarding to other ports, but the ARL
lookup will still happen, and the packet gets dropped because the port
isn't allowed to forward there.

I have a fix/workaround for that, but as it is a bit more controversial
and makes use of an unrelated feature, I decided to hold off from that
and post it later.

This wasn't noticed so far, because learning was never working in VLAN
unaware mode, so the traffic was always broadcast (which sidesteps the
issue).

Finally some of the multicast tests from local_termination fail, where
the reception worked except it shouldn't. This doesn't seem to me as a
super serious issue, so I didn't attempt to debug/fix these yet.

I'm not super confident I didn't break sf2 along the way, but I did
compile test and tried to find ways it cause issues (I failed to find
any). I hope Florian will tell me.
====================

Link: https://patch.msgid.link/20250429201710.330937-1-jonas.gorski@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 months agonet: dsa: b53: do not set learning and unicast/multicast on up
Jonas Gorski [Tue, 29 Apr 2025 20:17:10 +0000 (22:17 +0200)]
net: dsa: b53: do not set learning and unicast/multicast on up

When a port gets set up, b53 disables learning and enables the port for
flooding. This can undo any bridge configuration on the port.

E.g. the following flow would disable learning on a port:

$ ip link add br0 type bridge
$ ip link set sw1p1 master br0 <- enables learning for sw1p1
$ ip link set br0 up
$ ip link set sw1p1 up <- disables learning again

Fix this by populating dsa_switch_ops::port_setup(), and set up initial
config there.

Fixes: f9b3827ee66c ("net: dsa: b53: Support setting learning on port")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20250429201710.330937-12-jonas.gorski@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>