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 F2A2FA00BE; Sat, 13 Jun 2020 17:59:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 68E011BE3D; Sat, 13 Jun 2020 17:58:30 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 074105B3C for ; Sat, 13 Jun 2020 17:58:27 +0200 (CEST) IronPort-SDR: /FE279+2h/rzGL8sabpW07FYF0aVzrPE+cnOU6Ik1agEUENfDJpcckhuMmulmcBeXlIBZW9hDs OSYti52dANtA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2020 08:58:27 -0700 IronPort-SDR: NcqLM3zrDszTFZqT5LVu3LyBdiylDwZB9atXVf8lFN24Rt0J0OKVAPNVGRM+AAFBtjCPeLUttE 0ARU6l7n6pJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,507,1583222400"; d="scan'208";a="448663759" Received: from yexl-server.sh.intel.com ([10.67.116.183]) by orsmga005.jf.intel.com with ESMTP; 13 Jun 2020 08:58:26 -0700 From: Xiaolong Ye To: Olivier Matz Cc: dev@dpdk.org, Xiaolong Ye Date: Sat, 13 Jun 2020 23:49:21 +0800 Message-Id: <20200613154922.42379-6-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200613154922.42379-1-xiaolong.ye@intel.com> References: <20200613154922.42379-1-xiaolong.ye@intel.com> Subject: [dpdk-dev] [PATCH 5/5] mbuf: support to dump free_flags for dynamic flag 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" Add support to dump free_flags as below format: Free bit in mbuf->ol_flags (0 = occupied, 1 = free): 0000: 0 0 0 0 0 0 0 0 0008: 0 0 0 0 0 0 0 0 0010: 0 0 0 0 0 0 0 1 0018: 1 1 1 1 1 1 1 1 0020: 1 1 1 1 1 1 1 1 0028: 1 0 0 0 0 0 0 0 0030: 0 0 0 0 0 0 0 0 0038: 0 0 0 0 0 0 0 0 Signed-off-by: Xiaolong Ye --- lib/librte_mbuf/rte_mbuf_dyn.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c index f071651acf..538a43f695 100644 --- a/lib/librte_mbuf/rte_mbuf_dyn.c +++ b/lib/librte_mbuf/rte_mbuf_dyn.c @@ -559,5 +559,13 @@ void rte_mbuf_dyn_dump(FILE *out) fprintf(out, "%2.2x%s", shm->free_space[i], (i % 8 != 7) ? " " : "\n"); } + fprintf(out, "Free bit in mbuf->ol_flags (0 = occupied, 1 = free):\n"); + for (i = 0; i < sizeof(uint64_t) * CHAR_BIT; i++) { + if ((i % 8) == 0) + fprintf(out, " %4.4zx: ", i); + fprintf(out, "%1.1x%s", (shm->free_flags & (1ULL << i)) ? 1 : 0, + (i % 8 != 7) ? " " : "\n"); + } + rte_mcfg_tailq_write_unlock(); } -- 2.17.1