DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH 4/4] bus/vmbus: improve debug output
Date: Wed,  6 May 2020 12:27:30 -0700
Message-ID: <20200506192730.21613-5-stephen@networkplumber.org> (raw)
In-Reply-To: <20200506192730.21613-1-stephen@networkplumber.org>

Make debug output more compact. Don't print pending size
or interrupt mask for the transmit side (not applicable).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/vmbus/vmbus_channel.c | 42 +++++++++++++++++++------------
 1 file changed, 26 insertions(+), 16 deletions(-)

diff --git a/drivers/bus/vmbus/vmbus_channel.c b/drivers/bus/vmbus/vmbus_channel.c
index ff2985c25758..5df7deadd3f1 100644
--- a/drivers/bus/vmbus/vmbus_channel.c
+++ b/drivers/bus/vmbus/vmbus_channel.c
@@ -421,26 +421,36 @@ void rte_vmbus_chan_close(struct vmbus_channel *chan)
 static void vmbus_dump_ring(FILE *f, const char *id, const struct vmbus_br *br)
 {
 	const struct vmbus_bufring *vbr = br->vbr;
-	struct vmbus_chanpkt_hdr pkt;
 
-	fprintf(f, "%s windex=%u rindex=%u mask=%u pending=%u feature=%#x\n",
-		id, vbr->windex, vbr->rindex, vbr->imask,
-		vbr->pending_send, vbr->feature_bits.value);
-	fprintf(f, " size=%u avail write=%u read=%u\n",
-		br->dsize, vmbus_br_availwrite(br, vbr->windex),
+	fprintf(f, "%s index=%u/%u  avail=%u/%u\n",
+		id, vbr->windex, vbr->rindex,
+		vmbus_br_availwrite(br, vbr->windex),
 		vmbus_br_availread(br));
-
-	if (vmbus_rxbr_peek(br, &pkt, sizeof(pkt)) == 0)
-		fprintf(f, "  pkt type %#x len %u flags %#x xactid %#"PRIx64"\n",
-			pkt.type,
-			pkt.tlen << VMBUS_CHANPKT_SIZE_SHIFT,
-			pkt.flags, pkt.xactid);
 }
 
 void rte_vmbus_chan_dump(FILE *f, const struct vmbus_channel *chan)
 {
-	fprintf(f, "channel[%u] relid=%u monitor=%u\n",
-		chan->subchannel_id, chan->relid, chan->monitor_id);
-	vmbus_dump_ring(f, "rxbr", &chan->rxbr);
-	vmbus_dump_ring(f, "txbr", &chan->txbr);
+	const struct vmbus_br *rbr = &chan->rxbr;
+	const struct vmbus_bufring *vbr = rbr->vbr;
+	struct vmbus_chanpkt_hdr pkt;
+
+	fprintf(f, "chan %u: relid=%u mask=%u",
+		chan->subchannel_id, chan->relid, vbr->imask);
+
+	if (vbr->feature_bits.feat_pending_send_sz)
+		fprintf(f, " pending_sz=%u\n",
+			vbr->pending_send);
+	else
+		fprintf(f, "\n");
+
+	vmbus_dump_ring(f, "    tx", &chan->txbr);
+	vmbus_dump_ring(f, "    rx", rbr);
+
+	/* show first packet if any from host */
+	if (vmbus_rxbr_peek(rbr, &pkt, sizeof(pkt)))
+		return;
+
+	fprintf(f, "[pkt type %#x len %u flags %#x xactid %#"PRIx64"]\n",
+		pkt.type, pkt.tlen << VMBUS_CHANPKT_SIZE_SHIFT,
+		pkt.flags, pkt.xactid);
 }
-- 
2.20.1


  parent reply	other threads:[~2020-05-06 19:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 19:27 [dpdk-dev] [PATCH 0/4] net/netvsc: diagnostic enhancements Stephen Hemminger
2020-05-06 19:27 ` [dpdk-dev] [PATCH 1/4] net/netvsc: support per-queue info requests Stephen Hemminger
2020-05-06 19:27 ` [dpdk-dev] [PATCH 2/4] net/netvsc: implement rx/tx descriptor status functions Stephen Hemminger
2020-05-06 19:27 ` [dpdk-dev] [PATCH 3/4] net/netvsc: change tx/rx error handling Stephen Hemminger
2020-05-06 19:27 ` Stephen Hemminger [this message]
2020-05-06 19:52 ` [dpdk-dev] [PATCH v2 0/4] net/netvsc: diagnostic enhancements Stephen Hemminger
2020-05-06 19:52   ` [dpdk-dev] [PATCH v2 1/4] net/netvsc: support per-queue info requests Stephen Hemminger
2020-05-06 19:52   ` [dpdk-dev] [PATCH v2 2/4] net/netvsc: implement rx/tx descriptor status functions Stephen Hemminger
2020-05-07 15:27     ` Ferruh Yigit
2020-05-06 19:52   ` [dpdk-dev] [PATCH v2 3/4] net/netvsc: change tx/rx error handling Stephen Hemminger
2020-05-07 15:29     ` Ferruh Yigit
2020-05-06 19:52   ` [dpdk-dev] [PATCH v2 4/4] bus/vmbus: improve debug output Stephen Hemminger
2020-05-19 16:52 ` [dpdk-dev] [PATCH v3 0/7] net/netvsc: VF bug fix and diagnostic support Stephen Hemminger
2020-05-19 16:52   ` [dpdk-dev] [PATCH v3 1/7] net/netvsc: support per-queue info requests Stephen Hemminger
2020-05-19 16:52   ` [dpdk-dev] [PATCH v3 2/7] net/netvsc: implement rx/tx descriptor status functions Stephen Hemminger
2020-05-27 18:14     ` Ferruh Yigit
2020-05-27 21:00       ` Stephen Hemminger
2020-05-19 16:52   ` [dpdk-dev] [PATCH v3 3/7] net/netvsc: change tx/rx logging Stephen Hemminger
2020-05-19 16:52   ` [dpdk-dev] [PATCH v3 4/7] net/netvsc: fix warning when VF is removed Stephen Hemminger
2020-05-19 16:52   ` [dpdk-dev] [PATCH v3 5/7] net/netvsc: don't query VF link state Stephen Hemminger
2020-05-19 16:52   ` [dpdk-dev] [PATCH v3 6/7] net/netvsc: process link change messages in alarm Stephen Hemminger
2020-05-19 16:52   ` [dpdk-dev] [PATCH v3 7/7] net/netvsc: do not spin forever waiting for reply Stephen Hemminger
2020-05-27 18:16   ` [dpdk-dev] [PATCH v3 0/7] net/netvsc: VF bug fix and diagnostic support Ferruh Yigit

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=20200506192730.21613-5-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git