DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: support query of AGE action
@ 2020-09-30  9:04 Dekel Peled
  2020-09-30 14:50 ` Ori Kam
  2020-10-01 19:32 ` [dpdk-dev] [PATCH v2 0/2] " Dekel Peled
  0 siblings, 2 replies; 17+ messages in thread
From: Dekel Peled @ 2020-09-30  9:04 UTC (permalink / raw)
  To: orika, thomas, ferruh.yigit, arybchenko; +Cc: dev

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>
---

Testpmd updates to follow shortly.

 doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst |  3 +++
 lib/librte_ethdev/rte_flow.h           | 14 ++++++++++++++
 3 files changed, 34 insertions(+)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 119b128..4b8d033 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -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             |
+   +-------------------------+-----+-----------------------------------+
+   | ``last_hit_time_valid`` | out | ``last_hit_time`` field is valid  |
+   +-------------------------+-----+-----------------------------------+
+   | ``last_hit_time``       | out | Seconds since last traffic hit    |
+   +-------------------------+-----+-----------------------------------+
+
 Negative types
 ~~~~~~~~~~~~~~
 
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index 4bcf220..9a397d2 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -162,6 +162,9 @@ API Changes
 
 * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
+* ethdev: Added struct ``rte_flow_query_age`` for use in response to query
+  of AGE action.
+
 * Renamed internal ethdev APIs:
 
   * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index da8bfa5..1a13802 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -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,
 };
@@ -2194,6 +2195,19 @@ struct rte_flow_action_age {
 };
 
 /**
+ * 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 aged:1; /**< 1 if aging timeout expired, 0 otherwise. */
+	uint32_t last_hit_time_valid:1; /**< 1 if last_hit_time value valid. */
+	uint32_t reserved:6; /**< Reserved, must be zero. */
+	uint32_t last_hit_time:24; /**< Seconds since last traffic hit. */
+};
+
+/**
  * @warning
  * @b EXPERIMENTAL: this structure may change without prior notice
  *
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: support query of AGE action
  2020-09-30  9:04 [dpdk-dev] [PATCH] ethdev: support query of AGE action Dekel Peled
@ 2020-09-30 14:50 ` Ori Kam
  2020-10-01 19:32 ` [dpdk-dev] [PATCH v2 0/2] " Dekel Peled
  1 sibling, 0 replies; 17+ messages in thread
From: Ori Kam @ 2020-09-30 14:50 UTC (permalink / raw)
  To: Dekel Peled, NBU-Contact-Thomas Monjalon, ferruh.yigit, arybchenko; +Cc: dev

Hi Dekel,

PSB,

Best,
Ori

> -----Original Message-----
> From: Dekel Peled <dekelp@nvidia.com>
> Sent: Wednesday, September 30, 2020 12:04 PM
> Subject: [PATCH] ethdev: support query of AGE action
> 
> 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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmails.dp
> dk.org%2Farchives%2Fdev%2F2020-
> September%2F180061.html&amp;data=02%7C01%7Corika%40nvidia.com%7Cc
> 23713ddc6ea4274097a08d8651fe28c%7C43083d15727340c1b7db39efd9ccc17
> a%7C0%7C0%7C637370534898213186&amp;sdata=KWN9qVOcOk10l3kcMkEX
> VPxsqwuyNWV1NroiHcPqCNE%3D&amp;reserved=0
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
> 
> Testpmd updates to follow shortly.
> 
>  doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
>  doc/guides/rel_notes/release_20_11.rst |  3 +++
>  lib/librte_ethdev/rte_flow.h           | 14 ++++++++++++++
>  3 files changed, 34 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/rte_flow.rst
> b/doc/guides/prog_guide/rte_flow.rst
> index 119b128..4b8d033 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -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             |
> +   +-------------------------+-----+-----------------------------------+
> +   | ``last_hit_time_valid`` | out | ``last_hit_time`` field is valid  |
> +   +-------------------------+-----+-----------------------------------+
> +   | ``last_hit_time``       | out | Seconds since last traffic hit    |
> +   +-------------------------+-----+-----------------------------------+
> +
>  Negative types
>  ~~~~~~~~~~~~~~
> 
> diff --git a/doc/guides/rel_notes/release_20_11.rst
> b/doc/guides/rel_notes/release_20_11.rst
> index 4bcf220..9a397d2 100644
> --- a/doc/guides/rel_notes/release_20_11.rst
> +++ b/doc/guides/rel_notes/release_20_11.rst
> @@ -162,6 +162,9 @@ API Changes
> 
>  * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
> 
> +* ethdev: Added struct ``rte_flow_query_age`` for use in response to query
> +  of AGE action.
> +
>  * Renamed internal ethdev APIs:
> 
>    * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
> diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
> index da8bfa5..1a13802 100644
> --- a/lib/librte_ethdev/rte_flow.h
> +++ b/lib/librte_ethdev/rte_flow.h
> @@ -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,
>  };
> @@ -2194,6 +2195,19 @@ struct rte_flow_action_age {
>  };
> 
>  /**
> + * 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 aged:1; /**< 1 if aging timeout expired, 0 otherwise. */
> +	uint32_t last_hit_time_valid:1; /**< 1 if last_hit_time value valid. */
> +	uint32_t reserved:6; /**< Reserved, must be zero. */


