Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
* [Cake] [PATCH net-next] net: account for encap headers in qdisc pkt len
@ 2025-07-02 16:07 Fengyuan Gong
  2025-07-02 16:53 ` Willem de Bruijn
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Fengyuan Gong @ 2025-07-02 16:07 UTC (permalink / raw)
  To: Jakub Kicinski, Paolo Abeni, Simon Horman, toke, edumazet,
	David S . Miller
  Cc: Jamal Hadi Salim, Cong Wang, Jiri Pirko, Stanislav Fomichev,
	Kuniyuki Iwashima, Ahmed Zaki, Alexander Lobakin, netdev,
	linux-kernel, cake, willemb, Fengyuan Gong

Refine qdisc_pkt_len_init to include headers up through
the inner transport header when computing header size
for encapsulations. Also refine net/sched/sch_cake.c
borrowed from qdisc_pkt_len_init().

Signed-off-by: Fengyuan Gong <gfengyuan@google.com>
---
 net/core/dev.c       | 5 ++++-
 net/sched/sch_cake.c | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 11da1e272ec20..dfec541f68e3a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3944,7 +3944,10 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
 		unsigned int hdr_len;
 
 		/* mac layer + network layer */
-		hdr_len = skb_transport_offset(skb);
+		if (!skb->encapsulation)
+			hdr_len = skb_transport_offset(skb);
+		else
+			hdr_len = skb_inner_transport_offset(skb);
 
 		/* + transport layer */
 		if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) {
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 48dd8c88903fe..dbcfb948c8670 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -1407,7 +1407,10 @@ static u32 cake_overhead(struct cake_sched_data *q, const struct sk_buff *skb)
 		return cake_calc_overhead(q, len, off);
 
 	/* borrowed from qdisc_pkt_len_init() */
-	hdr_len = skb_transport_offset(skb);
+	if (!skb->encapsulation)
+		hdr_len = skb_transport_offset(skb);
+	else
+		hdr_len = skb_inner_transport_offset(skb);
 
 	/* + transport layer */
 	if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 |
-- 
2.50.0.727.gbf7dc18ff4-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-08 16:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-02 16:07 [Cake] [PATCH net-next] net: account for encap headers in qdisc pkt len Fengyuan Gong
2025-07-02 16:53 ` Willem de Bruijn
2025-07-02 17:23   ` Eric Dumazet
2025-07-03 13:35 ` Toke Høiland-Jørgensen
2025-07-04  4:31 ` Cong Wang
2025-07-06 14:30   ` Willem de Bruijn
2025-07-08 16:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox