Cake - FQ_codel the next generation
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Fengyuan Gong <gfengyuan@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	toke@toke.dk, edumazet@google.com,
	"David S . Miller" <davem@davemloft.net>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Ahmed Zaki <ahmed.zaki@intel.com>,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	cake@lists.bufferbloat.net, willemb@google.com
Subject: Re: [Cake] [PATCH net-next] net: account for encap headers in qdisc pkt len
Date: Thu, 3 Jul 2025 21:31:18 -0700	[thread overview]
Message-ID: <aGdZFhGu40UD6UDU@pop-os.localdomain> (raw)
In-Reply-To: <20250702160741.1204919-1-gfengyuan@google.com>

On Wed, Jul 02, 2025 at 04:07:41PM +0000, Fengyuan Gong wrote:
> 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);

This pattern seems repeated in a few places, other than the two you are
patching, I saw another one:

2465 static netdev_features_t hns3_features_check(struct sk_buff *skb,
2466                                              struct net_device *dev,
2467                                              netdev_features_t features)
2468 {
2469 #define HNS3_MAX_HDR_LEN        480U
2470 #define HNS3_MAX_L4_HDR_LEN     60U
2471 
2472         size_t len;
2473 
2474         if (skb->ip_summed != CHECKSUM_PARTIAL)
2475                 return features;
2476 
2477         if (skb->encapsulation)
2478                 len = skb_inner_transport_offset(skb);
2479         else
2480                 len = skb_transport_offset(skb);


Maybe worth a helper now?

Thanks!

  parent reply	other threads:[~2025-07-04  4:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-02 16:07 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 [this message]
2025-07-06 14:30   ` Willem de Bruijn
2025-07-08 16:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aGdZFhGu40UD6UDU@pop-os.localdomain \
    --to=xiyou.wangcong@gmail.com \
    --cc=ahmed.zaki@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=cake@lists.bufferbloat.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gfengyuan@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=toke@toke.dk \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox