History

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.

William Tu committed 10 years ago

Commit f2a4d081 parent 1578b0a6 files · +73 −17Browse files

Showing the changes to include/uapi/linux (1 of 6 files). Show all

Unified · Split

include/uapi/linux/openvswitch.h+6−0
@@ -580,6 +580,10 @@ enum ovs_userspace_attr { · 579 unmodified lines
580580
581581 #define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
582582
583+struct ovs_action_trunc {
584+ uint32_t max_len; /* Max packet size in bytes. */
585+};
586+
583587 /**
584588 * struct ovs_action_push_mpls - %OVS_ACTION_ATTR_PUSH_MPLS action argument.
585589 * @mpls_lse: MPLS label stack entry to push.
@@ -703,6 +707,7 @@ enum ovs_nat_attr { · 117 unmodified lines
703707 * enum ovs_action_attr - Action types.
704708 *
705709 * @OVS_ACTION_ATTR_OUTPUT: Output packet to port.
710+ * @OVS_ACTION_ATTR_TRUNC: Output packet to port with truncated packet size.
706711 * @OVS_ACTION_ATTR_USERSPACE: Send packet to userspace according to nested
707712 * %OVS_USERSPACE_ATTR_* attributes.
708713 * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The
@@ -756,6 +761,7 @@ enum ovs_action_attr { · 47 unmodified lines
756761 * The data must be zero for the unmasked
757762 * bits. */
758763 OVS_ACTION_ATTR_CT, /* Nested OVS_CT_ATTR_* . */
764+ OVS_ACTION_ATTR_TRUNC, /* u32 struct ovs_action_trunc. */
759765
760766 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted
761767 * from userspace. */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t