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

Message ID 1513757055-13883-1-git-send-email-huangbin.mails@gmail.com (mailing list archive)
State Not Applicable, archived
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Bin Huang Dec. 20, 2017, 8:04 a.m. UTC
  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.

Signed-off-by: Bin Huang <huangbin.mails@gmail.com>
Signed-off-by: Bin Huang <bin.huang@hxt-semitech.com>
Signed-off-by: Bin Huang <huangbin.mails@gmail.com>
---
 lib/common/mbuf.h | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Wiles, Keith Dec. 20, 2017, 2:04 p.m. UTC | #1
> On Dec 20, 2017, at 2:04 AM, Bin Huang <huangbin.mails@gmail.com> wrote:
> 
> 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.
> 
> Signed-off-by: Bin Huang <huangbin.mails@gmail.com>
> Signed-off-by: Bin Huang <bin.huang@hxt-semitech.com>
> Signed-off-by: Bin Huang <huangbin.mails@gmail.com>
> ---
> lib/common/mbuf.h | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/lib/common/mbuf.h b/lib/common/mbuf.h
> index 759f95d..93065f6 100644
> --- a/lib/common/mbuf.h
> +++ b/lib/common/mbuf.h
> @@ -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;
> }
> -- 
> 2.7.4

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

Regards,
Keith
  

Patch

diff --git a/lib/common/mbuf.h b/lib/common/mbuf.h
index 759f95d..93065f6 100644
--- a/lib/common/mbuf.h
+++ b/lib/common/mbuf.h
@@ -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;
 }