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
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
583struct 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 { · 117 unmodified lines
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 nested711 * @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. The713 * @OVS_ACTION_ATTR_SET: Replaces the contents of an existing header. The
@@ -756,6 +761,7 @@ enum ovs_action_attr { · 47 unmodified lines
756 * The data must be zero for the unmasked761 * 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 accepted766 __OVS_ACTION_ATTR_MAX, /* Nothing past this will be accepted
761 * from userspace. */767 * 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