DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xiaolong Ye <xiaolong.ye@intel.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: dev@dpdk.org, Xiaolong Ye <xiaolong.ye@intel.com>
Subject: [dpdk-dev] [PATCH 5/5] mbuf: support to dump free_flags for dynamic flag
Date: Sat, 13 Jun 2020 23:49:21 +0800	[thread overview]
Message-ID: <20200613154922.42379-6-xiaolong.ye@intel.com> (raw)
In-Reply-To: <20200613154922.42379-1-xiaolong.ye@intel.com>

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 <xiaolong.ye@intel.com>
---
 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


  parent reply	other threads:[~2020-06-13 15:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-13 15:49 [dpdk-dev] [PATCH 0/5] small fixes for mbuf's dynamic field/flag feature Xiaolong Ye
2020-06-13 15:49 ` [dpdk-dev] [PATCH 1/5] mbuf: fix out-of-bounds access at dyn field register Xiaolong Ye
2020-06-13 15:49 ` [dpdk-dev] [PATCH 2/5] mbuf: fix missing errno for dyn field/flag registration Xiaolong Ye
2020-06-25 15:31   ` Olivier Matz
2020-06-13 15:49 ` [dpdk-dev] [PATCH 3/5] mbuf: fix free_space setting for dynamic field Xiaolong Ye
2020-06-25 15:53   ` Olivier Matz
2020-06-13 15:49 ` [dpdk-dev] [PATCH 4/5] mbuf: fix a dynamic field dump log Xiaolong Ye
2020-06-25 15:54   ` Olivier Matz
2020-06-13 15:49 ` Xiaolong Ye [this message]
2020-06-25 15:55   ` [dpdk-dev] [PATCH 5/5] mbuf: support to dump free_flags for dynamic flag Olivier Matz
2020-06-25 20:40 ` [dpdk-dev] [PATCH 0/5] small fixes for mbuf's dynamic field/flag feature Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200613154922.42379-6-xiaolong.ye@intel.com \
    --to=xiaolong.ye@intel.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).