Why place the reserve in the middle?

> +	uint32_t last_hit_time:24; /**< Seconds since last traffic hit. */
> +};
> +
> +/**
>   * @warning
>   * @b EXPERIMENTAL: this structure may change without prior notice
>   *
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v2 0/2] support query of AGE action
  2020-09-30  9:04 [dpdk-dev] [PATCH] ethdev: support query of AGE action Dekel Peled
  2020-09-30 14:50 ` Ori Kam
@ 2020-10-01 19:32 ` Dekel Peled
  2020-10-01 19:32   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Dekel Peled
                     ` (2 more replies)
  1 sibling, 3 replies; 17+ messages in thread
From: Dekel Peled @ 2020-10-01 19:32 UTC (permalink / raw)
  To: orika, thomas, ferruh.yigit, arybchenko, wenzhuo.lu, beilei.xing,
	bernard.iremonger
  Cc: dev

This series includes change in ethdev to support a new query
response format, and change in testpmd CLI using it.

---
v2: enclose 2 separate patches in series.
    (no change in patch contents). 
---

Dekel Peled (2):
  ethdev: support query of AGE action
  app/testpmd: support query of AGE action

 app/test-pmd/config.c                  | 12 ++++++++++++
 doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst |  3 +++
 lib/librte_ethdev/rte_flow.h           | 14 ++++++++++++++
 4 files changed, 46 insertions(+)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v2 1/2] ethdev: support query of AGE action
  2020-10-01 19:32 ` [dpdk-dev] [PATCH v2 0/2] " Dekel Peled
@ 2020-10-01 19:32   ` Dekel Peled
  2020-10-04 10:01     ` Ori Kam
  2020-10-01 19:32   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: " Dekel Peled
  2020-10-07 11:37   ` [dpdk-dev] [PATCH v3 0/2] " Dekel Peled
  2 siblings, 1 reply; 17+ messages in thread
From: Dekel Peled @ 2020-10-01 19:32 UTC (permalink / raw)
  To: orika, thomas, ferruh.yigit, arybchenko, wenzhuo.lu, beilei.xing,
	bernard.iremonger
  Cc: dev

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>
---
 doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst |  3 +++
 lib/librte_ethdev/rte_flow.h           | 14 ++++++++++++++
 3 files changed, 34 insertions(+)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 119b128..4b8d033 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -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             |
+   +-------------------------+-----+-----------------------------------+
+   | ``last_hit_time_valid`` | out | ``last_hit_time`` field is valid  |
+   +-------------------------+-----+-----------------------------------+
+   | ``last_hit_time``       | out | Seconds since last traffic hit    |
+   +-------------------------+-----+-----------------------------------+
+
 Negative types
 ~~~~~~~~~~~~~~
 
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index 7f9d0dd..dd77f04 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -168,6 +168,9 @@ API Changes
 
 * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
+* ethdev: Added struct ``rte_flow_query_age`` for use in response to query
+  of AGE action.
+
 * Renamed internal ethdev APIs:
 
   * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index da8bfa5..1a13802 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -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,
 };
@@ -2194,6 +2195,19 @@ struct rte_flow_action_age {
 };
 
 /**
+ * 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 aged:1; /**< 1 if aging timeout expired, 0 otherwise. */
+	uint32_t last_hit_time_valid:1; /**< 1 if last_hit_time value valid. */
+	uint32_t reserved:6; /**< Reserved, must be zero. */
+	uint32_t last_hit_time:24; /**< Seconds since last traffic hit. */
+};
+
+/**
  * @warning
  * @b EXPERIMENTAL: this structure may change without prior notice
  *
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v2 2/2] app/testpmd: support query of AGE action
  2020-10-01 19:32 ` [dpdk-dev] [PATCH v2 0/2] " Dekel Peled
  2020-10-01 19:32   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Dekel Peled
@ 2020-10-01 19:32   ` Dekel Peled
  2020-10-07 11:37   ` [dpdk-dev] [PATCH v3 0/2] " Dekel Peled
  2 siblings, 0 replies; 17+ messages in thread
From: Dekel Peled @ 2020-10-01 19:32 UTC (permalink / raw)
  To: orika, thomas, ferruh.yigit, arybchenko, wenzhuo.lu, beilei.xing,
	bernard.iremonger
  Cc: dev

Following ethdev update [1], this patch adds CLI support to query
information related to AGE action.

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

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 app/test-pmd/config.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 418ea6d..cb268d0 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1770,6 +1770,7 @@ void print_valid_ports(void)
 	union {
 		struct rte_flow_query_count count;
 		struct rte_flow_action_rss rss_conf;
+		struct rte_flow_query_age age;
 	} query;
 	int ret;
 
@@ -1792,6 +1793,7 @@ void print_valid_ports(void)
 	switch (action->type) {
 	case RTE_FLOW_ACTION_TYPE_COUNT:
 	case RTE_FLOW_ACTION_TYPE_RSS:
+	case RTE_FLOW_ACTION_TYPE_AGE:
 		break;
 	default:
 		printf("Cannot query action type %d (%s)\n",
@@ -1819,6 +1821,16 @@ void print_valid_ports(void)
 	case RTE_FLOW_ACTION_TYPE_RSS:
 		rss_config_display(&query.rss_conf);
 		break;
+	case RTE_FLOW_ACTION_TYPE_AGE:
+		printf("%s:\n"
+		       " aged: %u\n"
+		       " last_hit_time_valid: %u\n"
+		       " last_hit_time: %" PRIu32 "\n",
+		       name,
+		       query.age.aged,
+		       query.age.last_hit_time_valid,
+		       query.age.last_hit_time);
+		break;
 	default:
 		printf("Cannot display result for action type %d (%s)\n",
 		       action->type, name);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: support query of AGE action
  2020-10-01 19:32   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Dekel Peled
@ 2020-10-04 10:01     ` Ori Kam
  2020-10-05 11:03       ` Dekel Peled
  0 siblings, 1 reply; 17+ messages in thread
From: Ori Kam @ 2020-10-04 10:01 UTC (permalink / raw)
  To: Dekel Peled, NBU-Contact-Thomas Monjalon, ferruh.yigit,
	arybchenko, wenzhuo.lu, beilei.xing, bernard.iremonger
  Cc: dev

Hi Dekel,
PSB

> -----Original Message-----
> From: Dekel Peled <dekelp@nvidia.com>
> Sent: Thursday, October 1, 2020 10:33 PM
> Subject: [PATCH v2 1/2] ethdev: support query of AGE action
> 
> 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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmails.dp
> dk.org%2Farchives%2Fdev%2F2020-
> September%2F180061.html&amp;data=02%7C01%7Corika%40nvidia.com%7Ce
> c8f8a845a284c153d7d08d86640d8e6%7C43083d15727340c1b7db39efd9ccc17
> a%7C0%7C1%7C637371776001401360&amp;sdata=y8g1yZiKsypXy%2BgsXtR5L
> Q2yVQ%2FudbbCfbbM1Zwt5dY%3D&amp;reserved=0
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
>  doc/guides/rel_notes/release_20_11.rst |  3 +++
>  lib/librte_ethdev/rte_flow.h           | 14 ++++++++++++++
>  3 files changed, 34 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/rte_flow.rst
> b/doc/guides/prog_guide/rte_flow.rst
> index 119b128..4b8d033 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -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             |
> +   +-------------------------+-----+-----------------------------------+
> +   | ``last_hit_time_valid`` | out | ``last_hit_time`` field is valid  |
> +   +-------------------------+-----+-----------------------------------+
> +   | ``last_hit_time``       | out | Seconds since last traffic hit    |
> +   +-------------------------+-----+-----------------------------------+
> +
>  Negative types
>  ~~~~~~~~~~~~~~
> 
> diff --git a/doc/guides/rel_notes/release_20_11.rst
> b/doc/guides/rel_notes/release_20_11.rst
> index 7f9d0dd..dd77f04 100644
> --- a/doc/guides/rel_notes/release_20_11.rst
> +++ b/doc/guides/rel_notes/release_20_11.rst
> @@ -168,6 +168,9 @@ API Changes
> 
>  * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
> 
> +* ethdev: Added struct ``rte_flow_query_age`` for use in response to query
> +  of AGE action.
> +
>  * Renamed internal ethdev APIs:
> 
>    * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
> diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
> index da8bfa5..1a13802 100644
> --- a/lib/librte_ethdev/rte_flow.h
> +++ b/lib/librte_ethdev/rte_flow.h
> @@ -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,
>  };
> @@ -2194,6 +2195,19 @@ struct rte_flow_action_age {
>  };
> 
>  /**
> + * 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 aged:1; /**< 1 if aging timeout expired, 0 otherwise. */
> +	uint32_t last_hit_time_valid:1; /**< 1 if last_hit_time value valid. */
> +	uint32_t reserved:6; /**< Reserved, must be zero. */
> +	uint32_t last_hit_time:24; /**< Seconds since last traffic hit. */
> +};
From previous patch, I asked you why set the reserved in the middle?

