New upstream version 18.08
[deb_dpdk.git] / lib / librte_ethdev / rte_flow.h
similarity index 57%
rename from lib/librte_ether/rte_flow.h
rename to lib/librte_ethdev/rte_flow.h
index 13e4202..f8ba71c 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright 2016 6WIND S.A.
- * Copyright 2016 Mellanox.
+ * Copyright 2016 Mellanox Technologies, Ltd
  */
 
 #ifndef RTE_FLOW_H_
  * associated actions in hardware through flow rules.
  */
 
+#include <stddef.h>
+#include <stdint.h>
+
 #include <rte_arp.h>
 #include <rte_ether.h>
+#include <rte_eth_ctrl.h>
 #include <rte_icmp.h>
 #include <rte_ip.h>
 #include <rte_sctp.h>
@@ -31,18 +35,20 @@ extern "C" {
 /**
  * Flow rule attributes.
  *
- * Priorities are set on two levels: per group and per rule within groups.
+ * Priorities are set on a per rule based within groups.
  *
- * Lower values denote higher priority, the highest priority for both levels
- * is 0, so that a rule with priority 0 in group 8 is always matched after a
- * rule with priority 8 in group 0.
+ * Lower values denote higher priority, the highest priority for a flow rule
+ * is 0, so that a flow that matches for than one rule, the rule with the
+ * lowest priority value will always be matched.
  *
  * Although optional, applications are encouraged to group similar rules as
  * much as possible to fully take advantage of hardware capabilities
  * (e.g. optimized matching) and work around limitations (e.g. a single
- * pattern type possibly allowed in a given group).
+ * pattern type possibly allowed in a given group). Applications should be
+ * aware that groups are not linked by default, and that they must be
+ * explicitly linked by the application using the JUMP action.
  *
- * Group and priority levels are arbitrary and up to the application, they
+ * Priority levels are arbitrary and up to the application, they
  * do not need to be contiguous nor start from 0, however the maximum number
  * varies between devices and may be affected by existing flow rules.
  *
@@ -65,10 +71,29 @@ extern "C" {
  */
 struct rte_flow_attr {
        uint32_t group; /**< Priority group. */
-       uint32_t priority; /**< Priority level within group. */
+       uint32_t priority; /**< Rule priority level within group. */
        uint32_t ingress:1; /**< Rule applies to ingress traffic. */
        uint32_t egress:1; /**< Rule applies to egress traffic. */
-       uint32_t reserved:30; /**< Reserved, must be zero. */
+       /**
+        * Instead of simply matching the properties of traffic as it would
+        * appear on a given DPDK port ID, enabling this attribute transfers
+        * a flow rule to the lowest possible level of any device endpoints
+        * found in the pattern.
+        *
+        * When supported, this effectively enables an application to
+        * re-route traffic not necessarily intended for it (e.g. coming
+        * from or addressed to different physical ports, VFs or
+        * applications) at the device level.
+        *
+        * It complements the behavior of some pattern items such as
+        * RTE_FLOW_ITEM_TYPE_PHY_PORT and is meaningless without them.
+        *
+        * When transferring flow rules, ingress and egress attributes keep
+        * their original meaning, as if processing traffic emitted or
+        * received by the application.
+        */
+       uint32_t transfer:1;
+       uint32_t reserved:29; /**< Reserved, must be zero. */
 };
 
 /**
@@ -76,15 +101,13 @@ struct rte_flow_attr {
  *
  * Pattern items fall in two categories:
  *
- * - Matching protocol headers and packet data (ANY, RAW, ETH, VLAN, IPV4,
- *   IPV6, ICMP, UDP, TCP, SCTP, VXLAN and so on), usually associated with a
+ * - Matching protocol headers and packet data, usually associated with a
  *   specification structure. These must be stacked in the same order as the
- *   protocol layers to match, starting from the lowest.
+ *   protocol layers to match inside packets, starting from the lowest.
  *
- * - Matching meta-data or affecting pattern processing (END, VOID, INVERT,
- *   PF, VF, PORT and so on), often without a specification structure. Since
- *   they do not match packet contents, these can be specified anywhere
- *   within item lists without affecting others.
+ * - Matching meta-data or affecting pattern processing, often without a
+ *   specification structure. Since they do not match packet contents, their
+ *   position in the list is usually not relevant.
  *
  * See the description of individual types for more information. Those
  * marked with [META] fall into the second category.
@@ -131,13 +154,8 @@ enum rte_flow_item_type {
        /**
         * [META]
         *
-        * Matches packets addressed to the physical function of the device.
-        *
-        * If the underlying device function differs from the one that would
-        * normally receive the matched traffic, specifying this item
-        * prevents it from reaching that device unless the flow rule
-        * contains a PF action. Packets are not duplicated between device
-        * instances by default.
+        * Matches traffic originating from (ingress) or going to (egress)
+        * the physical function of the current device.
         *
         * No associated specification structure.
         */
@@ -146,13 +164,8 @@ enum rte_flow_item_type {
        /**
         * [META]
         *
-        * Matches packets addressed to a virtual function ID of the device.
-        *
-        * If the underlying device function differs from the one that would
-        * normally receive the matched traffic, specifying this item
-        * prevents it from reaching that device unless the flow rule
-        * contains a VF action. Packets are not duplicated between device
-        * instances by default.
+        * Matches traffic originating from (ingress) or going to (egress) a
+        * given virtual function of the current device.
         *
         * See struct rte_flow_item_vf.
         */
@@ -161,17 +174,22 @@ enum rte_flow_item_type {
        /**
         * [META]
         *
-        * Matches packets coming from the specified physical port of the
-        * underlying device.
+        * Matches traffic originating from (ingress) or going to (egress) a
+        * physical port of the underlying device.
         *
-        * The first PORT item overrides the physical port normally
-        * associated with the specified DPDK input port (port_id). This
-        * item can be provided several times to match additional physical
-        * ports.
+        * See struct rte_flow_item_phy_port.
+        */
+       RTE_FLOW_ITEM_TYPE_PHY_PORT,
+
+       /**
+        * [META]
+        *
+        * Matches traffic originating from (ingress) or going to (egress) a
+        * given DPDK port ID.
         *
-        * See struct rte_flow_item_port.
+        * See struct rte_flow_item_port_id.
         */
-       RTE_FLOW_ITEM_TYPE_PORT,
+       RTE_FLOW_ITEM_TYPE_PORT_ID,
 
        /**
         * Matches a byte string of a given length at a given offset.
@@ -323,6 +341,78 @@ enum rte_flow_item_type {
         * See struct rte_flow_item_geneve.
         */
        RTE_FLOW_ITEM_TYPE_GENEVE,
+
+       /**
+        * Matches a VXLAN-GPE header.
+        *
+        * See struct rte_flow_item_vxlan_gpe.
+        */
+       RTE_FLOW_ITEM_TYPE_VXLAN_GPE,
+
+       /**
+        * Matches an ARP header for Ethernet/IPv4.
+        *
+        * See struct rte_flow_item_arp_eth_ipv4.
+        */
+       RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4,
+
+       /**
+        * Matches the presence of any IPv6 extension header.
+        *
+        * See struct rte_flow_item_ipv6_ext.
+        */
+       RTE_FLOW_ITEM_TYPE_IPV6_EXT,
+
+       /**
+        * Matches any ICMPv6 header.
+        *
+        * See struct rte_flow_item_icmp6.
+        */
+       RTE_FLOW_ITEM_TYPE_ICMP6,
+
+       /**
+        * Matches an ICMPv6 neighbor discovery solicitation.
+        *
+        * See struct rte_flow_item_icmp6_nd_ns.
+        */
+       RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS,
+
+       /**
+        * Matches an ICMPv6 neighbor discovery advertisement.
+        *
+        * See struct rte_flow_item_icmp6_nd_na.
+        */
+       RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA,
+
+       /**
+        * Matches the presence of any ICMPv6 neighbor discovery option.
+        *
+        * See struct rte_flow_item_icmp6_nd_opt.
+        */
+       RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT,
+
+       /**
+        * Matches an ICMPv6 neighbor discovery source Ethernet link-layer
+        * address option.
+        *
+        * See struct rte_flow_item_icmp6_nd_opt_sla_eth.
+        */
+       RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH,
+
+       /**
+        * Matches an ICMPv6 neighbor discovery target Ethernet link-layer
+        * address option.
+        *
+        * See struct rte_flow_item_icmp6_nd_opt_tla_eth.
+        */
+       RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH,
+
+       /**
+        * Matches specified mark field.
+        *
+        * See struct rte_flow_item_mark.
+        */
+       RTE_FLOW_ITEM_TYPE_MARK,
 };
 
 /**
@@ -350,15 +440,15 @@ static const struct rte_flow_item_any rte_flow_item_any_mask = {
 /**
  * RTE_FLOW_ITEM_TYPE_VF
  *
- * Matches packets addressed to a virtual function ID of the device.
+ * Matches traffic originating from (ingress) or going to (egress) a given
+ * virtual function of the current device.
+ *
+ * If supported, should work even if the virtual function is not managed by
+ * the application and thus not associated with a DPDK port ID.
  *
- * If the underlying device function differs from the one that would
- * normally receive the matched traffic, specifying this item prevents it
- * from reaching that device unless the flow rule contains a VF
- * action. Packets are not duplicated between device instances by default.
+ * Note this pattern item does not match VF representors traffic which, as
+ * separate entities, should be addressed through their own DPDK port IDs.
  *
- * - Likely to return an error or never match any traffic if this causes a
- *   VF device to match traffic addressed to a different VF.
  * - Can be specified multiple times to match traffic addressed to several
  *   VF IDs.
  * - Can be combined with a PF item to match both PF and VF traffic.
@@ -366,7 +456,7 @@ static const struct rte_flow_item_any rte_flow_item_any_mask = {
  * A zeroed mask can be used to match any VF ID.
  */
 struct rte_flow_item_vf {
-       uint32_t id; /**< Destination VF ID. */
+       uint32_t id; /**< VF ID. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VF. */
@@ -377,13 +467,13 @@ static const struct rte_flow_item_vf rte_flow_item_vf_mask = {
 #endif
 
 /**
- * RTE_FLOW_ITEM_TYPE_PORT
+ * RTE_FLOW_ITEM_TYPE_PHY_PORT
  *
- * Matches packets coming from the specified physical port of the underlying
- * device.
+ * Matches traffic originating from (ingress) or going to (egress) a
+ * physical port of the underlying device.
  *
- * The first PORT item overrides the physical port normally associated with
- * the specified DPDK input port (port_id). This item can be provided
+ * The first PHY_PORT item overrides the physical port normally associated
+ * with the specified DPDK input port (port_id). This item can be provided
  * several times to match additional physical ports.
  *
  * Note that physical ports are not necessarily tied to DPDK input ports
@@ -396,17 +486,43 @@ static const struct rte_flow_item_vf rte_flow_item_vf_mask = {
  *
  * A zeroed mask can be used to match any port index.
  */
-struct rte_flow_item_port {
+struct rte_flow_item_phy_port {
        uint32_t index; /**< Physical port index. */
 };
 
-/** Default mask for RTE_FLOW_ITEM_TYPE_PORT. */
+/** Default mask for RTE_FLOW_ITEM_TYPE_PHY_PORT. */
 #ifndef __cplusplus
-static const struct rte_flow_item_port rte_flow_item_port_mask = {
+static const struct rte_flow_item_phy_port rte_flow_item_phy_port_mask = {
        .index = 0x00000000,
 };
 #endif
 
+/**
+ * RTE_FLOW_ITEM_TYPE_PORT_ID
+ *
+ * Matches traffic originating from (ingress) or going to (egress) a given
+ * DPDK port ID.
+ *
+ * Normally only supported if the port ID in question is known by the
+ * underlying PMD and related to the device the flow rule is created
+ * against.
+ *
+ * This must not be confused with @p PHY_PORT which refers to the physical
+ * port of a device, whereas @p PORT_ID refers to a struct rte_eth_dev
+ * object on the application side (also known as "port representor"
+ * depending on the kind of underlying device).
+ */
+struct rte_flow_item_port_id {
+       uint32_t id; /**< DPDK port ID. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_PORT_ID. */
+#ifndef __cplusplus
+static const struct rte_flow_item_port_id rte_flow_item_port_id_mask = {
+       .id = 0xffffffff,
+};
+#endif
+
 /**
  * RTE_FLOW_ITEM_TYPE_RAW
  *
@@ -432,7 +548,7 @@ struct rte_flow_item_raw {
        int32_t offset; /**< Absolute or relative offset for pattern. */
        uint16_t limit; /**< Search area limit for start of pattern. */
        uint16_t length; /**< Pattern length. */
-       uint8_t pattern[]; /**< Byte string to look for. */
+       const uint8_t *pattern; /**< Byte string to look for. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_RAW. */
@@ -444,6 +560,7 @@ static const struct rte_flow_item_raw rte_flow_item_raw_mask = {
        .offset = 0xffffffff,
        .limit = 0xffff,
        .length = 0xffff,
+       .pattern = NULL,
 };
 #endif
 
@@ -451,11 +568,17 @@ static const struct rte_flow_item_raw rte_flow_item_raw_mask = {
  * RTE_FLOW_ITEM_TYPE_ETH
  *
  * Matches an Ethernet header.
+ *
+ * The @p type field either stands for "EtherType" or "TPID" when followed
+ * by so-called layer 2.5 pattern items such as RTE_FLOW_ITEM_TYPE_VLAN. In
+ * the latter case, @p type refers to that of the outer header, with the
+ * inner EtherType/TPID provided by the subsequent pattern item. This is the
+ * same order as on the wire.
  */
 struct rte_flow_item_eth {
        struct ether_addr dst; /**< Destination MAC. */
        struct ether_addr src; /**< Source MAC. */
-       rte_be16_t type; /**< EtherType. */
+       rte_be16_t type; /**< EtherType or TPID. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */
@@ -472,19 +595,20 @@ static const struct rte_flow_item_eth rte_flow_item_eth_mask = {
  *
  * Matches an 802.1Q/ad VLAN tag.
  *
- * This type normally follows either RTE_FLOW_ITEM_TYPE_ETH or
- * RTE_FLOW_ITEM_TYPE_VLAN.
+ * The corresponding standard outer EtherType (TPID) values are
+ * ETHER_TYPE_VLAN or ETHER_TYPE_QINQ. It can be overridden by the preceding
+ * pattern item.
  */
 struct rte_flow_item_vlan {
-       rte_be16_t tpid; /**< Tag protocol identifier. */
        rte_be16_t tci; /**< Tag control information. */
+       rte_be16_t inner_type; /**< Inner EtherType or TPID. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_VLAN. */
 #ifndef __cplusplus
 static const struct rte_flow_item_vlan rte_flow_item_vlan_mask = {
-       .tpid = RTE_BE16(0x0000),
-       .tci = RTE_BE16(0xffff),
+       .tci = RTE_BE16(0x0fff),
+       .inner_type = RTE_BE16(0x0000),
 };
 #endif
 
@@ -514,7 +638,8 @@ static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask = {
  *
  * Matches an IPv6 header.
  *
- * Note: IPv6 options are handled by dedicated pattern items.
+ * Note: IPv6 options are handled by dedicated pattern items, see
+ * RTE_FLOW_ITEM_TYPE_IPV6_EXT.
  */
 struct rte_flow_item_ipv6 {
        struct ipv6_hdr hdr; /**< IPv6 header definition. */
@@ -633,9 +758,11 @@ static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask = {
  * RTE_FLOW_ITEM_TYPE_E_TAG.
  *
  * Matches a E-tag header.
+ *
+ * The corresponding standard outer EtherType (TPID) value is
+ * ETHER_TYPE_ETAG. It can be overridden by the preceding pattern item.
  */
 struct rte_flow_item_e_tag {
-       rte_be16_t tpid; /**< Tag protocol identifier (0x893F). */
        /**
         * E-Tag control information (E-TCI).
         * E-PCP (3b), E-DEI (1b), ingress E-CID base (12b).
@@ -645,6 +772,7 @@ struct rte_flow_item_e_tag {
        rte_be16_t rsvd_grp_ecid_b;
        uint8_t in_ecid_e; /**< Ingress E-CID ext. */
        uint8_t ecid_e; /**< E-CID ext. */
+       rte_be16_t inner_type; /**< Inner EtherType or TPID. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_E_TAG. */
@@ -814,6 +942,241 @@ static const struct rte_flow_item_geneve rte_flow_item_geneve_mask = {
 };
 #endif
 
+/**
+ * RTE_FLOW_ITEM_TYPE_VXLAN_GPE (draft-ietf-nvo3-vxlan-gpe-05).
+ *
+ * Matches a VXLAN-GPE header.
+ */
+struct rte_flow_item_vxlan_gpe {
+       uint8_t flags; /**< Normally 0x0c (I and P flags). */
+       uint8_t rsvd0[2]; /**< Reserved, normally 0x0000. */
+       uint8_t protocol; /**< Protocol type. */
+       uint8_t vni[3]; /**< VXLAN identifier. */
+       uint8_t rsvd1; /**< Reserved, normally 0x00. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE. */
+#ifndef __cplusplus
+static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask = {
+       .vni = "\xff\xff\xff",
+};
+#endif
+
+/**
+ * RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4
+ *
+ * Matches an ARP header for Ethernet/IPv4.
+ */
+struct rte_flow_item_arp_eth_ipv4 {
+       rte_be16_t hrd; /**< Hardware type, normally 1. */
+       rte_be16_t pro; /**< Protocol type, normally 0x0800. */
+       uint8_t hln; /**< Hardware address length, normally 6. */
+       uint8_t pln; /**< Protocol address length, normally 4. */
+       rte_be16_t op; /**< Opcode (1 for request, 2 for reply). */
+       struct ether_addr sha; /**< Sender hardware address. */
+       rte_be32_t spa; /**< Sender IPv4 address. */
+       struct ether_addr tha; /**< Target hardware address. */
+       rte_be32_t tpa; /**< Target IPv4 address. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4. */
+#ifndef __cplusplus
+static const struct rte_flow_item_arp_eth_ipv4
+rte_flow_item_arp_eth_ipv4_mask = {
+       .sha.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+       .spa = RTE_BE32(0xffffffff),
+       .tha.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+       .tpa = RTE_BE32(0xffffffff),
+};
+#endif
+
+/**
+ * RTE_FLOW_ITEM_TYPE_IPV6_EXT
+ *
+ * Matches the presence of any IPv6 extension header.
+ *
+ * Normally preceded by any of:
+ *
+ * - RTE_FLOW_ITEM_TYPE_IPV6
+ * - RTE_FLOW_ITEM_TYPE_IPV6_EXT
+ */
+struct rte_flow_item_ipv6_ext {
+       uint8_t next_hdr; /**< Next header. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_IPV6_EXT. */
+#ifndef __cplusplus
+static const
+struct rte_flow_item_ipv6_ext rte_flow_item_ipv6_ext_mask = {
+       .next_hdr = 0xff,
+};
+#endif
+
+/**
+ * RTE_FLOW_ITEM_TYPE_ICMP6
+ *
+ * Matches any ICMPv6 header.
+ */
+struct rte_flow_item_icmp6 {
+       uint8_t type; /**< ICMPv6 type. */
+       uint8_t code; /**< ICMPv6 code. */
+       uint16_t checksum; /**< ICMPv6 checksum. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6. */
+#ifndef __cplusplus
+static const struct rte_flow_item_icmp6 rte_flow_item_icmp6_mask = {
+       .type = 0xff,
+       .code = 0xff,
+};
+#endif
+
+/**
+ * RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS
+ *
+ * Matches an ICMPv6 neighbor discovery solicitation.
+ */
+struct rte_flow_item_icmp6_nd_ns {
+       uint8_t type; /**< ICMPv6 type, normally 135. */
+       uint8_t code; /**< ICMPv6 code, normally 0. */
+       rte_be16_t checksum; /**< ICMPv6 checksum. */
+       rte_be32_t reserved; /**< Reserved, normally 0. */
+       uint8_t target_addr[16]; /**< Target address. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS. */
+#ifndef __cplusplus
+static const
+struct rte_flow_item_icmp6_nd_ns rte_flow_item_icmp6_nd_ns_mask = {
+       .target_addr =
+               "\xff\xff\xff\xff\xff\xff\xff\xff"
+               "\xff\xff\xff\xff\xff\xff\xff\xff",
+};
+#endif
+
+/**
+ * RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA
+ *
+ * Matches an ICMPv6 neighbor discovery advertisement.
+ */
+struct rte_flow_item_icmp6_nd_na {
+       uint8_t type; /**< ICMPv6 type, normally 136. */
+       uint8_t code; /**< ICMPv6 code, normally 0. */
+       rte_be16_t checksum; /**< ICMPv6 checksum. */
+       /**
+        * Route flag (1b), solicited flag (1b), override flag (1b),
+        * reserved (29b).
+        */
+       rte_be32_t rso_reserved;
+       uint8_t target_addr[16]; /**< Target address. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA. */
+#ifndef __cplusplus
+static const
+struct rte_flow_item_icmp6_nd_na rte_flow_item_icmp6_nd_na_mask = {
+       .target_addr =
+               "\xff\xff\xff\xff\xff\xff\xff\xff"
+               "\xff\xff\xff\xff\xff\xff\xff\xff",
+};
+#endif
+
+/**
+ * RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT
+ *
+ * Matches the presence of any ICMPv6 neighbor discovery option.
+ *
+ * Normally preceded by any of:
+ *
+ * - RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA
+ * - RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS
+ * - RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT
+ */
+struct rte_flow_item_icmp6_nd_opt {
+       uint8_t type; /**< ND option type. */
+       uint8_t length; /**< ND option length. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT. */
+#ifndef __cplusplus
+static const struct rte_flow_item_icmp6_nd_opt
+rte_flow_item_icmp6_nd_opt_mask = {
+       .type = 0xff,
+};
+#endif
+
+/**
+ * RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH
+ *
+ * Matches an ICMPv6 neighbor discovery source Ethernet link-layer address
+ * option.
+ *
+ * Normally preceded by any of:
+ *
+ * - RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA
+ * - RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT
+ */
+struct rte_flow_item_icmp6_nd_opt_sla_eth {
+       uint8_t type; /**< ND option type, normally 1. */
+       uint8_t length; /**< ND option length, normally 1. */
+       struct ether_addr sla; /**< Source Ethernet LLA. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH. */
+#ifndef __cplusplus
+static const struct rte_flow_item_icmp6_nd_opt_sla_eth
+rte_flow_item_icmp6_nd_opt_sla_eth_mask = {
+       .sla.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+};
+#endif
+
+/**
+ * RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH
+ *
+ * Matches an ICMPv6 neighbor discovery target Ethernet link-layer address
+ * option.
+ *
+ * Normally preceded by any of:
+ *
+ * - RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS
+ * - RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT
+ */
+struct rte_flow_item_icmp6_nd_opt_tla_eth {
+       uint8_t type; /**< ND option type, normally 2. */
+       uint8_t length; /**< ND option length, normally 1. */
+       struct ether_addr tla; /**< Target Ethernet LLA. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH. */
+#ifndef __cplusplus
+static const struct rte_flow_item_icmp6_nd_opt_tla_eth
+rte_flow_item_icmp6_nd_opt_tla_eth_mask = {
+       .tla.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+};
+#endif
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_MARK
+ *
+ * Matches an arbitrary integer value which was set using the ``MARK`` action
+ * in a previously matched rule.
+ *
+ * This item can only be specified once as a match criteria as the ``MARK``
+ * action can only be specified once in a flow action.
+ *
+ * This value is arbitrary and application-defined. Maximum allowed value
+ * depends on the underlying implementation.
+ *
+ * Depending on the underlying implementation the MARK item may be supported on
+ * the physical device, with virtual groups in the PMD or not at all.
+ */
+struct rte_flow_item_mark {
+       uint32_t id; /**< Integer value to match against. */
+};
+
 /**
  * Matching pattern item definition.
  *
@@ -859,33 +1222,28 @@ struct rte_flow_item {
  *
  * Each possible action is represented by a type. Some have associated
  * configuration structures. Several actions combined in a list can be
- * affected to a flow rule. That list is not ordered.
+ * assigned to a flow rule and are performed in order.
  *
  * They fall in three categories:
  *
- * - Terminating actions (such as QUEUE, DROP, RSS, PF, VF) that prevent
- *   processing matched packets by subsequent flow rules, unless overridden
- *   with PASSTHRU.
- *
- * - Non terminating actions (PASSTHRU, DUP) that leave matched packets up
- *   for additional processing by subsequent flow rules.
+ * - Actions that modify the fate of matching traffic, for instance by
+ *   dropping or assigning it a specific destination.
  *
- * - Other non terminating meta actions that do not affect the fate of
- *   packets (END, VOID, MARK, FLAG, COUNT).
+ * - Actions that modify matching traffic contents or its properties. This
+ *   includes adding/removing encapsulation, encryption, compression and
+ *   marks.
  *
- * When several actions are combined in a flow rule, they should all have
- * different types (e.g. dropping a packet twice is not possible).
+ * - Actions related to the flow rule itself, such as updating counters or
+ *   making it non-terminating.
  *
- * Only the last action of a given type is taken into account. PMDs still
- * perform error checking on the entire list.
+ * Flow rules being terminating by default, not specifying any action of the
+ * fate kind results in undefined behavior. This applies to both ingress and
+ * egress.
  *
- * Note that PASSTHRU is the only action able to override a terminating
- * rule.
+ * PASSTHRU, when supported, makes a flow rule non-terminating.
  */
 enum rte_flow_action_type {
        /**
-        * [META]
-        *
         * End marker for action lists. Prevents further processing of
         * actions, thereby ending the list.
         *
@@ -894,8 +1252,6 @@ enum rte_flow_action_type {
        RTE_FLOW_ACTION_TYPE_END,
 
        /**
-        * [META]
-        *
         * Used as a placeholder for convenience. It is ignored and simply
         * discarded by PMDs.
         *
@@ -904,18 +1260,23 @@ enum rte_flow_action_type {
        RTE_FLOW_ACTION_TYPE_VOID,
 
        /**
-        * Leaves packets up for additional processing by subsequent flow
-        * rules. This is the default when a rule does not contain a
-        * terminating action, but can be specified to force a rule to
-        * become non-terminating.
+        * Leaves traffic up for additional processing by subsequent flow
+        * rules; makes a flow rule non-terminating.
         *
         * No associated configuration structure.
         */
        RTE_FLOW_ACTION_TYPE_PASSTHRU,
 
        /**
-        * [META]
+        * RTE_FLOW_ACTION_TYPE_JUMP
+        *
+        * Redirects packets to a group on the current device.
         *
+        * See struct rte_flow_action_jump.
+        */
+       RTE_FLOW_ACTION_TYPE_JUMP,
+
+       /**
         * Attaches an integer value to packets and sets PKT_RX_FDIR and
         * PKT_RX_FDIR_ID mbuf flags.
         *
@@ -924,8 +1285,6 @@ enum rte_flow_action_type {
        RTE_FLOW_ACTION_TYPE_MARK,
 
        /**
-        * [META]
-        *
         * Flags packets. Similar to MARK without a specific value; only
         * sets the PKT_RX_FDIR mbuf flag.
         *
@@ -950,27 +1309,15 @@ enum rte_flow_action_type {
        RTE_FLOW_ACTION_TYPE_DROP,
 
        /**
-        * [META]
-        *
-        * Enables counters for this rule.
+        * Enables counters for this flow rule.
         *
         * These counters can be retrieved and reset through rte_flow_query(),
         * see struct rte_flow_query_count.
         *
-        * No associated configuration structure.
+        * See struct rte_flow_action_count.
         */
        RTE_FLOW_ACTION_TYPE_COUNT,
 
-       /**
-        * Duplicates packets to a given queue index.
-        *
-        * This is normally combined with QUEUE, however when used alone, it
-        * is actually similar to QUEUE + PASSTHRU.
-        *
-        * See struct rte_flow_action_dup.
-        */
-       RTE_FLOW_ACTION_TYPE_DUP,
-
        /**
         * Similar to QUEUE, except RSS is additionally performed on packets
         * to spread them among several queues according to the provided
@@ -981,21 +1328,36 @@ enum rte_flow_action_type {
        RTE_FLOW_ACTION_TYPE_RSS,
 
        /**
-        * Redirects packets to the physical function (PF) of the current
-        * device.
+        * Directs matching traffic to the physical function (PF) of the
+        * current device.
         *
         * No associated configuration structure.
         */
        RTE_FLOW_ACTION_TYPE_PF,
 
        /**
-        * Redirects packets to the virtual function (VF) of the current
-        * device with the specified ID.
+        * Directs matching traffic to a given virtual function of the
+        * current device.
         *
         * See struct rte_flow_action_vf.
         */
        RTE_FLOW_ACTION_TYPE_VF,
 
+       /**
+        * Directs packets to a given physical port index of the underlying
+        * device.
+        *
+        * See struct rte_flow_action_phy_port.
+        */
+       RTE_FLOW_ACTION_TYPE_PHY_PORT,
+
+       /**
+        * Directs matching traffic to a given DPDK port ID.
+        *
+        * See struct rte_flow_action_port_id.
+        */
+       RTE_FLOW_ACTION_TYPE_PORT_ID,
+
        /**
         * Traffic metering and policing (MTR).
         *
@@ -1010,7 +1372,139 @@ enum rte_flow_action_type {
         *
         * See struct rte_flow_action_security.
         */
-       RTE_FLOW_ACTION_TYPE_SECURITY
+       RTE_FLOW_ACTION_TYPE_SECURITY,
+
+       /**
+        * Implements OFPAT_SET_MPLS_TTL ("MPLS TTL") as defined by the
+        * OpenFlow Switch Specification.
+        *
+        * See struct rte_flow_action_of_set_mpls_ttl.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_SET_MPLS_TTL,
+
+       /**
+        * Implements OFPAT_DEC_MPLS_TTL ("decrement MPLS TTL") as defined
+        * by the OpenFlow Switch Specification.
+        *
+        * No associated configuration structure.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_DEC_MPLS_TTL,
+
+       /**
+        * Implements OFPAT_SET_NW_TTL ("IP TTL") as defined by the OpenFlow
+        * Switch Specification.
+        *
+        * See struct rte_flow_action_of_set_nw_ttl.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_SET_NW_TTL,
+
+       /**
+        * Implements OFPAT_DEC_NW_TTL ("decrement IP TTL") as defined by
+        * the OpenFlow Switch Specification.
+        *
+        * No associated configuration structure.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_DEC_NW_TTL,
+
+       /**
+        * Implements OFPAT_COPY_TTL_OUT ("copy TTL "outwards" -- from
+        * next-to-outermost to outermost") as defined by the OpenFlow
+        * Switch Specification.
+        *
+        * No associated configuration structure.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_COPY_TTL_OUT,
+
+       /**
+        * Implements OFPAT_COPY_TTL_IN ("copy TTL "inwards" -- from
+        * outermost to next-to-outermost") as defined by the OpenFlow
+        * Switch Specification.
+        *
+        * No associated configuration structure.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_COPY_TTL_IN,
+
+       /**
+        * Implements OFPAT_POP_VLAN ("pop the outer VLAN tag") as defined
+        * by the OpenFlow Switch Specification.
+        *
+        * No associated configuration structure.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_POP_VLAN,
+
+       /**
+        * Implements OFPAT_PUSH_VLAN ("push a new VLAN tag") as defined by
+        * the OpenFlow Switch Specification.
+        *
+        * See struct rte_flow_action_of_push_vlan.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN,
+
+       /**
+        * Implements OFPAT_SET_VLAN_VID ("set the 802.1q VLAN id") as
+        * defined by the OpenFlow Switch Specification.
+        *
+        * See struct rte_flow_action_of_set_vlan_vid.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID,
+
+       /**
+        * Implements OFPAT_SET_LAN_PCP ("set the 802.1q priority") as
+        * defined by the OpenFlow Switch Specification.
+        *
+        * See struct rte_flow_action_of_set_vlan_pcp.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP,
+
+       /**
+        * Implements OFPAT_POP_MPLS ("pop the outer MPLS tag") as defined
+        * by the OpenFlow Switch Specification.
+        *
+        * See struct rte_flow_action_of_pop_mpls.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_POP_MPLS,
+
+       /**
+        * Implements OFPAT_PUSH_MPLS ("push a new MPLS tag") as defined by
+        * the OpenFlow Switch Specification.
+        *
+        * See struct rte_flow_action_of_push_mpls.
+        */
+       RTE_FLOW_ACTION_TYPE_OF_PUSH_MPLS,
+
+       /**
+        * Encapsulate flow in VXLAN tunnel as defined in
+        * rte_flow_action_vxlan_encap action structure.
+        *
+        * See struct rte_flow_action_vxlan_encap.
+        */
+       RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP,
+
+       /**
+        * Decapsulate outer most VXLAN tunnel from matched flow.
+        *
+        * If flow pattern does not define a valid VXLAN tunnel (as specified by
+        * RFC7348) then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION
+        * error.
+        */
+       RTE_FLOW_ACTION_TYPE_VXLAN_DECAP,
+
+       /**
+        * Encapsulate flow in NVGRE tunnel defined in the
+        * rte_flow_action_nvgre_encap action structure.
+        *
+        * See struct rte_flow_action_nvgre_encap.
+        */
+       RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP,
+
+       /**
+        * Decapsulate outer most NVGRE tunnel from matched flow.
+        *
+        * If flow pattern does not define a valid NVGRE tunnel (as specified by
+        * RFC7637) then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION
+        * error.
+        */
+       RTE_FLOW_ACTION_TYPE_NVGRE_DECAP,
 };
 
 /**
@@ -1027,17 +1521,63 @@ struct rte_flow_action_mark {
        uint32_t id; /**< Integer value to return with packets. */
 };
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_JUMP
+ *
+ * Redirects packets to a group on the current device.
+ *
+ * In a hierarchy of groups, which can be used to represent physical or logical
+ * flow tables on the device, this action allows the action to be a redirect to
+ * a group on that device.
+ */
+struct rte_flow_action_jump {
+       uint32_t group;
+};
+
 /**
  * RTE_FLOW_ACTION_TYPE_QUEUE
  *
  * Assign packets to a given queue index.
- *
- * Terminating by default.
  */
 struct rte_flow_action_queue {
        uint16_t index; /**< Queue index to use. */
 };
 
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_COUNT
+ *
+ * Adds a counter action to a matched flow.
+ *
+ * If more than one count action is specified in a single flow rule, then each
+ * action must specify a unique id.
+ *
+ * Counters can be retrieved and reset through ``rte_flow_query()``, see
+ * ``struct rte_flow_query_count``.
+ *
+ * The shared flag indicates whether the counter is unique to the flow rule the
+ * action is specified with, or whether it is a shared counter.
+ *
+ * For a count action with the shared flag set, then then a global device
+ * namespace is assumed for the counter id, so that any matched flow rules using
+ * a count action with the same counter id on the same port will contribute to
+ * that counter.
+ *
+ * For ports within the same switch domain then the counter id namespace extends
+ * to all ports within that switch domain.
+ */
+struct rte_flow_action_count {
+       uint32_t shared:1; /**< Share counter ID with other flow rules. */
+       uint32_t reserved:31; /**< Reserved, must be zero. */
+       uint32_t id; /**< Counter ID. */
+};
+
 /**
  * RTE_FLOW_ACTION_TYPE_COUNT (query)
  *
@@ -1052,55 +1592,100 @@ struct rte_flow_query_count {
        uint64_t bytes; /**< Number of bytes through this rule [out]. */
 };
 
-/**
- * RTE_FLOW_ACTION_TYPE_DUP
- *
- * Duplicates packets to a given queue index.
- *
- * This is normally combined with QUEUE, however when used alone, it is
- * actually similar to QUEUE + PASSTHRU.
- *
- * Non-terminating by default.
- */
-struct rte_flow_action_dup {
-       uint16_t index; /**< Queue index to duplicate packets to. */
-};
-
 /**
  * RTE_FLOW_ACTION_TYPE_RSS
  *
  * Similar to QUEUE, except RSS is additionally performed on packets to
  * spread them among several queues according to the provided parameters.
  *
+ * Unlike global RSS settings used by other DPDK APIs, unsetting the
+ * @p types field does not disable RSS in a flow rule. Doing so instead
+ * requests safe unspecified "best-effort" settings from the underlying PMD,
+ * which depending on the flow rule, may result in anything ranging from
+ * empty (single queue) to all-inclusive RSS.
+ *
  * Note: RSS hash result is stored in the hash.rss mbuf field which overlaps
  * hash.fdir.lo. Since the MARK action sets the hash.fdir.hi field only,
  * both can be requested simultaneously.
- *
- * Terminating by default.
  */
 struct rte_flow_action_rss {
-       const struct rte_eth_rss_conf *rss_conf; /**< RSS parameters. */
-       uint16_t num; /**< Number of entries in queue[]. */
-       uint16_t queue[]; /**< Queues indices to use. */
+       enum rte_eth_hash_function func; /**< RSS hash function to apply. */
+       /**
+        * Packet encapsulation level RSS hash @p types apply to.
+        *
+        * - @p 0 requests the default behavior. Depending on the packet
+        *   type, it can mean outermost, innermost, anything in between or
+        *   even no RSS.
+        *
+        *   It basically stands for the innermost encapsulation level RSS
+        *   can be performed on according to PMD and device capabilities.
+        *
+        * - @p 1 requests RSS to be performed on the outermost packet
+        *   encapsulation level.
+        *
+        * - @p 2 and subsequent values request RSS to be performed on the
+        *   specified inner packet encapsulation level, from outermost to
+        *   innermost (lower to higher values).
+        *
+        * Values other than @p 0 are not necessarily supported.
+        *
+        * Requesting a specific RSS level on unrecognized traffic results
+        * in undefined behavior. For predictable results, it is recommended
+        * to make the flow rule pattern match packet headers up to the
+        * requested encapsulation level so that only matching traffic goes
+        * through.
+        */
+       uint32_t level;
+       uint64_t types; /**< Specific RSS hash types (see ETH_RSS_*). */
+       uint32_t key_len; /**< Hash key length in bytes. */
+       uint32_t queue_num; /**< Number of entries in @p queue. */
+       const uint8_t *key; /**< Hash key. */
+       const uint16_t *queue; /**< Queue indices to use. */
 };
 
 /**
  * RTE_FLOW_ACTION_TYPE_VF
  *
- * Redirects packets to a virtual function (VF) of the current device.
+ * Directs matching traffic to a given virtual function of the current
+ * device.
  *
  * Packets matched by a VF pattern item can be redirected to their original
  * VF ID instead of the specified one. This parameter may not be available
  * and is not guaranteed to work properly if the VF part is matched by a
  * prior flow rule or if packets are not addressed to a VF in the first
  * place.
- *
- * Terminating by default.
  */
 struct rte_flow_action_vf {
        uint32_t original:1; /**< Use original VF ID if possible. */
        uint32_t reserved:31; /**< Reserved, must be zero. */
-       uint32_t id; /**< VF ID to redirect packets to. */
+       uint32_t id; /**< VF ID. */
+};
+
+/**
+ * RTE_FLOW_ACTION_TYPE_PHY_PORT
+ *
+ * Directs packets to a given physical port index of the underlying
+ * device.
+ *
+ * @see RTE_FLOW_ITEM_TYPE_PHY_PORT
+ */
+struct rte_flow_action_phy_port {
+       uint32_t original:1; /**< Use original port index if possible. */
+       uint32_t reserved:31; /**< Reserved, must be zero. */
+       uint32_t index; /**< Physical port index. */
+};
+
+/**
+ * RTE_FLOW_ACTION_TYPE_PORT_ID
+ *
+ * Directs matching traffic to a given DPDK port ID.
+ *
+ * @see RTE_FLOW_ITEM_TYPE_PORT_ID
+ */
+struct rte_flow_action_port_id {
+       uint32_t original:1; /**< Use original DPDK port ID if possible. */
+       uint32_t reserved:31; /**< Reserved, must be zero. */
+       uint32_t id; /**< DPDK port ID. */
 };
 
 /**
@@ -1110,8 +1695,6 @@ struct rte_flow_action_vf {
  *
  * Packets matched by items of this type can be either dropped or passed to the
  * next item with their color set by the MTR object.
- *
- * Non-terminating by default.
  */
 struct rte_flow_action_meter {
        uint32_t mtr_id; /**< MTR object ID created with rte_mtr_create(). */
@@ -1141,14 +1724,151 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security session.
- *
- * Non-terminating by default.
  */
 struct rte_flow_action_security {
        void *security_session; /**< Pointer to security session structure. */
 };
 
 /**
+ * RTE_FLOW_ACTION_TYPE_OF_SET_MPLS_TTL
+ *
+ * Implements OFPAT_SET_MPLS_TTL ("MPLS TTL") as defined by the OpenFlow
+ * Switch Specification.
+ */
+struct rte_flow_action_of_set_mpls_ttl {
+       uint8_t mpls_ttl; /**< MPLS TTL. */
+};
+
+/**
+ * RTE_FLOW_ACTION_TYPE_OF_SET_NW_TTL
+ *
+ * Implements OFPAT_SET_NW_TTL ("IP TTL") as defined by the OpenFlow Switch
+ * Specification.
+ */
+struct rte_flow_action_of_set_nw_ttl {
+       uint8_t nw_ttl; /**< IP TTL. */
+};
+
+/**
+ * RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN
+ *
+ * Implements OFPAT_PUSH_VLAN ("push a new VLAN tag") as defined by the
+ * OpenFlow Switch Specification.
+ */
+struct rte_flow_action_of_push_vlan {
+       rte_be16_t ethertype; /**< EtherType. */
+};
+
+/**
+ * RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID
+ *
+ * Implements OFPAT_SET_VLAN_VID ("set the 802.1q VLAN id") as defined by
+ * the OpenFlow Switch Specification.
+ */
+struct rte_flow_action_of_set_vlan_vid {
+       rte_be16_t vlan_vid; /**< VLAN id. */
+};
+
+/**
+ * RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP
+ *
+ * Implements OFPAT_SET_LAN_PCP ("set the 802.1q priority") as defined by
+ * the OpenFlow Switch Specification.
+ */
+struct rte_flow_action_of_set_vlan_pcp {
+       uint8_t vlan_pcp; /**< VLAN priority. */
+};
+
+/**
+ * RTE_FLOW_ACTION_TYPE_OF_POP_MPLS
+ *
+ * Implements OFPAT_POP_MPLS ("pop the outer MPLS tag") as defined by the
+ * OpenFlow Switch Specification.
+ */
+struct rte_flow_action_of_pop_mpls {
+       rte_be16_t ethertype; /**< EtherType. */
+};
+
+/**
+ * RTE_FLOW_ACTION_TYPE_OF_PUSH_MPLS
+ *
+ * Implements OFPAT_PUSH_MPLS ("push a new MPLS tag") as defined by the
+ * OpenFlow Switch Specification.
+ */
+struct rte_flow_action_of_push_mpls {
+       rte_be16_t ethertype; /**< EtherType. */
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP
+ *
+ * VXLAN tunnel end-point encapsulation data definition
+ *
+ * The tunnel definition is provided through the flow item pattern, the
+ * provided pattern must conform to RFC7348 for the tunnel specified. The flow
+ * definition must be provided in order from the RTE_FLOW_ITEM_TYPE_ETH
+ * definition up the end item which is specified by RTE_FLOW_ITEM_TYPE_END.
+ *
+ * The mask field allows user to specify which fields in the flow item
+ * definitions can be ignored and which have valid data and can be used
+ * verbatim.
+ *
+ * Note: the last field is not used in the definition of a tunnel and can be
+ * ignored.
+ *
+ * Valid flow definition for RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP include:
+ *
+ * - ETH / IPV4 / UDP / VXLAN / END
+ * - ETH / IPV6 / UDP / VXLAN / END
+ * - ETH / VLAN / IPV4 / UDP / VXLAN / END
+ *
+ */
+struct rte_flow_action_vxlan_encap {
+       /**
+        * Encapsulating vxlan tunnel definition
+        * (terminated by the END pattern item).
+        */
+       struct rte_flow_item *definition;
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP
+ *
+ * NVGRE tunnel end-point encapsulation data definition
+ *
+ * The tunnel definition is provided through the flow item pattern  the
+ * provided pattern must conform with RFC7637. The flow definition must be
+ * provided in order from the RTE_FLOW_ITEM_TYPE_ETH definition up the end item
+ * which is specified by RTE_FLOW_ITEM_TYPE_END.
+ *
+ * The mask field allows user to specify which fields in the flow item
+ * definitions can be ignored and which have valid data and can be used
+ * verbatim.
+ *
+ * Note: the last field is not used in the definition of a tunnel and can be
+ * ignored.
+ *
+ * Valid flow definition for RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP include:
+ *
+ * - ETH / IPV4 / NVGRE / END
+ * - ETH / VLAN / IPV6 / NVGRE / END
+ *
+ */
+struct rte_flow_action_nvgre_encap {
+       /**
+        * Encapsulating vxlan tunnel definition
+        * (terminated by the END pattern item).
+        */
+       struct rte_flow_item *definition;
+};
+
+/*
  * Definition of a single action.
  *
  * A list of actions is terminated by a END action.
@@ -1182,10 +1902,15 @@ enum rte_flow_error_type {
        RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, /**< Priority field. */
        RTE_FLOW_ERROR_TYPE_ATTR_INGRESS, /**< Ingress field. */
        RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, /**< Egress field. */
+       RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER, /**< Transfer field. */
        RTE_FLOW_ERROR_TYPE_ATTR, /**< Attributes structure. */
        RTE_FLOW_ERROR_TYPE_ITEM_NUM, /**< Pattern length. */
+       RTE_FLOW_ERROR_TYPE_ITEM_SPEC, /**< Item specification. */
+       RTE_FLOW_ERROR_TYPE_ITEM_LAST, /**< Item specification range. */
+       RTE_FLOW_ERROR_TYPE_ITEM_MASK, /**< Item specification mask. */
        RTE_FLOW_ERROR_TYPE_ITEM, /**< Specific pattern item. */
        RTE_FLOW_ERROR_TYPE_ACTION_NUM, /**< Number of actions. */
+       RTE_FLOW_ERROR_TYPE_ACTION_CONF, /**< Action configuration. */
        RTE_FLOW_ERROR_TYPE_ACTION, /**< Specific action. */
 };
 
@@ -1351,7 +2076,7 @@ rte_flow_flush(uint16_t port_id,
  * @param flow
  *   Flow rule handle to query.
  * @param action
- *   Action type to query.
+ *   Action definition as defined in original flow rule.
  * @param[in, out] data
  *   Pointer to storage for the associated query data type.
  * @param[out] error
@@ -1364,7 +2089,7 @@ rte_flow_flush(uint16_t port_id,
 int
 rte_flow_query(uint16_t port_id,
               struct rte_flow *flow,
-              enum rte_flow_action_type action,
+              const struct rte_flow_action *action,
               void *data,
               struct rte_flow_error *error);