2022-09-16 14:35:42

by Howard Hsu

[permalink] [raw]
Subject: [PATCH v2] wifi: mac80211: fix decapsulation offload flag for WDS interface

Rx decapsulation offload cannot be enabled on WDS interface since its
offload_flags is not configured. Its offload_flags shall be configured
by checking hardware information.

Signed-off-by: Howard Hsu <[email protected]>
---
v2:
- Configure offload_flags in ieee80211_check_fast_rx
- Update commit message
---
net/mac80211/rx.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index a57811372027..0d8cfe34b088 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -4433,6 +4433,16 @@ void ieee80211_check_fast_rx(struct sta_info *sta)
if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED))
goto clear;

+ if (ieee80211_hw_check(&local->hw, SUPPORTS_RX_DECAP_OFFLOAD)) {
+ sdata->vif.offload_flags |= IEEE80211_OFFLOAD_DECAP_ENABLED;
+
+ if (local->monitors &&
+ !ieee80211_hw_check(&local->hw, SUPPORTS_CONC_MON_RX_DECAP))
+ sdata->vif.offload_flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED;
+ } else {
+ sdata->vif.offload_flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED;
+ }
+
rcu_read_lock();
key = rcu_dereference(sta->ptk[sta->ptk_idx]);
if (!key)
--
2.18.0


2022-09-16 15:38:08

by Felix Fietkau

[permalink] [raw]
Subject: Re: [PATCH v2] wifi: mac80211: fix decapsulation offload flag for WDS interface


On 16.09.22 16:27, Howard Hsu wrote:
> Rx decapsulation offload cannot be enabled on WDS interface since its
> offload_flags is not configured. Its offload_flags shall be configured
> by checking hardware information.
>
> Signed-off-by: Howard Hsu <[email protected]>
> ---
> v2:
> - Configure offload_flags in ieee80211_check_fast_rx
> - Update commit message
> ---
> net/mac80211/rx.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index a57811372027..0d8cfe34b088 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -4433,6 +4433,16 @@ void ieee80211_check_fast_rx(struct sta_info *sta)
> if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED))
> goto clear;
>
> + if (ieee80211_hw_check(&local->hw, SUPPORTS_RX_DECAP_OFFLOAD)) {
> + sdata->vif.offload_flags |= IEEE80211_OFFLOAD_DECAP_ENABLED;
> +
> + if (local->monitors &&
> + !ieee80211_hw_check(&local->hw, SUPPORTS_CONC_MON_RX_DECAP))
> + sdata->vif.offload_flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED;
> + } else {
> + sdata->vif.offload_flags &= ~IEEE80211_OFFLOAD_DECAP_ENABLED;
> + }
I don't think you should be messing with decap flags here.
Further down there's a piece of code that does:

offload = assign &&
(sdata->vif.offload_flags & IEEE80211_OFFLOAD_DECAP_ENABLED);

Please change the code so that it gets the sdata from sdata->bss and
check sdata_bss->vif.offload_flags.

- Felix