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 7B346A0A0A; Tue, 30 Mar 2021 17:45:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B262140E18; Tue, 30 Mar 2021 17:45:50 +0200 (CEST) Received: from spider.fraudbuster.mobi (spider.fraudbuster.mobi [62.4.12.223]) by mails.dpdk.org (Postfix) with ESMTP id 8D7EA406B4 for ; Tue, 30 Mar 2021 17:45:48 +0200 (CEST) Received: from [10.8.0.214] (gypsy.fraudbuster.mobi [212.129.1.221]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by spider.fraudbuster.mobi (Postfix) with ESMTPSA id 0C51D21C5E; Tue, 30 Mar 2021 17:45:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fraudbuster.mobi; s=rsa-20200712; t=1617119148; bh=dpiQOcoLOOsnRD7A10WAggWE6DQr6vfJzEkhQ/21MMM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=DuAXsbvLlfouWZfLCmkll9Se9aSRUiluyGy0MOjj0E9Nv6kzLDEza8UCalwZQxBlp XYuoQCyanorpx+u8SRF5j8lL0l0QVb8JTLwIwOFAFVtPlwSeI4z1vzmC2LmpSdPcn3 ZroSC9OccgWBDL+yBV8QNu2VjnHrdU8Umd+5KhSNkCEBHrxBl4l1RcVpL5OCzrvD8E 39C8M9D9L6iA181ts89rA5zaF99rZoM9fnm6qt65yObbNFQztVCqntI1vMlRHMtSnc abIrohsG8xvCAdgHAbM2kFQv0BFc17hww6HVLcbuRbvyb0U3jCQMsYvY0DqbIQgLl7 A7cSIgE8dFuVg== To: Asaf Penso , "dev@dpdk.org" Cc: Matan Azrad , Jack Min References: <26698242-bb7b-baa0-9e61-235ac3725cd7@fraudbuster.mobi> From: David Bouyeure Message-ID: <1ad78db6-38bd-2e01-0d81-60dd3b256c2a@fraudbuster.mobi> Date: Tue, 30 Mar 2021 17:45:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:12876, ipnet:212.129.0.0/18, country:FR]; IP_WHITELIST(0.00)[212.129.1.221] X-Rspamd-Queue-Id: 0C51D21C5E X-Rspamd-Server: spider Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] rte_flow ageing 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 Sender: "dev" Thanks a lot Asaf, for your answer, so fast. depending on the feature we want, the table you mentioned in the doc may give different combinations. Mine, DPDK-20.08/OFED 5.1-2, is part of the list. Anyway, my question is more about the API design. Please, find my comments below. On 3/29/21 8:02 PM, Asaf Penso wrote: > Hello David, > > Thanks for reaching out, I'll try to answer as best as I know and I added Matan who will be able to provide further info during next week. > First, according to our pmd documentation (http://doc.dpdk.org/guides/nics/mlx5.html#supported-hardware-offloads) we recommend using DPDK20.11 and OFED5.2, and not the combo you are referring to. > Second, we can always improve our documentation and I appreciate your queries. > > Please see my comments inline. > > Regards, > Asaf Penso > >> -----Original Message----- >> From: dev On Behalf Of David Bouyeure >> Sent: Monday, March 29, 2021 11:35 AM >> To: dev@dpdk.org >> Subject: [dpdk-dev] rte_flow ageing >> >> Hi, >> >> >> I've found out the pretty useful experimental brand new flow ageing API >> implemented in the mlx5 PMD. > It is useful and I hope you'll fully understand at the end why 😊 > > >> I'm trying it (rte_eth_dev_callback_register(RTE_ETH_EVENT_FLOW_AGED), >> RTE_FLOW_ACTION_TYPE_AGE) to recover any flow that I previously >> offloaded. >> >> The DPDK version is 20.08 and Mellanox(Connect-X6) OFED drivers are 5.1- >> 2.5.8.0. >> > See above the suggested versions for this feature > >> I eventually don't see the usefulness of the callback since it's actually triggered >> indirectly by us(the DPDK application) when calling >> rte_flow_get_aged_flows(). > The main intention is to offload the aging logic from the application level to the pmd level. > There is so saving of cpu cycles, and the gain here is with simplicity. > The application doesn't need to have complex logic of comparison between counters or other HW info that can be retrieve. > Now, the pmd hides all of that and leaves the application only to decide what to do with the flows that are aged out. > Please note, the pmd does not delete any flow, just provide the list of all the flows that are aged. I fully understand that and this is a very very useful feature to us. >> If we don't call it, the callback is called only once. >> >> And, calling rte_flow_get_aged_flows() from the callback won't trigger it next >> time(MLX5_AGE_TRIGGER is reset after the callback call) > Once you call the function the pmd will not trigger more events. Now it's up to the application to decide what to do. > Doing it differently, will cause an interrupt storm and the pmd avoids that.If new flows are aged then the pmd will trigger a new event. Sorry, I wasn't realizing that the callback isn't called for each flow but rather for each port, though it's clear in the PMD code. But, the fact that we can register several RTE_ETH_EVENT_FLOW_AGED event handlers is surprising. So, you suggest to use the callback as an indicator to later retrieve the aged-out flows, that's it? Wouldn't calling rte_flow_get_aged_flows with NULL param just to get the number of aged_flows do the same, without the need to un/register a callback, and DPDK to call it? Another thing, the explanation here http://doc.dpdk.org/api/rte__flow_8h.html#a43763e0794d2696b18b6272619aafc2a *"...to get the aged flows usynchronously from the event callback..."* seems wrong to me because age_info->flags is set to 0 just after the callback, thus ML5_AGE_TRIGGER is canceled and no event will be triggered before we'll call rte_flow_get_aged_flows() outside of the callback. >> Furthermore, I don't see the point of computing ageing flows in >> mlx5_fow.c::mlx5_flow_aging_check() if the client callback isn't called. >> > Can you elaborate? I'm not sure I understand your intention. Please forgot :-) > >> So far, I can handle the flow ageing from the same thread as the one which is >> handling the flow direction(rte_flow), it even avoid threads synchronization. >> But, in the future, I may need to be noticed as soon as possible of a single flow >> ageing, and thus handle this flow logic from the ageing callback. >> >> >> I may misunderstand the whole ageing API... Thanks a lot for any clarification.