ethdev: fix device capability to string translation
[dpdk.git] / lib / ethdev / rte_flow.h
index 64ed7f2..ebcd3a3 100644 (file)
@@ -35,6 +35,8 @@
 #include <rte_mbuf_dyn.h>
 #include <rte_meter.h>
 #include <rte_gtp.h>
+#include <rte_l2tpv2.h>
+#include <rte_ppp.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -644,6 +646,20 @@ enum rte_flow_item_type {
         * @see struct rte_flow_item_flex.
         */
        RTE_FLOW_ITEM_TYPE_FLEX,
+
+       /**
+        * Matches L2TPv2 Header.
+        *
+        * See struct rte_flow_item_l2tpv2.
+        */
+       RTE_FLOW_ITEM_TYPE_L2TPV2,
+
+       /**
+        * Matches PPP Header.
+        *
+        * See struct rte_flow_item_ppp.
+        */
+       RTE_FLOW_ITEM_TYPE_PPP,
 };
 
 /**
@@ -1504,11 +1520,12 @@ rte_flow_item_icmp6_nd_opt_tla_eth_mask = {
  * RTE_FLOW_ITEM_TYPE_META
  *
  * Matches a specified metadata value. On egress, metadata can be set
- * either by mbuf dynamic metadata field with PKT_TX_DYNF_METADATA flag or
- * RTE_FLOW_ACTION_TYPE_SET_META. On ingress, RTE_FLOW_ACTION_TYPE_SET_META
+ * either by mbuf dynamic metadata field with RTE_MBUF_DYNFLAG_TX_METADATA flag
+ * or RTE_FLOW_ACTION_TYPE_SET_META. On ingress, RTE_FLOW_ACTION_TYPE_SET_META
  * sets metadata for a packet and the metadata will be reported via mbuf
- * metadata dynamic field with PKT_RX_DYNF_METADATA flag. The dynamic mbuf
- * field must be registered in advance by rte_flow_dynf_metadata_register().
+ * metadata dynamic field with RTE_MBUF_DYNFLAG_RX_METADATA flag. The dynamic
+ * mbuf field must be registered in advance by
+ * rte_flow_dynf_metadata_register().
  */
 struct rte_flow_item_meta {
        uint32_t data;
@@ -1900,6 +1917,57 @@ static const struct rte_flow_item_ethdev rte_flow_item_ethdev_mask = {
 };
 #endif
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_L2TPV2
+ *
+ * Matches L2TPv2 Header
+ */
+struct rte_flow_item_l2tpv2 {
+       struct rte_l2tpv2_combined_msg_hdr hdr;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_L2TPV2. */
+#ifndef __cplusplus
+static const struct rte_flow_item_l2tpv2 rte_flow_item_l2tpv2_mask = {
+       /*
+        * flags and version bit mask
+        * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
+        * T L x x S x O P x x x x V V V V
+        */
+       .hdr = {
+               .common = {
+                       .flags_version = RTE_BE16(0xcb0f),
+               },
+       },
+};
+#endif
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_PPP
+ *
+ * Matches PPP Header
+ */
+struct rte_flow_item_ppp {
+       struct rte_ppp_hdr hdr;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_PPP. */
+#ifndef __cplusplus
+static const struct rte_flow_item_ppp rte_flow_item_ppp_mask = {
+       .hdr = {
+               .addr = 0xff,
+               .ctrl = 0xff,
+               .proto_id = RTE_BE16(0xffff),
+       }
+};
+#endif
+
 /**
  * Matching pattern item definition.
  *
@@ -2172,8 +2240,8 @@ enum rte_flow_action_type {
        RTE_FLOW_ACTION_TYPE_JUMP,
 
        /**
-        * Attaches an integer value to packets and sets PKT_RX_FDIR and
-        * PKT_RX_FDIR_ID mbuf flags.
+        * Attaches an integer value to packets and sets RTE_MBUF_F_RX_FDIR and
+        * RTE_MBUF_F_RX_FDIR_ID mbuf flags.
         *
         * See struct rte_flow_action_mark.
         *
@@ -2185,7 +2253,7 @@ enum rte_flow_action_type {
 
        /**
         * Flags packets. Similar to MARK without a specific value; only
-        * sets the PKT_RX_FDIR mbuf flag.
+        * sets the RTE_MBUF_F_RX_FDIR mbuf flag.
         *
         * No associated configuration structure.
         *
@@ -2725,8 +2793,8 @@ enum rte_flow_action_type {
 /**
  * RTE_FLOW_ACTION_TYPE_MARK
  *
- * Attaches an integer value to packets and sets PKT_RX_FDIR and
- * PKT_RX_FDIR_ID mbuf flags.
+ * Attaches an integer value to packets and sets RTE_MBUF_F_RX_FDIR and
+ * RTE_MBUF_F_RX_FDIR_ID mbuf flags.
  *
  * This value is arbitrary and application-defined. Maximum allowed value
  * depends on the underlying implementation. It is returned in the
@@ -2890,7 +2958,7 @@ struct rte_flow_action_rss {
         * through.
         */
        uint32_t level;
-       uint64_t types; /**< Specific RSS hash types (see ETH_RSS_*). */
+       uint64_t types; /**< Specific RSS hash types (see RTE_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. */
@@ -3269,10 +3337,10 @@ struct rte_flow_action_set_tag {
  * RTE_FLOW_ACTION_TYPE_SET_META
  *
  * Set metadata. Metadata set by mbuf metadata dynamic field with
- * PKT_TX_DYNF_DATA flag on egress will be overridden by this action. On
- * ingress, the metadata will be carried by mbuf metadata dynamic field
- * with PKT_RX_DYNF_METADATA flag if set.  The dynamic mbuf field must be
- * registered in advance by rte_flow_dynf_metadata_register().
+ * RTE_MBUF_DYNFLAG_TX_METADATA flag on egress will be overridden by this
+ * action. On ingress, the metadata will be carried by mbuf metadata dynamic
+ * field with RTE_MBUF_DYNFLAG_RX_METADATA flag if set.  The dynamic mbuf field
+ * must be registered in advance by rte_flow_dynf_metadata_register().
  *
  * Altering partial bits is supported with mask. For bits which have never
  * been set, unpredictable value will be seen depending on driver
@@ -3593,8 +3661,12 @@ extern uint64_t rte_flow_dynf_metadata_mask;
        RTE_MBUF_DYNFIELD((m), rte_flow_dynf_metadata_offs, uint32_t *)
 
 /* Mbuf dynamic flags for metadata. */
-#define PKT_RX_DYNF_METADATA (rte_flow_dynf_metadata_mask)
-#define PKT_TX_DYNF_METADATA (rte_flow_dynf_metadata_mask)
+#define RTE_MBUF_DYNFLAG_RX_METADATA (rte_flow_dynf_metadata_mask)
+#define PKT_RX_DYNF_METADATA RTE_DEPRECATED(PKT_RX_DYNF_METADATA) \
+               RTE_MBUF_DYNFLAG_RX_METADATA
+#define RTE_MBUF_DYNFLAG_TX_METADATA (rte_flow_dynf_metadata_mask)
+#define PKT_TX_DYNF_METADATA RTE_DEPRECATED(PKT_TX_DYNF_METADATA) \
+               RTE_MBUF_DYNFLAG_TX_METADATA
 
 __rte_experimental
 static inline uint32_t
@@ -3676,6 +3748,7 @@ enum rte_flow_error_type {
        RTE_FLOW_ERROR_TYPE_ACTION_NUM, /**< Number of actions. */
        RTE_FLOW_ERROR_TYPE_ACTION_CONF, /**< Action configuration. */
        RTE_FLOW_ERROR_TYPE_ACTION, /**< Specific action. */
+       RTE_FLOW_ERROR_TYPE_STATE, /**< Current device state. */
 };
 
 /**