]> Git Repo - linux.git/log
linux.git
9 months agowifi: iwlwifi: mvm: add mvm-specific guard
Johannes Berg [Sun, 12 May 2024 12:24:58 +0000 (15:24 +0300)]
wifi: iwlwifi: mvm: add mvm-specific guard

Add and use an mvm-specific guard for the mvm mutex.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512152312.7391425b3af2.I1b109f56753dd3f35602dd2c5cf6e1e35aee313d@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: simplify TX tracing
Johannes Berg [Sun, 12 May 2024 12:24:57 +0000 (15:24 +0300)]
wifi: iwlwifi: simplify TX tracing

There's no need to calculate again whether data should
be included or be handled externally, just check if any
space for it was already reserved.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512152312.a3d3b4796460.I85bd3029baee24ebf0be04db7d6bf01834090869@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: tracing: fix condition to allocate buf1
Johannes Berg [Sun, 12 May 2024 12:24:56 +0000 (15:24 +0300)]
wifi: iwlwifi: tracing: fix condition to allocate buf1

There's no need to allocate buf1 if we're not going to
write anything to it, and the condition for writing is
(correctly) "hdr_len > 0 && !iwl_trace_data()". Also
allocate the event space only under the same condition.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512152312.a11e6490d053.Ie090beea70d2f271bb22c9b0e287dbd342fb2a96@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: leave a print in the logs when we call fw_nmi()
Emmanuel Grumbach [Sun, 12 May 2024 04:58:57 +0000 (07:58 +0300)]
wifi: iwlwifi: mvm: leave a print in the logs when we call fw_nmi()

When we crash the firmware, we need to know why we decided to do so.
Almost all the callsites of iwl_force_nmi() print something in the logs
that explain why the driver decided to crash the firmware.
Debugfs doesn't print anything and it is then hard to understand why the
firmware has crashed.
Add a simple print in the debugfs hook to ease the debug.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512075822.e2558de222dc.Idd81777c47264e6f557b086625895c1dc2f667f3@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: disable dynamic EMLSR when AUTO_EML is false
Miri Korenblit [Sun, 12 May 2024 04:31:10 +0000 (07:31 +0300)]
wifi: iwlwifi: mvm: disable dynamic EMLSR when AUTO_EML is false

When AUTO_EML is set to false, this change ignores the exit criteria,
for testing purposes. Currently, if AUTO_EML is disabled, the
driver will not select a link or enter EMLSR, but will still exit if one
of the criteria is not fulfilled.

Signed-off-by: Miri Korenblit <[email protected]>
Reviewed-by: Johannes Berg <[email protected]>
Link: https://msgid.link/20240512072733.10a0b5da6ec2.I46fd578a3ef6cdbf14fdc4dfa97b4be008fe68e3@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: use vif P2P type helper
Benjamin Berg [Sun, 12 May 2024 04:31:08 +0000 (07:31 +0300)]
wifi: iwlwifi: mvm: use vif P2P type helper

Use ieee80211_vif_type_p2p instead of checking for IFTYPE_AP in
combination with vif->p2p.

Signed-off-by: Benjamin Berg <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.15a00a812c1b.I5ffee795d960c9beda46a934f5b4c70acde112f9@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: don't track used links separately
Johannes Berg [Sun, 12 May 2024 04:31:07 +0000 (07:31 +0300)]
wifi: iwlwifi: mvm: don't track used links separately

We track which link is using which FW link ID, so there
really isn't a need to separately track which link IDs
are in use. Remove that code and check the table when
looking for a new link ID to use.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.1a67d8af815f.Ie642c12dce3ab55c688abd9a25918569e83e558a@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: always print the firmware version in hex
Emmanuel Grumbach [Sun, 12 May 2024 04:31:05 +0000 (07:31 +0300)]
wifi: iwlwifi: always print the firmware version in hex

All our firmware versions should now be printed in hex.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Reviewed-by: Johannes Berg <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.cae4c562b2c3.I5043383bd0e81f872c55046afd2c6560f482c8e0@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: fw: avoid bad FW config on RXQ DMA failure
Johannes Berg [Sun, 12 May 2024 04:31:03 +0000 (07:31 +0300)]
wifi: iwlwifi: fw: avoid bad FW config on RXQ DMA failure

In practice, iwl_trans_get_rxq_dma_data() will not fail,
it only can do that if called with the wrong arguments.
But it does have an error value and doesn't initialize
the argument when it fails, so don't use the value then.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.faf3a1b87589.I77c950173cb914676fbd28483e5ef420bb9f1bc9@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: fw: api: Add new timepoint for scan failure
Mukesh Sisodiya [Sun, 12 May 2024 04:31:01 +0000 (07:31 +0300)]
wifi: iwlwifi: fw: api: Add new timepoint for scan failure

Add new time point to get the details of scan failure
While on it added other missing enum to match with FW.

Signed-off-by: Mukesh Sisodiya <[email protected]>
Reviewed-by: Pagadala Yesu Anjaneyulu <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.6781e76990c4.Iadfb3f6dd63a98fc35019772266b5ebddc5b5270@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mei: unify iwl_mei_set_power_limit() prototype
Johannes Berg [Sun, 12 May 2024 04:31:00 +0000 (07:31 +0300)]
wifi: iwlwifi: mei: unify iwl_mei_set_power_limit() prototype

The two versions of iwl_mei_set_power_limit() are a bit different,
and while really the const isn't all that necessary on the inline,
it's still better to have it be the same.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.854427753c92.I557716085cb1f6a35d1f97640388fa421f42a56a@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: mark bad no-data RX as having bad PLCP
Johannes Berg [Sun, 12 May 2024 04:30:59 +0000 (07:30 +0300)]
wifi: iwlwifi: mvm: mark bad no-data RX as having bad PLCP

Just like with any other frame, mac80211 will do sanity checks
on no-data RX (representing e.g. sounding PPDUs), and if e.g.
the NSS is wrong, it will warn. This isn't a good idea if we
already know the frame wasn't received well, e.g. has bad PLCP.
Unless the firmware reports "no error", set the bad PLCP flag
to skip checks in mac80211.

Also, since we're now extracting two different values from the
info field, use le32_get_bits() for both.

Signed-off-by: Johannes Berg <[email protected]>
Reviewed-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.e6adcb9a6ece.Ic14c2e8ed5e80d48af78b2f04e9f08beeb62d68e@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: bump FW API to 91 for BZ/SC devices
Miri Korenblit [Sun, 12 May 2024 04:30:58 +0000 (07:30 +0300)]
wifi: iwlwifi: bump FW API to 91 for BZ/SC devices

Start supporting API version 91 for new devices.

Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.27c00099e8b7.I99b4f24bba073414dd04a6e04a359c7fbba52990@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: add a of print of a few commands
Miri Korenblit [Sun, 12 May 2024 04:30:57 +0000 (07:30 +0300)]
wifi: iwlwifi: mvm: add a of print of a few commands

This is needed for debugging.

Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.65fc46e2ffbc.I19d4ef2cc06bfee7d9644a376d39399f0f6eaa15@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: Use the SMPS cfg of the correct link
Miri Korenblit [Sun, 12 May 2024 04:30:56 +0000 (07:30 +0300)]
wifi: iwlwifi: mvm: Use the SMPS cfg of the correct link

The exiting code is checking the SMPS mode of deflink.
Use the SMPS mode of the link_sta function parameter.

Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.f3e2834e78f5.Ie24b431a6ad0dbf977afbbd4d2116bfe2426a0d5@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: don't always set antenna in beacon template cmd
Miri Korenblit [Sun, 12 May 2024 04:30:55 +0000 (07:30 +0300)]
wifi: iwlwifi: mvm: don't always set antenna in beacon template cmd

This needs to be set only if the FW is not capable of selecting an
antenna on its own.

Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240512072733.73d790911268.I158dc1dbc9c2e199c69d8213e5496d2de72da28b@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: remove redundant reading from NVM file
Chaya Rachel Ivgi [Fri, 10 May 2024 14:06:41 +0000 (17:06 +0300)]
wifi: iwlwifi: remove redundant reading from NVM file

The driver reads xtal_calib from NVM file, but actually never uses it.
This is only used in dvm driver.

Signed-off-by: Chaya Rachel Ivgi <[email protected]>
Reviewed-by: Luciano Coelho <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240510170500.c4d1a4571049.I7d7b73dccb793e220f023e0d049b082b043ca95e@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: remove fw_running op
Shahar S Matityahu [Fri, 10 May 2024 14:06:40 +0000 (17:06 +0300)]
wifi: iwlwifi: remove fw_running op

fw_running assumes that memory can be retrieved only after alive.
This assumption is no longer true as we support dump before alive.
To avoid invalid access to the NIC, check that STATUS_DEVICE_ENABLED
bit in trans status is set before dumping instead of the prior check.

