From patchwork Wed Sep 9 09:25:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dekel Peled X-Patchwork-Id: 77026 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 63CDDA04B1; Wed, 9 Sep 2020 11:25:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 490D11BF8F; Wed, 9 Sep 2020 11:25:47 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 1440DDE0 for ; Wed, 9 Sep 2020 11:25:45 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from dekelp@nvidia.com) with SMTP; 9 Sep 2020 12:25:42 +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 0899PgJR002860; Wed, 9 Sep 2020 12:25:42 +0300 From: Dekel Peled To: adrien.mazarguil@6wind.com, orika@mellanox.com, thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org, matan@nvidia.com Date: Wed, 9 Sep 2020 12:25:05 +0300 Message-Id: X-Mailer: git-send-email 1.7.1 Subject: [dpdk-dev] [RFC] 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 single flow. Recent patch [1] introduced the shared action API. Using this API, an action can be created as shared, unattached to any flow rule. Multiple flows can then be created using the shared action. The new API also supports query operation of a shared action. This RFC proposes the response format for query of a shared AGE action. This response format can be also used for existing flow query operation. Following this RFC, the MLX5 PMD will implement support of shared AGE action. This new feature will utilize the Flow Hit ASO Object mechanism. A Flow Hit ASO Object contains 512 flags, each flag can be assigned to a specific shared AGE action. Traffic hit on any flow which uses the shared AGE action will set the flag assigned to this action. MLX5 PMD will monitor the state of all allocated Flow Hit flags. The duration of time with no flow hit will be aggregated until aging timeout expires. Application will use the shared action query operation to find the AGE action state. The response will be returned in the format proposed here. [1] https://mails.dpdk.org/archives/dev/2020-July/174110.html Signed-off-by: Dekel Peled --- lib/librte_ethdev/rte_flow.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index 7b9f82b..5f7235c 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -2064,6 +2064,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, @@ -2181,6 +2182,19 @@ struct rte_flow_query_count { }; /** + * 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. */ +}; + +/** * Hash function types. */ enum rte_eth_hash_function {