summaryrefslogtreecommitdiff
path: root/lib/packets.h
diff options
context:
space:
mode:
authorDaniele Di Proietto <diproiettod@vmware.com>2016-01-28 17:47:51 -0800
committerDaniele Di Proietto <diproiettod@vmware.com>2016-02-02 18:25:00 -0800
commita90ed02611446fc7fcfc6fbf237c5c2fbe06eee3 (patch)
tree3477407b33072ba5c40938b656446abf6ce34be1 /lib/packets.h
parent34c3c2b755d403bc6db7cf2eca6c89e3791b6bd1 (diff)
downloadopenvswitch-a90ed02611446fc7fcfc6fbf237c5c2fbe06eee3.tar.gz
dpif-netdev: Delay packets' metadata initialization.
When a group of packets arrives from a port, we loop through them to initialize metadata and then we loop through them again to extract the flow and perform the exact match classification. This commit combines the two loops into one, and initializes packet->md in emc_processing() to improve performance. Since emc_processing() might also be called after recirculation (in which case the metadata is already valid), an extra parameter is added to support both cases. This commits also implements simple prefetching of packet metadata, to further improve performance. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Andy Zhou <azhou@ovn.org> Acked-by: Chandran, Sugesh <sugesh.chandran@intel.com>
Diffstat (limited to 'lib/packets.h')
-rw-r--r--lib/packets.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/packets.h b/lib/packets.h
index 834e8a498..f1445deea 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -163,6 +163,14 @@ pkt_metadata_init(struct pkt_metadata *md, odp_port_t port)
md->in_port.odp_port = port;
}
+/* This function prefetches the cachelines touched by pkt_metadata_init()
+ * For performance reasons the two functions should be kept in sync. */
+static inline void
+pkt_metadata_prefetch_init(struct pkt_metadata *md)
+{
+ ovs_prefetch_range(md, offsetof(struct pkt_metadata, tunnel.ip_src));
+}
+
bool dpid_from_string(const char *s, uint64_t *dpidp);
#define ETH_ADDR_LEN 6