From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 39E75A034E; Wed, 6 May 2020 21:28:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 484731DA78; Wed, 6 May 2020 21:27:56 +0200 (CEST) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id EA52F1DA29 for ; Wed, 6 May 2020 21:27:52 +0200 (CEST) Received: by mail-pg1-f193.google.com with SMTP id o18so1256025pgg.8 for ; Wed, 06 May 2020 12:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TMjZAc7ZtbQCLRZe8Dgo+fJUCe6Jtnp/x2gI+KHy//8=; b=dUmAYQQ7E39QjXHyk60r2Bnm5k2kI69A9YP5N+FuEif8TysRTmzmYyl2aigalCO6pH Zex3ORjBYDhIN82x6ylnKp4rt3pRO7KlpK1MCvGToBCxlDX5LjT/0+GevkA9PpeBgFqD 3hAvEcypxBnovuC3Qc3ZRBG3brvEm7FVAKDsDpAMbmSulTRveDIo3wzsf9MtLqfP8VMY 5ziTsa7UZS/WXx/QrZztud4K35IyOvKMMW+cZWcNXK6/I0Dy3CTu/YeEn5AJ7JNbpjo8 WjMrnYAojx7AequbkE0elbLgmYhxGyQ/XSVJ27eJPjAXWifbpZsYKgRi7RREoPrzq9Hy 54rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TMjZAc7ZtbQCLRZe8Dgo+fJUCe6Jtnp/x2gI+KHy//8=; b=C0lrmeNhy3yNhTlloC0pK2Pr3+rl1Q/H3pPk7eJrw9Hg05hhZoR7aWzvEcwYz9pyZf qhnxdYWkek6s/Xppg9UyN1F2xzG6psxFCBZxx8QWQELHPL4lcVTYm5acZxG6ZVpBc+EM NHaoieWaPm6QlLvIgIndK8q9YVKXT1XjNX7iisaRjOHCl+gvGlAPvdrieaUxFLMPuuvL hjR6vY6WHcSbe+SA1lHKn2Dmj37ASPASuKVNxCFD6G+bbnke+yGM8NOLdW8H8sVfuG0H u6bDlEDtcBTUuaP9Ctl9zFMsBCu3f2PFhmzAANpimx/1Jsv8YC8yewk2Qgic0D3u2o9o Cw/g== X-Gm-Message-State: AGi0Puatli7ueF99aRMhNPpIAxhTGNqHJqwb04gfP7NzECQo0Q85qD9N nwyG03uqqjpikZNzJRGfCdJ3mhYzmqQkUA== X-Google-Smtp-Source: APiQypKvCAjo1EtyTE6E3rnPBAzlaqIs0lTtria/h5LNNv0j5wW/TFvuUurWXi/tb3CVXNK9W6jgxg== X-Received: by 2002:a63:745:: with SMTP id 66mr8169735pgh.337.1588793271543; Wed, 06 May 2020 12:27:51 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id i15sm2105511pgj.30.2020.05.06.12.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2020 12:27:50 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 6 May 2020 12:27:30 -0700 Message-Id: <20200506192730.21613-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200506192730.21613-1-stephen@networkplumber.org> References: <20200506192730.21613-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 4/4] bus/vmbus: improve debug output X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Make debug output more compact. Don't print pending size or interrupt mask for the transmit side (not applicable). Signed-off-by: Stephen Hemminger --- 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