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 81CD4A034E; Wed, 6 May 2020 21:53:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 935741DAF3; Wed, 6 May 2020 21:52:38 +0200 (CEST) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by dpdk.org (Postfix) with ESMTP id EB5611DAEA for ; Wed, 6 May 2020 21:52:36 +0200 (CEST) Received: by mail-pl1-f195.google.com with SMTP id s20so976453plp.6 for ; Wed, 06 May 2020 12:52:36 -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=cZ22W8WhYRTEcpUf5PX0PktaXMnRsrUQxbfjcyxH1UX6ODYuJlKnzQM8+EOfG5y1ni HQF0l86Ts+7s4byHk6U8Xsr6KEUKVVR2+o28wrhGsjCBM8EEjsqad2DZtrlom7DEV2w/ h87bKhvgNjh2+wdn4ekivmDzb5XD1AX4zmndUpbSt6pwpMSZ346hpvCRS0XimPHFqupP x8XDduGWLP8F3TDAaPQlWlYov4fOkJhvQa+oNAo8AVCFTRwf8h2yJ6tYz40OUjmXk8Gn yx1v6CJ/34+7nkWsjkyGds8lNfmZlWJo0KmOnwEpIlP3RT9SvivX6GH0CHeUbbkVBDXW tzCA== 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=b6PUGdL5/Jqo93KGhGS9JHp3QMv1RmVg3/s3yXcbHwR5ePt3ndwD29/7XGhAbRgJFW quD5PIQst/rHJrV6o530bDycCeTBQoMjQd8LBxXH/b3oiPqCMGfohIO89VJkVbQOnU4T YCb5O3Ol3tLD5tWGQpCQ3LLRbydRnE2SzotMOm/ZTnVo7rMvVHDGg0lGAxwBM7IAJ+xh CaYdgr5OPu1psWKn5+sPp+4tfh5t8HTSkLhnZoOK/lk1rWEH7+k0twmnQAAroy3kNQvA XLtMLy0x+BznPOmJQlnOlkKjyfIpT5bbla9CHSyhm5MaSeArx5iBsqyzcvdTu4qKo7GK 97xA== X-Gm-Message-State: AGi0PuZmMzHGlaF79NiNLGYU2xRWi7jP0YSGiYT83bOgKenZ5ONCD/fq 5AgfSDP1AzXaELAwaimpA4se80/q9hewYA== X-Google-Smtp-Source: APiQypK5vrBe45k32bRCLpvvcPhgZhGykBH8r7wMiM8JxTnMCeoy/kmIDZzx2TRx10AE58DCHdu/0g== X-Received: by 2002:a17:90b:4d09:: with SMTP id mw9mr11484778pjb.55.1588794755647; Wed, 06 May 2020 12:52:35 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id w69sm2655604pff.168.2020.05.06.12.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2020 12:52:34 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 6 May 2020 12:52:21 -0700 Message-Id: <20200506195221.26306-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200506195221.26306-1-stephen@networkplumber.org> References: <20200506192730.21613-1-stephen@networkplumber.org> <20200506195221.26306-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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