History

openvswitch: Extend packet attribute for egress tunnel info

OVS vswitch has extended IPFIX exporter to export tunnel headers to improve network visibility. To export this information userspace needs to know egress tunnel for given packet. By extending packet attributes datapath can export egress tunnel info for given packet. So that userspace can ask for egress tunnel info in userspace action. This information is used to build IPFIX data for given flow.

Wenyu Zhang committed 12 years ago

Commit 8f0aad61 parent 9ba559d12 files · +275 −31Browse files

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

Unified · Split

include/uapi/linux/openvswitch.h+13−0
@@ -157,6 +157,11 @@ enum ovs_packet_cmd { · 156 unmodified lines
157157 * notification if the %OVS_ACTION_ATTR_USERSPACE action specified an
158158 * %OVS_USERSPACE_ATTR_USERDATA attribute, with the same length and content
159159 * specified there.
160+ * @OVS_PACKET_ATTR_EGRESS_TUN_KEY: Present for an %OVS_PACKET_CMD_ACTION
161+ * notification if the %OVS_ACTION_ATTR_USERSPACE action specified an
162+ * %OVS_USERSPACE_ATTR_EGRESS_TUN_PORT attribute, which is sent only if the
163+ * output port is actually a tunnel port. Contains the output tunnel key
164+ * extracted from the packet as nested %OVS_TUNNEL_KEY_ATTR_* attributes.
160165 *
161166 * These attributes follow the &struct ovs_header within the Generic Netlink
162167 * payload for %OVS_PACKET_* commands.
@@ -167,6 +172,8 @@ enum ovs_packet_attr { · 4 unmodified lines
167172 OVS_PACKET_ATTR_KEY, /* Nested OVS_KEY_ATTR_* attributes. */
168173 OVS_PACKET_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */
169174 OVS_PACKET_ATTR_USERDATA, /* OVS_ACTION_ATTR_USERSPACE arg. */
175+ OVS_PACKET_ATTR_EGRESS_TUN_KEY, /* Nested OVS_TUNNEL_KEY_ATTR_*
176+ attributes. */
170177 __OVS_PACKET_ATTR_MAX
171178 };
172179
@@ -315,6 +322,8 @@ enum ovs_tunnel_key_attr { · 142 unmodified lines
315322 OVS_TUNNEL_KEY_ATTR_CSUM, /* No argument. CSUM packet. */
316323 OVS_TUNNEL_KEY_ATTR_OAM, /* No argument. OAM frame. */
317324 OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS, /* Array of Geneve options. */
325+ OVS_TUNNEL_KEY_ATTR_TP_SRC, /* be16 src Transport Port. */
326+ OVS_TUNNEL_KEY_ATTR_TP_DST, /* be16 dst Transport Port. */
318327 __OVS_TUNNEL_KEY_ATTR_MAX
319328 };
320329
@@ -480,11 +489,15 @@ enum ovs_sample_attr { · 159 unmodified lines
480489 * message should be sent. Required.
481490 * @OVS_USERSPACE_ATTR_USERDATA: If present, its variable-length argument is
482491 * copied to the %OVS_PACKET_CMD_ACTION message as %OVS_PACKET_ATTR_USERDATA.
492+ * @OVS_USERSPACE_ATTR_EGRESS_TUN_PORT: If present, u32 output port to get
493+ * tunnel info.
483494 */
484495 enum ovs_userspace_attr {
485496 OVS_USERSPACE_ATTR_UNSPEC,
486497 OVS_USERSPACE_ATTR_PID, /* u32 Netlink PID to receive upcalls. */
487498 OVS_USERSPACE_ATTR_USERDATA, /* Optional user-specified cookie. */
499+ OVS_USERSPACE_ATTR_EGRESS_TUN_PORT, /* Optional, u32 output port
500+ * to get tunnel info. */
488501 __OVS_USERSPACE_ATTR_MAX
489502 };
490503