From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3D4F6A0032 for ; Fri, 22 Apr 2022 10:40:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AFEE40042; Fri, 22 Apr 2022 10:40:13 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 982BB40042 for ; Fri, 22 Apr 2022 10:40:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650616811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6pffUd+4mlk9GI80Kli8wymxDPgxDJhYa0VeM/mQgAs=; b=DV/uU2p2Ju2yhQ1ksLmkNby4KPpzt55BwbKprdJ4uEyV5rXj8u3PkQtPYJGKonH1Flu5iA QsH033oGux4S8z+zkMd/gR76fF/8A4azQddxwbUqUc2kS7N8Vz4SFr/yA1fTf4vmEDGLm4 cTwa9Ryyg4GnE8HFuTCFN1h1Eksj8CE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-388-em16_6OwNTO-2tJe7Y7s8w-1; Fri, 22 Apr 2022 04:40:09 -0400 X-MC-Unique: em16_6OwNTO-2tJe7Y7s8w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4C555804189; Fri, 22 Apr 2022 08:40:09 +0000 (UTC) Received: from [10.39.208.35] (unknown [10.39.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 64022404776F; Fri, 22 Apr 2022 08:40:08 +0000 (UTC) Message-ID: Date: Fri, 22 Apr 2022 10:40:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] examples/vdpa: fix disabled VirtQ statistics query To: Xueming Li , dev@dpdk.org Cc: stable@dpdk.org, Chenbo Xia , Matan Azrad References: <20220224132405.1939006-1-xuemingl@nvidia.com> From: Maxime Coquelin In-Reply-To: <20220224132405.1939006-1-xuemingl@nvidia.com> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org "examples/vdpa: fix disabled virtqueue statistics query" On 2/24/22 14:24, Xueming Li wrote: > Quit VirtQ statistics query instead of reporting error. > > Fixes: 6505865aa8ed ("examples/vdpa: add statistics show command") > Cc: stable@dpdk.org > > Signed-off-by: Xueming Li > --- > examples/vdpa/main.c | 21 +++++++++++++++++++-- > 1 file changed, 19 insertions(+), 2 deletions(-) > > diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c > index 5ab07655aed..bd66deca85c 100644 > --- a/examples/vdpa/main.c > +++ b/examples/vdpa/main.c > @@ -391,7 +391,9 @@ static void cmd_device_stats_parsed(void *parsed_result, struct cmdline *cl, > struct rte_vdpa_device *vdev = rte_vdpa_find_device_by_name(res->bdf); > struct vdpa_port *vport = NULL; > uint32_t first, last; > + int vq_disabled = -1; > int i; > + int ret; > > if (!vdev) { > RTE_LOG(ERR, VDPA, "Invalid device: %s.\n", > @@ -449,8 +451,20 @@ static void cmd_device_stats_parsed(void *parsed_result, struct cmdline *cl, > cmdline_printf(cl, "\nDevice %s:\n", res->bdf); > for (; first <= last; first++) { > memset(vport->stats, 0, sizeof(*vport->stats) * vport->stats_n); > - if (rte_vdpa_get_stats(vport->dev, (int)first, vport->stats, > - vport->stats_n) <= 0) { > + ret = rte_vdpa_get_stats(vport->dev, (int)first, vport->stats, > + vport->stats_n); > + if (ret == 0) { > + /* VQ disabled. */ > + if (vq_disabled == -1) > + vq_disabled = (int)first; > + continue; > + } > + if (vq_disabled != -1) { > + cmdline_printf(cl, "\tVirtq %d - %d disabled\n", > + vq_disabled, (int)first - 1); > + vq_disabled = -1; > + } > + if (ret < 0) { > RTE_LOG(ERR, VDPA, "Failed to get vdpa queue statistics" > " for device %s qid %d.\n", res->bdf, > (int)first); > @@ -464,6 +478,9 @@ static void cmd_device_stats_parsed(void *parsed_result, struct cmdline *cl, > vport->stats[i].value); > } > } > + if (vq_disabled != -1) > + cmdline_printf(cl, "\tVirtq %d - %d disabled\n", > + vq_disabled, (int)first - 1); > } > > cmdline_parse_token_string_t cmd_device_stats_ = It is not clear to me how it is going to look like, could you paste some logs?