[PATCH v9 3/8] mbuf: decode the hash and fdir info in rte_pktmbuf_dump
Stephen Hemminger
stephen at networkplumber.org
Sat Sep 28 18:18:33 CEST 2024
Useful to be able to see the meta data in the hex dump.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
lib/mbuf/rte_mbuf.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/lib/mbuf/rte_mbuf.c b/lib/mbuf/rte_mbuf.c
index 559d5ad8a7..8e452ca98f 100644
--- a/lib/mbuf/rte_mbuf.c
+++ b/lib/mbuf/rte_mbuf.c
@@ -678,12 +678,26 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)
fprintf(f, " pkt_len=%u, ol_flags=%#"PRIx64", nb_segs=%u, port=%u",
m->pkt_len, m->ol_flags, m->nb_segs, m->port);
+ if (m->port != RTE_MBUF_PORT_INVALID)
+ fprintf(f, ", port=%u", m->port);
+
if (m->ol_flags & (RTE_MBUF_F_RX_QINQ | RTE_MBUF_F_TX_QINQ))
fprintf(f, ", vlan_tci_outer=%u", m->vlan_tci_outer);
if (m->ol_flags & (RTE_MBUF_F_RX_VLAN | RTE_MBUF_F_TX_VLAN))
fprintf(f, ", vlan_tci=%u", m->vlan_tci);
+ if (m->ol_flags & RTE_MBUF_F_RX_RSS_HASH)
+ fprintf(f, ", rss=%#x", m->hash.rss);
+ else if (m->ol_flags & RTE_MBUF_F_RX_FDIR) {
+ if (m->ol_flags & RTE_MBUF_F_RX_FDIR_ID)
+ fprintf(f, ", fdir id=%u", m->hash.fdir.id);
+ else if (m->ol_flags & RTE_MBUF_F_RX_FDIR_FLX)
+ fprintf(f, ", fdir flex=%#x %x", m->hash.fdir.hi, m->hash.fdir.lo);
+ else
+ fprintf(f, " fdir hash=%#x id=%#x ", m->hash.fdir.hash, m->hash.fdir.id);
+ }
+
fprintf(f, ", ptype=%#"PRIx32"\n", m->packet_type);
nb_segs = m->nb_segs;
--
2.45.2
More information about the dev
mailing list