Also I think last_hit_time is by definition time, that the rule was hit.
I think you have couple of options:
1. keep last_hit_time but then set it to he time the last packet was seen.
In this case the type should be changed to 64 bit.

2. set the name to remaining time - in this case it should show the remaining time.
I think that maybe this is worth adding in any case. Since I can see a lot of uses to know
how long this flow will age. 

3. rename to seconds_since_last_hit
 
What do you think?

> +
> +/**
>   * @warning
>   * @b EXPERIMENTAL: this structure may change without prior notice
>   *
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: support query of AGE action
  2020-10-04 10:01     ` Ori Kam
@ 2020-10-05 11:03       ` Dekel Peled
  0 siblings, 0 replies; 17+ messages in thread
From: Dekel Peled @ 2020-10-05 11:03 UTC (permalink / raw)
  To: Ori Kam, NBU-Contact-Thomas Monjalon, ferruh.yigit, arybchenko,
	wenzhuo.lu, beilei.xing, bernard.iremonger
  Cc: dev

Thanks, PSB.

> -----Original Message-----
> From: Ori Kam <orika@nvidia.com>
> Sent: Sunday, October 4, 2020 1:02 PM
> To: Dekel Peled <dekelp@nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas@monjalon.net>; ferruh.yigit@intel.com;
> arybchenko@solarflare.com; wenzhuo.lu@intel.com; beilei.xing@intel.com;
> bernard.iremonger@intel.com
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v2 1/2] ethdev: support query of AGE action
> 
> Hi Dekel,
> PSB
> 
> > -----Original Message-----
> > From: Dekel Peled <dekelp@nvidia.com>
> > Sent: Thursday, October 1, 2020 10:33 PM
> > Subject: [PATCH v2 1/2] ethdev: support query of AGE action
> >
> > 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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail
> > s.dp
> > dk.org%2Farchives%2Fdev%2F2020-
> >
> September%2F180061.html&amp;data=02%7C01%7Corika%40nvidia.com%7
> Ce
> >
> c8f8a845a284c153d7d08d86640d8e6%7C43083d15727340c1b7db39efd9ccc17
> >
> a%7C0%7C1%7C637371776001401360&amp;sdata=y8g1yZiKsypXy%2BgsXtR5L
> > Q2yVQ%2FudbbCfbbM1Zwt5dY%3D&amp;reserved=0
> >
> > Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> > Acked-by: Matan Azrad <matan@nvidia.com>
> > ---
> >  doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
> >  doc/guides/rel_notes/release_20_11.rst |  3 +++
> >  lib/librte_ethdev/rte_flow.h           | 14 ++++++++++++++
> >  3 files changed, 34 insertions(+)
> >
> > diff --git a/doc/guides/prog_guide/rte_flow.rst
> > b/doc/guides/prog_guide/rte_flow.rst
> > index 119b128..4b8d033 100644
> > --- a/doc/guides/prog_guide/rte_flow.rst
> > +++ b/doc/guides/prog_guide/rte_flow.rst
> > @@ -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             |
> > +   +-------------------------+-----+-----------------------------------+
> > +   | ``last_hit_time_valid`` | out | ``last_hit_time`` field is valid  |
> > +   +-------------------------+-----+-----------------------------------+
> > +   | ``last_hit_time``       | out | Seconds since last traffic hit    |
> > +
> > + +-------------------------+-----+-----------------------------------
> > + +
> > +
> >  Negative types
> >  ~~~~~~~~~~~~~~
> >
> > diff --git a/doc/guides/rel_notes/release_20_11.rst
> > b/doc/guides/rel_notes/release_20_11.rst
> > index 7f9d0dd..dd77f04 100644
> > --- a/doc/guides/rel_notes/release_20_11.rst
> > +++ b/doc/guides/rel_notes/release_20_11.rst
> > @@ -168,6 +168,9 @@ API Changes
> >
> >  * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
> >
> > +* ethdev: Added struct ``rte_flow_query_age`` for use in response to
> > +query
> > +  of AGE action.
> > +
> >  * Renamed internal ethdev APIs:
> >
> >    * ``_rte_eth_dev_callback_process()`` ->
> > ``rte_eth_dev_callback_process()``
> > diff --git a/lib/librte_ethdev/rte_flow.h
> > b/lib/librte_ethdev/rte_flow.h index da8bfa5..1a13802 100644
> > --- a/lib/librte_ethdev/rte_flow.h
> > +++ b/lib/librte_ethdev/rte_flow.h
> > @@ -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,
> >  };
> > @@ -2194,6 +2195,19 @@ struct rte_flow_action_age {  };
> >
> >  /**
> > + * 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 aged:1; /**< 1 if aging timeout expired, 0 otherwise. */
> > +	uint32_t last_hit_time_valid:1; /**< 1 if last_hit_time value valid. */
> > +	uint32_t reserved:6; /**< Reserved, must be zero. */
> > +	uint32_t last_hit_time:24; /**< Seconds since last traffic hit. */
> > +};
> From previous patch, I asked you why set the reserved in the middle?

