b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From: Ryder Lee <ryder.lee@mediatek.com> |
| 2 | Date: Fri, 18 Jun 2021 04:38:59 +0800 |
| 3 | Subject: [PATCH] mac80211: check per vif offload_flags in Tx path |
| 4 | |
| 5 | offload_flags has been introduced to indicate encap status of each interface. |
| 6 | An interface can encap offload at runtime, or if it has some extra limitations |
| 7 | it can simply override the flags, so it's more flexible to check offload_flags |
| 8 | in Tx path. |
| 9 | |
| 10 | Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> |
| 11 | Link: https://lore.kernel.org/r/177785418cf407808bf3a44760302d0647076990.1623961575.git.ryder.lee@mediatek.com |
| 12 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> |
| 13 | --- |
| 14 | |
| 15 | --- a/net/mac80211/tx.c |
| 16 | +++ b/net/mac80211/tx.c |
| 17 | @@ -3335,6 +3335,9 @@ static bool ieee80211_amsdu_aggregate(st |
| 18 | if (!ieee80211_hw_check(&local->hw, TX_AMSDU)) |
| 19 | return false; |
| 20 | |
| 21 | + if (sdata->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED) |
| 22 | + return false; |
| 23 | + |
| 24 | if (skb_is_gso(skb)) |
| 25 | return false; |
| 26 | |