tunnels: Don't initialize unnecessary packet metadata.
authorJesse Gross <jesse@nicira.com>
Wed, 1 Jul 2015 02:19:40 +0000 (19:19 -0700)
committerJesse Gross <jesse@nicira.com>
Wed, 1 Jul 2015 22:24:04 +0000 (15:24 -0700)
commit35303d715b1f0db46e6a27146815061a60385dc6
tree54dc0c17e4478ee71fca8fc49c93d7ae584f6f66
parent421e24220fc9493683f75fafc7e2ced8ba60bf30
tunnels: Don't initialize unnecessary packet metadata.

The addition of Geneve options to packet metadata significantly
expanded its size. It was reported that this can decrease performance
for DPDK ports by up to 25% since we need to initialize the whole
structure on each packet receive.

It is not really necessary to zero out the entire structure because
miniflow_extract() only copies the tunnel metadata when particular
fields indicate that it is valid. Therefore, as long as we zero out
these fields when the metadata is initialized and ensure that the
rest of the structure is correctly set in the presence of a tunnel,
we can avoid touching the tunnel fields on packet reception.

Reported-by: Ciara Loftus <ciara.loftus@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/dp-packet.c
lib/dpif-netdev.c
lib/netdev-vport.c
lib/netdev.c
lib/odp-util.c
lib/packets.h
lib/tun-metadata.h
ofproto/ofproto-dpif-upcall.c
utilities/ovs-ofctl.c