2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-17 14:28:02 +00:00

dpif: Minimize memory copy for revalidation.

One of the limiting factors on the number of flows that can be supported
in the datapath is the overhead of assembling flow dump messages in the
datapath. This patch modifies the dpif to allow revalidators to skip
dumping the key, mask and actions from the datapath, by making use of
the unique flow identifiers introduced in earlier patches.

For each flow dump, the dpif user specifies whether to skip these
attributes, allowing the common case to only dump a pair of 128-bit ID
and flow stats. With datapath support, this increases the number of
flows that a revalidator can handle per second by 50% or more. Support
in dpif-netdev and dpif-netlink is added in this patch; kernel support
is left for future patches.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Joe Stringer
2014-10-06 11:14:08 +13:00
parent 70e5ed6f39
commit 64bb477f05
10 changed files with 279 additions and 101 deletions

View File

@@ -860,6 +860,20 @@ dpif_flow_flush(struct dpif *dpif)
return error;
}
/* Tests whether 'dpif' supports userspace flow ids. We can skip serializing
* some flow attributes for datapaths that support this feature.
*
* Returns true if 'dpif' supports UFID for flow operations.
* Returns false if 'dpif' does not support UFID. */
bool
dpif_get_enable_ufid(struct dpif *dpif)
{
if (dpif->dpif_class->get_ufid_support) {
return dpif->dpif_class->get_ufid_support(dpif);
}
return false;
}
/* A dpif_operate() wrapper for performing a single DPIF_OP_FLOW_GET. */
int
dpif_flow_get(struct dpif *dpif,
@@ -937,14 +951,15 @@ dpif_flow_del(struct dpif *dpif,
}
/* Creates and returns a new 'struct dpif_flow_dump' for iterating through the
* flows in 'dpif'.
* flows in 'dpif'. If 'terse' is true, then only UFID and statistics will
* be returned in the dump. Otherwise, all fields will be returned.
*
* This function always successfully returns a dpif_flow_dump. Error
* reporting is deferred to dpif_flow_dump_destroy(). */
struct dpif_flow_dump *
dpif_flow_dump_create(const struct dpif *dpif)
dpif_flow_dump_create(const struct dpif *dpif, bool terse)
{
return dpif->dpif_class->flow_dump_create(dpif);
return dpif->dpif_class->flow_dump_create(dpif, terse);
}
/* Destroys 'dump', which must have been created with dpif_flow_dump_create().