DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/memif: replace memcpy() with rte_memcpy() to improve perf
@ 2021-06-23 16:49 David Christensen
  2021-06-23 17:03 ` Stephen Hemminger
  2021-06-23 20:31 ` David Christensen
  0 siblings, 2 replies; 6+ messages in thread
From: David Christensen @ 2021-06-23 16:49 UTC (permalink / raw)
  To: jgrajcia, dev; +Cc: David Christensen

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>
---
 drivers/net/memif/rte_eth_memif.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index d17222c612..330c9c2fd6 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -384,8 +384,8 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 				rte_pktmbuf_pkt_len(mbuf_head) += cp_len;
 
 			rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, void *, dst_off),
-			       (uint8_t *)memif_get_buffer(proc_private, d0) + src_off,
-			       cp_len);
+			       (uint8_t *)memif_get_buffer(proc_private, d0)
+			       + src_off, cp_len);
 
 			src_off += cp_len;
 			dst_off += cp_len;
@@ -644,7 +644,8 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			}
 			cp_len = RTE_MIN(dst_len, src_len);
 
-			rte_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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/memif: replace memcpy() with rte_memcpy() to improve perf
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2021-06-23 17:03 UTC (permalink / raw)
  To: David Christensen; +Cc: jgrajcia, dev

On Wed, 23 Jun 2021 09:49:35 -0700
David Christensen <drc@linux.vnet.ibm.com> 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.

I see rte_memcpy was already used in the patch diff

> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---
>  drivers/net/memif/rte_eth_memif.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
> index d17222c612..330c9c2fd6 100644
> --- a/drivers/net/memif/rte_eth_memif.c
> +++ b/drivers/net/memif/rte_eth_memif.c
> @@ -384,8 +384,8 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>  				rte_pktmbuf_pkt_len(mbuf_head) += cp_len;
>  
>  			rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, void *, dst_off),
> -			       (uint8_t *)memif_get_buffer(proc_private, d0) + src_off,
> -			       cp_len);
> +			       (uint8_t *)memif_get_buffer(proc_private, d0)
> +			       + src_off, cp_len);

This just changes line break for no good reason.
>  
>  			src_off += cp_len;
>  			dst_off += cp_len;
> @@ -644,7 +644,8 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>  			}
>  			cp_len = RTE_MIN(dst_len, src_len);
>  
> -			rte_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);
>  

ditto.

Look like this patch is confused, the description does not match the code.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH] net/memif: replace memcpy() with rte_memcpy() to improve perf
  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-06-23 20:31 ` David Christensen
  2021-06-24 16:15   ` Tyler Retzlaff
  1 sibling, 1 reply; 6+ messages in thread
From: David Christensen @ 2021-06-23 20:31 UTC (permalink / raw)
  To: dev, jgrajcia; +Cc: David Christensen

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/memif: replace memcpy() with rte_memcpy() to improve perf
  2021-06-23 20:31 ` David Christensen
@ 2021-06-24 16:15   ` Tyler Retzlaff
  2021-07-01 16:19     ` Andrew Rybchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Tyler Retzlaff @ 2021-06-24 16:15 UTC (permalink / raw)
  To: David Christensen; +Cc: dev, jgrajcia

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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/memif: replace memcpy() with rte_memcpy() to improve perf
  2021-06-24 16:15   ` Tyler Retzlaff
@ 2021-07-01 16:19     ` Andrew Rybchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Rybchenko @ 2021-07-01 16:19 UTC (permalink / raw)
  To: Tyler Retzlaff, David Christensen; +Cc: dev, jgrajcia

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/memif: replace memcpy() with rte_memcpy() to improve perf
  2021-06-23 17:03 ` Stephen Hemminger
@ 2021-07-01 16:22   ` Andrew Rybchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Rybchenko @ 2021-07-01 16:22 UTC (permalink / raw)
  To: Stephen Hemminger, David Christensen; +Cc: jgrajcia, dev

On 6/23/21 8:03 PM, Stephen Hemminger wrote:
> On Wed, 23 Jun 2021 09:49:35 -0700
> David Christensen <drc@linux.vnet.ibm.com> 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.
> 
> I see rte_memcpy was already used in the patch diff
> 
>> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
>> ---
>>  drivers/net/memif/rte_eth_memif.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
>> index d17222c612..330c9c2fd6 100644
>> --- a/drivers/net/memif/rte_eth_memif.c
>> +++ b/drivers/net/memif/rte_eth_memif.c
>> @@ -384,8 +384,8 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>>  				rte_pktmbuf_pkt_len(mbuf_head) += cp_len;
>>  
>>  			rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, void *, dst_off),
>> -			       (uint8_t *)memif_get_buffer(proc_private, d0) + src_off,
>> -			       cp_len);
>> +			       (uint8_t *)memif_get_buffer(proc_private, d0)
>> +			       + src_off, cp_len);
> 
> This just changes line break for no good reason.
>>  
>>  			src_off += cp_len;
>>  			dst_off += cp_len;
>> @@ -644,7 +644,8 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>>  			}
>>  			cp_len = RTE_MIN(dst_len, src_len);
>>  
>> -			rte_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);
>>  
> 
> ditto.
> 
> Look like this patch is confused, the description does not match the code.
> 


I guess it was a patch on top of [1]. Marking this one as rejected since
I've applied style fixes before applying it.

[1]
https://patches.dpdk.org/project/dpdk/patch/20210623203154.72409-1-drc@linux.vnet.ibm.com/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-01 16:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-06-24 16:15   ` Tyler Retzlaff
2021-07-01 16:19     ` Andrew Rybchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).