From: David Christensen Date: Wed, 23 Jun 2021 20:31:54 +0000 (-0700) Subject: net/memif: improve memcpy performance X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=663191e2d64d8f0229ec553f63a78470bdc81af1;p=dpdk.git net/memif: improve memcpy performance Replacing memcpy() with rte_memcpy() improved 64 byte packet performance by 33% on a POWER9 system and by 10% on an x86_64 system. Signed-off-by: David Christensen Acked-by: Tyler Retzlaff --- diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c index da7195783f..de6becd45e 100644 --- a/drivers/net/memif/rte_eth_memif.c +++ b/drivers/net/memif/rte_eth_memif.c @@ -383,9 +383,10 @@ next_slot: if (mbuf != mbuf_head) rte_pktmbuf_pkt_len(mbuf_head) += cp_len; - memcpy(rte_pktmbuf_mtod_offset(mbuf, void *, dst_off), - (uint8_t *)memif_get_buffer(proc_private, d0) + src_off, - cp_len); + rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, void *, + dst_off), + (uint8_t *)memif_get_buffer(proc_private, d0) + + src_off, cp_len); src_off += cp_len; dst_off += cp_len; @@ -644,9 +645,10 @@ next_in_chain: } cp_len = RTE_MIN(dst_len, src_len); - memcpy((uint8_t *)memif_get_buffer(proc_private, d0) + dst_off, - rte_pktmbuf_mtod_offset(mbuf, void *, src_off), - cp_len); + rte_memcpy((uint8_t *)memif_get_buffer(proc_private, + d0) + dst_off, + rte_pktmbuf_mtod_offset(mbuf, void *, src_off), + cp_len); mq->n_bytes += cp_len; src_off += cp_len;