[PATCH v6 7/7] vhost: optimize memcpy routines when cc memcpy is used

Maxime Coquelin maxime.coquelin at redhat.com
Thu Oct 3 13:46:59 CEST 2024



On 9/20/24 12:27, Mattias Rönnblom wrote:
> In build where use_cc_memcpy is set to true, the vhost user PMD
> suffers a large performance drop on Intel P-cores for small packets,
> at least when built by GCC and (to a much lesser extent) clang.
> 
> This patch addresses that issue by using a custom virtio
> memcpy()-based packet copying routine.
> 
> Performance results from a Raptor Lake @ 3,2 GHz:
> 
> GCC 12.3.0
> 64 bytes packets
> Core  Mode              Mpps
> E     RTE memcpy        9.5
> E     cc memcpy         9.7
> E     cc memcpy+pktcpy  9.0
> 
> P     RTE memcpy        16.4
> P     cc memcpy         13.5
> P     cc memcpy+pktcpy  16.2
> 
> GCC 12.3.0
> 1500 bytes packets
> Core  Mode              Mpps
> P    RTE memcpy         5.8
> P    cc memcpy          5.9
> P    cc memcpy+pktcpy   5.9
> 
> clang 15.0.7
> 64 bytes packets
> Core  Mode              Mpps
> P     RTE memcpy        13.3
> P     cc memcpy         12.9
> P     cc memcpy+pktcpy  13.9
> 
> "RTE memcpy" is use_cc_memcpy=false, "cc memcpy" is use_cc_memcpy=true
> and "pktcpy" is when this patch is applied.
> 
> Signed-off-by: Mattias Rönnblom <mattias.ronnblom at ericsson.com>
> ---
>   lib/vhost/virtio_net.c | 37 +++++++++++++++++++++++++++++++++++--
>   1 file changed, 35 insertions(+), 2 deletions(-)
> 

As the default behaviour remains unchanged, this is good to me:

Acked-by: Maxime Coquelin <maxime.coquelin at redhat.com>

Thanks,
Maxime



More information about the dev mailing list