Subject: Re: [PATCH 2/2 net-next] openvswitch: Use skb_zerocopy() for upcall

From: Daniel Borkmann <[email-masked]>
Date: Fri, 08 Nov 2013 12:24:21 +0100

On 11/08/2013 11:47 AM, Thomas Graf wrote:
> Use of skb_zerocopy() avoids the expensive call to memcpy() when
> copying the packet data into the Netlink skb. Completes checksum
> through skb_checksum_help() if needed.
>
> Netlink messaged must be properly padded and aligned to meet
> sanity checks of the user space counterpart.
>
> Cost of memcpy is significantly reduced from:
> +   7.48%       vhost-8471  [k] memcpy
> +   5.57%     ovs-vswitchd  [k] memcpy
> +   2.81%       vhost-8471  [k] csum_partial_copy_generic
>
> to:
> +   5.72%     ovs-vswitchd  [k] memcpy
> +   3.32%       vhost-5153  [k] memcpy
> +   0.68%       vhost-5153  [k] skb_zerocopy
>
> (megaflows disabled)
>
> Signed-off-by: Thomas Graf <tgraf-G/[email-masked]>
> Cc: Jesse Gross <[email-masked]>
> Cc: Eric Dumazet <[email-masked]>

Reviewed-by: Daniel Borkmann <[email-masked]>