From patchwork Wed Oct 7 13:28:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dekel Peled X-Patchwork-Id: 79875 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A3BD0A04BA; Wed, 7 Oct 2020 15:29:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7F50F1BAC5; Wed, 7 Oct 2020 15:29:19 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 677331BAC5 for ; Wed, 7 Oct 2020 15:29:18 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from dekelp@nvidia.com) with SMTP; 7 Oct 2020 16:29:15 +0300 Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx [10.228.134.250]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 097DTD4Z014566; Wed, 7 Oct 2020 16:29:15 +0300 From: Dekel Peled To: orika@nvidia.com, 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 Date: Wed, 7 Oct 2020 16:28:42 +0300 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v4 1/2] ethdev: support query of AGE action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "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 Acked-by: Matan Azrad Acked-by: Ori Kam Acked-by: Andrew Rybchenko --- 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 * From patchwork Wed Oct 7 13:28:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dekel Peled X-Patchwork-Id: 79877 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A0BEA04BC; Wed, 7 Oct 2020 15:30:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 33E741BC1A; Wed, 7 Oct 2020 15:29:25 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 48B751BBDB for ; Wed, 7 Oct 2020 15:29:23 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from dekelp@nvidia.com) with SMTP; 7 Oct 2020 16:29:17 +0300 Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx [10.228.134.250]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 097DTD4a014566; Wed, 7 Oct 2020 16:29:17 +0300 From: Dekel Peled To: orika@nvidia.com, 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 Date: Wed, 7 Oct 2020 16:28:43 +0300 Message-Id: <66ddfa4691ca4acb1298dc1c1f51a053223fe961.1602077120.git.dekelp@nvidia.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v4 2/2] app/testpmd: support query of AGE action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "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 Acked-by: Matan Azrad --- 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);