ethdev: support query of age action
authorDekel Peled <dekelp@nvidia.com>
Wed, 7 Oct 2020 13:28:42 +0000 (16:28 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Oct 2020 17:48:16 +0000 (19:48 +0200)
Existing API supports AGE action to monitor the aging of a flow.
This patch implements RFC [1], introducing the response format for query
of an AGE action.
Application will be able to query the AGE action state.
The response will be returned in the format implemented here.

[1] https://mails.dpdk.org/archives/dev/2020-September/180061.html

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
doc/guides/prog_guide/rte_flow.rst
doc/guides/rel_notes/release_20_11.rst
lib/librte_ethdev/rte_flow.h

index 4e022df..a446b51 100644 (file)
@@ -2666,6 +2666,23 @@ timeout passed without any matching on the flow.
    | ``context``  | user input flow context         |
    +--------------+---------------------------------+
 
+Query structure to retrieve ageing status information of a
+shared AGE action, or a flow rule using the AGE action:
+
+.. _table_rte_flow_query_age:
+
+.. table:: AGE query
+
+   +------------------------------+-----+----------------------------------------+
+   | Field                        | I/O | Value                                  |
+   +==============================+=====+========================================+
+   | ``aged``                     | out | Aging timeout expired                  |
+   +------------------------------+-----+----------------------------------------+
+   | ``sec_since_last_hit_valid`` | out | ``sec_since_last_hit`` value is valid  |
+   +------------------------------+-----+----------------------------------------+
+   | ``sec_since_last_hit``       | out | Seconds since last traffic hit         |
+   +------------------------------+-----+----------------------------------------+
+
 Action: ``SAMPLE``
 ^^^^^^^^^^^^^^^^^^
 
index fafad67..e1c2f40 100644 (file)
@@ -387,6 +387,8 @@ API Changes
   * ``rx_qN*`` -> ``rx_qN_*``
   * ``tx_qN*`` -> ``tx_qN_*``
 
+* ethdev: Added capability to query age flow action.
+
 * ethdev: Renamed internal functions:
 
   * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
index fa70d40..3d5fb09 100644 (file)
@@ -2130,6 +2130,7 @@ enum rte_flow_action_type {
         * See struct rte_flow_action_age.
         * See function rte_flow_get_aged_flows
         * see enum RTE_ETH_EVENT_FLOW_AGED
+        * See struct rte_flow_query_age
         */
        RTE_FLOW_ACTION_TYPE_AGE,
 
@@ -2201,6 +2202,20 @@ struct rte_flow_action_age {
                /**< The user flow context, NULL means the rte_flow pointer. */
 };
 
+/**
+ * RTE_FLOW_ACTION_TYPE_AGE (query)
+ *
+ * Query structure to retrieve the aging status information of a
+ * shared AGE action, or a flow rule using the AGE action.
+ */
+struct rte_flow_query_age {
+       uint32_t reserved:6; /**< Reserved, must be zero. */
+       uint32_t aged:1; /**< 1 if aging timeout expired, 0 otherwise. */
+       uint32_t sec_since_last_hit_valid:1;
+       /**< sec_since_last_hit value is valid. */
+       uint32_t sec_since_last_hit:24; /**< Seconds since last traffic hit. */
+};
+
 /**
  * @warning
  * @b EXPERIMENTAL: this structure may change without prior notice