]> Pileus Git - ~andy/linux/commit
openvswitch: Use skb_zerocopy() for upcall
authorThomas Graf <tgraf@suug.ch>
Fri, 13 Dec 2013 14:22:21 +0000 (15:22 +0100)
committerJesse Gross <jesse@nicira.com>
Mon, 6 Jan 2014 23:53:17 +0000 (15:53 -0800)
commitbda56f143c9dc38ae7926ba21ebeb35359a6c051
treeb3deb68ee339b9857796a51a4a68deba0188fede
parent8055a89cfa533f70bea5970727a50e220bb7d18e
openvswitch: Use skb_zerocopy() for upcall

Use of skb_zerocopy() can avoid the expensive call to memcpy()
when copying the packet data into the Netlink skb. Completes
checksum through skb_checksum_help() if not already done in
GSO segmentation.

Zerocopy is only performed if user space supported unaligned
Netlink messages. memory mapped netlink i/o is preferred over
zerocopy if it is set up.

Cost of upcall 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@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
net/openvswitch/datapath.c