net/memif: replace memcpy() with rte_memcpy() to improve perf
Checks
Commit Message
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(-)
--
2.27.0
Comments
On Wed, Jun 23, 2021 at 01:31:54PM -0700, David Christensen wrote:
> 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>
> ---
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
On 6/24/21 7:15 PM, Tyler Retzlaff wrote:
> On Wed, Jun 23, 2021 at 01:31:54PM -0700, David Christensen wrote:
>> 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>
>> ---
>
> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
>
Fixed long lines and changed summary to:
net/memif: use rte_memcpy() to improve performance
Applied, thanks.
@@ -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);