From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 90AFAA2F6B for ; Tue, 8 Oct 2019 14:51:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 68CEE1BEB3; Tue, 8 Oct 2019 14:51:19 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 8F5A31BE81 for ; Tue, 8 Oct 2019 14:51:17 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2019 05:51:16 -0700 X-IronPort-AV: E=Sophos;i="5.67,270,1566889200"; d="scan'208";a="206629412" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.10]) ([10.237.221.10]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/AES256-SHA; 08 Oct 2019 05:51:10 -0700 To: Adrien Mazarguil , Andrew Rybchenko Cc: Yongseok Koh , Thomas Monjalon , Olivier Matz , Bruce Richardson , Shahaf Shuler , Ferruh Yigit , dev , Slava Ovsiienko References: <20190603213231.27020-1-yskoh@mellanox.com> <20190710100743.z5ioyxish4wnh3s4@glumotte.dev.6wind.com> <20190710120128.GC505@bricha3-MOBL.ger.corp.intel.com> <6507101.CIctlFmaPS@xps> <5D78C242-D970-4001-B8CE-268D4E444BC6@mellanox.com> <20190711074418.GT4512@6wind.com> <4d0ad1e8-10d6-d5ff-d3b3-a94379d60662@solarflare.com> <20190729150605.GA4512@6wind.com> From: "Yigit, Ferruh" Openpgp: preference=signencrypt Autocrypt: addr=ferruh.yigit@linux.intel.com; keydata= mQINBFXZCFABEADCujshBOAaqPZpwShdkzkyGpJ15lmxiSr3jVMqOtQS/sB3FYLT0/d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K3LmNz/UxHBSWEmUnkg4fJl Rr7oItHsZ0ia6wWQ8lQnABEBAAGJAjwEGAEKACYCGwwWIQTSNlOHQi7ChOOZgcf5M+tD3xNh HwUCXWZ5wAUJB3FgggAKCRD5M+tD3xNhH2O+D/9OEz62YuJQLuIuOfL67eFTIB5/1+0j8Tsu o2psca1PUQ61SZJZOMl6VwNxpdvEaolVdrpnSxUF31kPEvR0Igy8HysQ11pj8AcgH0a9FrvU /8k2Roccd2ZIdpNLkirGFZR7LtRw41Kt1Jg+lafI0efkiHKMT/6D/P1EUp1RxOBNtWGV2hrd 0Yg9ds+VMphHHU69fDH02SwgpvXwG8Qm14Zi5WQ66R4CtTkHuYtA63sS17vMl8fDuTCtvfPF HzvdJLIhDYN3Mm1oMjKLlq4PUdYh68Fiwm+boJoBUFGuregJFlO3hM7uHBDhSEnXQr5mqpPM 6R/7Q5BjAxrwVBisH0yQGjsWlnysRWNfExAE2sRePSl0or9q19ddkRYltl6X4FDUXy2DTXa9 a+Fw4e1EvmcF3PjmTYs9IE3Vc64CRQXkhujcN4ZZh5lvOpU8WgyDxFq7bavFnSS6kx7Tk29/ wNJBp+cf9qsQxLbqhW5kfORuZGecus0TLcmpZEFKKjTJBK9gELRBB/zoN3j41hlEl7uTUXTI JQFLhpsFlEdKLujyvT/aCwP3XWT+B2uZDKrMAElF6ltpTxI53JYi22WO7NH7MR16Fhi4R6vh FHNBOkiAhUpoXRZXaCR6+X4qwA8CwHGqHRBfYFSU/Ulq1ZLR+S3hNj2mbnSx0lBs1eEqe2vh cA== Message-ID: <12d8ad96-0626-a6df-91b3-10287a08b2fd@linux.intel.com> Date: Tue, 8 Oct 2019 13:51:07 +0100 MIME-Version: 1.0 In-Reply-To: <20190729150605.GA4512@6wind.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] ethdev: extend flow metadata 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" On 7/29/2019 4:06 PM, Adrien Mazarguil wrote: > On Sun, Jul 14, 2019 at 02:46:58PM +0300, Andrew Rybchenko wrote: >> On 11.07.2019 10:44, Adrien Mazarguil wrote: >>> On Wed, Jul 10, 2019 at 04:37:46PM +0000, Yongseok Koh wrote: >>>>> On Jul 10, 2019, at 5:26 AM, Thomas Monjalon wrote: >>>>> >>>>> 10/07/2019 14:01, Bruce Richardson: >>>>>> On Wed, Jul 10, 2019 at 12:07:43PM +0200, Olivier Matz wrote: >>>>>>> On Wed, Jul 10, 2019 at 10:55:34AM +0100, Bruce Richardson wrote: >>>>>>>> On Wed, Jul 10, 2019 at 11:31:56AM +0200, Olivier Matz wrote: >>>>>>>>> On Thu, Jul 04, 2019 at 04:21:22PM -0700, Yongseok Koh wrote: >>>>>>>>>> Currently, metadata can be set on egress path via mbuf tx_meatadata field >>>>>>>>>> with PKT_TX_METADATA flag and RTE_FLOW_ITEM_TYPE_RX_META matches metadata. >>>>>>>>>> >>>>>>>>>> This patch extends the usability. >>>>>>>>>> >>>>>>>>>> 1) RTE_FLOW_ACTION_TYPE_SET_META >>>>>>>>>> >>>>>>>>>> When supporting multiple tables, Tx metadata can also be set by a rule and >>>>>>>>>> matched by another rule. This new action allows metadata to be set as a >>>>>>>>>> result of flow match. >>>>>>>>>> >>>>>>>>>> 2) Metadata on ingress >>>>>>>>>> >>>>>>>>>> There's also need to support metadata on packet Rx. Metadata can be set by >>>>>>>>>> SET_META action and matched by META item like Tx. The final value set by >>>>>>>>>> the action will be delivered to application via mbuf metadata field with >>>>>>>>>> PKT_RX_METADATA ol_flag. >>>>>>>>>> >>>>>>>>>> For this purpose, mbuf->tx_metadata is moved as a separate new field and >>>>>>>>>> renamed to 'metadata' to support both Rx and Tx metadata. >>>>>>>>>> >>>>>>>>>> For loopback/hairpin packet, metadata set on Rx/Tx may or may not be >>>>>>>>>> propagated to the other path depending on HW capability. >>>>>>>>>> >>>>>>>>>> Signed-off-by: Yongseok Koh >>>>>>>>>> --- a/lib/librte_mbuf/rte_mbuf.h >>>>>>>>>> +++ b/lib/librte_mbuf/rte_mbuf.h >>>>>>>>>> @@ -648,17 +653,6 @@ struct rte_mbuf { >>>>>>>>>> /**< User defined tags. See rte_distributor_process() */ >>>>>>>>>> uint32_t usr; >>>>>>>>>> } hash; /**< hash information */ >>>>>>>>>> - struct { >>>>>>>>>> - /** >>>>>>>>>> - * Application specific metadata value >>>>>>>>>> - * for egress flow rule match. >>>>>>>>>> - * Valid if PKT_TX_METADATA is set. >>>>>>>>>> - * Located here to allow conjunct use >>>>>>>>>> - * with hash.sched.hi. >>>>>>>>>> - */ >>>>>>>>>> - uint32_t tx_metadata; >>>>>>>>>> - uint32_t reserved; >>>>>>>>>> - }; >>>>>>>>>> }; >>>>>>>>>> >>>>>>>>>> /** Outer VLAN TCI (CPU order), valid if PKT_RX_QINQ is set. */ >>>>>>>>>> @@ -727,6 +721,11 @@ struct rte_mbuf { >>>>>>>>>> */ >>>>>>>>>> struct rte_mbuf_ext_shared_info *shinfo; >>>>>>>>>> >>>>>>>>>> + /** Application specific metadata value for flow rule match. >>>>>>>>>> + * Valid if PKT_RX_METADATA or PKT_TX_METADATA is set. >>>>>>>>>> + */ >>>>>>>>>> + uint32_t metadata; >>>>>>>>>> + >>>>>>>>>> } __rte_cache_aligned; >>>>>>>>> This will break the ABI, so we cannot put it in 19.08, and we need a >>>>>>>>> deprecation notice. >>>>>>>>> >>>>>>>> Does it actually break the ABI? Adding a new field to the mbuf should only >>>>>>>> break the ABI if it either causes new fields to move or changes the >>>>>>>> structure size. Since this is at the end, it's not going to move any older >>>>>>>> fields, and since everything is cache-aligned I don't think the structure >>>>>>>> size changes either. >>>>>>> I think it does break the ABI: in previous version, when the PKT_TX_METADATA >>>>>>> flag is set, the associated value is put in m->tx_metadata (offset 44 on >>>>>>> x86-64), and in the next version, it will be in m->metadata (offset 112). So, >>>>>>> these 2 versions are not binary compatible. >>>>>>> >>>>>>> Anyway, at least it breaks the API. >>>>>> Ok, I misunderstood. I thought it was the structure change itself you were >>>>>> saying broke the ABI. Yes, putting the data in a different place is indeed >>>>>> an ABI break. >>>>> We could add the new field and keep the old one unused, >>>>> so it does not break the ABI. >>>> Still breaks ABI if PKT_TX_METADATA is set. :-) In order not to break it, I can >>>> keep the current union'd field (tx_metadata) as is with PKT_TX_METADATA, add >>>> the new one at the end and make it used with the new PKT_RX_METADATA. >>>> >>>>> However I suppose everybody will prefer a version using dynamic fields. >>>>> Is someone against using dynamic field for such usage? >>>> However, given that the amazing dynamic fields is coming soon (thanks for your >>>> effort, Olivier and Thomas!), I'd be honored to be the first user of it. >>>> >>>> Olivier, I'll take a look at your RFC. >>> Just got a crazy idea while reading this thread... How about repurposing >>> that "reserved" field as "rx_metadata" in the meantime? >> >> It overlaps with hash.fdir.hi which has RSS hash. > > While it does overlap with hash.fdir.hi, isn't the RSS hash stored in the > "rss" field overlapping with hash.fdir.lo? (see struct rte_flow_action_rss) > > hash.fdir.hi was originally used by FDIR and later repurposed by rte_flow > for its MARK action, which neatly qualifies as Rx metadata so renaming > "reserved" as "rx_metadata" could already make sense. > > That is, assuming users do not need two different kinds of Rx metadata > returned simultaneously with their packets. I think it's safe. > >>> I know reserved fields are cursed and no one's ever supposed to touch them >>> but this risk is mitigated by having the end user explicitly request its >>> use, so the patch author (and his relatives) should be safe from the >>> resulting bad juju. >>> >>> Joke aside, while I like the idea of Tx/Rx META, I think the similarities >>> with MARK (and TAG eventually) is a problem. I wasn't available and couldn't >>> comment when META was originally added to the Tx path, but there's a lot of >>> overlap between these items/actions, without anything explaining to the end >>> user how and why they should pick one over the other, if they can be >>> combined at all and what happens in that case. >>> >>> All this must be documented, then we should think about unifying their >>> respective features and deprecate the less capable items/actions. In my >>> opinion, users need exactly one method to mark/match some mark while >>> processing Rx/Tx traffic and *optionally* have that mark read from/written >>> to the mbuf, which may or may not be possible depending on HW features. > > Thoughts regarding this suggestion? From a user perspective I think all > these actions should be unified but maybe there are good reasons to keep > them separate? > I think more recent plan is introducing dynamic fields for the remaining 16 bytes in the second cacheline. I will update the patch as rejected, is there any objection?