All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Eric Dumazet <edumazet@google.com>,
	 "David S . Miller" <davem@davemloft.net>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	 netdev@vger.kernel.org,  eric.dumazet@gmail.com,
	 Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH net] net: add skb->data_len and (skb>end - skb->tail) to skb_dump()
Date: Mon, 12 Jan 2026 14:07:58 -0500	[thread overview]
Message-ID: <willemdebruijn.kernel.338b382b46c4b@gmail.com> (raw)
In-Reply-To: <20260112172621.4188700-1-edumazet@google.com>

Eric Dumazet wrote:
> While working on a syzbot report, I found that skb_dump()
> is lacking two important parts :
> 
> - skb->data_len.
> 
> - (skb>end - skb->tail) tailroom is zero if skb is not linear.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Willem de Bruijn <willemb@google.com>

Good point on tailroom, I was not aware of that limitation on linear.

data_len is calculated from len and headlen, but may be nice to print.

> ---
>  net/core/skbuff.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index a56133902c0d9c47b45a4a19b228b151456e5051..61746c2b95f63e465c1f2cd05bf6a61bc5331d8f 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -1312,14 +1312,15 @@ void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt)
>  	has_mac = skb_mac_header_was_set(skb);
>  	has_trans = skb_transport_header_was_set(skb);
>  
> -	printk("%sskb len=%u headroom=%u headlen=%u tailroom=%u\n"
> -	       "mac=(%d,%d) mac_len=%u net=(%d,%d) trans=%d\n"
> +	printk("%sskb len=%u data_len=%u headroom=%u headlen=%u tailroom=%u\n"

Maybe order len, headlen, datalen, headroom, tailroom.

And really no need to ever print skb_tailroom if end-tail always
captures that. Can just call that tailroom or tailroom* or so.

> +	       "end-tail=%u mac=(%d,%d) mac_len=%u net=(%d,%d) trans=%d\n"
>  	       "shinfo(txflags=%u nr_frags=%u gso(size=%hu type=%u segs=%hu))\n"
>  	       "csum(0x%x start=%u offset=%u ip_summed=%u complete_sw=%u valid=%u level=%u)\n"
>  	       "hash(0x%x sw=%u l4=%u) proto=0x%04x pkttype=%u iif=%d\n"
>  	       "priority=0x%x mark=0x%x alloc_cpu=%u vlan_all=0x%x\n"
>  	       "encapsulation=%d inner(proto=0x%04x, mac=%u, net=%u, trans=%u)\n",
> -	       level, skb->len, headroom, skb_headlen(skb), tailroom,
> +	       level, skb->len, skb->data_len, headroom, skb_headlen(skb),
> +	       tailroom, skb->end - skb->tail,
>  	       has_mac ? skb->mac_header : -1,
>  	       has_mac ? skb_mac_header_len(skb) : -1,
>  	       skb->mac_len,
> -- 
> 2.52.0.457.g6b5491de43-goog
> 



  reply	other threads:[~2026-01-12 19:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-12 17:26 [PATCH net] net: add skb->data_len and (skb>end - skb->tail) to skb_dump() Eric Dumazet
2026-01-12 19:07 ` Willem de Bruijn [this message]
2026-01-16  3:50 ` 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

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

  git send-email \
    --in-reply-to=willemdebruijn.kernel.338b382b46c4b@gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.