diff options
| author | William Tu <u9012063@gmail.com> | 2016-06-10 14:49:33 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-06-10 20:58:03 -0400 |
| commit | f2a4d086ed4c588d32fe9b7aa67fead7280e7bf1 (patch) | |
| tree | 7824d6446b4fd259cc7430641fd27475445361ba /include/uapi/linux/openvswitch.h | |
| parent | 1578b0a5e92825334760741e5c166b8873886f1b (diff) | |
openvswitch: Add packet truncation support.
The patch adds a new OVS action, OVS_ACTION_ATTR_TRUNC, in order to
truncate packets. A 'max_len' is added for setting up the maximum
packet size, and a 'cutlen' field is to record the number of bytes
to trim the packet when the packet is outputting to a port, or when
the packet is sent to userspace.
Signed-off-by: William Tu <u9012063@gmail.com>
Cc: Pravin Shelar <pshelar@nicira.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/openvswitch.h')
| -rw-r--r-- | include/uapi/linux/openvswitch.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h index bb0d515b7654..8274675ba9a3 100644 --- a/include/uapi/linux/openvswitch.h +++ b/include/uapi/linux/openvswitch.h | |||
| @@ -580,6 +580,10 @@ enum ovs_userspace_attr { | |||
| 580 | 580 | ||
| 581 | #define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1) | 581 | #define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1) |
| 582 | 582 | ||
| 583 | struct ovs_action_trunc { | ||
| 584 | uint32_t max_len; /* Max packet size in bytes. */ | ||
| 585 | }; | ||
| 586 | |||
| 583 | /** | 587 | /** |
| 584 | * struct ovs_action_push_mpls - %OVS_ACTION_ATTR_PUSH_MPLS action argument. | 588 | * struct ovs_action_push_mpls - %OVS_ACTION_ATTR_PUSH_MPLS action argument. |
| 585 | * @mpls_lse: MPLS label stack entry to push. | 589 | * @mpls_lse: MPLS label stack entry to push. |
| @@ -703,6 +707,7 @@ enum ovs_nat_attr { | |||
| 703 | * enum ovs_action_attr - Action types. | 707 | * enum ovs_action_attr - Action types. |
| 704 | * | 708 | * |
| 705 | * @OVS_ACTION_ATTR_OUTPUT: Output packet to port. | 709 | * @OVS_ACTION_ATTR_OUTPUT: Output packet to port. |
| 710 | * @OVS_ACTION_ATTR_TRUNC: Output packet to port with truncated packet size. | ||
| 706 | * @OVS_ACTION_ATTR_USERSPACE: Send packet to userspace according to nested | 711 | * @OVS_ACTION_ATTR_USERSPACE: Send packet to userspace according to nested |
| 707 | * %OVS_USERSPACE_ATTR_* attributes. | 712 | * %OVS_USERSPACE_ATTR_* attributes. |
| 708 | * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The | 713 | * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The |
| @@ -756,6 +761,7 @@ enum ovs_action_attr { | |||
| 756 | * The data must be zero for the unmasked | 761 | * The data must be zero for the unmasked |
| 757 | * bits. */ | 762 | * bits. */ |
| 758 | OVS_ACTION_ATTR_CT, /* Nested OVS_CT_ATTR_* . */ | 763 | OVS_ACTION_ATTR_CT, /* Nested OVS_CT_ATTR_* . */ |
| 764 | OVS_ACTION_ATTR_TRUNC, /* u32 struct ovs_action_trunc. */ | ||
| 759 | 765 | ||
| 760 | __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted | 766 | __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted |
| 761 | * from userspace. */ | 767 | * from userspace. */ |
