From: David Christensen <drc@linux.vnet.ibm.com>
To: dev@dpdk.org, jgrajcia@cisco.com
Cc: David Christensen <drc@linux.vnet.ibm.com>
Subject: [dpdk-dev] [PATCH] net/memif: replace memcpy() with rte_memcpy() to improve perf
Date: Wed, 23 Jun 2021 13:31:54 -0700 [thread overview]
Message-ID: <20210623203154.72409-1-drc@linux.vnet.ibm.com> (raw)
In-Reply-To: <20210623164935.59796-1-drc@linux.vnet.ibm.com>
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 <drc@linux.vnet.ibm.com>
---
v2: Fixed last patch which was bungled due to a bad local git squash
drivers/net/memif/rte_eth_memif.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index da7195783f..d17222c612 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -383,7 +383,7 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
if (mbuf != mbuf_head)
rte_pktmbuf_pkt_len(mbuf_head) += cp_len;
- memcpy(rte_pktmbuf_mtod_offset(mbuf, void *, dst_off),
+ rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, void *, dst_off),
(uint8_t *)memif_get_buffer(proc_private, d0) + src_off,
cp_len);
@@ -644,7 +644,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
cp_len = RTE_MIN(dst_len, src_len);
- memcpy((uint8_t *)memif_get_buffer(proc_private, d0) + dst_off,
+ rte_memcpy((uint8_t *)memif_get_buffer(proc_private, d0) + dst_off,
rte_pktmbuf_mtod_offset(mbuf, void *, src_off),
cp_len);
--
2.27.0
next prev parent reply other threads:[~2021-06-23 20:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 16:49 [dpdk-dev] [PATCH] net/memif: replace memcpy() with rte_memcpy() to improve perf David Christensen
2021-06-23 17:03 ` Stephen Hemminger
2021-07-01 16:22 ` Andrew Rybchenko
2021-06-23 20:31 ` David Christensen [this message]
2021-06-24 16:15 ` Tyler Retzlaff
2021-07-01 16:19 ` Andrew Rybchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210623203154.72409-1-drc@linux.vnet.ibm.com \
--to=drc@linux.vnet.ibm.com \
--cc=dev@dpdk.org \
--cc=jgrajcia@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.