From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 76FBA437B3; Thu, 28 Dec 2023 15:10:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03399402CB; Thu, 28 Dec 2023 15:10:56 +0100 (CET) Received: from agw.arknetworks.am (agw.arknetworks.am [79.141.165.80]) by mails.dpdk.org (Postfix) with ESMTP id 6D01F402C4 for ; Thu, 28 Dec 2023 15:10:54 +0100 (CET) Received: from debian (unknown [78.109.64.250]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by agw.arknetworks.am (Postfix) with ESMTPSA id 68B88E0EC9; Thu, 28 Dec 2023 18:10:53 +0400 (+04) DKIM-Filter: OpenDKIM Filter v2.11.0 agw.arknetworks.am 68B88E0EC9 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arknetworks.am; s=default; t=1703772654; bh=e3g2spo4nh4i20yZNES7dFZInXdR3zs5tvN9lOex3y4=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=79uxkx69IrfoYmW6FlG5IjGuySBc+5WOMVKBF0rSpWwDpe27kTABH9Gca0RhJ1ElS Af5+23sTS2LDhF38o1/wQ4QblMAscRxsl8d9VEysECCfYrDlqDozJnDuqIdQ3QV3gS Q9ohDZ7ffEDzPo5jQOXi6vRzq4h1DtVDrbhAXXowgR+TbZry2coV67toRCdldiYtTp U1XlVFM9HKgxE3YudOFLyeYEk+E04zzZEJg69IgYikpnYbwFUc4/uxmlIoos6X9Oyv W4PlkkzzeYVSFNoa0TD6qHEd76IcJMwyRGggnsJnxrGEdAHt6bJ5sc0uRKWA2MeTxD D/1+qe4KQfO3w== Date: Thu, 28 Dec 2023 18:10:32 +0400 (+04) From: Ivan Malov To: Dariusz Sosnowski cc: Stephen Hemminger , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Ferruh Yigit , Andrew Rybchenko , Ori Kam , "dev@dpdk.org" Subject: RE: [RFC] ethdev: fast path async flow API In-Reply-To: Message-ID: <014e697b-a0f1-32d5-dc1e-11cd24c7f38e@arknetworks.am> References: <20231227105709.1951231-1-dsosnowski@nvidia.com> <20231227094117.678ce828@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Dariusz, I appreciate the proposal. You say that a reference PMD implementation will be made available for 24.03 release. What about the applications? Is this supposed to go to upstream code of some applications? Thank you. On Thu, 28 Dec 2023, Dariusz Sosnowski wrote: > Hi Stephen, > >>> +/** >>> + * @internal >>> + * >>> + * Fast path async flow functions and related data are held in a flat array, >> one entry per ethdev. >>> + * It is assumed that each entry is read-only and cache aligned. >>> + */ >>> +struct rte_flow_fp_ops { >>> + void *ctx; >>> + rte_flow_async_create_t async_create; >>> + rte_flow_async_create_by_index_t async_create_by_index; >>> + rte_flow_async_actions_update_t async_actions_update; >>> + rte_flow_async_destroy_t async_destroy; >>> + rte_flow_push_t push; >>> + rte_flow_pull_t pull; >>> + rte_flow_async_action_handle_create_t async_action_handle_create; >>> + rte_flow_async_action_handle_destroy_t async_action_handle_destroy; >>> + rte_flow_async_action_handle_update_t async_action_handle_update; >>> + rte_flow_async_action_handle_query_t async_action_handle_query; >>> + rte_flow_async_action_handle_query_update_t >> async_action_handle_query_update; >>> + rte_flow_async_action_list_handle_create_t >> async_action_list_handle_create; >>> + rte_flow_async_action_list_handle_destroy_t >> async_action_list_handle_destroy; >>> + rte_flow_async_action_list_handle_query_update_t >> async_action_list_handle_query_update; >>> +} __rte_cache_aligned; >> >> If you go ahead with this then all usage should be const pointer. >> Still think it is bad idea and creates even more technical debt. > Could you please elaborate a bit more on why do you think it is a bad idea and why it creates technical debt? > >>> **Future considerations** >>> >>> A case can be made about converting some of the existing stable API >>> functions to fast path versions in future LTS releases. >>> I don't have any hard data on how such changes would affect >>> performance of these APIs, but I assume that the improvement would be noticeable. >> >> The problem is that inline functions create future ABI problems. > Agreed, this is why such a change can only be introduced when a new major ABI version is released. > However, even though inlining could reduce function call overhead, I'm not sure if such a change is needed for synchronous flow API. > I mentioned it here as a thing to consider. > >> Usually, there are other ways to get the same performance benefit. >> Often batching updates to hardware will do the trick. > This is true, but we still have some library-level overhead. > To elaborate more, the current state of flow API is as follows: > - With sync flow API: > - Applications cannot batch flow operations. > - With async flow APIs: > - Applications can enqueue multiple flow operations and PMDs can issue batches to HW. > - But there is still one function call per enqueued flow operation. > The overall API overhead in datapath may be nonnegligible if we consider that applications may enqueue a flow rule creation operation for every packet received in SW. > This proposal specifically aims at reducing API overhead for async flow API in a case mentioned above. > > As a side note, we plan to push changes to mlx5 PMD in 24.03 which will reduce PMD overhead in such scenarios. > This proposal's goal is to reduce overhead of async flow API at library level. > > Best regards, > Dariusz Sosnowski >