diff options
| author | Andy Zhou <azhou@nicira.com> | 2014-09-15 22:37:25 -0400 |
|---|---|---|
| committer | Pravin B Shelar <pshelar@nicira.com> | 2014-09-16 02:28:14 -0400 |
| commit | 971427f353f3c42c8dcef62e7124440df68eb809 (patch) | |
| tree | 7eed9ed50fe70cfc82ce33e12a13147ad0de580c /include/uapi/linux | |
| parent | 32ae87ff795781b7ceffc44b7c694c1bb206a266 (diff) | |
openvswitch: Add recirc and hash action.
Recirc action allows a packet to reenter openvswitch processing.
currently openvswitch lookup flow for packet received and execute
set of actions on that packet, with help of recirc action we can
process/modify the packet and recirculate it back in openvswitch
for another pass.
OVS hash action calculates 5-tupple hash and set hash in flow-key
hash. This can be used along with recirculation for distributing
packets among different ports for bond devices.
For example:
OVS bonding can use following actions:
Match on: bond flow; Action: hash, recirc(id)
Match on: recirc-id == id and hash lower bits == a;
Action: output port_bond_a
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/openvswitch.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h index a794d1dd7b40..f7fc507d82ab 100644 --- a/include/uapi/linux/openvswitch.h +++ b/include/uapi/linux/openvswitch.h | |||
| @@ -289,6 +289,9 @@ enum ovs_key_attr { | |||
| 289 | OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */ | 289 | OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */ |
| 290 | OVS_KEY_ATTR_SCTP, /* struct ovs_key_sctp */ | 290 | OVS_KEY_ATTR_SCTP, /* struct ovs_key_sctp */ |
| 291 | OVS_KEY_ATTR_TCP_FLAGS, /* be16 TCP flags. */ | 291 | OVS_KEY_ATTR_TCP_FLAGS, /* be16 TCP flags. */ |
| 292 | OVS_KEY_ATTR_DP_HASH, /* u32 hash value. Value 0 indicates the hash | ||
| 293 | is not computed by the datapath. */ | ||
| 294 | OVS_KEY_ATTR_RECIRC_ID, /* u32 recirc id */ | ||
| 292 | 295 | ||
| 293 | #ifdef __KERNEL__ | 296 | #ifdef __KERNEL__ |
| 294 | OVS_KEY_ATTR_IPV4_TUNNEL, /* struct ovs_key_ipv4_tunnel */ | 297 | OVS_KEY_ATTR_IPV4_TUNNEL, /* struct ovs_key_ipv4_tunnel */ |
| @@ -493,6 +496,27 @@ struct ovs_action_push_vlan { | |||
| 493 | __be16 vlan_tci; /* 802.1Q TCI (VLAN ID and priority). */ | 496 | __be16 vlan_tci; /* 802.1Q TCI (VLAN ID and priority). */ |
| 494 | }; | 497 | }; |
| 495 | 498 | ||
| 499 | /* Data path hash algorithm for computing Datapath hash. | ||
| 500 | * | ||
| 501 | * The algorithm type only specifies the fields in a flow | ||
| 502 | * will be used as part of the hash. Each datapath is free | ||
| 503 | * to use its own hash algorithm. The hash value will be | ||
| 504 | * opaque to the user space daemon. | ||
| 505 | */ | ||
| 506 | enum ovs_hash_alg { | ||
| 507 | OVS_HASH_ALG_L4, | ||
| 508 | }; | ||
| 509 | |||
| 510 | /* | ||
| 511 | * struct ovs_action_hash - %OVS_ACTION_ATTR_HASH action argument. | ||
| 512 | * @hash_alg: Algorithm used to compute hash prior to recirculation. | ||
| 513 | * @hash_basis: basis used for computing hash. | ||
| 514 | */ | ||
| 515 | struct ovs_action_hash { | ||
| 516 | uint32_t hash_alg; /* One of ovs_hash_alg. */ | ||
| 517 | uint32_t hash_basis; | ||
| 518 | }; | ||
| 519 | |||
| 496 | /** | 520 | /** |
| 497 | * enum ovs_action_attr - Action types. | 521 | * enum ovs_action_attr - Action types. |
| 498 | * | 522 | * |
| @@ -521,6 +545,8 @@ enum ovs_action_attr { | |||
| 521 | OVS_ACTION_ATTR_PUSH_VLAN, /* struct ovs_action_push_vlan. */ | 545 | OVS_ACTION_ATTR_PUSH_VLAN, /* struct ovs_action_push_vlan. */ |
| 522 | OVS_ACTION_ATTR_POP_VLAN, /* No argument. */ | 546 | OVS_ACTION_ATTR_POP_VLAN, /* No argument. */ |
| 523 | OVS_ACTION_ATTR_SAMPLE, /* Nested OVS_SAMPLE_ATTR_*. */ | 547 | OVS_ACTION_ATTR_SAMPLE, /* Nested OVS_SAMPLE_ATTR_*. */ |
| 548 | OVS_ACTION_ATTR_RECIRC, /* u32 recirc_id. */ | ||
| 549 | OVS_ACTION_ATTR_HASH, /* struct ovs_action_hash. */ | ||
| 524 | __OVS_ACTION_ATTR_MAX | 550 | __OVS_ACTION_ATTR_MAX |
| 525 | }; | 551 | }; |
| 526 | 552 | ||
