Default behavior for multicast AP VLAN interface traffic is using software encryption as per commit 18890d4b89d8 ("mac80211: Disable hw crypto for GTKs on AP VLAN interfaces"). When encapsulation offload is enabled, non-VLAN AP unicast packets are taking the 8023 xmit path. Similarly unicast packets in AP VLAN interfaces should have the same behavior as the non-VLAN AP case. Allow AP VLAN unicast packets to take the 8023 xmit path where hardware will handle encapsulation and encryption. As a result, there is less CPU overhead in the 8023 xmit path as we don't encapsulate in software. Mcast/bcast will continue to use 80211 xmit path. Co-developed-by: Gautham Kumar Senthilkumaran <quic_gauthamk@xxxxxxxxxxx> Signed-off-by: Gautham Kumar Senthilkumaran <quic_gauthamk@xxxxxxxxxxx> Signed-off-by: Muna Sinada <quic_msinada@xxxxxxxxxxx> --- net/mac80211/tx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index c0e0b5f63714..d77172771a36 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -4654,7 +4654,9 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb, u64 *cookie) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct ieee80211_sub_if_data *ap_sdata; struct ieee80211_local *local = sdata->local; + struct ieee80211_key *key; struct sta_info *sta; struct sk_buff *next; int len = skb->len; @@ -4679,6 +4681,17 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb, if (IS_ERR(sta)) sta = NULL; + if (sta && sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { + ap_sdata = container_of(sdata->bss, + struct ieee80211_sub_if_data, u.ap); + if (ap_sdata->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED && + !is_multicast_ether_addr(skb->data)) { + key = rcu_dereference(sta->ptk[sta->ptk_idx]); + ieee80211_8023_xmit(sdata, dev, sta, key, skb); + goto out; + } + } + skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb)); ieee80211_aggr_check(sdata, sta, skb); -- 2.34.1