Skip to contentSkip to conversation

mac80211: reduce the amount of unnecessary traffic on cooked monitor interfaces

PATCH In review Felix Fietkau 2 participants 3 messages Nov 14, 2009 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: reduce the amount of unnecessary traffic on cooked monitor interfaces

In order to handle association and authentication in AP mode, hostapd needs access to the tx status info of its own frames through a cooked monitor interface. Without this patch the cooked monitor interfaces also passed on tx status information for packets from other virtual interfaces. This creates a significant performance issue on embedded system. Hostapd tries to work around this by installing a Linux Socket Filter that only captures the frames it's interested in, however data duplication and socket filter matching still uses up enough CPU cycles to be very noticeable on small systems. This patch ensures that tx status information of non-injected frames does not make it to cooked monitor interfaces.

---

net/mac80211/main.c +5 -0
@@ -587,6 +587,11 @@ void ieee80211_tx_status(struct ieee8021
 			if (!netif_running(sdata->dev))
 				continue;
 
+			if ((sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) &&
+			    !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
+			    (type == IEEE80211_FTYPE_DATA))
+				continue;
+
 			if (prev_dev) {
 				skb2 = skb_clone(skb, GFP_ATOMIC);
 				if (skb2) {
maintainer
#1 lore raw
Quoted 15 lines · Felix Fietkau

In order to handle association and authentication in AP mode, hostapd needs access to the tx status info of its own frames through a cooked monitor interface. Without this patch the cooked monitor interfaces also passed on tx status information for packets from other virtual interfaces. This creates a significant performance issue on embedded system. Hostapd tries to work around this by installing a Linux Socket Filter that only captures the frames it's interested in, however data duplication and socket filter matching still uses up enough CPU cycles to be very noticeable on small systems. This patch ensures that tx status information of non-injected frames does not make it to cooked monitor interfaces.

net/mac80211/main.c void ieee80211_tx_status(struct ieee8021 · line 594

Quoted 5 lines
net/mac80211/main.c +5 -0
+			if ((sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) &&
+			    !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
+			    (type == IEEE80211_FTYPE_DATA))
+				continue;
+

This patch also breaks IEEE 802.11 compliance. :)

johannes

maintainer
#2 lore raw
Quoted 7 lines · Johannes Berg

net/mac80211/main.c void ieee80211_tx_status(struct ieee8021 · line 594

Quoted 5 lines
net/mac80211/main.c +5 -0
+			if ((sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) &&
+			    !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
+			    (type == IEEE80211_FTYPE_DATA))
+				continue;
+

This patch also breaks IEEE 802.11 compliance. :)

Oh no, it doesn't, wrong code path.

johannes