net: add ESP header to generic flow steering
[dpdk.git] / lib / librte_ether / rte_flow.h
index a0ffb71..bd8274d 100644 (file)
@@ -50,6 +50,7 @@
 #include <rte_tcp.h>
 #include <rte_udp.h>
 #include <rte_byteorder.h>
+#include <rte_esp.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -336,6 +337,13 @@ enum rte_flow_item_type {
         * See struct rte_flow_item_gtp.
         */
        RTE_FLOW_ITEM_TYPE_GTPU,
+
+       /**
+        * Matches a ESP header.
+        *
+        * See struct rte_flow_item_esp.
+        */
+       RTE_FLOW_ITEM_TYPE_ESP,
 };
 
 /**
@@ -786,6 +794,24 @@ static const struct rte_flow_item_gtp rte_flow_item_gtp_mask = {
 };
 #endif
 
+/**
+ * RTE_FLOW_ITEM_TYPE_ESP
+ *
+ * Matches an ESP header.
+ */
+struct rte_flow_item_esp {
+       struct esp_hdr hdr; /**< ESP header definition. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_ESP. */
+#ifndef __cplusplus
+static const struct rte_flow_item_esp rte_flow_item_esp_mask = {
+       .hdr = {
+               .spi = 0xffffffff,
+       },
+};
+#endif
+
 /**
  * Matching pattern item definition.
  *
@@ -967,6 +993,14 @@ enum rte_flow_action_type {
         * See struct rte_flow_action_vf.
         */
        RTE_FLOW_ACTION_TYPE_VF,
+
+       /**
+        * Traffic metering and policing (MTR).
+        *
+        * See struct rte_flow_action_meter.
+        * See file rte_mtr.h for MTR object configuration.
+        */
+       RTE_FLOW_ACTION_TYPE_METER,
 };
 
 /**
@@ -1059,6 +1093,20 @@ struct rte_flow_action_vf {
        uint32_t id; /**< VF ID to redirect packets to. */
 };
 
+/**
+ * RTE_FLOW_ACTION_TYPE_METER
+ *
+ * Traffic metering and policing (MTR).
+ *
+ * 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(). */
+};
+
 /**
  * Definition of a single action.
  *