From e788fe1c6a3fbc789614d425a7e3507f5cbd9513 Mon Sep 17 00:00:00 2001 From: Ivan Boule Date: Tue, 26 Apr 2011 16:45:43 +0200 Subject: [PATCH] app/testpmd: fix compliance with __rte_mbuf_sanity_check() Build mbuf and lists of mbufs in a way compliant with the checks performed by the function __rte_mbuf_sanity_check() when CONFIG_RTE_LIBRTE_MBUF_DEBUG=y Signed-off-by: Ivan Boule Acked-by: Olivier Matz --- app/test-pmd/testpmd.c | 1 + app/test-pmd/txonly.c | 1 + 2 files changed, 2 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index d4226ddff7..e1d765e74f 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -359,6 +359,7 @@ testpmd_mbuf_ctor(struct rte_mempool *mp, mb_ctor_arg = (struct mbuf_ctor_arg *) opaque_arg; mb = (struct rte_mbuf *) raw_mbuf; + mb->type = RTE_MBUF_PKT; mb->pool = mp; mb->buf_addr = (void *) ((char *)mb + mb_ctor_arg->seg_buf_offset); mb->buf_physaddr = (uint64_t) (rte_mempool_virt2phy(mp, mb) + diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index b943ca1bf3..13ab0a44ce 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -231,6 +231,7 @@ pkt_burst_transmit(struct fwd_stream *fs) for (i = 1; i < tx_pkt_nb_segs; i++) { pkt_seg->pkt.next = tx_mbuf_alloc(mbp); if (pkt_seg->pkt.next == NULL) { + pkt->pkt.nb_segs = i; rte_pktmbuf_free(pkt); goto nomore_mbuf; } -- 2.20.1