From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DDA06A0495 for ; Mon, 10 Jun 2019 09:20:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACBC71BE72; Mon, 10 Jun 2019 09:20:46 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 5395C1BE6D for ; Mon, 10 Jun 2019 09:20:44 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us2.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 971A31C006E; Mon, 10 Jun 2019 07:20:41 +0000 (UTC) Received: from [192.168.38.17] (91.220.146.112) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Jun 2019 08:20:33 +0100 To: "Wang, Haiyue" , Yongseok Koh , "shahafs@mellanox.com" , "thomas@monjalon.net" , "Yigit, Ferruh" , "adrien.mazarguil@6wind.com" , "olivier.matz@6wind.com" CC: "dev@dpdk.org" , "Ananyev, Konstantin" References: <20190603213231.27020-1-yskoh@mellanox.com> <7047a597-ea0d-f159-e95d-0fd8bca5b78d@solarflare.com> From: Andrew Rybchenko Message-ID: <82445af1-9e66-9de9-f3d2-176de09d904b@solarflare.com> Date: Mon, 10 Jun 2019 10:20:28 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Originating-IP: [91.220.146.112] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24664.003 X-TM-AS-Result: No-14.420200-8.000000-10 X-TMASE-MatchedRID: 0+daXaNUWRVEgaBf5eVRwvZvT2zYoYOwt3aeg7g/usAutoY2UtFqGEOx /QaSekcbwPb5NDq94CA5ZtwAbvsNRZtARfBFOP6hMIxbvM3AVohKgIbix5+XxAsFkS6ogv1Kdgz YBmAQUb0gOU4U1ceXYgXzISSu+42iAOZWqwY0KQB8OuPNcLArQg5k1ea+clp6fkiy7TTogYZpcr NTw4Vi6OSh/CjCOpctDp6ahsDW2XqRuj9FcgJUJjdfT4zyWoZSpRgiDG6+4P6A6UrbM3j3qYsT+ +zNXrEMblc670GKxHXJJaEievVvIaEiiWmjr2gp54eqweLWaL74h+uI7dxXxNctGlxeXl/ogT+8 g2HJ9+OZBGy67vn2NrnevGJvHuf1m7Y1PYDhGLrrOLyP6vXu3QGTUEvH1nWdsS0sZEB7c8ZFExD //AYDDC1/HX6casAVMpZb49DrsdUNdWPTMyGlNlD5LQ3Tl9H76/ovm5YGTGk7sEw6V/IotG3mqD rOQ2QpTiotbXXy88TjvPGBMtOggFuydZLqmw3hE9L0HNvKzVF8yGO3dvk8/QJ1vk7thYuGUdfEK c10rU79hat6Mb3lf+6i+CFG0PeWYcjDoVD2e568yvURlYGCIR98smInoXHLQiO6TS4ko334FuPC zchHYOic1Jf/iK9R/76CM4Z/MGawUTIOkt+yH54CIKY/Hg3AtOt1ofVlaoLUHQeTVDUrIm8tYvU 4XC4GIhDmZnlKoc9OgTxjbTyDulAoE5k55Y3jbeaeYEUkjCCXcVfKpR3mLi6kRAuZ8iiCzLymtd 1Mch1gNdTnQCMjZ5gQOGPvz7OMPHPYaTb4O26+68HqACCvKA== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--14.420200-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24664.003 X-MDID: 1560151242-mpKIvn0qtdwC Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [RFC 1/3] 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 6/10/19 6:19 AM, Wang, Haiyue wrote: >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Andrew Rybchenko >> Sent: Sunday, June 9, 2019 22:24 >> To: Yongseok Koh ; shahafs@mellanox.com; thomas@monjalon.net; Yigit, Ferruh >> ; adrien.mazarguil@6wind.com; olivier.matz@6wind.com >> Cc: dev@dpdk.org >> Subject: Re: [dpdk-dev] [RFC 1/3] ethdev: extend flow metadata >> >> On 6/4/19 12:32 AM, 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 >> There is a mark on Rx which is delivered to application in hash.fdir.hi. >> Why do we need one more 32-bit value set by NIC and delivered to >> application? >> What is the difference between MARK and META on Rx? >> When application should use MARK and when META? >> Is there cases when both could be necessary? >> > In my understanding, MARK is FDIR related thing, META seems to be NIC > specific. And we also need this kind of specific data field to export > NIC's data to application. I think it is better to avoid NIC vendor-specifics in motivation. I understand that it exists for you, but I think it is better to look at it from RTE flow API definition point of view: both are 32-bit (except endianess and I'm not sure that I understand why meta is defined as big-endian since it is not a value coming from or going to network in a packet, I'm sorry that I've missed it on review that time), both may be set using action on Rx, both may be matched using pattern item. >> Moreover, the third patch adds 32-bit tags which are not delivered to >> application. May be META/MARK should be simply a kind of TAG (e.g. with >> index 0 or marked using additional attribute) which is delivered to >> application? >> >> (It is either API breakage (if tx_metadata is removed) or ABI breakage >> if metadata and tx_metadata will share new location after shinfo). >> > Make use of udata64 to export NIC metadata to application ? > RTE_STD_C11 > union { > void *userdata; /**< Can be used for external metadata */ > uint64_t udata64; /**< Allow 8-byte userdata on 32-bit */ > uint64_t rx_metadata; > }; As I understand it does not work for Tx and I'm not sure that it is a good idea to have different locations for Tx and Rx. RFC adds it at the end of mbuf, but it was rejected before since it eats space in mbuf structure (CC Konstantin). There is a long discussion on the topic before [1], [2], [3] and [4]. Andrew. [1] http://mails.dpdk.org/archives/dev/2018-August/109660.html [2] http://mails.dpdk.org/archives/dev/2018-September/111771.html [3] http://mails.dpdk.org/archives/dev/2018-October/114559.html [4] http://mails.dpdk.org/archives/dev/2018-October/115469.html