aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/openvswitch.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/linux/openvswitch.h')
-rw-r--r--include/uapi/linux/openvswitch.h84
1 files changed, 80 insertions, 4 deletions
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index a794d1dd7b40..3a6dcaa359b7 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -157,6 +157,11 @@ enum ovs_packet_cmd {
157 * notification if the %OVS_ACTION_ATTR_USERSPACE action specified an 157 * notification if the %OVS_ACTION_ATTR_USERSPACE action specified an
158 * %OVS_USERSPACE_ATTR_USERDATA attribute, with the same length and content 158 * %OVS_USERSPACE_ATTR_USERDATA attribute, with the same length and content
159 * specified there. 159 * 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.
160 * 165 *
161 * These attributes follow the &struct ovs_header within the Generic Netlink 166 * These attributes follow the &struct ovs_header within the Generic Netlink
162 * payload for %OVS_PACKET_* commands. 167 * payload for %OVS_PACKET_* commands.
@@ -167,6 +172,8 @@ enum ovs_packet_attr {
167 OVS_PACKET_ATTR_KEY, /* Nested OVS_KEY_ATTR_* attributes. */ 172 OVS_PACKET_ATTR_KEY, /* Nested OVS_KEY_ATTR_* attributes. */
168 OVS_PACKET_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */ 173 OVS_PACKET_ATTR_ACTIONS, /* Nested OVS_ACTION_ATTR_* attributes. */
169 OVS_PACKET_ATTR_USERDATA, /* OVS_ACTION_ATTR_USERSPACE arg. */ 174 OVS_PACKET_ATTR_USERDATA, /* OVS_ACTION_ATTR_USERSPACE arg. */
175 OVS_PACKET_ATTR_EGRESS_TUN_KEY, /* Nested OVS_TUNNEL_KEY_ATTR_*
176 attributes. */
170 __OVS_PACKET_ATTR_MAX 177 __OVS_PACKET_ATTR_MAX
171}; 178};
172 179
@@ -192,6 +199,7 @@ enum ovs_vport_type {
192 OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */ 199 OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */
193 OVS_VPORT_TYPE_GRE, /* GRE tunnel. */ 200 OVS_VPORT_TYPE_GRE, /* GRE tunnel. */
194 OVS_VPORT_TYPE_VXLAN, /* VXLAN tunnel. */ 201 OVS_VPORT_TYPE_VXLAN, /* VXLAN tunnel. */
202 OVS_VPORT_TYPE_GENEVE, /* Geneve tunnel. */
195 __OVS_VPORT_TYPE_MAX 203 __OVS_VPORT_TYPE_MAX
196}; 204};
197 205
@@ -289,9 +297,15 @@ enum ovs_key_attr {
289 OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */ 297 OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */
290 OVS_KEY_ATTR_SCTP, /* struct ovs_key_sctp */ 298 OVS_KEY_ATTR_SCTP, /* struct ovs_key_sctp */
291 OVS_KEY_ATTR_TCP_FLAGS, /* be16 TCP flags. */ 299 OVS_KEY_ATTR_TCP_FLAGS, /* be16 TCP flags. */
300 OVS_KEY_ATTR_DP_HASH, /* u32 hash value. Value 0 indicates the hash
301 is not computed by the datapath. */
302 OVS_KEY_ATTR_RECIRC_ID, /* u32 recirc id */
303 OVS_KEY_ATTR_MPLS, /* array of struct ovs_key_mpls.
304 * The implementation may restrict
305 * the accepted length of the array. */
292 306
293#ifdef __KERNEL__ 307#ifdef __KERNEL__
294 OVS_KEY_ATTR_IPV4_TUNNEL, /* struct ovs_key_ipv4_tunnel */ 308 OVS_KEY_ATTR_TUNNEL_INFO, /* struct ovs_tunnel_info */
295#endif 309#endif
296 __OVS_KEY_ATTR_MAX 310 __OVS_KEY_ATTR_MAX
297}; 311};
@@ -306,6 +320,10 @@ enum ovs_tunnel_key_attr {
306 OVS_TUNNEL_KEY_ATTR_TTL, /* u8 Tunnel IP TTL. */ 320 OVS_TUNNEL_KEY_ATTR_TTL, /* u8 Tunnel IP TTL. */
307 OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT, /* No argument, set DF. */ 321 OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT, /* No argument, set DF. */
308 OVS_TUNNEL_KEY_ATTR_CSUM, /* No argument. CSUM packet. */ 322 OVS_TUNNEL_KEY_ATTR_CSUM, /* No argument. CSUM packet. */
323 OVS_TUNNEL_KEY_ATTR_OAM, /* No argument. OAM frame. */
324 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. */
309 __OVS_TUNNEL_KEY_ATTR_MAX 327 __OVS_TUNNEL_KEY_ATTR_MAX
310}; 328};
311 329
@@ -334,6 +352,10 @@ struct ovs_key_ethernet {
334 __u8 eth_dst[ETH_ALEN]; 352 __u8 eth_dst[ETH_ALEN];
335}; 353};
336 354
355struct ovs_key_mpls {
356 __be32 mpls_lse;
357};
358
337struct ovs_key_ipv4 { 359struct ovs_key_ipv4 {
338 __be32 ipv4_src; 360 __be32 ipv4_src;
339 __be32 ipv4_dst; 361 __be32 ipv4_dst;
@@ -387,9 +409,9 @@ struct ovs_key_arp {
387}; 409};
388 410
389struct ovs_key_nd { 411struct ovs_key_nd {
390 __u32 nd_target[4]; 412 __be32 nd_target[4];
391 __u8 nd_sll[ETH_ALEN]; 413 __u8 nd_sll[ETH_ALEN];
392 __u8 nd_tll[ETH_ALEN]; 414 __u8 nd_tll[ETH_ALEN];
393}; 415};
394 416
395/** 417/**
@@ -435,6 +457,8 @@ enum ovs_flow_attr {
435 OVS_FLOW_ATTR_USED, /* u64 msecs last used in monotonic time. */ 457 OVS_FLOW_ATTR_USED, /* u64 msecs last used in monotonic time. */
436 OVS_FLOW_ATTR_CLEAR, /* Flag to clear stats, tcp_flags, used. */ 458 OVS_FLOW_ATTR_CLEAR, /* Flag to clear stats, tcp_flags, used. */
437 OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */ 459 OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */
460 OVS_FLOW_ATTR_PROBE, /* Flow operation is a feature probe, error
461 * logging should be suppressed. */
438 __OVS_FLOW_ATTR_MAX 462 __OVS_FLOW_ATTR_MAX
439}; 463};
440 464
@@ -467,17 +491,34 @@ enum ovs_sample_attr {
467 * message should be sent. Required. 491 * message should be sent. Required.
468 * @OVS_USERSPACE_ATTR_USERDATA: If present, its variable-length argument is 492 * @OVS_USERSPACE_ATTR_USERDATA: If present, its variable-length argument is
469 * copied to the %OVS_PACKET_CMD_ACTION message as %OVS_PACKET_ATTR_USERDATA. 493 * copied to the %OVS_PACKET_CMD_ACTION message as %OVS_PACKET_ATTR_USERDATA.
494 * @OVS_USERSPACE_ATTR_EGRESS_TUN_PORT: If present, u32 output port to get
495 * tunnel info.
470 */ 496 */
471enum ovs_userspace_attr { 497enum ovs_userspace_attr {
472 OVS_USERSPACE_ATTR_UNSPEC, 498 OVS_USERSPACE_ATTR_UNSPEC,
473 OVS_USERSPACE_ATTR_PID, /* u32 Netlink PID to receive upcalls. */ 499 OVS_USERSPACE_ATTR_PID, /* u32 Netlink PID to receive upcalls. */
474 OVS_USERSPACE_ATTR_USERDATA, /* Optional user-specified cookie. */ 500 OVS_USERSPACE_ATTR_USERDATA, /* Optional user-specified cookie. */
501 OVS_USERSPACE_ATTR_EGRESS_TUN_PORT, /* Optional, u32 output port
502 * to get tunnel info. */
475 __OVS_USERSPACE_ATTR_MAX 503 __OVS_USERSPACE_ATTR_MAX
476}; 504};
477 505
478#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1) 506#define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
479 507
480/** 508/**
509 * struct ovs_action_push_mpls - %OVS_ACTION_ATTR_PUSH_MPLS action argument.
510 * @mpls_lse: MPLS label stack entry to push.
511 * @mpls_ethertype: Ethertype to set in the encapsulating ethernet frame.
512 *
513 * The only values @mpls_ethertype should ever be given are %ETH_P_MPLS_UC and
514 * %ETH_P_MPLS_MC, indicating MPLS unicast or multicast. Other are rejected.
515 */
516struct ovs_action_push_mpls {
517 __be32 mpls_lse;
518 __be16 mpls_ethertype; /* Either %ETH_P_MPLS_UC or %ETH_P_MPLS_MC */
519};
520
521/**
481 * struct ovs_action_push_vlan - %OVS_ACTION_ATTR_PUSH_VLAN action argument. 522 * struct ovs_action_push_vlan - %OVS_ACTION_ATTR_PUSH_VLAN action argument.
482 * @vlan_tpid: Tag protocol identifier (TPID) to push. 523 * @vlan_tpid: Tag protocol identifier (TPID) to push.
483 * @vlan_tci: Tag control identifier (TCI) to push. The CFI bit must be set 524 * @vlan_tci: Tag control identifier (TCI) to push. The CFI bit must be set
@@ -493,6 +534,27 @@ struct ovs_action_push_vlan {
493 __be16 vlan_tci; /* 802.1Q TCI (VLAN ID and priority). */ 534 __be16 vlan_tci; /* 802.1Q TCI (VLAN ID and priority). */
494}; 535};
495 536
537/* Data path hash algorithm for computing Datapath hash.
538 *
539 * The algorithm type only specifies the fields in a flow
540 * will be used as part of the hash. Each datapath is free
541 * to use its own hash algorithm. The hash value will be
542 * opaque to the user space daemon.
543 */
544enum ovs_hash_alg {
545 OVS_HASH_ALG_L4,
546};
547
548/*
549 * struct ovs_action_hash - %OVS_ACTION_ATTR_HASH action argument.
550 * @hash_alg: Algorithm used to compute hash prior to recirculation.
551 * @hash_basis: basis used for computing hash.
552 */
553struct ovs_action_hash {
554 uint32_t hash_alg; /* One of ovs_hash_alg. */
555 uint32_t hash_basis;
556};
557
496/** 558/**
497 * enum ovs_action_attr - Action types. 559 * enum ovs_action_attr - Action types.
498 * 560 *
@@ -507,6 +569,15 @@ struct ovs_action_push_vlan {
507 * @OVS_ACTION_ATTR_POP_VLAN: Pop the outermost 802.1Q header off the packet. 569 * @OVS_ACTION_ATTR_POP_VLAN: Pop the outermost 802.1Q header off the packet.
508 * @OVS_ACTION_ATTR_SAMPLE: Probabilitically executes actions, as specified in 570 * @OVS_ACTION_ATTR_SAMPLE: Probabilitically executes actions, as specified in
509 * the nested %OVS_SAMPLE_ATTR_* attributes. 571 * the nested %OVS_SAMPLE_ATTR_* attributes.
572 * @OVS_ACTION_ATTR_PUSH_MPLS: Push a new MPLS label stack entry onto the
573 * top of the packets MPLS label stack. Set the ethertype of the
574 * encapsulating frame to either %ETH_P_MPLS_UC or %ETH_P_MPLS_MC to
575 * indicate the new packet contents.
576 * @OVS_ACTION_ATTR_POP_MPLS: Pop an MPLS label stack entry off of the
577 * packet's MPLS label stack. Set the encapsulating frame's ethertype to
578 * indicate the new packet contents. This could potentially still be
579 * %ETH_P_MPLS if the resulting MPLS label stack is not empty. If there
580 * is no MPLS label stack, as determined by ethertype, no action is taken.
510 * 581 *
511 * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all 582 * Only a single header can be set with a single %OVS_ACTION_ATTR_SET. Not all
512 * fields within a header are modifiable, e.g. the IPv4 protocol and fragment 583 * fields within a header are modifiable, e.g. the IPv4 protocol and fragment
@@ -521,6 +592,11 @@ enum ovs_action_attr {
521 OVS_ACTION_ATTR_PUSH_VLAN, /* struct ovs_action_push_vlan. */ 592 OVS_ACTION_ATTR_PUSH_VLAN, /* struct ovs_action_push_vlan. */
522 OVS_ACTION_ATTR_POP_VLAN, /* No argument. */ 593 OVS_ACTION_ATTR_POP_VLAN, /* No argument. */
523 OVS_ACTION_ATTR_SAMPLE, /* Nested OVS_SAMPLE_ATTR_*. */ 594 OVS_ACTION_ATTR_SAMPLE, /* Nested OVS_SAMPLE_ATTR_*. */
595 OVS_ACTION_ATTR_RECIRC, /* u32 recirc_id. */
596 OVS_ACTION_ATTR_HASH, /* struct ovs_action_hash. */
597 OVS_ACTION_ATTR_PUSH_MPLS, /* struct ovs_action_push_mpls. */
598 OVS_ACTION_ATTR_POP_MPLS, /* __be16 ethertype. */
599
524 __OVS_ACTION_ATTR_MAX 600 __OVS_ACTION_ATTR_MAX
525}; 601};
526 602