Signed-off-by: Shahar S Matityahu <[email protected]>
Reviewed-by: Luciano Coelho <[email protected]>
Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240510170500.ca07138cedeb.I090e31d3eaeb4ba19f5f84aba997ccd36927e9ac@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: Don't set NO_HT40+/- flags on 6 GHz band
Andrei Otcheretianski [Fri, 10 May 2024 14:06:38 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: Don't set NO_HT40+/- flags on 6 GHz band

These flags are not needed on 6 GHz channels, and anyway they were set
incorrectly.
This in turn resulted in alternating channel flags, preventing reg domain
rules to be merged together, so cfg80211 couldn't even send them to the
user space, as the regulatory domain was too large.
Fix it.

Signed-off-by: Andrei Otcheretianski <[email protected]>
Reviewed-by: Luciano Coelho <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240510170500.b0d51b2229f8.I092e21cde43320ffc2eff17f5748ff9c87c87fcf@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: call ieee80211_sta_recalc_aggregates on A-MSDU size update
Miri Korenblit [Fri, 10 May 2024 14:06:37 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: call ieee80211_sta_recalc_aggregates on A-MSDU size update

The driver needs to call this function when the A-MSDU size changes.

Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240510170500.632ee6612a79.Ice3a536a4cbfe60d0edfa231fcb79ee7ab9495dd@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: set A-MSDU size on the correct link
Miri Korenblit [Fri, 10 May 2024 14:06:36 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: set A-MSDU size on the correct link

The existing code sets the max A-MSDU size to the deflink, set it
on the given link instead.

Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240510170500.4de5c1a031ca.I063bc1508e5068b32e321b0f268bc51dba0c0747@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: define link_sta in the relevant scope
Miri Korenblit [Fri, 10 May 2024 14:06:34 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: define link_sta in the relevant scope

The link_sta pointer is now only used inside this if, so define it inside
its scope.

Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240510170500.e0a1dd285d9a.Id5ff16fb98af0c5f533aed6b5ec3cc856401e488@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: debugfs: add entry for setting maximum TXOP time
Avraham Stern [Fri, 10 May 2024 14:06:32 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: debugfs: add entry for setting maximum TXOP time

Add an entry for setting the maximum TXOP time in microseconds.
The configured value can be read from the same entry.

Signed-off-by: Avraham Stern <[email protected]>
Reviewed-by: Gregory Greenman <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240510170500.b8d17a9c1731.I57c33574a61edd68bd0ec1aa7009f31111fd7efe@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: allow UAPSD when in SCM
Avraham Stern [Fri, 10 May 2024 14:06:31 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: allow UAPSD when in SCM

Allow UAPSD when P2P and BSS interfaces share the same channel.

Signed-off-by: Avraham Stern <[email protected]>
Reviewed-by: Luciano Coelho <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240510170500.1ec19d432497.Id6de5337c878fa70e85bfcf6f4e0e34ce60756fb@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: mvm: simplify the uAPSD coexistence limitation code
Emmanuel Grumbach [Fri, 10 May 2024 14:06:30 +0000 (17:06 +0300)]
wifi: iwlwifi: mvm: simplify the uAPSD coexistence limitation code

uAPSD can't be enabled on BSS or P2P Client if there is
another active interface (e.g. associated client). Allow
the code that apply those limitations to run on BSS as well.
Also forbid uAPSD if we have an IBSS or NAN interface in
the system.
Since we are now forbidding uAPSD in any concurrency
scenario, we don't need to check the number of PHY
contexts.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Miri Korenblit <[email protected]>
Link: https://msgid.link/20240510170500.4ac26534adf7.Ib892020177e86603b2be3a105f8717b9a15951d3@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: iwlwifi: dvm: clean up rs_get_rate() logic
Johannes Berg [Fri, 10 May 2024 14:06:28 +0000 (17:06 +0300)]
wifi: iwlwifi: dvm: clean up rs_get_rate() logic

The logic here is rather convoluted - we cannot get here with
lq_sta being NULL as mac80211 will (no longer) call us like
that, and since I removed the rate_control_send_low() call in
this function there's no longer any point in setting priv_sta
to NULL either.

So the only thing that remains to check is if we have actually
initialized our lq_sta->drv pointer, and exit if we didn't in
which case we'll use the data mac80211 already set up for the
low rate usage.

Reviewed-by: Luciano Coelho <[email protected]>
Link: https://msgid.link/20240510170500.a4cdb41825eb.Id202bcc967c32829f70ab1412f8893b6eb7f78e2@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: mac80211: track changes in AP's TPE
Johannes Berg [Mon, 6 May 2024 19:37:57 +0000 (21:37 +0200)]
wifi: mac80211: track changes in AP's TPE

If the TPE (transmit power envelope) is changed, detect and
report that to the driver.

Reviewed-by: Miriam Rachel Korenblit <[email protected]>
Link: https://msgid.link/20240506214536.103dda923f45.I990877e409ab8eade9ed7c172272e0cae57256cf@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: mac80211: pass parsed TPE data to drivers
Johannes Berg [Mon, 6 May 2024 19:37:56 +0000 (21:37 +0200)]
wifi: mac80211: pass parsed TPE data to drivers

Instead of passing the full TPE elements, in all their glory
and mixed up data formats for HE backward compatibility, parse
them fully into the right values, and pass that to the drivers.

Also introduce proper validation already in mac80211, so that
drivers don't need to do it, and parse the EHT portions.

The code now passes the values in the right order according to
the channel used by an interface, which could also be a subset
of the data advertised by the AP, if we couldn't connect with
the full bandwidth (for whatever reason.)

Also add kunit tests for the more complicated bits of it.

Reviewed-by: Miriam Rachel Korenblit <[email protected]>
Acked-by: Kalle Valo <[email protected]>
Link: https://msgid.link/20240506214536.2aa839969b60.I265b28209e0b29772b2f125f7f83de44a4da877b@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: ath11k: fix TPE power levels
Johannes Berg [Mon, 6 May 2024 19:37:55 +0000 (21:37 +0200)]
wifi: ath11k: fix TPE power levels

The chanctx can be shared, but it seems like the TPE values for
this vif should only reflect the channel that the vif uses, which
is captured in bss_conf->chanreq.oper rather than the chanctx.
Use that when calculating defaults, a similar issue is where the
data from the AP is processed, but I'm moving that to mac80211.

Acked-by: Kalle Valo <[email protected]>
Link: https://msgid.link/20240506214536.d99fcf5856b9.I359bb401ea74bf82dc981a86a7ca3fa44d169d2e@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: ieee80211/ath11k: remove IEEE80211_MAX_NUM_PWR_LEVEL
Johannes Berg [Mon, 6 May 2024 19:37:54 +0000 (21:37 +0200)]
wifi: ieee80211/ath11k: remove IEEE80211_MAX_NUM_PWR_LEVEL

The define IEEE80211_MAX_NUM_PWR_LEVEL doesn't make much
sense. Yes, that table has a maximum value of 8, and the
table will actually remain that way, but EHT introduced
a way to encode more levels for 320 MHz channels.

Remove IEEE80211_MAX_NUM_PWR_LEVEL and, for ath11k being
the only user, add ATH11K_NUM_PWR_LEVELS, where it makes
sense since it cannot support 320 MHz channels.

Acked-by: Kalle Valo <[email protected]>
Link: https://msgid.link/20240506214536.9818e5471055.Icece7e47e963d6b68e0d97ba13c102b37fbaa689@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: mac80211: update 6 GHz AP power type before association
Mukesh Sisodiya [Mon, 6 May 2024 19:37:53 +0000 (21:37 +0200)]
wifi: mac80211: update 6 GHz AP power type before association

6 GHz AP power type details are required to set proper tx power
used to send frames.

Update AP power type received in beacon while preparing
for connection instead of after association so the frames
before association can use the correct tx power.

Reviewed-by: Miriam Rachel Korenblit <[email protected]>
Reviewed-by: Johannes Berg <[email protected]>
Signed-off-by: Mukesh Sisodiya <[email protected]>
Link: https://msgid.link/20240506214536.310434f55f76.I6aca291ee06265e3f63e0f9024ba19a850b53a33@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: mac80211: remove extra link STA functions
Johannes Berg [Mon, 6 May 2024 19:19:34 +0000 (21:19 +0200)]
wifi: mac80211: remove extra link STA functions

There's no need to have a lockdep assert and then call
another function, just move everything into one place.

Reviewed-by: Miriam Rachel Korenblit <[email protected]>
Link: https://msgid.link/20240506211934.9759564a25f4.I88d43aa459d15c1d6230152e76b7757c2cdd6085@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: mac80211: remove outdated comments
Johannes Berg [Mon, 6 May 2024 19:14:22 +0000 (21:14 +0200)]
wifi: mac80211: remove outdated comments

These comments are no longer correct, it's a wiphy work now
so it will go away immediately when canceled.

Reviewed-by: Miriam Rachel Korenblit <[email protected]>
Link: https://msgid.link/20240506211422.68bc10efbd8a.If80f43f4c8b9db1f5266f70d93a805f8c7463fe2@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: cfg80211: add tracing for wiphy work
Johannes Berg [Mon, 6 May 2024 19:00:03 +0000 (21:00 +0200)]
wifi: cfg80211: add tracing for wiphy work

Add trace events to trace when wiphy works are queued (or
delayed ones scheduled), and other APIs are called. Also
add an event when the worker starts, before acquiring the
mutex, to be able to see potential delays due to locking.

Reviewed-by: Miriam Rachel Korenblit <[email protected]>
Reviewed-by: Benjamin Berg <[email protected]>
Link: https://msgid.link/20240506210002.bf1840a1d22d.I4abba048c1c4017345640219cf1384a0b2288dd3@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: cfg80211: sort trace events again
Johannes Berg [Mon, 6 May 2024 19:00:02 +0000 (21:00 +0200)]
wifi: cfg80211: sort trace events again

They were meant to be split into ops and APIs, but some
ops were added in the wrong place. Fix that.

Reviewed-by: Miriam Rachel Korenblit <[email protected]>
Link: https://msgid.link/20240506210002.0b3a86a5d8d7.I5591c03223bdb95597e181de63a2eded424de34c@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: nl80211: disallow setting special AP channel widths
Johannes Berg [Wed, 15 May 2024 12:16:00 +0000 (14:16 +0200)]
wifi: nl80211: disallow setting special AP channel widths

Setting the AP channel width is meant for use with the normal
20/40/... MHz channel width progression, and switching around
in S1G or narrow channels isn't supported. Disallow that.

Reported-by: [email protected]
Link: https://msgid.link/20240515141600.d4a9590bfe32.I19a32d60097e81b527eafe6b0924f6c5fbb2dc45@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: ieee80211: document two FTM related functions
Johannes Berg [Wed, 15 May 2024 07:38:40 +0000 (09:38 +0200)]
wifi: ieee80211: document two FTM related functions

Add some documentation to ieee80211_is_timing_measurement()
and ieee80211_is_ftm().

Link: https://msgid.link/20240515093852.229aa69e972c.Ifae6762a698e79cd5a49a055fe4c32330e826200@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: ieee80211: document function return values
Johannes Berg [Wed, 15 May 2024 07:38:39 +0000 (09:38 +0200)]
wifi: ieee80211: document function return values

These are all missing, as pointed out when running kernel-doc.
Add return value documentation and fix some small things while
at it.

Link: https://msgid.link/20240515093852.1cd5ad8f354d.Idc16e9767fa42de80b659c32efc58aea38c26996@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: ieee80211: remove ieee80211_next_tbtt_present()
Johannes Berg [Wed, 15 May 2024 07:38:38 +0000 (09:38 +0200)]
wifi: ieee80211: remove ieee80211_next_tbtt_present()

This is actually completely equivalent to the other function
ieee80211_is_s1g_short_beacon(), but open-codes the logic.
Implement the necessary logic in ieee80211_is_s1g_short_beacon()
and remove ieee80211_next_tbtt_present().

Link: https://msgid.link/20240515093852.774ced74dea8.I152525b4cff6e6a25be6c48fe6a4b89f17bab8a9@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: radiotap: document ieee80211_get_radiotap_len() return value
Johannes Berg [Wed, 15 May 2024 07:38:37 +0000 (09:38 +0200)]
wifi: radiotap: document ieee80211_get_radiotap_len() return value

Document the return value of ieee80211_get_radiotap_len() in
the proper kernel-doc format.

Link: https://msgid.link/20240515093852.143aadfdb094.I8795ec1e8cfd7106d58325fb514bae92625fb45c@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: ieee80211: add missing doc short descriptions
Johannes Berg [Wed, 15 May 2024 07:38:36 +0000 (09:38 +0200)]
wifi: ieee80211: add missing doc short descriptions

Some structures erroneously don't have a short description,
add the missing descriptions.

Link: https://msgid.link/20240515093852.16f4355e918e.I940276a4fb006ada68ab1a3e6077e3229fff0f14@changeid
Signed-off-by: Johannes Berg <[email protected]>
9 months agowifi: regulatory: remove extra documentation
Johannes Berg [Wed, 15 May 2024 07:38:35 +0000 (09:38 +0200)]
wifi: regulatory: remove extra documentation

The struct member country_ie_checksum doesn't exist, so
don't document it.

Link: https://msgid.link/20240515093852.ebcc9673558b.Ie0b58c1249c6375c60859fa6474d7cdd8862b065@changeid
Signed-off-by: Johannes Berg <[email protected]>
10 months agowifi: rt2x00: remove unused delayed work data from link description
Dmitry Antipov [Wed, 15 May 2024 15:28:24 +0000 (18:28 +0300)]
wifi: rt2x00: remove unused delayed work data from link description

Remove unused 'agc_work' and 'vco_work' members of 'struct link'.
This follows commit d96324703ffa ("rt2x00: merge agc and vco works
with link tuner") where AGC and VCO calibration code was completely
redesigned. Compile tested only.

Signed-off-by: Dmitry Antipov <[email protected]>
Acked-by: Stanislaw Gruszka <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agowifi: mwifiex: Fix interface type change
Rafael Beims [Fri, 10 May 2024 11:04:58 +0000 (13:04 +0200)]
wifi: mwifiex: Fix interface type change

When changing the interface type we also need to update the bss_num, the
driver private data is searched based on a unique (bss_type, bss_num)
tuple, therefore every time bss_type changes, bss_num must also change.

This fixes for example an issue in which, after the mode changed, a
wireless scan on the changed interface would not finish, leading to
repeated -EBUSY messages to userspace when other scan requests were
sent.

Fixes: c606008b7062 ("mwifiex: Properly initialize private structure on interface type changes")
Cc: [email protected]
Signed-off-by: Rafael Beims <[email protected]>
Signed-off-by: Francesco Dolcini <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agowifi: wilc1000: read MAC address from fuse at probe
Ajay Singh [Tue, 14 May 2024 15:51:24 +0000 (17:51 +0200)]
wifi: wilc1000: read MAC address from fuse at probe

The default netdev interface exposed by WILC1000 is registered at probe,
but the chip mac address is not known until ndo_open, which will load and
start chip firmware and then retrieve stored MAC address from it. As a
consequence, the interface has uninitialized value (00:00:00:00:00) until a
user brings up the interface.

Fix MAC address at probe by setting the following steps:
- at probe, read MAC address directly from fuse
- whenever a new netdevice is created, apply saved mac address (which can
  be a user-provided address, or the eFuse Mac address if no address has
  been passed by user)
- whenever an interface is brought up for the first time (and so the
  firmware is loaded and started), enforce netdevice mac address to the
  chip (in case user has changed it)

Reported-by: Heiko Thiery <[email protected]>
Closes: https://lore.kernel.org/netdev/CAEyMn7aV-B4OEhHR4Ad0LM3sKCz1-nDqSb9uZNmRWR-hMZ=z+A@mail.gmail.com/T/
Signed-off-by: Ajay Singh <[email protected]>
Co-developed-by: Alexis Lothoré <[email protected]>
Signed-off-by: Alexis Lothoré <[email protected]>
Tested-by: Heiko Thiery <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agowifi: wilc1000: make sdio deinit function really deinit the sdio card
Alexis Lothoré [Tue, 14 May 2024 15:51:23 +0000 (17:51 +0200)]
wifi: wilc1000: make sdio deinit function really deinit the sdio card

In order to be able to read raw registers (eg the nv mac address) in
wilc1000 during probe before the firmware is loaded and running, we need to
run the basic sdio functions initialization, but then we also need to
properly deinitialize those right after, to preserve the current driver
behavior (keeping the chip idle/unconfigured until the corresponding
interface is brought up). Calling wilc_sdio_deinit in its current form is
not enough because it merely resets an internal flag.

Implement a deinit sequence which symmetrically reset all steps performed
in wilc_sdio_init (only for parts activating/deactivating features, for the
sake of simplicity, let's ignore blocks size configuration reset)

Signed-off-by: Alexis Lothoré <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agowifi: wilc1000: add function to read mac address from eFuse
Alexis Lothoré [Tue, 14 May 2024 15:51:22 +0000 (17:51 +0200)]
wifi: wilc1000: add function to read mac address from eFuse

wilc driver currently reads and sets mac address by firmware calls. It
means that we can not access mac address if no interface has been brought
up (so firmware is up and running). Another way to get mac address is to
read it directly from eFUSE.

Add a function helper to read the mac address written in eFuse, without
firmware assistance

Signed-off-by: Alexis Lothoré <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agowifi: wilc1000: set wilc_set_mac_address parameter as const
Alexis Lothoré [Tue, 14 May 2024 15:51:21 +0000 (17:51 +0200)]
wifi: wilc1000: set wilc_set_mac_address parameter as const

Any attempt to provide a const mac address to wilc_set_mac_address results
in the following warning:

warning: passing argument 2 of 'wilc_set_mac_address' discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
[...]
drivers/net/wireless/microchip/wilc1000/hif.h:170:52: note: expected 'u8 *'
{aka 'unsigned char *'} but argument is of type 'const unsigned char *'a
int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr);

Instead of using an explicit cast each time we need provide a MAC address,
set the function parameter as const

Signed-off-by: Alexis Lothoré <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agowifi: wilc1000: register net device only after bus being fully initialized
Alexis Lothoré [Tue, 14 May 2024 15:51:20 +0000 (17:51 +0200)]
wifi: wilc1000: register net device only after bus being fully initialized

SDIO/SPI probes functions automatically add a default wlan interface on top
of registered wiphy, through wilc_cfg80211_init which in turn calls
wilc_netdev_ifc_init. However, bus is still not fully initialized when we
register corresponding net device (for example we still miss some private
driver data pointers), which for example makes it impossible to
retrieve MAC address from chip (which is supposed to be set on net device
before its registration) before registering net device. More generally, net
device registration should not be done until driver has fully initialized
everything and is ready to handle any operation  on the net device.

Prevent net device from being registered so early by doing it at the end of
probe functions. Apply this logic to both sdio and spi buses.

Signed-off-by: Alexis Lothoré <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agowifi: wilc1000: set net device registration as last step during interface creation
Alexis Lothoré [Tue, 14 May 2024 15:51:19 +0000 (17:51 +0200)]
wifi: wilc1000: set net device registration as last step during interface creation

net device registration is currently done in wilc_netdev_ifc_init but
other initialization operations are still done after this registration.
Since net device is assumed to be usable right after registration, it
should be the very last step of initialization.

Move netdev registration at the very end of wilc_netdev_ifc_init to let
this function completely initialize netdevice before registering it.

Signed-off-by: Alexis Lothoré <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agowifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only device
Samasth Norway Ananda [Thu, 9 May 2024 23:10:37 +0000 (16:10 -0700)]
wifi: brcmsmac: LCN PHY code is used for BCM4313 2G-only device

The band_idx variable in the function wlc_lcnphy_tx_iqlo_cal() will
never be set to 1 as BCM4313 is the only device for which the LCN PHY
code is used. This is a 2G-only device.

Fixes: 5b435de0d786 ("net: wireless: add brcm80211 drivers")
Signed-off-by: Samasth Norway Ananda <[email protected]>
Acked-by: Arend van Spriel <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agowifi: iwlegacy: do not skip frames with bad FCS
Andrii Batyiev [Thu, 9 May 2024 10:11:25 +0000 (13:11 +0300)]
wifi: iwlegacy: do not skip frames with bad FCS

Monitor/sniffer mode benefits from all types of frames, even if FCS
check fails. But we must mark frames as such.

Tested on iwl3945 only.

Signed-off-by: Andrii Batyiev <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agoMerge tag 'wireless-next-2024-05-08' of git://git.kernel.org/pub/scm/linux/kernel...
Jakub Kicinski [Thu, 9 May 2024 02:09:38 +0000 (19:09 -0700)]
Merge tag 'wireless-next-2024-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next

Kalle Valo says:

====================
wireless-next patches for v6.10

The third, and most likely the last, "new features" pull request for
v6.10 with changes both in stack and in drivers. In ath12k and rtw89
we disabled Wireless Extensions just like with iwlwifi earlier. Wi-Fi
7 devices will not support Wireless Extensions (WEXT) anymore so if
someone is still using the legacy WEXT interface it's time to switch
to nl80211 now!

We merged wireless into wireless-next as we decided not to send a
wireless pull request to v6.9 this late in the cycle. Also an
immutable branch with MHI subsystem was merged to get ath11k and
ath12k hibernation working.

Major changes:

mac80211/cfg80211
 * handle color change per link

mt76
 * mt7921 LED control
 * mt7925 EHT radiotap support
 * mt7920e PCI support

ath12k
 * debugfs support
 * dfs_simulate_radar debugfs file
 * disable Wireless Extensions
 * suspend and hibernation support
 * ACPI support
 * refactoring in preparation of multi-link support

ath11k
 * support hibernation (required changes in qrtr and MHI subsystems)
 * ieee80211-freq-limit Device Tree property support

ath10k
 * firmware-name Device Tree property support

rtw89
 * complete features of new WiFi 7 chip 8922AE including BT-coexistence
   and WoWLAN
 * use BIOS ACPI settings to set TX power and channels
 * disable Wireless Extensios on Wi-Fi 7 devices

iwlwifi
 * block_esr debugfs file
 * support again firmware API 90 (was reverted earlier)
 * provide channel survey information for Automatic Channel Selection (ACS)

* tag 'wireless-next-2024-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (214 commits)
  wifi: mwl8k: initialize cmd->addr[] properly
  wifi: iwlwifi: Ensure prph_mac dump includes all addresses
  wifi: iwlwifi: mvm: don't request statistics in restart
  wifi: iwlwifi: mvm: exit EMLSR if secondary link is not used
  wifi: iwlwifi: mvm: add beacon template version 14
  wifi: iwlwifi: mvm: align UATS naming with firmware
  wifi: iwlwifi: Force SCU_ACTIVE for specific platforms
  wifi: iwlwifi: mvm: record and return channel survey information
  wifi: iwlwifi: mvm: add the firmware API for channel survey
  wifi: iwlwifi: mvm: Fix race in scan completion
  wifi: iwlwifi: mvm: Add a print for invalid link pair due to bandwidth
  wifi: iwlwifi: mvm: add a debugfs for reading EMLSR blocking reasons
  wifi: iwlwifi: mvm: Add active EMLSR blocking reasons prints
  wifi: iwlwifi: bump FW API to 90 for BZ/SC devices
  wifi: iwlwifi: mvm: fix primary link setting
  wifi: iwlwifi: mvm: use already determined cmd_id
  wifi: iwlwifi: mvm: don't reset link selection during restart
  wifi: iwlwifi: Print EMLSR states name
  wifi: iwlwifi: mvm: Block EMLSR when a p2p/softAP vif is active
  wifi: iwlwifi: mvm: fix typo in debug print
  ...
====================

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agoMerge branch 'netdevsim-add-napi-support'
Jakub Kicinski [Thu, 9 May 2024 01:59:51 +0000 (18:59 -0700)]
Merge branch 'netdevsim-add-napi-support'

David Wei says:

====================
netdevsim: add NAPI support

Add NAPI support to netdevsim and register its Rx queues with NAPI
instances. Then add a selftest using the new netdev Python selftest
infra to exercise the existing Netdev Netlink API, specifically the
queue-get API.

This expands test coverage and further fleshes out netdevsim as a test
device. It's still my goal to make it useful for testing things like
flow steering and ZC Rx.
====================

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonet: selftest: add test for netdev netlink queue-get API
David Wei [Tue, 7 May 2024 16:32:28 +0000 (09:32 -0700)]
net: selftest: add test for netdev netlink queue-get API

Add a selftest for netdev generic netlink. For now there is only a
single test that exercises the `queue-get` API.

The test works with netdevsim by default or with a real device by
setting NETIF.

Add a timeout param to cmd() since ethtool -L can take a long time on
real devices.

Signed-off-by: David Wei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonetdevsim: add NAPI support
David Wei [Tue, 7 May 2024 16:32:27 +0000 (09:32 -0700)]
netdevsim: add NAPI support

Add NAPI support to netdevim, similar to veth.

* Add a nsim_rq rx queue structure to hold a NAPI instance and a skb
  queue.
* During xmit, store the skb in the peer skb queue and schedule NAPI.
* During napi_poll(), drain the skb queue and pass up the stack.
* Add assoc between rxq and NAPI instance using netif_queue_set_napi().

Signed-off-by: David Wei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agoselftests: drv-net: add checksum tests
Willem de Bruijn [Tue, 7 May 2024 15:40:58 +0000 (11:40 -0400)]
selftests: drv-net: add checksum tests

Run tools/testing/selftest/net/csum.c as part of drv-net.
This binary covers multiple scenarios, based on arguments given,
for both IPv4 and IPv6:

- Accept UDP correct checksum
- Detect UDP invalid checksum
- Accept TCP correct checksum
- Detect TCP invalid checksum

- Transmit UDP: basic checksum offload
- Transmit UDP: zero checksum conversion

The test direction is reversed between receive and transmit tests, so
that the NIC under test is always the local machine.

In total this adds up to 12 testcases, with more to follow. For
conciseness, I replaced individual functions with a function factory.

Also detect hardware offload feature availability using Ethtool
netlink and skip tests when either feature is off. This need may be
common for offload feature tests and eventually deserving of a thin
wrapper in lib.py.

Missing are the PF_PACKET based send tests ('-P'). These use
virtio_net_hdr to program hardware checksum offload. Which requires
looking up the local MAC address and (harder) the MAC of the next hop.
I'll have to give it some though how to do that robustly and where
that code would belong.

Tested:

        make -C tools/testing/selftests/ \
                TARGETS="drivers/net drivers/net/hw" \
                install INSTALL_PATH=/tmp/ksft
        cd /tmp/ksft

sudo NETIF=ens4 REMOTE_TYPE=ssh \
REMOTE_ARGS="[email protected]" \
LOCAL_V4="10.40.0.1" \
REMOTE_V4="10.40.0.2" \
./run_kselftest.sh -t drivers/net/hw:csum.py

Signed-off-by: Willem de Bruijn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agophonet: no longer hold RTNL in route_dumpit()
Eric Dumazet [Tue, 7 May 2024 12:17:48 +0000 (12:17 +0000)]
phonet: no longer hold RTNL in route_dumpit()

route_dumpit() already relies on RCU, RTNL is not needed.

Also change return value at the end of a dump.
This allows NLMSG_DONE to be appended to the current
skb at the end of a dump, saving a couple of recvmsg()
system calls.

Signed-off-by: Eric Dumazet <[email protected]>
Cc: Remi Denis-Courmont <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonet: annotate data-races around dev->if_port
Eric Dumazet [Tue, 7 May 2024 18:41:44 +0000 (18:41 +0000)]
net: annotate data-races around dev->if_port

Various ndo_set_config() methods can change dev->if_port

dev->if_port is going to be read locklessly from
rtnl_fill_link_ifmap().

Add corresponding WRITE_ONCE() on writer sides.

Signed-off-by: Eric Dumazet <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonet: dst_cache: minor optimization in dst_cache_set_ip6()
Eric Dumazet [Tue, 7 May 2024 13:27:17 +0000 (13:27 +0000)]
net: dst_cache: minor optimization in dst_cache_set_ip6()

There is no need to use this_cpu_ptr(dst_cache->cache) twice.

Compiler is unable to optimize the second call, because of
per-cpu constraints.

Signed-off-by: Eric Dumazet <[email protected]>
Acked-by: Paolo Abeni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonet: dst_cache: annotate data-races around dst_cache->reset_ts
Eric Dumazet [Tue, 7 May 2024 13:20:00 +0000 (13:20 +0000)]
net: dst_cache: annotate data-races around dst_cache->reset_ts

dst_cache->reset_ts is read or written locklessly,
add READ_ONCE() and WRITE_ONCE() annotations.

Signed-off-by: Eric Dumazet <[email protected]>
Acked-by: Paolo Abeni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonetlink/specs: Add VF attributes to rt_link spec
Donald Hunter [Tue, 7 May 2024 10:36:03 +0000 (11:36 +0100)]
netlink/specs: Add VF attributes to rt_link spec

Add support for retrieving VFs as part of link info. For example:

./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_link.yaml \
  --do getlink --json '{"ifi-index": 38, "ext-mask": ["vf", "skip-stats"]}'
{'address': 'b6:75:91:f2:64:65',
 [snip]
 'vfinfo-list': {'info': [{'broadcast': b'\xff\xff\xff\xff\xff\xff\x00\x00'
                                        b'\x00\x00\x00\x00\x00\x00\x00\x00'
                                        b'\x00\x00\x00\x00\x00\x00\x00\x00'
                                        b'\x00\x00\x00\x00\x00\x00\x00\x00',
                           'link-state': {'link-state': 'auto', 'vf': 0},
                           'mac': {'mac': b'\x00\x00\x00\x00\x00\x00\x00\x00'
                                          b'\x00\x00\x00\x00\x00\x00\x00\x00'
                                          b'\x00\x00\x00\x00\x00\x00\x00\x00'
                                          b'\x00\x00\x00\x00\x00\x00\x00\x00',
                                   'vf': 0},
                           'rate': {'max-tx-rate': 0,
                                    'min-tx-rate': 0,
                                    'vf': 0},
                           'rss-query-en': {'setting': 0, 'vf': 0},
                           'spoofchk': {'setting': 0, 'vf': 0},
                           'trust': {'setting': 0, 'vf': 0},
                           'tx-rate': {'rate': 0, 'vf': 0},
                           'vlan': {'qos': 0, 'vf': 0, 'vlan': 0},
                           'vlan-list': {'info': [{'qos': 0,
                                                   'vf': 0,
                                                   'vlan': 0,
                                                   'vlan-proto': 0}]}},
                          {'broadcast': b'\xff\xff\xff\xff\xff\xff\x00\x00'
                                        b'\x00\x00\x00\x00\x00\x00\x00\x00'
                                        b'\x00\x00\x00\x00\x00\x00\x00\x00'
                                        b'\x00\x00\x00\x00\x00\x00\x00\x00',
                           'link-state': {'link-state': 'auto', 'vf': 1},
                           'mac': {'mac': b'\x00\x00\x00\x00\x00\x00\x00\x00'
                                          b'\x00\x00\x00\x00\x00\x00\x00\x00'
                                          b'\x00\x00\x00\x00\x00\x00\x00\x00'
                                          b'\x00\x00\x00\x00\x00\x00\x00\x00',
                                   'vf': 1},
                           'rate': {'max-tx-rate': 0,
                                    'min-tx-rate': 0,
                                    'vf': 1},
                           'rss-query-en': {'setting': 0, 'vf': 1},
                           'spoofchk': {'setting': 0, 'vf': 1},
                           'trust': {'setting': 0, 'vf': 1},
                           'tx-rate': {'rate': 0, 'vf': 1},
                           'vlan': {'qos': 0, 'vf': 1, 'vlan': 0},
                           'vlan-list': {'info': [{'qos': 0,
                                                   'vf': 1,
                                                   'vlan': 0,
                                                   'vlan-proto': 0}]}}]},
 'xdp': {'attached': 0}}

Signed-off-by: Donald Hunter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agodt-bindings: net: ipq4019-mdio: add IPQ9574 compatible
Alexandru Gagniuc [Tue, 7 May 2024 02:47:57 +0000 (21:47 -0500)]
dt-bindings: net: ipq4019-mdio: add IPQ9574 compatible

Add a compatible property specific to IPQ9574. This should be used
along with the IPQ4019 compatible. This second compatible serves the
same purpose as the ipq{5,6,8} compatibles. This is to indicate that
the clocks properties are required.

Signed-off-by: Alexandru Gagniuc <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agotest: hsr: Call cleanup_all_ns when hsr_redbox.sh script exits
Lukasz Majewski [Tue, 7 May 2024 09:11:55 +0000 (11:11 +0200)]
test: hsr: Call cleanup_all_ns when hsr_redbox.sh script exits

Without this change the created netns instances are not cleared after
this script execution. To fix this problem the cleanup_all_ns function
from ../lib.sh is called.

Signed-off-by: Lukasz Majewski <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agoax25: Remove superfuous "return" from ax25_ds_set_timer
Joel Granados [Tue, 7 May 2024 08:40:39 +0000 (10:40 +0200)]
ax25: Remove superfuous "return" from ax25_ds_set_timer

Remove the explicit call to "return" in the void ax25_ds_set_timer
function that was introduced in 78a7b5dbc060 ("ax.25: x.25: Remove the
now superfluous sentinel elements from ctl_table array").

Signed-off-by: Joel Granados <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agoipvs: allow some sysctls in non-init user namespaces
Alexander Mikhalitsyn [Mon, 6 May 2024 14:14:44 +0000 (16:14 +0200)]
ipvs: allow some sysctls in non-init user namespaces

Let's make all IPVS sysctls writtable even when
network namespace is owned by non-initial user namespace.

Let's make a few sysctls to be read-only for non-privileged users:
- sync_qlen_max
- sync_sock_size
- run_estimation
- est_cpulist
- est_nice

I'm trying to be conservative with this to prevent
introducing any security issues in there. Maybe,
we can allow more sysctls to be writable, but let's
do this on-demand and when we see real use-case.

This patch is motivated by user request in the LXC
project [1]. Having this can help with running some
Kubernetes [2] or Docker Swarm [3] workloads inside the system
containers.

Link: https://github.com/lxc/lxc/issues/4278
Link: https://github.com/kubernetes/kubernetes/blob/b722d017a34b300a2284b890448e5a605f21d01e/pkg/proxy/ipvs/proxier.go#L103
Link: https://github.com/moby/libnetwork/blob/3797618f9a38372e8107d8c06f6ae199e1133ae8/osl/namespace_linux.go#L682
Cc: Julian Anastasov <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Pablo Neira Ayuso <[email protected]>
Cc: Jozsef Kadlecsik <[email protected]>
Cc: Florian Westphal <[email protected]>
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
Acked-by: Julian Anastasov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agoipvs: add READ_ONCE barrier for ipvs->sysctl_amemthresh
Alexander Mikhalitsyn [Mon, 6 May 2024 14:14:43 +0000 (16:14 +0200)]
ipvs: add READ_ONCE barrier for ipvs->sysctl_amemthresh

Cc: Julian Anastasov <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Pablo Neira Ayuso <[email protected]>
Cc: Jozsef Kadlecsik <[email protected]>
Cc: Florian Westphal <[email protected]>
Suggested-by: Julian Anastasov <[email protected]>
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
Acked-by: Julian Anastasov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: stmmac: dwmac-ipq806x: account for rgmii-txid/rxid/id phy-mode
Christian Marangi [Mon, 6 May 2024 12:32:46 +0000 (14:32 +0200)]
net: stmmac: dwmac-ipq806x: account for rgmii-txid/rxid/id phy-mode

Currently the ipq806x dwmac driver is almost always used attached to the
CPU port of a switch and phy-mode was always set to "rgmii" or "sgmii".

Some device came up with a special configuration where the PHY is
directly attached to the GMAC port and in those case phy-mode needs to
be set to "rgmii-id" to make the PHY correctly work and receive packets.

Since the driver supports only "rgmii" and "sgmii" mode, when "rgmii-id"
(or variants) mode is set, the mode is rejected and probe fails.

Add support also for these phy-modes to correctly setup PHYs that requires
delay applied to tx/rx.

Signed-off-by: Christian Marangi <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: bridge: switchdev: Improve error message for port_obj_add/del functions
Oleksij Rempel [Mon, 6 May 2024 10:32:05 +0000 (12:32 +0200)]
net: bridge: switchdev: Improve error message for port_obj_add/del functions

Enhance the error reporting mechanism in the switchdev framework to
provide more informative and user-friendly error messages.

Following feedback from users struggling to understand the implications
of error messages like "failed (err=-28) to add object (id=2)", this
update aims to clarify what operation failed and how this might impact
the system or network.

With this change, error messages now include a description of the failed
operation, the specific object involved, and a brief explanation of the
potential impact on the system. This approach helps administrators and
developers better understand the context and severity of errors,
facilitating quicker and more effective troubleshooting.

Example of the improved logging:

[   70.516446] ksz-switch spi0.0 uplink: Failed to add Port Multicast
               Database entry (object id=2) with error: -ENOSPC (-28).
[   70.516446] Failure in updating the port's Multicast Database could
               lead to multicast forwarding issues.
[   70.516446] Current HW/SW setup lacks sufficient resources.

This comprehensive update includes handling for a range of switchdev
object IDs, ensuring that most operations within the switchdev framework
benefit from clearer error reporting.

Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: Oleksij Rempel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet/ipv4: add tracepoint for icmp_send
Peilin He [Tue, 7 May 2024 07:41:03 +0000 (15:41 +0800)]
net/ipv4: add tracepoint for icmp_send

Introduce a tracepoint for icmp_send, which can help users to get more
detail information conveniently when icmp abnormal events happen.

1. Giving an usecase example:
=============================
When an application experiences packet loss due to an unreachable UDP
destination port, the kernel will send an exception message through the
icmp_send function. By adding a trace point for icmp_send, developers or
system administrators can obtain detailed information about the UDP
packet loss, including the type, code, source address, destination address,
source port, and destination port. This facilitates the trouble-shooting
of UDP packet loss issues especially for those network-service
applications.

2. Operation Instructions:
==========================
Switch to the tracing directory.
        cd /sys/kernel/tracing
Filter for destination port unreachable.
        echo "type==3 && code==3" > events/icmp/icmp_send/filter
Enable trace event.
        echo 1 > events/icmp/icmp_send/enable

3. Result View:
================
 udp_client_erro-11370   [002] ...s.12   124.728002:
 icmp_send: icmp_send: type=3, code=3.
 From 127.0.0.1:41895 to 127.0.0.1:6666 ulen=23
 skbaddr=00000000589b167a

Signed-off-by: Peilin He <[email protected]>
Signed-off-by: xu xin <[email protected]>
Reviewed-by: Yunkai Zhang <[email protected]>
Cc: Yang Yang <[email protected]>
Cc: Liu Chun <[email protected]>
Cc: Xuexin Jiang <[email protected]>
Reviewed-by: Steven Rostedt (Google) <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agoMerge branch 'ksz-dcb-dscp'
David S. Miller [Wed, 8 May 2024 09:35:11 +0000 (10:35 +0100)]
Merge branch 'ksz-dcb-dscp'

Oleksij Rempel says:

====================
add DCB and DSCP support for KSZ switches

This patch series is aimed at improving support for DCB (Data Center
Bridging) and DSCP (Differentiated Services Code Point) on KSZ switches.

The main goal is to introduce global DSCP and PCP (Priority Code Point)
mapping support, addressing the limitation of KSZ switches not having
per-port DSCP priority mapping. This involves extending the DSA
framework with new callbacks for managing trust settings for global DSCP
and PCP maps. Additionally, we introduce IEEE 802.1q helpers for default
configurations, benefiting other drivers too.

Change logs are in separate patches.

Compared to v6 this series includes some new patches for DSCP global
mapping support and QoS selftest script for KSZ9477 switches.
====================

Signed-off-by: David S. Miller <[email protected]>
10 months agoselftests: microchip: add test for QoS support on KSZ9477 switch family
Oleksij Rempel [Fri, 3 May 2024 13:13:51 +0000 (15:13 +0200)]
selftests: microchip: add test for QoS support on KSZ9477 switch family

Add tests covering following functionality on KSZ9477 switch family:
- default port priority
- global DSCP to Internal Priority Mapping
- apptrust configuration

This script was tested on KSZ9893R

Signed-off-by: Oleksij Rempel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: dsa: microchip: add support DSCP priority mapping
Oleksij Rempel [Fri, 3 May 2024 13:13:50 +0000 (15:13 +0200)]
net: dsa: microchip: add support DSCP priority mapping

Microchip KSZ and LAN variants do not have per port DSCP priority
configuration. Instead there is a global DSCP mapping table.

This patch provides write access to this global DSCP map. In case entry
is "deleted", we map corresponding DSCP entry to a best effort prio,
which is expected to be the default priority for all untagged traffic.

Signed-off-by: Oleksij Rempel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: dsa: add support switches global DSCP priority mapping
Oleksij Rempel [Fri, 3 May 2024 13:13:49 +0000 (15:13 +0200)]
net: dsa: add support switches global DSCP priority mapping

Some switches like Microchip KSZ variants do not support per port DSCP
priority configuration. Instead there is a global DSCP mapping table.

To handle it, we will accept set/del request to any of user ports to
make global configuration and update dcb app entries for all other
ports.

Signed-off-by: Oleksij Rempel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: dsa: microchip: let DCB code do PCP and DSCP policy configuration
Oleksij Rempel [Fri, 3 May 2024 13:13:48 +0000 (15:13 +0200)]
net: dsa: microchip: let DCB code do PCP and DSCP policy configuration

802.1P (PCP) and DiffServ (DSCP) are handled now by DCB code. Let it do
all needed initial configuration.

Signed-off-by: Oleksij Rempel <[email protected]>
Acked-by: Arun Ramadoss <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: dsa: microchip: init predictable IPV to queue mapping for all non KSZ8xxx variants
Oleksij Rempel [Fri, 3 May 2024 13:13:47 +0000 (15:13 +0200)]
net: dsa: microchip: init predictable IPV to queue mapping for all non KSZ8xxx variants

Init priority to queue mapping in the way as it shown in IEEE 802.1Q
mapping example.

Signed-off-by: Oleksij Rempel <[email protected]>
Acked-by: Arun Ramadoss <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: dsa: microchip: enable ETS support for KSZ989X variants
Oleksij Rempel [Fri, 3 May 2024 13:13:46 +0000 (15:13 +0200)]
net: dsa: microchip: enable ETS support for KSZ989X variants

I tested ETS support on KSZ9893, so it should work other KSZ989X
variants too, which was till not listed as support.

With this change we now officially not support only ksz8 family of
chips.

Signed-off-by: Oleksij Rempel <[email protected]>
Acked-by: Arun Ramadoss <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: dsa: microchip: dcb: add special handling for KSZ88X3 family
Oleksij Rempel [Fri, 3 May 2024 13:13:45 +0000 (15:13 +0200)]
net: dsa: microchip: dcb: add special handling for KSZ88X3 family

KSZ88X3 switches have different behavior on different ports:
- It seems to be not possible to disable VLAN PCP classification on port
  2. It means, as soon as mutliqueue support is enabled, frames with
     VLAN tag will get PCP prios. This behavior do not affect Port 1 -
     it is possible to disable PCP prios.
- DSCP classification is not working on Port 2.

Since there are still usable configuration combinations, I added some
quirks to make sure user will get appropriate error message if not
possible configuration is chosen.

Signed-off-by: Oleksij Rempel <[email protected]>
Acked-by: Arun Ramadoss <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: dsa: microchip: add support for different DCB app configurations
Oleksij Rempel [Fri, 3 May 2024 13:13:44 +0000 (15:13 +0200)]
net: dsa: microchip: add support for different DCB app configurations

Add DCB support to configure app trust sources and default port priority.

Following commands can be used for testing:
dcb apptrust set dev lan1 order pcp dscp
dcb app replace dev lan1 default-prio 3

Since it is not possible to configure DSCP-Prio mapping per port, this
patch provide only ability to read switch global dscp-prio mapping and
way to enable/disable app trust for DSCP.

Signed-off-by: Oleksij Rempel <[email protected]>
Acked-by: Arun Ramadoss <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: dsa: microchip: add multi queue support for KSZ88X3 variants
Oleksij Rempel [Fri, 3 May 2024 13:13:43 +0000 (15:13 +0200)]
net: dsa: microchip: add multi queue support for KSZ88X3 variants

KSZ88X3 switches support up to 4 queues. Rework ksz8795_set_prio_queue()
to support KSZ8795 and KSZ88X3 families of switches.

Per default, configure KSZ88X3 to use one queue, since it need special
handling due to priority related errata. Errata handling is implemented
in a separate patch.

Signed-off-by: Oleksij Rempel <[email protected]>
Acked-by: Arun Ramadoss <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: add IEEE 802.1q specific helpers
Oleksij Rempel [Fri, 3 May 2024 13:13:42 +0000 (15:13 +0200)]
net: add IEEE 802.1q specific helpers

IEEE 802.1q specification provides recommendation and examples which can
be used as good default values for different drivers.

This patch implements mapping examples documented in IEEE 802.1Q-2022 in
Annex I "I.3 Traffic type to traffic class mapping" and IETF DSCP naming
and mapping DSCP to Traffic Type inspired by RFC8325.

This helpers will be used in followup patches for dsa/microchip DCB
implementation.

Signed-off-by: Oleksij Rempel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: dsa: microchip: add IPV information support
Oleksij Rempel [Fri, 3 May 2024 13:13:41 +0000 (15:13 +0200)]
net: dsa: microchip: add IPV information support

Most of Microchip KSZ switches use Internal Priority Value associated
with every frame. For example, it is possible to map any VLAN PCP or
DSCP value to IPV and at the end, map IPV to a queue.

Since amount of IPVs is not equal to amount of queues, add this
information and make use of it in some functions.

Signed-off-by: Oleksij Rempel <[email protected]>
Acked-by: Arun Ramadoss <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agonet: dsa: add support for DCB get/set apptrust configuration
Oleksij Rempel [Fri, 3 May 2024 13:13:40 +0000 (15:13 +0200)]
net: dsa: add support for DCB get/set apptrust configuration

Add DCB support to get/set trust configuration for different packet
priority information sources. Some switch allow to chose different
source of packet priority classification. For example on KSZ switches it
is possible to configure VLAN PCP and/or DSCP sources.

Signed-off-by: Oleksij Rempel <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
10 months agoMerge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next...
Jakub Kicinski [Wed, 8 May 2024 02:08:34 +0000 (19:08 -0700)]
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2024-05-06 (ice)

This series contains updates to ice driver only.

Paul adds support for additional E830 devices and adjusts naming for
existing E830 devices.

Marcin commonizes a couple of TC setup calls to reduce duplicated code.

Mateusz adds ice_vsi_cfg_params into ice_vsi to consolidate info.

* '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
  ice: refactor struct ice_vsi_cfg_params to be inside of struct ice_vsi
  ice: Deduplicate tc action setup
  ice: update E830 device ids and comments
  ice: add additional E830 device ids
====================

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonet: usb: sr9700: stop lying about skb->truesize
Eric Dumazet [Mon, 6 May 2024 14:39:39 +0000 (14:39 +0000)]
net: usb: sr9700: stop lying about skb->truesize

Some usb drivers set small skb->truesize and break
core networking stacks.

In this patch, I removed one of the skb->truesize override.

I also replaced one skb_clone() by an allocation of a fresh
and small skb, to get minimally sized skbs, like we did
in commit 1e2c61172342 ("net: cdc_ncm: reduce skb truesize
in rx path") and 4ce62d5b2f7a ("net: usb: ax88179_178a:
stop lying about skb->truesize")

Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
Signed-off-by: Eric Dumazet <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonet: usb: smsc75xx: stop lying about skb->truesize
Eric Dumazet [Mon, 6 May 2024 14:23:58 +0000 (14:23 +0000)]
net: usb: smsc75xx: stop lying about skb->truesize

Some usb drivers try to set small skb->truesize and break
core networking stacks.

In this patch, I removed one of the skb->truesize override.

I also replaced one skb_clone() by an allocation of a fresh
and small skb, to get minimally sized skbs, like we did
in commit 1e2c61172342 ("net: cdc_ncm: reduce skb truesize
in rx path") and 4ce62d5b2f7a ("net: usb: ax88179_178a:
stop lying about skb->truesize")

Signed-off-by: Eric Dumazet <[email protected]>
Cc: Steve Glendinning <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agousb: aqc111: stop lying about skb->truesize
Eric Dumazet [Mon, 6 May 2024 13:55:46 +0000 (13:55 +0000)]
usb: aqc111: stop lying about skb->truesize

Some usb drivers try to set small skb->truesize and break
core networking stacks.

I replace one skb_clone() by an allocation of a fresh
and small skb, to get minimally sized skbs, like we did
in commit 1e2c61172342 ("net: cdc_ncm: reduce skb truesize
in rx path") and 4ce62d5b2f7a ("net: usb: ax88179_178a:
stop lying about skb->truesize")

Fixes: 361459cd9642 ("net: usb: aqc111: Implement RX data path")
Signed-off-by: Eric Dumazet <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agoselftests/net: fix uninitialized variables
John Hubbard [Mon, 6 May 2024 19:02:04 +0000 (12:02 -0700)]
selftests/net: fix uninitialized variables

When building with clang, via:

    make LLVM=1 -C tools/testing/selftest

...clang warns about three variables that are not initialized in all
cases:

1) The opt_ipproto_off variable is used uninitialized if "testname" is
not "ip". Willem de Bruijn pointed out that this is an actual bug, and
suggested the fix that I'm using here (thanks!).

2) The addr_len is used uninitialized, but only in the assert case,
   which bails out, so this is harmless.

3) The family variable in add_listener() is only used uninitialized in
   the error case (neither IPv4 nor IPv6 is specified), so it's also
   harmless.

Fix by initializing each variable.

Signed-off-by: John Hubbard <[email protected]>
Reviewed-by: Willem de Bruijn <[email protected]>
Acked-by: Mat Martineau <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agolib: Allow for the DIM library to be modular
Florian Fainelli [Mon, 6 May 2024 17:50:40 +0000 (10:50 -0700)]
lib: Allow for the DIM library to be modular

Allow the Dynamic Interrupt Moderation (DIM) library to be built as a
module. This is particularly useful in an Android GKI (Google Kernel
Image) configuration where everything is built as a module, including
Ethernet controller drivers. Having to build DIMLIB into the kernel
image with potentially no user is wasteful.

Signed-off-by: Florian Fainelli <[email protected]>
Reviewed-by: Alexander Lobakin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agomptcp: fix possible NULL dereferences
Eric Dumazet [Mon, 6 May 2024 12:30:32 +0000 (12:30 +0000)]
mptcp: fix possible NULL dereferences

subflow_add_reset_reason(skb, ...) can fail.

We can not assume mptcp_get_ext(skb) always return a non NULL pointer.

syzbot reported:

general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
CPU: 0 PID: 5098 Comm: syz-executor132 Not tainted 6.9.0-rc6-syzkaller-01478-gcdc74c9d06e7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
 RIP: 0010:subflow_v6_route_req+0x2c7/0x490 net/mptcp/subflow.c:388
Code: 8d 7b 07 48 89 f8 48 c1 e8 03 42 0f b6 04 20 84 c0 0f 85 c0 01 00 00 0f b6 43 07 48 8d 1c c3 48 83 c3 18 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 84 01 00 00 0f b6 5b 01 83 e3 0f 48 89
RSP: 0018:ffffc9000362eb68 EFLAGS: 00010206
RAX: 0000000000000003 RBX: 0000000000000018 RCX: ffff888022039e00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff88807d961140 R08: ffffffff8b6cb76b R09: 1ffff1100fb2c230
R10: dffffc0000000000 R11: ffffed100fb2c231 R12: dffffc0000000000
R13: ffff888022bfe273 R14: ffff88802cf9cc80 R15: ffff88802ad5a700
FS:  0000555587ad2380(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f420c3f9720 CR3: 0000000022bfc000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
  tcp_conn_request+0xf07/0x32c0 net/ipv4/tcp_input.c:7180
  tcp_rcv_state_process+0x183c/0x4500 net/ipv4/tcp_input.c:6663
  tcp_v6_do_rcv+0x8b2/0x1310 net/ipv6/tcp_ipv6.c:1673
  tcp_v6_rcv+0x22b4/0x30b0 net/ipv6/tcp_ipv6.c:1910
  ip6_protocol_deliver_rcu+0xc76/0x1570 net/ipv6/ip6_input.c:438
  ip6_input_finish+0x186/0x2d0 net/ipv6/ip6_input.c:483
  NF_HOOK+0x3a4/0x450 include/linux/netfilter.h:314
  NF_HOOK+0x3a4/0x450 include/linux/netfilter.h:314
  __netif_receive_skb_one_core net/core/dev.c:5625 [inline]
  __netif_receive_skb+0x1ea/0x650 net/core/dev.c:5739
  netif_receive_skb_internal net/core/dev.c:5825 [inline]
  netif_receive_skb+0x1e8/0x890 net/core/dev.c:5885
  tun_rx_batched+0x1b7/0x8f0 drivers/net/tun.c:1549
  tun_get_user+0x2f35/0x4560 drivers/net/tun.c:2002
  tun_chr_write_iter+0x113/0x1f0 drivers/net/tun.c:2048
  call_write_iter include/linux/fs.h:2110 [inline]
  new_sync_write fs/read_write.c:497 [inline]
  vfs_write+0xa84/0xcb0 fs/read_write.c:590
  ksys_write+0x1a0/0x2c0 fs/read_write.c:643
  do_syscall_x64 arch/x86/entry/common.c:52 [inline]
  do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Fixes: 3e140491dd80 ("mptcp: support rstreason for passive reset")
Reported-by: syzbot <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Acked-by: Paolo Abeni <[email protected]>
Reviewed-by: Matthieu Baerts (NGI0) <[email protected]>
Reviewed-by: Jason Xing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agoselftests: netfilter: conntrack_tcp_unreplied.sh: wait for initial connection attempt
Florian Westphal [Mon, 6 May 2024 11:43:16 +0000 (13:43 +0200)]
selftests: netfilter: conntrack_tcp_unreplied.sh: wait for initial connection attempt

Netdev CI reports occasional failures with this test
("ERROR: ns2-dX6bUE did not pick up tcp connection from peer").

Add explicit busywait call until the initial connection attempt shows
up in conntrack rather than a one-shot 'must exist' check.

Signed-off-by: Florian Westphal <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonet: annotate writes on dev->mtu from ndo_change_mtu()
Eric Dumazet [Mon, 6 May 2024 10:28:12 +0000 (10:28 +0000)]
net: annotate writes on dev->mtu from ndo_change_mtu()

Simon reported that ndo_change_mtu() methods were never
updated to use WRITE_ONCE(dev->mtu, new_mtu) as hinted
in commit 501a90c94510 ("inet: protect against too small
mtu values.")

We read dev->mtu without holding RTNL in many places,
with READ_ONCE() annotations.

It is time to take care of ndo_change_mtu() methods
to use corresponding WRITE_ONCE()

Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: Simon Horman <[email protected]>
Closes: https://lore.kernel.org/netdev/[email protected]/
Reviewed-by: Jacob Keller <[email protected]>
Reviewed-by: Sabrina Dubroca <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Acked-by: Shannon Nelson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonet: dccp: Fix ccid2_rtt_estimator() kernel-doc
Jeff Johnson [Sun, 5 May 2024 20:09:31 +0000 (13:09 -0700)]
net: dccp: Fix ccid2_rtt_estimator() kernel-doc

make C=1 reports:

warning: Function parameter or struct member 'mrtt' not described in 'ccid2_rtt_estimator'

So document the 'mrtt' parameter.

Signed-off-by: Jeff Johnson <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonet: phy: marvell: add support for MV88E6250 family internal PHYs
Matthias Schiffer [Thu, 2 May 2024 11:13:01 +0000 (13:13 +0200)]
net: phy: marvell: add support for MV88E6250 family internal PHYs

The embedded PHYs of the 88E6250 family switches are very basic - they
do not even have an Extended Address / Page register.

This adds support for the PHYs to the driver to set up PHY interrupts
and retrieve error stats. To deal with PHYs without a page register,
"simple" variants of all stat handling functions are introduced.

The code should work with all 88E6250 family switches (6250/6220/6071/
6070/6020). The PHY ID 0x01410db0 was read from a 88E6020, under the
assumption that all switches of this family use the same ID. The spec
only lists the prefix 0x01410c00 and leaves the last 10 bits as reserved,
but that seems too unspecific to be useful, as it would cover several
existing PHY IDs already supported by the driver; therefore, the ID read
from the actual hardware is used.

Signed-off-by: Matthias Schiffer <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Link: https://lore.kernel.org/r/0695f699cd942e6e06da9d30daeedfd47785bc01.1714643285.git.matthias.schiffer@ew.tq-group.com
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agonet: phy: marvell: constify marvell_hw_stats
Matthias Schiffer [Thu, 2 May 2024 11:13:00 +0000 (13:13 +0200)]
net: phy: marvell: constify marvell_hw_stats

The list of stat registers is read-only, so we can declare it as const.

Signed-off-by: Matthias Schiffer <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Link: https://lore.kernel.org/r/24d7a2f39e0c4c94466e8ad43228fdd798053f3a.1714643285.git.matthias.schiffer@ew.tq-group.com
Signed-off-by: Jakub Kicinski <[email protected]>
10 months agowifi: mwl8k: initialize cmd->addr[] properly
Dan Carpenter [Sat, 4 May 2024 11:38:15 +0000 (14:38 +0300)]
wifi: mwl8k: initialize cmd->addr[] properly

This loop is supposed to copy the mac address to cmd->addr but the
i++ increment is missing so it copies everything to cmd->addr[0] and
only the last address is recorded.

Fixes: 22bedad3ce11 ("net: convert multicast list to list_head")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
10 months agoMerge branch 'remove-rtnl-lock-protection-of-cvq'
Paolo Abeni [Tue, 7 May 2024 09:42:03 +0000 (11:42 +0200)]
Merge branch 'remove-rtnl-lock-protection-of-cvq'

Daniel Jurgens says:

====================
Remove RTNL lock protection of CVQ

Currently the buffer used for control VQ commands is protected by the
RTNL lock. Previously this wasn't a major concern because the control VQ
was only used during device setup and user interaction. With the recent
addition of dynamic interrupt moderation the control VQ may be used
frequently during normal operation.

This series removes the RNTL lock dependency by introducing a mutex
to protect the control buffer and writing SGs to the control VQ.

v6:
- Rebased over new stats code.
- Added comment to cvq_lock, init the mutex unconditionally,
  and replaced some duplicate code with a goto.
- Fixed minor grammer errors, checkpatch warnings, and clarified
  a comment.
v5:
- Changed cvq_lock to a mutex.
- Changed dim_lock to mutex, because it's held taking
  the cvq_lock.
- Use spin/mutex_lock/unlock vs guard macros.
v4:
- Protect dim_enabled with same lock as well intr_coal.
- Rename intr_coal_lock to dim_lock.
- Remove some scoped_guard where the error path doesn't
  have to be in the lock.
v3:
- Changed type of _offloads to __virtio16 to fix static
  analysis warning.
- Moved a misplaced hunk to the correct patch.
v2:
- New patch to only process the provided queue in
  virtnet_dim_work
- New patch to lock per queue rx coalescing structure.
====================

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
10 months agovirtio_net: Remove rtnl lock protection of command buffers
Daniel Jurgens [Fri, 3 May 2024 20:24:45 +0000 (23:24 +0300)]
virtio_net: Remove rtnl lock protection of command buffers

The rtnl lock is no longer needed to protect the control buffer and
command VQ.

Signed-off-by: Daniel Jurgens <[email protected]>
Reviewed-by: Jiri Pirko <[email protected]>
Reviewed-by: Heng Qi <[email protected]>
Tested-by: Heng Qi <[email protected]>
Acked-by: Jason Wang <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
10 months agovirtio_net: Add a lock for per queue RX coalesce
Daniel Jurgens [Fri, 3 May 2024 20:24:44 +0000 (23:24 +0300)]
virtio_net: Add a lock for per queue RX coalesce

Once the RTNL locking around the control buffer is removed there can be
contention on the per queue RX interrupt coalescing data. Use a mutex
per queue. A mutex is required because virtnet_send_command can sleep.

Signed-off-by: Daniel Jurgens <[email protected]>
Reviewed-by: Heng Qi <[email protected]>
Tested-by: Heng Qi <[email protected]>
Acked-by: Jason Wang <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
10 months agovirtio_net: Do DIM update for specified queue only
Daniel Jurgens [Fri, 3 May 2024 20:24:43 +0000 (23:24 +0300)]
virtio_net: Do DIM update for specified queue only

Since we no longer have to hold the RTNL lock here just do updates for
the specified queue.

Signed-off-by: Daniel Jurgens <[email protected]>
Reviewed-by: Heng Qi <[email protected]>
Tested-by: Heng Qi <[email protected]>
Acked-by: Jason Wang <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
This page took 0.124169 seconds and 4 git commands to generate.