wifi: mac80211: MLO handling for Dynamic VLAN
v4 cover wifi: mac80211: MLO handling for Dynamic VLAN
Currently for AP_VLAN interfaces that are a part of a MLD master AP, links are not created for the interface. Additionally, mac80211 handles duplicating multicast traffic on each link when a driver/hw is not handling such action.
With the introduction of MLO, there are two areas where additional handling is needed to enable Dynamic VLAN traffic: creating separate links for AP_VLAN interface and enabling mac80211 to send multicast Dynamic VLAN traffic on each link.
4addr mode + MLO is not currently supported.
v4:
- Add link iteration macro and utilize it.
v3:
- rebase to cleanly apply to wireless-next
v2:
- update Author signoff to new email
Muna Sinada (3):
wifi: mac80211: Add link iteration macro for link data
wifi: mac80211: Create separate links for VLAN interfaces
wifi: mac80211: VLAN traffic in multicast path
net/mac80211/chan.c | 3 ++ net/mac80211/ieee80211_i.h | 12 +++++ net/mac80211/iface.c | 12 ++++- net/mac80211/link.c | 90 ++++++++++++++++++++++++++++++++++++-- net/mac80211/tx.c | 6 ++- 5 files changed, 116 insertions(+), 7 deletions(-)
base-commit: 1794d7ab34d2221ac7eb921b171e75b856e10561
Signature · 1 line
2.34.1
PATCH v4 1/3 wifi: mac80211: Add link iteration macro for link data
Currently before iterating through valid links we are utilizing open-coding when checking if vif valid_links is a non-zero value.
Add new macro, for_each_link_data(), which iterates through link_id and checks if it is set on vif valid_links. If it is a valid link then access link data for that link id.
---
v4: new patch
--- net/mac80211/ieee80211_i.h | 9 +++++++++ 1 file changed, 9 insertions(+)
net/mac80211/ieee80211_i.h +9 -0
@@ -1226,6 +1226,15 @@ struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p)if ((_link =wiphy_dereference ((_local)->hw.wiphy, \ ___sdata->link[___link_id]))) +#define for_each_link_data (sdata, __link) \ + struct ieee80211_sub_if_data *__sdata = sdata; \ + for (int __link_id = 0; \ + __link_id < ARRAY_SIZE((__sdata)->link); __link_id++) \ + if ((!(__sdata)->vif.valid_links || \ + (__sdata)->vif.valid_links & BIT(__link_id)) && \ + ((__link) = sdata_dereference((__sdata)->link[__link_id], \ + (__sdata)))) + static inline int ieee80211_get_mbssid_beacon_len(struct cfg80211_mbssid_elems *elems, struct cfg80211_rnr_elems *rnr_elems,
Signature · 1 line
2.34.1
PATCH v4 2/3 wifi: mac80211: Create separate links for VLAN interfaces
In reply to Muna SinadaCurrently, MLD links for an AP_VLAN interface type is not fully supported.
Add allocation of separate links for each VLAN interface and copy chanctx and chandef of AP bss to VLAN where necessary. Separate links are created because for Dynamic VLAN each link will have its own default_multicast_key.
---
v4: Utilize new link iteration macro
v3: rebase to cleanly apply to wireless-next
v2:
- move clearing links for AP_VLAN into seperate function:
ieee80211_apvlan_link_clear()
- remove use of goto
- replaced "master" terminalogy with "AP bss"
- update Author signoff to new email
--- net/mac80211/chan.c | 3 ++ net/mac80211/ieee80211_i.h | 3 ++ net/mac80211/iface.c | 12 ++++- net/mac80211/link.c | 90 ++++++++++++++++++++++++++++++++++++-- 4 files changed, 103 insertions(+), 5 deletions(-)
net/mac80211/chan.c +3 -0
@@ -2131,6 +2131,9 @@ void ieee80211_link_release_channel(struct ieee80211_link_data *link) {struct ieee80211_sub_if_data *sdata = link->sdata; +if (sdata->vif.type ==NL80211_IFTYPE_AP_VLAN ) +return ; +lockdep_assert_wiphy (sdata->local->hw.wiphy);if (rcu_access_pointer (link->conf->chanctx_conf))
net/mac80211/ieee80211_i.h +3 -0
@@ -2087,6 +2087,9 @@ static inline void ieee80211_vif_clear_links(struct ieee80211_sub_if_data *sdataieee80211_vif_set_links (sdata,0 ,0 ); } +void ieee80211_apvlan_link_setup (struct ieee80211_sub_if_data *sdata); +void ieee80211_apvlan_link_clear (struct ieee80211_sub_if_data *sdata); +/* tx handling */ void ieee80211_clear_tx_pending (struct ieee80211_local *local);void ieee80211_tx_pending (struct tasklet_struct *t);
net/mac80211/iface.c +11 -1
@@ -485,6 +485,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_docase NL80211_IFTYPE_MONITOR :list_del_rcu (&sdata->u.mntr.list);break ; +case NL80211_IFTYPE_AP_VLAN : +ieee80211_apvlan_link_clear (sdata); +break ;default :break ; }
@@ -1265,6 +1268,8 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) sdata->crypto_tx_tailroom_needed_cnt += master->crypto_tx_tailroom_needed_cnt; +ieee80211_apvlan_link_setup (sdata); +break ; }case NL80211_IFTYPE_AP :
@@ -1321,7 +1326,12 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)case NL80211_IFTYPE_AP_VLAN :/* no need to tell driver, but set carrier and chanctx */ if (sdata->bss->active) { -ieee80211_link_vlan_copy_chanctx (&sdata->deflink); +struct ieee80211_link_data *link; + +for_each_link_data (sdata, link) { +ieee80211_link_vlan_copy_chanctx (link); + } +netif_carrier_on (dev);ieee80211_set_vif_encap_ops (sdata); }else {
net/mac80211/link.c +86 -4
122 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v4 3/3 wifi: mac80211: VLAN traffic in multicast path
In reply to Muna SinadaCurrently for MLO, sending out multicast frames on each link is handled by mac80211 only when IEEE80211_HW_MLO_MCAST_MULTI_LINK_TX flag is not set.
Dynamic VLAN multicast traffic utilizes software encryption. Due to this, mac80211 should handle transmitting multicast frames on all links for multicast VLAN traffic.
---
v4: no changes
v3: rebase to cleanly apply to wireless-next
v2:
- move clearing links for AP_VLAN into seperate function:
ieee80211_apvlan_link_clear()
- remove use of goto
- replaced "master" terminalogy with "AP bss"
- update Author signoff to new email
--- net/mac80211/tx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/mac80211/tx.c +4 -2
@@ -4526,8 +4526,10 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,IEEE80211_TX_CTRL_MLO_LINK_UNSPEC , NULL); }else if (ieee80211_vif_is_mld (&sdata->vif) && - sdata->vif.type ==NL80211_IFTYPE_AP && - !ieee80211_hw_check (&sdata->local->hw,MLO_MCAST_MULTI_LINK_TX )) { + ((sdata->vif.type ==NL80211_IFTYPE_AP && + !ieee80211_hw_check (&sdata->local->hw,MLO_MCAST_MULTI_LINK_TX )) || + ((sdata->vif.type ==NL80211_IFTYPE_AP_VLAN ) && + !sdata->wdev.use_4addr))) {ieee80211_mlo_multicast_tx (dev, skb); }else { normal:
Signature · 1 line
2.34.1