Skip to contentSkip to conversation

wifi: mac80211: add support for declaring netdev GSO support

RFC New Felix Fietkau 1 participant 1 message Oct 3, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 wifi: mac80211: add support for declaring netdev GSO support

Improve performance by deferring GSO segmentation until after the sta lookup, flow hash calculation and aggregation check. Pass the segmented packets to fq in one batch.
GSO packets can't be passed to the driver, because they have metadata stored in skb->cb, which gets overwritten by mac80211. Because of that, segmentation needs to be done unconditionally in mac80211.

---
 include/net/fq_impl.h | 16 ++++---
 net/mac80211/tx.c     | 98 ++++++++++++++++++++++++++++++++-----------
 2 files changed, 83 insertions(+), 31 deletions(-)
include/net/fq_impl.h +10 -6
index 524b510f1c68..9467e33dfb36 100644
@@ -200,6 +200,7 @@ static void fq_tin_enqueue(struct fq *fq,
 			   fq_skb_free_t free_func)
 {
 	struct fq_flow *flow;
+	struct sk_buff *next;
 	bool oom;
 
 	lockdep_assert_held(&fq->lock);
@@ -214,11 +215,15 @@ static void fq_tin_enqueue(struct fq *fq,
 	}
 
 	flow->tin = tin;
-	flow->backlog += skb->len;
-	tin->backlog_bytes += skb->len;
-	tin->backlog_packets++;
-	fq->memory_usage += skb->truesize;
-	fq->backlog++;
+	skb_list_walk_safe(skb, skb, next) {
+		skb_mark_not_on_list(skb);
+		flow->backlog += skb->len;
+		tin->backlog_bytes += skb->len;
+		tin->backlog_packets++;
+		fq->memory_usage += skb->truesize;
+		fq->backlog++;
+		__skb_queue_tail(&flow->queue, skb);
+	}
 
 	if (list_empty(&flow->flowchain)) {
 		flow->deficit = fq->quantum;
@@ -226,7 +231,6 @@ static void fq_tin_enqueue(struct fq *fq,
 			      &tin->new_flows);
 	}
 
-	__skb_queue_tail(&flow->queue, skb);
 	oom = (fq->memory_usage > fq->memory_limit);
 	while (fq->backlog > fq->limit || oom) {
 		flow = fq_find_fattest_flow(fq);
net/mac80211/tx.c +73 -25

164 lines not on this page · raw message

Signature · 1 line
2.36.1