* [PATCH v2] wifi: mac80211: fix decapsulation offload flag for WDS interface
@ 2022-09-16 14:27 Howard Hsu
2022-09-16 15:28 ` Felix Fietkau
0 siblings, 1 reply; 2+ messages in thread
From: Howard Hsu @ 2022-09-16 14:27 UTC (permalink / raw)
To: Johannes Berg
Cc: linux-wireless, Felix Fietkau, Lorenzo Bianconi, Ryder Lee,
Shayne Chen, Evelyn Tsai, linux-mediatek, Howard Hsu
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 <howard-yh.hsu@mediatek.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] wifi: mac80211: fix decapsulation offload flag for WDS interface
2022-09-16 14:27 [PATCH v2] wifi: mac80211: fix decapsulation offload flag for WDS interface Howard Hsu
@ 2022-09-16 15:28 ` Felix Fietkau
0 siblings, 0 replies; 2+ messages in thread
From: Felix Fietkau @ 2022-09-16 15:28 UTC (permalink / raw)
To: Howard Hsu, Johannes Berg
Cc: linux-wireless, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Evelyn Tsai, linux-mediatek
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 <howard-yh.hsu@mediatek.com>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-16 15:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 14:27 [PATCH v2] wifi: mac80211: fix decapsulation offload flag for WDS interface Howard Hsu
2022-09-16 15:28 ` Felix Fietkau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).