netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>,
	netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org
Cc: willemdebruijn.kernel@gmail.com
Subject: Re: [PATCH net-next] net: always dump full packets with skb_dump
Date: Mon, 5 Oct 2020 15:13:54 -0700	[thread overview]
Message-ID: <bcf0a19d-a8c9-a9a2-7bcf-a97205aa4d05@intel.com> (raw)
In-Reply-To: <20201005144838.851988-1-vladimir.oltean@nxp.com>



On 10/5/2020 7:48 AM, Vladimir Oltean wrote:
> Currently skb_dump has a restriction to only dump full packet for the
> first 5 socket buffers, then only headers will be printed. Remove this
> arbitrary and confusing restriction, which is only documented vaguely
> ("up to") in the comments above the prototype.
> 

So, this limitation appeared very clearly in the original commit,
6413139dfc64 ("skbuff: increase verbosity when dumping skb data")..

Searching the netdev list, that patch links back to this one as the
original idea:

https://patchwork.ozlabs.org/project/netdev/patch/20181121021309.6595-2-xiyou.wangcong@gmail.com/

I can't find any further justification on that limit. I suppose the
primary reasoning being if you somehow call this function in a loop this
would avoid dumping the entire packet over and over?

Thanks,
Jake

> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
>  net/core/skbuff.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index e0774471f56d..720076a6e2b1 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -712,11 +712,10 @@ EXPORT_SYMBOL(kfree_skb_list);
>   *
>   * Must only be called from net_ratelimit()-ed paths.
>   *
> - * Dumps up to can_dump_full whole packets if full_pkt, headers otherwise.
> + * Dumps whole packets if full_pkt, only headers otherwise.
>   */
>  void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt)
>  {
> -	static atomic_t can_dump_full = ATOMIC_INIT(5);
>  	struct skb_shared_info *sh = skb_shinfo(skb);
>  	struct net_device *dev = skb->dev;
>  	struct sock *sk = skb->sk;
> @@ -725,9 +724,6 @@ void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt)
>  	int headroom, tailroom;
>  	int i, len, seg_len;
>  
> -	if (full_pkt)
> -		full_pkt = atomic_dec_if_positive(&can_dump_full) >= 0;
> -
>  	if (full_pkt)
>  		len = skb->len;
>  	else
> 

  reply	other threads:[~2020-10-06  0:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 14:48 [PATCH net-next] net: always dump full packets with skb_dump Vladimir Oltean
2020-10-05 22:13 ` Jacob Keller [this message]
2020-10-06 11:30   ` Willem de Bruijn
2020-10-06 11:43     ` Vladimir Oltean
2020-10-06 11:57       ` Willem de Bruijn
2020-10-06 13:14 ` David Miller

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=bcf0a19d-a8c9-a9a2-7bcf-a97205aa4d05@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vladimir.oltean@nxp.com \
    --cc=willemdebruijn.kernel@gmail.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;
as well as URLs for NNTP newsgroup(s).