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 BED5FA0543; Thu, 22 Sep 2022 14:43:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6720340156; Thu, 22 Sep 2022 14:43:14 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 4F5C6400D7 for ; Thu, 22 Sep 2022 14:43:12 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 115) id C4F5B8B; Thu, 22 Sep 2022 15:43:11 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mail1.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD autolearn=no autolearn_force=no version=3.4.6 Received: from bree.oktetlabs.ru (bree.oktetlabs.ru [192.168.34.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPS id 0329786; Thu, 22 Sep 2022 15:43:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 0329786 Authentication-Results: shelob.oktetlabs.ru/0329786; dkim=none; dkim-atps=neutral Date: Thu, 22 Sep 2022 15:43:10 +0300 (MSK) From: Ivan Malov To: Ori Kam cc: Andrew Rybchenko , =?ISO-8859-15?Q?Morten_Br=F8rup?= , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Rongwei Liu , Matan Azrad , Slava Ovsiienko , Aman Singh , Yuying Zhang , "dev@dpdk.org" , Raslan Darawsheh , "jerinj@marvell.com" , "ajit.khaparde@broadcom.com" Subject: RE: [PATCH v1] ethdev: add direction info when creating the transfer table In-Reply-To: Message-ID: <70f9638b-1f35-e4c8-87ad-a0ae4d44f475@oktetlabs.ru> References: <20220907024020.2474860-1-rongweil@nvidia.com> <4733483b-effe-1eac-cbf-d238e1ec2b8@oktetlabs.ru> <13527775.RDIVbhacDa@thomas> <98CBD80474FA8B44BF855DF32C47DC35D87342@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1463810782-166430448-1663850591=:3945006" 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 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463810782-166430448-1663850591=:3945006 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT Hi Ori, On Thu, 22 Sep 2022, Ori Kam wrote: > Hi Andrew, > >> -----Original Message----- >> From: Andrew Rybchenko >> Sent: Thursday, 22 September 2022 10:39 >> >> On 9/21/22 15:51, Morten Brørup wrote: >>>> From: Ori Kam [mailto:orika@nvidia.com] >>>> Sent: Wednesday, 21 September 2022 14.41 >>>> >>>>> From: Andrew Rybchenko >>>>> >>>>> On 9/21/22 12:40, Thomas Monjalon wrote: >>>>>> 21/09/2022 11:04, Ivan Malov: >>>>>>> Now it's clear to me that your intention is to match on exact >>>> ports, >>>>>>> as usual, but this time with a hint for the flow table. Got it. >>>>>>> >>>>>>> In your response, you say that matching on ALL vports is not what >>>>>>> the use case needs. OK, I understood. But please note that the >>>>>>> item name does not say "ALL", it says "ANY". >>>>>>> >>>>>>> OK. Say, "ANY" is also confusing. Let's then name it "VPORTS_ONLY" >>>>>>> and "PHY_PORTS_ONLY". This way, if user provides item >> VPORTS_ONLY >>>>>>> and then provides item REPRESENTED_PORT, these two items do not >>>>>>> contradict each other. Item VPORTS_ONLY defines the scope of some >>>>>>> kind, then the following item, REPRESENTED_PORT, makes it >>>> narrower. >>>>>>> >>>>>>> And, in documentation, one can say clearly that the user *may* >>>>>>> omit item VPORTS_ONLY in the exact rule pattern provided that >>>>>>> they have already submitted this item as part of the template. >>>>>> >>>>>> I think the problem that Rongwei & Ori are trying to solve >>>>>> is to allocate resources for the templates table in the right >>>> place. >>>>>> A table can have multiple templates. >>>>>> If all rules/templates for this table are dedicated to virtual >>>> ports, >>>>>> then the table will be allocated in a place managing only virtual >>>> ports. >>>>>> This allocation decision must be taken at table creation, >>>>>> whereas rules will be created later. >>>>>> In order to do this specific table allocation for vports, >>>>>> we need to restrict all templates of the table to be "vports only". >>>>>> >>>>>> I hope it makes things clearer. >>>>>> Now the question is how to achieve this? Solutions are: >>>>>> >>>>>> 1/ give a hint to the table allocation >>>>>> 2/ insert a pattern item in all templates of the table >>>>>> >>>>>> I don't see any other solution. Please propose if there are more >>>> options. >>>>>> >>>>>> >>>>> >>>>> See my mail >>>>> >>>>> 3/ use jump rule which ensures that all traffic meets out >>>>> expectations >>>>> >>>>> It means that the table creation could be postponed. Or the >>>>> table could be per-configured at the point of creation and >>>>> finalized when we know that all traffic will be from wires >>>>> or from vports. Yes, it complicates internals to achieve >>>>> the optimization. >>>> >>>> Sorry Andrew your suggestion is not a valid one for the following >>>> reasons: >>>> 1. table creation can't be postponed this is a key idea of the rte_flow >>>> template API. >> >> I guess nobody cares if it delays insertion on the first rule >> only. Anyway, see below. >> >>>> 2. we can never know what rules will be inserted if the application >>>> doesn't tell us. >>>> how can we know this is the last rule? What do we do with the >>>> first rule? >>>> 3. I don't see how jumping helps since it worsens the issue when you >>>> jump to a table, >>>> how does the PMD know if this table should have only wire or only >>>> vports? >> >> Jump rules say so. PMD can analyze there rules. >> May be just need an attribute saying that all jump rules >> to the table are configured and further attempts to reconfigure >> will be rejected? >> > > The idea is the PMD will not analyze rules. That is why we have the table > and template. PMDs will not analyze **rules**, yes. But that does not dismiss the need to analyze **tables** and **templates** when they are created. I.e. table/template creation is some sort of "cold"/"slow" path. The PMD sees the item in the pattern and translates it to the internal representation of the table. Just like it **would** do in case of the attribute approach. But when the rules are inserted (**hot** async path), the PMD should just collect exact "spec" values from the pattern without analyzing it, as per the previously learned template. >From the HW resource usage perspective (in your case), why isn't such design good enough? > Sorry, I don't understand what attribute can be in jump? The jump is just > to table. It can't say anything about the table destination table. > This is all this patch adds the attribute to a table to say where this > table should be located. > >>>> >>>> I agree with Thomas, there are two valid options, I vote for the hint >>>> since this is the >>>> feature idea to tell the PMD where this resource should be allocated. >>> >>> This is an optimization; I agree with Ori that a hint is appropriate, like the >> MBUF_FAST_FREE hint on TX queues. >>> >>> No need to add more complexity by requiring the driver to recognize that >> the pattern is present in all templates. (And perhaps also remove that >> pattern when applying the templates.) >> >> What does the part of the matching criteria so special >> that it is allowed to have dedicated hint attribute? >> >> May be we can have really generic solution when any >> part of the matching criteria could provide such hints? > > That is the point I keep returning to, it is not matching! Let's face it: these attributes are in fact matching, which, in the case of MLX5, is translated into resource properties. I.e., to MLX5 (internally!), these attributes are indeed not matching but separate resource allocation. Got it. But what about other vendors? I guess, hardly can someone say for sure that others' internals work the same way... > This is on which HW resource the table should be allocated. > Think about ingress/egress/transfer why are they not in the pattern? - ingres/egress only applies to non-transfer rules and serves to catch either incoming or outcoming traffic of the single "door" (ethdev) (furthermore, these attributes had been defined long before the transfer concept was added, so even if we NOW realise these attributes **could** have been expressed in the form of items, I'm afraid it's no use crying over spilt milk) - transfer is not in pattern because it is not a match criterion; it is in fact the indication of which **match engine** to use: either the one of the embedded switch or the one of the vNIC / ethdev > They are where rules should be offloaded, they are different domain. It's OK to say that generic concept of "embedded switch level", or "transfer domain", in the case of MLX5, is in turn split into two different HW domains, - it's vendor-specific internals, - but it's not OK to assume that the same separation is also valid for other vendors. > Like we have elsewhere for example in action create we can state on which > domain the action should be created. If the application selects a number of domains > it may mean that extra resources will be allocated. Could you please expand on this / give an example? Just for me to check whether my point of view could be wrong based on the example or not. > > > > > Ivan ---1463810782-166430448-1663850591=:3945006--