mirror of
https://github.com/openvswitch/ovs
synced 2025-10-29 15:28:56 +00:00
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>
This commit is contained in:
@@ -29,7 +29,7 @@ dp_packet_init__(struct dp_packet *b, size_t allocated, enum dp_packet_source so
|
||||
b->source = source;
|
||||
b->l2_pad_size = 0;
|
||||
b->l2_5_ofs = b->l3_ofs = b->l4_ofs = UINT16_MAX;
|
||||
b->md = PKT_METADATA_INITIALIZER(0);
|
||||
pkt_metadata_init(&b->md, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user