History

openvswitch: Add packet len info to upcall.

The commit f2a4d086ed4c ("openvswitch: Add packet truncation support.") introduces packet truncation before sending to userspace upcall receiver. This patch passes up the skb->len before truncation so that the upcall receiver knows the original packet size. Potentially this will be used by sFlow, where OVS translates sFlow config header=N to a sample action, truncating packet to N byte in kernel datapath. Thus, only N bytes instead of full-packet size is copied from kernel to userspace, saving the kernel-to-userspace bandwidth.

William Tu committed 10 years ago

Commit b95e5921 parent 904632a2 files · +14 −1Browse files

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

Unified · Split

include/uapi/linux/openvswitch.h+2−0
@@ -166,6 +166,7 @@ enum ovs_packet_cmd { · 165 unmodified lines
166 * output port is actually a tunnel port. Contains the output tunnel key166 * output port is actually a tunnel port. Contains the output tunnel key
167 * extracted from the packet as nested %OVS_TUNNEL_KEY_ATTR_* attributes.167 * extracted from the packet as nested %OVS_TUNNEL_KEY_ATTR_* attributes.
168 * @OVS_PACKET_ATTR_MRU: Present for an %OVS_PACKET_CMD_ACTION and168 * @OVS_PACKET_ATTR_MRU: Present for an %OVS_PACKET_CMD_ACTION and
169 * @OVS_PACKET_ATTR_LEN: Packet size before truncation.
169 * %OVS_PACKET_ATTR_USERSPACE action specify the Maximum received fragment170 * %OVS_PACKET_ATTR_USERSPACE action specify the Maximum received fragment
170 * size.171 * size.
171 *172 *
@@ -185,6 +186,7 @@ enum ovs_packet_attr { · 13 unmodified lines
185 OVS_PACKET_ATTR_PROBE, /* Packet operation is a feature probe,186 OVS_PACKET_ATTR_PROBE, /* Packet operation is a feature probe,
186 error logging should be suppressed. */187 error logging should be suppressed. */
187 OVS_PACKET_ATTR_MRU, /* Maximum received IP fragment size. */188 OVS_PACKET_ATTR_MRU, /* Maximum received IP fragment size. */
189 OVS_PACKET_ATTR_LEN, /* Packet size before truncation. */
188 __OVS_PACKET_ATTR_MAX190 __OVS_PACKET_ATTR_MAX
189};191};
190 192

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