Skip to contentSkip to conversation

mac80211: set wifi_acked[_valid] bits for transmitted SKBs

RFC In review Johannes Berg 2 participants 2 messages Oct 27, 2016 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

RFC 1/1 mac80211: set wifi_acked[_valid] bits for transmitted SKBs

From: Johannes Berg <[email protected]>

There may be situations in which the in-kernel originator of an SKB cares about its wifi transmission status. To have that, set the wifi_acked[_valid] bits before freeing/orphaning the SKB if the destructor is set. The originator can then use it in there.

---
 net/mac80211/status.c | 5 +++++
 1 file changed, 5 insertions(+)
net/mac80211/status.c +5 -0
index ddf71c648cab..dc3132d0effe 100644
@@ -541,6 +541,11 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local,
 	} else if (info->ack_frame_id) {
 		ieee80211_report_ack_skb(local, info, acked, dropped);
 	}
+
+	if (!dropped && skb->destructor) {
+		skb->wifi_acked_valid = 1;
+		skb->wifi_acked = acked;
+	}
 }
 
 /*
Signature · 1 line
2.9.3
#1 lore raw

net/mac80211/status.c static void ieee80211_report_used_skb(struct ieee802=

Quoted 17 lines · Johannes Berg

From: Johannes Berg <[email protected]>

There may be situations in which the in-kernel originator of an SKB cares about its wifi transmission status. To have that, set the wifi_acked[_valid] bits before freeing/orphaning the SKB if the destructor is set. The originator can then use it in there.

---
 net/mac80211/status.c | 5 +++++
 1 file changed, 5 insertions(+)
net/mac80211/status.c +0 -0
index ddf71c648cab..dc3132d0effe 100644
@@ -541,6 +541,11 @@ static void ieee80211_report_used_skb(struct ieee802=

11_local *local,

net/mac80211/status.c static void ieee80211_report_used_skb(struct ieee80211_local *local, · line 549

Quoted 9 lines
net/mac80211/status.c +5 -0
        } else if (info->ack_frame_id) {
                ieee80211_report_ack_skb(local, info, acked, dropped);
        }
+
+       if (!dropped && skb->destructor) {
+               skb->wifi_acked_valid =3D 1;
+               skb->wifi_acked =3D acked;
+       }
 }

One of the things I've been curious about one day trying to take advantage = of
is the pacing available from sch_fq, in a world where we were trying to take advantage of the chocolatey goodness of the new TCP BBR congestion control algorithm. (sch_fq is apparently required for BBR to work right)

By moving the fq_codel algo into the softmac layer as we are doing, we currently expose the "noqueue" interface to the qdisc layer, there, which works great for routers, but for dual use (acting as a NAS host and routing) seems less than ideal.

Now it turns out that you can indeed slap the fq qdisc on top of the new wifi intermediate queues code...

dave@nemesis:~/slashdot$ tc -s qdisc show dev wlp3s0
qdisc fq 8001: root refcnt 5 limit 10000p flow_limit 100p buckets 1024
orphan_mask 1023 quantum 3028 initial_quantum 15140 refill_delay
40.0ms
 Sent 30828141202 bytes 20530733 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
  1127 flows (1127 inactive, 0 throttled)
  0 gc, 117 highprio, 714646 throttled

but as 1127 inactive flows have been there for a day now, and don't show up in netstat, I guess that somewhere in here we aren't "retiring" a skb in a way the tcp stack understands.

root@nemesis:~/slashdot# tc qdisc del dev wlp3s0 root
root@nemesis:~/slashdot# tc -s qdisc show dev wlp3s0
qdisc noqueue 0: root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
Quoted 5 lines
net/mac80211/status.c +0 -1
 /*
--

2.9.3

--=20
Dave T=C3=A4ht
Let's go make home routers and wifi faster! With better software!
http://blog.cerowrt.org