[ovs-dev] [PATCH 3/3] debug: print mbuf extra info.

Flavio Leitner fbl at sysclose.org
Mon Sep 23 14:15:10 UTC 2019


Signed-off-by: Flavio Leitner <fbl at sysclose.org>
---
 lib/netdev-dpdk.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index cfbd9a9e5..7965bf57a 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -2294,6 +2294,24 @@ netdev_dpdk_vhost_update_rx_counters(struct netdev_stats *stats,
         }
 
         stats->rx_bytes += packet_size;
+#if 0
+        /* Debug/Tracing */
+        struct rte_mbuf *mbuf = (struct rte_mbuf *)packet;
+        int nb_segs = mbuf->nb_segs;
+        if (nb_segs == 1)
+                VLOG_INFO("single (root) size = %d, nb_segs = %d, max = %d",
+                          mbuf->pkt_len, nb_segs,
+                          rte_pktmbuf_data_room_size(mbuf->pool));
+        else
+                VLOG_INFO("chained (root) size = %d, nb_segs = %d, max = %d",
+                          mbuf->pkt_len, nb_segs,
+                          rte_pktmbuf_data_room_size(mbuf->pool));
+
+        for (int j = 1; j < nb_segs; j++) {
+                mbuf = mbuf->next;
+                VLOG_INFO("chained packet (%d) size = %d", j, mbuf->data_len);
+        }
+#endif
     }
 }
 
-- 
2.20.1



More information about the dev mailing list