netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, apw@canonical.com,
	joe@perches.com, dwaipayanray1@gmail.com,
	lukas.bulwahn@gmail.com, akpm@linux-foundation.org,
	willemb@google.com, edumazet@google.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Wojciech Drewek <wojciech.drewek@intel.com>,
	Simon Horman <horms@kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v2 6/6] ice: devlink health: dump also skb on Tx hang
Date: Sun, 14 Jul 2024 07:30:48 -0700	[thread overview]
Message-ID: <20240714073048.77cd4b3f@kernel.org> (raw)
In-Reply-To: <20240712093251.18683-7-mateusz.polchlopek@intel.com>

On Fri, 12 Jul 2024 05:32:51 -0400 Mateusz Polchlopek wrote:
> +	buf_pos = ice_emit_to_buf(buf, buf_size, buf_pos,
> +		"skb len=%u headroom=%u headlen=%u tailroom=%u\n"
> +		"mac=(%d,%d) net=(%d,%d) trans=%d\n"
> +		"shinfo(txflags=%u nr_frags=%u gso(size=%hu type=%u segs=%hu))\n"
> +		"csum(0x%x 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",
> +		skb->len, headroom, skb_headlen(skb), tailroom,
> +		has_mac ? skb->mac_header : -1,
> +		has_mac ? skb_mac_header_len(skb) : -1,
> +		skb->network_header,
> +		has_trans ? skb_network_header_len(skb) : -1,
> +		has_trans ? skb->transport_header : -1,
> +		sh->tx_flags, sh->nr_frags,
> +		sh->gso_size, sh->gso_type, sh->gso_segs,
> +		skb->csum, skb->ip_summed, skb->csum_complete_sw,
> +		skb->csum_valid, skb->csum_level,
> +		skb->hash, skb->sw_hash, skb->l4_hash,
> +		ntohs(skb->protocol), skb->pkt_type, skb->skb_iif);

Make it a generic helper in devlink?

> +	if (dev)
> +		buf_pos = ice_emit_to_buf(buf, buf_size, buf_pos,
> +					  "dev name=%s feat=%pNF\n", dev->name,
> +					  &dev->features);
> +	if (sk)
> +		buf_pos = ice_emit_to_buf(buf, buf_size, buf_pos,
> +					  "sk family=%hu type=%u proto=%u\n",
> +					  sk->sk_family, sk->sk_type,
> +					  sk->sk_protocol);
> +
> +	if (headroom)
> +		buf_pos = ice_emit_hex_to_buf(buf, buf_size, buf_pos,
> +					      "skb headroom: ", skb->head,
> +					      headroom);
> +
> +	seg_len = min_t(int, skb_headlen(skb), len);
> +	if (seg_len)
> +		buf_pos = ice_emit_hex_to_buf(buf, buf_size, buf_pos,
> +					      "skb linear:   ", skb->data,
> +					      seg_len);
> +	len -= seg_len;
> +
> +	if (tailroom)
> +		buf_pos = ice_emit_hex_to_buf(buf, buf_size, buf_pos,
> +					      "skb tailroom: ",
> +					      skb_tail_pointer(skb), tailroom);

The printing on tailroom, headroom and frag data seems a bit much.
I guess you're only printing the head SKB so it may be fine. But
I don't think it's useful. The device will probably only care about
the contents of the headers, for other parts only the metadata matters.
No strong preference tho.

> +	for (i = 0; len && i < skb_shinfo(skb)->nr_frags; i++) {
> +		skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
> +		u32 p_off, p_len, copied;
> +		struct page *p;
> +		u8 *vaddr;
> +
> +		skb_frag_foreach_page(frag, skb_frag_off(frag),
> +				      skb_frag_size(frag), p, p_off, p_len,
> +				      copied) {
> +			seg_len = min_t(int, p_len, len);
> +			vaddr = kmap_local_page(p);
> +			buf_pos = ice_emit_hex_to_buf(buf, buf_size, buf_pos,
> +						      "skb frag:     ",
> +						      vaddr + p_off, seg_len);
> +			kunmap_local(vaddr);
> +			len -= seg_len;
> +
> +			if (!len || buf_pos == buf_size)
> +				break;
> +		}
> +	}
> +
> +	if (skb_has_frag_list(skb)) {
> +		buf_pos = ice_emit_to_buf(buf, buf_size, buf_pos,
> +					  "skb fraglist:\n");
> +		skb_walk_frags(skb, list_skb) {
> +			buf_pos = ice_skb_dump_buf(buf, buf_size, buf_pos,
> +						   list_skb);
> +
> +			if (buf_pos == buf_size)
> +				break;
> +		}
> +	}

You support transmitting skbs with fraglist? 🤨️

  reply	other threads:[~2024-07-14 14:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-12  9:32 [Intel-wired-lan] [PATCH iwl-next v2 0/6] Add support for devlink health events Mateusz Polchlopek
2024-07-12  9:32 ` [Intel-wired-lan] [PATCH iwl-next v2 1/6] checkpatch: don't complain on _Generic() use Mateusz Polchlopek
2024-07-12  9:32 ` [Intel-wired-lan] [PATCH iwl-next v2 2/6] devlink: add devlink_fmsg_put() macro Mateusz Polchlopek
2024-07-12  9:32 ` [Intel-wired-lan] [PATCH iwl-next v2 3/6] ice: add Tx hang devlink health reporter Mateusz Polchlopek
2024-07-14 14:23   ` Jakub Kicinski
2024-07-22  9:23     ` Mateusz Polchlopek
2024-07-30  9:33       ` Mateusz Polchlopek
2024-07-12  9:32 ` [Intel-wired-lan] [PATCH iwl-next v2 4/6] ice: print ethtool stats as part of " Mateusz Polchlopek
2024-07-12  9:32 ` [Intel-wired-lan] [PATCH iwl-next v2 5/6] ice: Add MDD logging via devlink health Mateusz Polchlopek
2024-07-12  9:32 ` [Intel-wired-lan] [PATCH iwl-next v2 6/6] ice: devlink health: dump also skb on Tx hang Mateusz Polchlopek
2024-07-14 14:30   ` Jakub Kicinski [this message]
2024-07-22  9:23     ` Mateusz Polchlopek
2024-07-30  9:35     ` Mateusz Polchlopek

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=20240714073048.77cd4b3f@kernel.org \
    --to=kuba@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=mateusz.polchlopek@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=willemb@google.com \
    --cc=wojciech.drewek@intel.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).