Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net_sched: cake: use qdisc_pkt_segs()

Use new qdisc_pkt_segs() to avoid a cache line miss in cake_enqueue()
for non GSO packets.

cake_overhead() does not have to recompute it.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20251121083256.674562-7-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Eric Dumazet and committed by
Paolo Abeni
c5d34f45 2773cb0b

+3 -9
+3 -9
net/sched/sch_cake.c
··· 1398 1398 const struct skb_shared_info *shinfo = skb_shinfo(skb); 1399 1399 unsigned int hdr_len, last_len = 0; 1400 1400 u32 off = skb_network_offset(skb); 1401 + u16 segs = qdisc_pkt_segs(skb); 1401 1402 u32 len = qdisc_pkt_len(skb); 1402 - u16 segs = 1; 1403 1403 1404 1404 q->avg_netoff = cake_ewma(q->avg_netoff, off << 16, 8); 1405 1405 1406 - if (!shinfo->gso_size) 1406 + if (segs == 1) 1407 1407 return cake_calc_overhead(q, len, off); 1408 1408 1409 1409 /* borrowed from qdisc_pkt_len_segs_init() */ ··· 1429 1429 sizeof(_udphdr), &_udphdr)) 1430 1430 hdr_len += sizeof(struct udphdr); 1431 1431 } 1432 - 1433 - if (unlikely(shinfo->gso_type & SKB_GSO_DODGY)) 1434 - segs = DIV_ROUND_UP(skb->len - hdr_len, 1435 - shinfo->gso_size); 1436 - else 1437 - segs = shinfo->gso_segs; 1438 1432 1439 1433 len = shinfo->gso_size + hdr_len; 1440 1434 last_len = skb->len - shinfo->gso_size * (segs - 1); ··· 1782 1788 if (unlikely(len > b->max_skblen)) 1783 1789 b->max_skblen = len; 1784 1790 1785 - if (skb_is_gso(skb) && q->rate_flags & CAKE_FLAG_SPLIT_GSO) { 1791 + if (qdisc_pkt_segs(skb) > 1 && q->rate_flags & CAKE_FLAG_SPLIT_GSO) { 1786 1792 struct sk_buff *segs, *nskb; 1787 1793 netdev_features_t features = netif_skb_features(skb); 1788 1794 unsigned int slen = 0, numsegs = 0;