Skip to contentSkip to conversation

pktgen-dpdk: fix low performance in VM virtio pmd mode

PATCH In review Bin Huang 2 participants 2 messages Dec 20, 2017

lore
Share & tools
lore

Bin Huang

author
#0 lore raw

PATCH 1/1 pktgen-dpdk: fix low performance in VM virtio pmd mode

pktgen pre-allocated TX data in mbuf would be modified by virtio pmd driver due to virtio pkt head extension. it will caused mbuf data_len keep growing, packets size on wire growing, then tx pps performance drop.

set corresponding mbuf data_len in pktmbuf reset to fix it.

---
 lib/common/mbuf.h | 1 +
 1 file changed, 1 insertion(+)
lib/common/mbuf.h +1 -0
index 759f95d..93065f6 100644
@@ -18,6 +18,7 @@ pktmbuf_reset(struct rte_mbuf *m)
 	m->nb_segs = 1;
 	m->port = 0xff;
 
+	m->data_len = m->pkt_len;
 	m->data_off = (RTE_PKTMBUF_HEADROOM <= m->buf_len) ?
 		RTE_PKTMBUF_HEADROOM : m->buf_len;
 }
Signature · 1 line
2.7.4
#1 lore raw
Quoted 30 lines · Bin Huang

pktgen pre-allocated TX data in mbuf would be modified by virtio pmd driver due to virtio pkt head extension. it will caused mbuf data_len keep growing, packets size on wire growing, then tx pps performance drop.

set corresponding mbuf data_len in pktmbuf reset to fix it.

---
lib/common/mbuf.h | 1 +

1 file changed, 1 insertion(+)
lib/common/mbuf.h +1 -0
index 759f95d..93065f6 100644
@@ -18,6 +18,7 @@ pktmbuf_reset(struct rte_mbuf *m)
 	m->nb_segs = 1;
 	m->port = 0xff;
 
+	m->data_len = m->pkt_len;
 	m->data_off = (RTE_PKTMBUF_HEADROOM <= m->buf_len) ?
 		RTE_PKTMBUF_HEADROOM : m->buf_len;
 }
Signature · 1 line
2.7.4

Thank you for the patch, this maybe the problem a few others have seen.

Quoted 1 line

Regards,
Keith