OSDN Git Service

net: always dump full packets with skb_dump
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 5 Oct 2020 14:48:38 +0000 (17:48 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 6 Oct 2020 13:14:02 +0000 (06:14 -0700)
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.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c

index c8afa2c..7cba279 100644 (file)
@@ -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;
@@ -726,9 +725,6 @@ void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt)
        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
                len = min_t(int, skb->len, MAX_HEADER + 128);