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 09D7CA052B; Fri, 31 Jul 2020 14:55:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 913B4262E; Fri, 31 Jul 2020 14:55:03 +0200 (CEST) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 4288A255 for ; Fri, 31 Jul 2020 14:55:02 +0200 (CEST) Received: by mail-wm1-f66.google.com with SMTP id 3so9155448wmi.1 for ; Fri, 31 Jul 2020 05:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qtm/3Wk+ji+/nnrlmM6ycYMypL1dOpEC3pQdDgxG2/U=; b=NHvVjI4IlsgjGSLAEySZgRxvjhLwStNNshlnvpQ24cMv6lB9ywh2hgBQIUvUnXWUzT ucpOeNQCbWlEzIR7aEr+PwaBMgXzf+jEszCw6KBaVJW/vxKmhWUsM24I67zm1OCcq0AW JDalLKt1eyHBDbTDVzaiHQH3zc0WMqPAnJKK8hRxGriW3RjmLDrLSlDk6FC2MH2mokTh mqQ4FV+eN63QQrmeOvi/6xhbZoC0mqVTpLsP7Ka7KwlweC8CA7CDVVkvOQD0u82+0HO7 nt09ZRrTnU+TBEpTrH/DNnm4SsO4VbViFbwuvinRCeircSPXHDSTTECjTJuV6gYy1Ce4 SfdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qtm/3Wk+ji+/nnrlmM6ycYMypL1dOpEC3pQdDgxG2/U=; b=MkIkwuvHJogRFQrP/mKcvRqSJZkKA4XnpLSSyLVfRgwVNX1B7d9Gwr+Lp0WPC5K2J0 h+JrrXmAB0saSzP96pxFLaPKG8LQniGhX6YBNaIkK6aCC9vf+bGkTjZi0ePfAz/eEaWM YEMt1sD+wxdqJktT5fG3AAbplsBKFuDbYxmXdSH16CmDuXyoOa4cKmrFOnfJuFSDozW/ gIMfCO+bN5GSsFY0LsAPYTvZCqxANT1opf0G7hjkxxMTHtfyuwJUf4xLCi/pmtrhBSZo EBJYk8dEvRotI83ztRSlYLrFjZ1A03OKkF/LkWlULZAm9KSkFdETrJfs7mcaxoL/1YuA 26dQ== X-Gm-Message-State: AOAM530MZnfHlnVCNXwMO74v8MrUko3Lbw/BIMNkrBgKHSeJZ8TrwcbV +vnoXl7yI225GB6vIZzp0i94oA== X-Google-Smtp-Source: ABdhPJx7HCLwI3/o+gYRuuEqg2Td7730U1ogv/NNwKbc2s6vRLYEyQ3BNOAFXSf9GbUBMw0lC9+W9Q== X-Received: by 2002:a7b:cf08:: with SMTP id l8mr3573473wmg.183.1596200101572; Fri, 31 Jul 2020 05:55:01 -0700 (PDT) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id f124sm12071554wmf.7.2020.07.31.05.55.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 05:55:00 -0700 (PDT) Date: Fri, 31 Jul 2020 14:55:00 +0200 From: Olivier Matz To: Hemant Agrawal Cc: dev@dpdk.org Message-ID: <20200731125500.GF5869@platinum> References: <20200711095936.11535-1-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200711095936.11535-1-hemant.agrawal@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH] mempool: enhance dump function to print ops name 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" Hi Hemant, Thank you for submitting this improvement. Minor comments below. On Sat, Jul 11, 2020 at 03:29:36PM +0530, Hemant Agrawal wrote: > Enhance the dump function to also print the ops index > and associated mempool ops name > > Signed-off-by: Hemant Agrawal > --- > lib/librte_mempool/rte_mempool.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c > index 5b23e2ae78..462ea850a1 100644 > --- a/lib/librte_mempool/rte_mempool.c > +++ b/lib/librte_mempool/rte_mempool.c > @@ -1186,6 +1186,7 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) > unsigned lcore_id; > #endif > struct rte_mempool_memhdr *memhdr; > + struct rte_mempool_ops *ops; > unsigned common_count; > unsigned cache_count; > size_t mem_len = 0; > @@ -1208,6 +1209,10 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) > > fprintf(f, " private_data_size=%"PRIu32"\n", mp->private_data_size); > > + ops = rte_mempool_get_ops(mp->ops_index); > + fprintf(f, " ops_index=%d ops_name: <%s>\n", > + mp->ops_index, ops ? ops->name:"NA"); > + Could you have 2 printed lines for it? One for index, and another for the name. About the ternary operator, even if checkpatch does not complain, I prefer having one space on each side around the colon (this form is more common in dpdk). > STAILQ_FOREACH(memhdr, &mp->mem_list, next) > mem_len += memhdr->len; > if (mem_len != 0) { > @@ -1250,7 +1255,6 @@ rte_mempool_dump(FILE *f, struct rte_mempool *mp) > #else > fprintf(f, " no statistics available\n"); > #endif > - > rte_mempool_audit(mp); > } Uneeded line removal there. Thanks! Olivier