ethdev: hide internal structures
[dpdk.git] / lib / ethdev / rte_flow.h
index c16f5ba..5f87851 100644 (file)
@@ -33,6 +33,8 @@
 #include <rte_bitops.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
+#include <rte_meter.h>
+#include <rte_gtp.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -73,7 +75,7 @@ extern "C" {
  * At least one direction must be specified.
  *
  * Specifying both directions at once for a given rule is not recommended
- * but may be valid in a few cases (e.g. shared counter).
+ * but may be valid in a few cases.
  */
 struct rte_flow_attr {
        uint32_t group; /**< Priority group. */
@@ -783,8 +785,8 @@ struct rte_flow_item_eth {
 /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */
 #ifndef __cplusplus
 static const struct rte_flow_item_eth rte_flow_item_eth_mask = {
-       .hdr.d_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
-       .hdr.s_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+       .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+       .hdr.src_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
        .hdr.ether_type = RTE_BE16(0x0000),
 };
 #endif
@@ -1443,15 +1445,14 @@ static const struct rte_flow_item_meta rte_flow_item_meta_mask = {
  * Matches a GTP PDU extension header with type 0x85.
  */
 struct rte_flow_item_gtp_psc {
-       uint8_t pdu_type; /**< PDU type. */
-       uint8_t qfi; /**< PPP, RQI, QoS flow identifier. */
+       struct rte_gtp_psc_generic_hdr hdr; /**< gtp psc generic hdr. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */
 #ifndef __cplusplus
 static const struct rte_flow_item_gtp_psc
 rte_flow_item_gtp_psc_mask = {
-       .qfi = 0xff,
+       .hdr.qfi = 0x3f,
 };
 #endif
 
@@ -1706,8 +1707,16 @@ rte_flow_item_geneve_opt_mask = {
 };
 #endif
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_INTEGRITY
+ *
+ * Match on packet integrity check result.
+ */
 struct rte_flow_item_integrity {
-       /**< Tunnel encapsulation level the item should apply to.
+       /** Tunnel encapsulation level the item should apply to.
         * @see rte_flow_action_rss
         */
        uint32_t level;
@@ -1715,21 +1724,21 @@ struct rte_flow_item_integrity {
        union {
                __extension__
                struct {
-                       /**< The packet is valid after passing all HW checks. */
+                       /** The packet is valid after passing all HW checks. */
                        uint64_t packet_ok:1;
-                       /**< L2 layer is valid after passing all HW checks. */
+                       /** L2 layer is valid after passing all HW checks. */
                        uint64_t l2_ok:1;
-                       /**< L3 layer is valid after passing all HW checks. */
+                       /** L3 layer is valid after passing all HW checks. */
                        uint64_t l3_ok:1;
-                       /**< L4 layer is valid after passing all HW checks. */
+                       /** L4 layer is valid after passing all HW checks. */
                        uint64_t l4_ok:1;
-                       /**< L2 layer CRC is valid. */
+                       /** L2 layer CRC is valid. */
                        uint64_t l2_crc_ok:1;
-                       /**< IPv4 layer checksum is valid. */
+                       /** IPv4 layer checksum is valid. */
                        uint64_t ipv4_csum_ok:1;
-                       /**< L4 layer checksum is valid. */
+                       /** L4 layer checksum is valid. */
                        uint64_t l4_csum_ok:1;
-                       /**< The l3 length is smaller than the frame length. */
+                       /** L3 length is smaller than frame length. */
                        uint64_t l3_len_ok:1;
                        uint64_t reserved:56;
                };
@@ -1895,6 +1904,10 @@ enum rte_flow_action_type {
         * PKT_RX_FDIR_ID mbuf flags.
         *
         * See struct rte_flow_action_mark.
+        *
+        * One should negotiate mark delivery from the NIC to the PMD.
+        * @see rte_eth_rx_metadata_negotiate()
+        * @see RTE_ETH_RX_METADATA_USER_MARK
         */
        RTE_FLOW_ACTION_TYPE_MARK,
 
@@ -1903,6 +1916,10 @@ enum rte_flow_action_type {
         * sets the PKT_RX_FDIR mbuf flag.
         *
         * No associated configuration structure.
+        *
+        * One should negotiate flag delivery from the NIC to the PMD.
+        * @see rte_eth_rx_metadata_negotiate()
+        * @see RTE_ETH_RX_METADATA_USER_FLAG
         */
        RTE_FLOW_ACTION_TYPE_FLAG,
 
@@ -2392,6 +2409,14 @@ enum rte_flow_action_type {
         * @see struct rte_flow_action_conntrack.
         */
        RTE_FLOW_ACTION_TYPE_CONNTRACK,
+
+       /**
+        * Color the packet to reflect the meter color result.
+        * Set the meter color in the mbuf to the selected color.
+        *
+        * See struct rte_flow_action_meter_color.
+        */
+       RTE_FLOW_ACTION_TYPE_METER_COLOR,
 };
 
 /**
@@ -2481,24 +2506,10 @@ struct rte_flow_query_age {
  * Counters can be retrieved and reset through ``rte_flow_query()``, see
  * ``struct rte_flow_query_count``.
  *
- * @deprecated Shared attribute is deprecated, use generic
- * RTE_FLOW_ACTION_TYPE_INDIRECT action.
- *
- * 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 {
-       /** @deprecated Share counter ID with other flow rules. */
-       uint32_t shared:1;
-       uint32_t reserved:31; /**< Reserved, must be zero. */
        uint32_t id; /**< Counter ID. */
 };
 
@@ -3138,6 +3149,19 @@ struct rte_flow_modify_conntrack {
        uint32_t reserved:30;
 };
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_METER_COLOR
+ *
+ * The meter color should be set in the packet meta-data
+ * (i.e. struct rte_mbuf::sched::color).
+ */
+struct rte_flow_action_meter_color {
+       enum rte_color color; /**< Packet color. */
+};
+
 /**
  * Field IDs for MODIFY_FIELD action.
  */
@@ -3248,7 +3272,7 @@ rte_flow_dynf_metadata_set(struct rte_mbuf *m, uint32_t v)
        *RTE_FLOW_DYNF_METADATA(m) = v;
 }
 
-/*
+/**
  * Definition of a single action.
  *
  * A list of actions is terminated by a END action.
@@ -4193,6 +4217,10 @@ rte_flow_tunnel_match(uint16_t port_id,
 /**
  * Populate the current packet processing state, if exists, for the given mbuf.
  *
+ * One should negotiate tunnel metadata delivery from the NIC to the HW.
+ * @see rte_eth_rx_metadata_negotiate()
+ * @see RTE_ETH_RX_METADATA_TUNNEL_ID
+ *
  * @param port_id
  *   Port identifier of Ethernet device.
  * @param[in] m