qualcommax: qca_edma: prefetch the next segment of a frag_list frame

Counting the descriptors of a frag_list frame walks its segments, and
each one misses on the skb and then on its shared info. Prefetch the next
segment while the current one is counted.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Julius Bairaktaris authored and Robert Marko committed 2026-10-26 09:44:47 +01:00
1 parent dd1227705a
commit 2ca23dee66
1 file changed
+6 -1
@@ -870,8 +870,13 @@ static u16 edma_tx_ndesc(const struct sk_buff *skb)
const struct sk_buff *seg;
u16 n = skb_shinfo(skb)->nr_frags + 1;
skb_walk_frags(skb, seg)
/* Each segment misses twice, on the skb and on its shared info, so
* the next one is fetched meanwhile.
*/
skb_walk_frags(skb, seg) {
prefetch(seg->next);
n += !!skb_headlen(seg) + skb_shinfo(seg)->nr_frags;
}
return n;
}