I will move it to the top.

> 
> Also I think last_hit_time is by definition time, that the rule was hit.
> I think you have couple of options:
> 1. keep last_hit_time but then set it to he time the last packet was seen.
> In this case the type should be changed to 64 bit.
> 
> 2. set the name to remaining time - in this case it should show the remaining
> time.
> I think that maybe this is worth adding in any case. Since I can see a lot of
> uses to know how long this flow will age.
> 
> 3. rename to seconds_since_last_hit
> 
> What do you think?

I will go with option 3.

> 
> > +
> > +/**
> >   * @warning
> >   * @b EXPERIMENTAL: this structure may change without prior notice
> >   *
> > --
> > 1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v3 0/2] support query of AGE action
  2020-10-01 19:32 ` [dpdk-dev] [PATCH v2 0/2] " Dekel Peled
  2020-10-01 19:32   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Dekel Peled
  2020-10-01 19:32   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: " Dekel Peled
@ 2020-10-07 11:37   ` Dekel Peled
  2020-10-07 11:37     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Dekel Peled
                       ` (2 more replies)
  2 siblings, 3 replies; 17+ messages in thread
From: Dekel Peled @ 2020-10-07 11:37 UTC (permalink / raw)
  To: orika, thomas, ferruh.yigit, arybchenko, wenzhuo.lu, beilei.xing,
	bernard.iremonger
  Cc: dev

This series includes change in ethdev to support a new query
response format, and change in testpmd CLI using it.

---
v2: enclose 2 separate patches in series.
    (no change in patch contents). 
v3: rename struct rte_flow_query_age field for clarity.
---

Dekel Peled (2):
  ethdev: support query of AGE action
  app/testpmd: support query of AGE action

 app/test-pmd/config.c                  | 12 ++++++++++++
 doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst |  3 +++
 lib/librte_ethdev/rte_flow.h           | 14 ++++++++++++++
 4 files changed, 46 insertions(+)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v3 1/2] ethdev: support query of AGE action
  2020-10-07 11:37   ` [dpdk-dev] [PATCH v3 0/2] " Dekel Peled
@ 2020-10-07 11:37     ` Dekel Peled
  2020-10-07 11:48       ` Ori Kam
  2020-10-07 11:37     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: " Dekel Peled
  2020-10-07 13:28     ` [dpdk-dev] [PATCH v4 0/2] " Dekel Peled
  2 siblings, 1 reply; 17+ messages in thread
From: Dekel Peled @ 2020-10-07 11:37 UTC (permalink / raw)
  To: orika, thomas, ferruh.yigit, arybchenko, wenzhuo.lu, beilei.xing,
	bernard.iremonger
  Cc: dev

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>
---
 doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst |  3 +++
 lib/librte_ethdev/rte_flow.h           | 14 ++++++++++++++
 3 files changed, 34 insertions(+)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 119b128..341e5ed 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -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                  |
+   +-------------------------+-----+----------------------------------------+
+   | ``last_hit_time_valid`` | out | ``sec_since_last_hit`` field is valid  |
+   +-------------------------+-----+----------------------------------------+
+   | ``sec_since_last_hit``  | out | Seconds since last traffic hit         |
+   +-------------------------+-----+----------------------------------------+
+
 Negative types
 ~~~~~~~~~~~~~~
 
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index 0b2a370..7e093f7 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -191,6 +191,9 @@ API Changes
 
 * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
+* ethdev: Added struct ``rte_flow_query_age`` for use in response to query
+  of AGE action.
+
 * Renamed internal ethdev APIs:
 
   * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index da8bfa5..129e4ab 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -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,
 };
@@ -2194,6 +2195,19 @@ struct rte_flow_action_age {
 };
 
 /**
+ * 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 last_hit_time_valid:1; /**< sec_since_last_hit value valid. */
+	uint32_t sec_since_last_hit:24; /**< Seconds since last traffic hit. */
+};
+
+/**
  * @warning
  * @b EXPERIMENTAL: this structure may change without prior notice
  *
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v3 2/2] app/testpmd: support query of AGE action
  2020-10-07 11:37   ` [dpdk-dev] [PATCH v3 0/2] " Dekel Peled
  2020-10-07 11:37     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Dekel Peled
@ 2020-10-07 11:37     ` Dekel Peled
  2020-10-07 13:28     ` [dpdk-dev] [PATCH v4 0/2] " Dekel Peled
  2 siblings, 0 replies; 17+ messages in thread
From: Dekel Peled @ 2020-10-07 11:37 UTC (permalink / raw)
  To: orika, thomas, ferruh.yigit, arybchenko, wenzhuo.lu, beilei.xing,
	bernard.iremonger
  Cc: dev

Following ethdev update [1], this patch adds CLI support to query
information related to AGE action.

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

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 app/test-pmd/config.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 418ea6d..83ef332 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1770,6 +1770,7 @@ void print_valid_ports(void)
 	union {
 		struct rte_flow_query_count count;
 		struct rte_flow_action_rss rss_conf;
+		struct rte_flow_query_age age;
 	} query;
 	int ret;
 
@@ -1792,6 +1793,7 @@ void print_valid_ports(void)
 	switch (action->type) {
 	case RTE_FLOW_ACTION_TYPE_COUNT:
 	case RTE_FLOW_ACTION_TYPE_RSS:
+	case RTE_FLOW_ACTION_TYPE_AGE:
 		break;
 	default:
 		printf("Cannot query action type %d (%s)\n",
@@ -1819,6 +1821,16 @@ void print_valid_ports(void)
 	case RTE_FLOW_ACTION_TYPE_RSS:
 		rss_config_display(&query.rss_conf);
 		break;
+	case RTE_FLOW_ACTION_TYPE_AGE:
+		printf("%s:\n"
+		       " aged: %u\n"
+		       " last_hit_time_valid: %u\n"
+		       " sec_since_last_hit: %" PRIu32 "\n",
+		       name,
+		       query.age.aged,
+		       query.age.last_hit_time_valid,
+		       query.age.sec_since_last_hit);
+		break;
 	default:
 		printf("Cannot display result for action type %d (%s)\n",
 		       action->type, name);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/2] ethdev: support query of AGE action
  2020-10-07 11:37     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Dekel Peled
@ 2020-10-07 11:48       ` Ori Kam
  0 siblings, 0 replies; 17+ messages in thread
From: Ori Kam @ 2020-10-07 11:48 UTC (permalink / raw)
  To: Dekel Peled, NBU-Contact-Thomas Monjalon, ferruh.yigit,
	arybchenko, wenzhuo.lu, beilei.xing, bernard.iremonger
  Cc: dev

Hi Dekel,

> -----Original Message-----
> From: Dekel Peled <dekelp@nvidia.com>
> Sent: Wednesday, October 7, 2020 2:38 PM
> Subject: [PATCH v3 1/2] ethdev: support query of AGE action
> 
> 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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmails.dp
> dk.org%2Farchives%2Fdev%2F2020-
> September%2F180061.html&amp;data=02%7C01%7Corika%40nvidia.com%7Cd
> 97faa2a57154e3ca5dd08d86ab58131%7C43083d15727340c1b7db39efd9ccc17
> a%7C0%7C0%7C637376675069240107&amp;sdata=SufcP3eY5NHVPKneg3jx06S
> EGhTl45DCMeUual5H7n8%3D&amp;reserved=0
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
>  doc/guides/rel_notes/release_20_11.rst |  3 +++
>  lib/librte_ethdev/rte_flow.h           | 14 ++++++++++++++
>  3 files changed, 34 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/rte_flow.rst
> b/doc/guides/prog_guide/rte_flow.rst
> index 119b128..341e5ed 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -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                  |
> +   +-------------------------+-----+----------------------------------------+
> +   | ``last_hit_time_valid`` | out | ``sec_since_last_hit`` field is valid  |
> +   +-------------------------+-----+----------------------------------------+
> +   | ``sec_since_last_hit``  | out | Seconds since last traffic hit         |
> +   +-------------------------+-----+----------------------------------------+
> +

I think the last_hit_time_valid name should also be changed.

>  Negative types
>  ~~~~~~~~~~~~~~
> 
> diff --git a/doc/guides/rel_notes/release_20_11.rst
> b/doc/guides/rel_notes/release_20_11.rst
> index 0b2a370..7e093f7 100644
> --- a/doc/guides/rel_notes/release_20_11.rst
> +++ b/doc/guides/rel_notes/release_20_11.rst
> @@ -191,6 +191,9 @@ API Changes
> 
>  * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
> 
> +* ethdev: Added struct ``rte_flow_query_age`` for use in response to query
> +  of AGE action.
> +
>  * Renamed internal ethdev APIs:
> 
>    * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
> diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
> index da8bfa5..129e4ab 100644
> --- a/lib/librte_ethdev/rte_flow.h
> +++ b/lib/librte_ethdev/rte_flow.h
> @@ -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,
>  };
> @@ -2194,6 +2195,19 @@ struct rte_flow_action_age {
>  };
> 
>  /**
> + * 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 last_hit_time_valid:1; /**< sec_since_last_hit value valid. */
> +	uint32_t sec_since_last_hit:24; /**< Seconds since last traffic hit. */
> +};
> +
> +/**
>   * @warning
>   * @b EXPERIMENTAL: this structure may change without prior notice
>   *
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v4 0/2] support query of AGE action
  2020-10-07 11:37   ` [dpdk-dev] [PATCH v3 0/2] " Dekel Peled
  2020-10-07 11:37     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Dekel Peled
  2020-10-07 11:37     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: " Dekel Peled
@ 2020-10-07 13:28     ` Dekel Peled
  2020-10-07 13:28       ` [dpdk-dev] [PATCH v4 1/2] ethdev: " Dekel Peled
  2020-10-07 13:28       ` [dpdk-dev] [PATCH v4 2/2] app/testpmd: " Dekel Peled
  2 siblings, 2 replies; 17+ messages in thread
From: Dekel Peled @ 2020-10-07 13:28 UTC (permalink / raw)
  To: orika, thomas, ferruh.yigit, arybchenko, wenzhuo.lu, beilei.xing,
	bernard.iremonger
  Cc: dev

This series includes change in ethdev to support a new query
response format, and change in testpmd CLI using it.

---
v2: enclose 2 separate patches in series.
    (no change in patch contents). 
v3: rename struct rte_flow_query_age field for clarity.
v4: rename struct rte_flow_query_age additional field for clarity.
---


Dekel Peled (2):
  ethdev: support query of AGE action
  app/testpmd: support query of AGE action

 app/test-pmd/config.c                  | 12 ++++++++++++
 doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst |  3 +++
 lib/librte_ethdev/rte_flow.h           | 15 +++++++++++++++
 4 files changed, 47 insertions(+)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v4 1/2] ethdev: support query of AGE action
  2020-10-07 13:28     ` [dpdk-dev] [PATCH v4 0/2] " Dekel Peled
@ 2020-10-07 13:28       ` Dekel Peled
  2020-10-07 13:46         ` Ori Kam
  2020-10-13  8:53         ` Andrew Rybchenko
  2020-10-07 13:28       ` [dpdk-dev] [PATCH v4 2/2] app/testpmd: " Dekel Peled
  1 sibling, 2 replies; 17+ messages in thread
From: Dekel Peled @ 2020-10-07 13:28 UTC (permalink / raw)
  To: orika, thomas, ferruh.yigit, arybchenko, wenzhuo.lu, beilei.xing,
	bernard.iremonger
  Cc: dev

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>
---
 doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
 doc/guides/rel_notes/release_20_11.rst |  3 +++
 lib/librte_ethdev/rte_flow.h           | 15 +++++++++++++++
 3 files changed, 35 insertions(+)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 119b128..a672fc5 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -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         |
+   +------------------------------+-----+----------------------------------------+
+
 Negative types
 ~~~~~~~~~~~~~~
 
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index 0b2a370..7e093f7 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -191,6 +191,9 @@ API Changes
 
 * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
 
+* ethdev: Added struct ``rte_flow_query_age`` for use in response to query
+  of AGE action.
+
 * Renamed internal ethdev APIs:
 
   * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index da8bfa5..42a315a 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -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,
 };
@@ -2194,6 +2195,20 @@ struct rte_flow_action_age {
 };
 
 /**
+ * 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
  *
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v4 2/2] app/testpmd: support query of AGE action
  2020-10-07 13:28     ` [dpdk-dev] [PATCH v4 0/2] " Dekel Peled
  2020-10-07 13:28       ` [dpdk-dev] [PATCH v4 1/2] ethdev: " Dekel Peled
@ 2020-10-07 13:28       ` Dekel Peled
  1 sibling, 0 replies; 17+ messages in thread
From: Dekel Peled @ 2020-10-07 13:28 UTC (permalink / raw)
  To: orika, thomas, ferruh.yigit, arybchenko, wenzhuo.lu, beilei.xing,
	bernard.iremonger
  Cc: dev

Following ethdev update in the previous patch of this series, this
patch adds CLI support to query information related to AGE action.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 app/test-pmd/config.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 418ea6d..7c50980 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1770,6 +1770,7 @@ void print_valid_ports(void)
 	union {
 		struct rte_flow_query_count count;
 		struct rte_flow_action_rss rss_conf;
+		struct rte_flow_query_age age;
 	} query;
 	int ret;
 
@@ -1792,6 +1793,7 @@ void print_valid_ports(void)
 	switch (action->type) {
 	case RTE_FLOW_ACTION_TYPE_COUNT:
 	case RTE_FLOW_ACTION_TYPE_RSS:
+	case RTE_FLOW_ACTION_TYPE_AGE:
 		break;
 	default:
 		printf("Cannot query action type %d (%s)\n",
@@ -1819,6 +1821,16 @@ void print_valid_ports(void)
 	case RTE_FLOW_ACTION_TYPE_RSS:
 		rss_config_display(&query.rss_conf);
 		break;
+	case RTE_FLOW_ACTION_TYPE_AGE:
+		printf("%s:\n"
+		       " aged: %u\n"
+		       " sec_since_last_hit_valid: %u\n"
+		       " sec_since_last_hit: %" PRIu32 "\n",
+		       name,
+		       query.age.aged,
+		       query.age.sec_since_last_hit_valid,
+		       query.age.sec_since_last_hit);
+		break;
 	default:
 		printf("Cannot display result for action type %d (%s)\n",
 		       action->type, name);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/2] ethdev: support query of AGE action
  2020-10-07 13:28       ` [dpdk-dev] [PATCH v4 1/2] ethdev: " Dekel Peled
@ 2020-10-07 13:46         ` Ori Kam
  2020-10-13  8:53         ` Andrew Rybchenko
  1 sibling, 0 replies; 17+ messages in thread
From: Ori Kam @ 2020-10-07 13:46 UTC (permalink / raw)
  To: Dekel Peled, NBU-Contact-Thomas Monjalon, ferruh.yigit,
	arybchenko, wenzhuo.lu, beilei.xing, bernard.iremonger
  Cc: dev

Hi
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Wednesday, October 7, 2020 4:29 PM
> Subject: [dpdk-dev] [PATCH v4 1/2] ethdev: support query of AGE action
> 
> 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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmails.dp
> dk.org%2Farchives%2Fdev%2F2020-
> September%2F180061.html&amp;data=02%7C01%7Corika%40nvidia.com%7Cd
> 4a344535a0a4cce067708d86ac50c2d%7C43083d15727340c1b7db39efd9ccc17
> a%7C0%7C0%7C637376741824163645&amp;sdata=i9ycF2KfCqDgcLXjzHTMxW
> TcCRS3pslGu1whISDlFbs%3D&amp;reserved=0
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
>  doc/guides/rel_notes/release_20_11.rst |  3 +++
>  lib/librte_ethdev/rte_flow.h           | 15 +++++++++++++++
>  3 files changed, 35 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/rte_flow.rst
> b/doc/guides/prog_guide/rte_flow.rst
> index 119b128..a672fc5 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -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         |
> +   +------------------------------+-----+----------------------------------------+
> +
>  Negative types
>  ~~~~~~~~~~~~~~
> 
> diff --git a/doc/guides/rel_notes/release_20_11.rst
> b/doc/guides/rel_notes/release_20_11.rst
> index 0b2a370..7e093f7 100644
> --- a/doc/guides/rel_notes/release_20_11.rst
> +++ b/doc/guides/rel_notes/release_20_11.rst
> @@ -191,6 +191,9 @@ API Changes
> 
>  * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
> 
> +* ethdev: Added struct ``rte_flow_query_age`` for use in response to query
> +  of AGE action.
> +
>  * Renamed internal ethdev APIs:
> 
>    * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
> diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
> index da8bfa5..42a315a 100644
> --- a/lib/librte_ethdev/rte_flow.h
> +++ b/lib/librte_ethdev/rte_flow.h
> @@ -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,
>  };
> @@ -2194,6 +2195,20 @@ struct rte_flow_action_age {
>  };
> 
>  /**
> + * 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
>   *
> --
> 1.8.3.1

Acked-by: Ori Kam <orika@nvidia.com>
Thanks,
Ori


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/2] ethdev: support query of AGE action
  2020-10-07 13:28       ` [dpdk-dev] [PATCH v4 1/2] ethdev: " Dekel Peled
  2020-10-07 13:46         ` Ori Kam
@ 2020-10-13  8:53         ` Andrew Rybchenko
  2020-10-13 11:14           ` Ferruh Yigit
  1 sibling, 1 reply; 17+ messages in thread
From: Andrew Rybchenko @ 2020-10-13  8:53 UTC (permalink / raw)
  To: Dekel Peled, orika, thomas, ferruh.yigit, wenzhuo.lu,
	beilei.xing, bernard.iremonger
  Cc: dev

On 10/7/20 4:28 PM, Dekel Peled wrote:
> 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>

with a nit below:

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

> ---
>  doc/guides/prog_guide/rte_flow.rst     | 17 +++++++++++++++++
>  doc/guides/rel_notes/release_20_11.rst |  3 +++
>  lib/librte_ethdev/rte_flow.h           | 15 +++++++++++++++
>  3 files changed, 35 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 119b128..a672fc5 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -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         |
> +   +------------------------------+-----+----------------------------------------+
> +
>  Negative types
>  ~~~~~~~~~~~~~~
>  
> diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
> index 0b2a370..7e093f7 100644
> --- a/doc/guides/rel_notes/release_20_11.rst
> +++ b/doc/guides/rel_notes/release_20_11.rst
> @@ -191,6 +191,9 @@ API Changes
>  
>  * ethdev: ``rte_eth_rx_descriptor_done()`` API has been deprecated.
>  
> +* ethdev: Added struct ``rte_flow_query_age`` for use in response to query
> +  of AGE action.
> +

IMO it too deep technical details for release notes advertising
new feature. What about:
 Added possibility to query AGE action state.

>  * Renamed internal ethdev APIs:
>  
>    * ``_rte_eth_dev_callback_process()`` -> ``rte_eth_dev_callback_process()``
> diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
> index da8bfa5..42a315a 100644
> --- a/lib/librte_ethdev/rte_flow.h
> +++ b/lib/librte_ethdev/rte_flow.h
> @@ -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,
>  };
> @@ -2194,6 +2195,20 @@ struct rte_flow_action_age {
>  };
>  
>  /**
> + * 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
>   *
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/2] ethdev: support query of AGE action
  2020-10-13  8:53         ` Andrew Rybchenko
@ 2020-10-13 11:14           ` Ferruh Yigit
  0 siblings, 0 replies; 17+ messages in thread
From: Ferruh Yigit @ 2020-10-13 11:14 UTC (permalink / raw)
  To: Andrew Rybchenko, Dekel Peled, orika, thomas, wenzhuo.lu,
	beilei.xing, bernard.iremonger
  Cc: dev

On 10/13/2020 9:53 AM, Andrew Rybchenko wrote:
> On 10/7/20 4:28 PM, Dekel Peled wrote:
>> 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>
> 
> with a nit below:
> 
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
 >

Series applied to dpdk-next-net/main, thanks.

Reworded release notes update as:
"ethdev: Added capability to query AGE flow action."

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-10-13 11:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30  9:04 [dpdk-dev] [PATCH] ethdev: support query of AGE action Dekel Peled
2020-09-30 14:50 ` Ori Kam
2020-10-01 19:32 ` [dpdk-dev] [PATCH v2 0/2] " Dekel Peled
2020-10-01 19:32   ` [dpdk-dev] [PATCH v2 1/2] ethdev: " Dekel Peled
2020-10-04 10:01     ` Ori Kam
2020-10-05 11:03       ` Dekel Peled
2020-10-01 19:32   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: " Dekel Peled
2020-10-07 11:37   ` [dpdk-dev] [PATCH v3 0/2] " Dekel Peled
2020-10-07 11:37     ` [dpdk-dev] [PATCH v3 1/2] ethdev: " Dekel Peled
2020-10-07 11:48       ` Ori Kam
2020-10-07 11:37     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: " Dekel Peled
2020-10-07 13:28     ` [dpdk-dev] [PATCH v4 0/2] " Dekel Peled
2020-10-07 13:28       ` [dpdk-dev] [PATCH v4 1/2] ethdev: " Dekel Peled
2020-10-07 13:46         ` Ori Kam
2020-10-13  8:53         ` Andrew Rybchenko
2020-10-13 11:14           ` Ferruh Yigit
2020-10-07 13:28       ` [dpdk-dev] [PATCH v4 2/2] app/testpmd: " Dekel Peled

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git