diff options
| author | Joe Stringer <joestringer@nicira.com> | 2015-01-21 19:42:52 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-01-26 18:45:50 -0500 |
| commit | 74ed7ab9264c54471c7f057409d352052820d750 (patch) | |
| tree | f90152a0560337fceaf55538a9e57e8c9aaa9182 /include/uapi/linux | |
| parent | 7b1883cefc288b2725966357edd2d8f321605622 (diff) | |
openvswitch: Add support for unique flow IDs.
Previously, flows were manipulated by userspace specifying a full,
unmasked flow key. This adds significant burden onto flow
serialization/deserialization, particularly when dumping flows.
This patch adds an alternative way to refer to flows using a
variable-length "unique flow identifier" (UFID). At flow setup time,
userspace may specify a UFID for a flow, which is stored with the flow
and inserted into a separate table for lookup, in addition to the
standard flow table. Flows created using a UFID must be fetched or
deleted using the UFID.
All flow dump operations may now be made more terse with OVS_UFID_F_*
flags. For example, the OVS_UFID_F_OMIT_KEY flag allows responses to
omit the flow key from a datapath operation if the flow has a
corresponding UFID. This significantly reduces the time spent assembling
and transacting netlink messages. With all OVS_UFID_F_OMIT_* flags
enabled, the datapath only returns the UFID and statistics for each flow
during flow dump, increasing ovs-vswitchd revalidator performance by 40%
or more.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/openvswitch.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h index cd8d933963c2..7a8785a99243 100644 --- a/include/uapi/linux/openvswitch.h +++ b/include/uapi/linux/openvswitch.h | |||
| @@ -459,6 +459,14 @@ struct ovs_key_nd { | |||
| 459 | * a wildcarded match. Omitting attribute is treated as wildcarding all | 459 | * a wildcarded match. Omitting attribute is treated as wildcarding all |
| 460 | * corresponding fields. Optional for all requests. If not present, | 460 | * corresponding fields. Optional for all requests. If not present, |
| 461 | * all flow key bits are exact match bits. | 461 | * all flow key bits are exact match bits. |
| 462 | * @OVS_FLOW_ATTR_UFID: A value between 1-16 octets specifying a unique | ||
| 463 | * identifier for the flow. Causes the flow to be indexed by this value rather | ||
| 464 | * than the value of the %OVS_FLOW_ATTR_KEY attribute. Optional for all | ||
| 465 | * requests. Present in notifications if the flow was created with this | ||
| 466 | * attribute. | ||
| 467 | * @OVS_FLOW_ATTR_UFID_FLAGS: A 32-bit value of OR'd %OVS_UFID_F_* | ||
| 468 | * flags that provide alternative semantics for flow installation and | ||
| 469 | * retrieval. Optional for all requests. | ||
| 462 | * | 470 | * |
| 463 | * These attributes follow the &struct ovs_header within the Generic Netlink | 471 | * These attributes follow the &struct ovs_header within the Generic Netlink |
| 464 | * payload for %OVS_FLOW_* commands. | 472 | * payload for %OVS_FLOW_* commands. |
| @@ -474,12 +482,24 @@ enum ovs_flow_attr { | |||
| 474 | OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */ | 482 | OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */ |
| 475 | OVS_FLOW_ATTR_PROBE, /* Flow operation is a feature probe, error | 483 | OVS_FLOW_ATTR_PROBE, /* Flow operation is a feature probe, error |
| 476 | * logging should be suppressed. */ | 484 | * logging should be suppressed. */ |
| 485 | OVS_FLOW_ATTR_UFID, /* Variable length unique flow identifier. */ | ||
| 486 | OVS_FLOW_ATTR_UFID_FLAGS,/* u32 of OVS_UFID_F_*. */ | ||
| 477 | __OVS_FLOW_ATTR_MAX | 487 | __OVS_FLOW_ATTR_MAX |
| 478 | }; | 488 | }; |
| 479 | 489 | ||
| 480 | #define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1) | 490 | #define OVS_FLOW_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1) |
| 481 | 491 | ||
| 482 | /** | 492 | /** |
| 493 | * Omit attributes for notifications. | ||
| 494 | * | ||
| 495 | * If a datapath request contains an %OVS_UFID_F_OMIT_* flag, then the datapath | ||
| 496 | * may omit the corresponding %OVS_FLOW_ATTR_* from the response. | ||
| 497 | */ | ||
| 498 | #define OVS_UFID_F_OMIT_KEY (1 << 0) | ||
| 499 | #define OVS_UFID_F_OMIT_MASK (1 << 1) | ||
| 500 | #define OVS_UFID_F_OMIT_ACTIONS (1 << 2) | ||
| 501 | |||
| 502 | /** | ||
| 483 | * enum ovs_sample_attr - Attributes for %OVS_ACTION_ATTR_SAMPLE action. | 503 | * enum ovs_sample_attr - Attributes for %OVS_ACTION_ATTR_SAMPLE action. |
| 484 | * @OVS_SAMPLE_ATTR_PROBABILITY: 32-bit fraction of packets to sample with | 504 | * @OVS_SAMPLE_ATTR_PROBABILITY: 32-bit fraction of packets to sample with |
| 485 | * @OVS_ACTION_ATTR_SAMPLE. A value of 0 samples no packets, a value of | 505 | * @OVS_ACTION_ATTR_SAMPLE. A value of 0 samples no packets, a value of |
