From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0071.outbound.protection.outlook.com [104.47.38.71]) by dpdk.org (Postfix) with ESMTP id 01DB37D19 for ; Fri, 5 Jan 2018 07:19:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=J1QzG59Pv4vhNzHgWn99OyRBr//XxXbEwrbBS49frv8=; b=C6+m+SvtQ9GX+uAojA8+FeaIx3hHzqzsW8fvLW/OkeBnC4Y8snJe6jziLL//tEzzxtKAN3y7XWuVDNRseMhZTH9wAldsP9ss73oT9HRHqHKeqQJguiPMtZ65UgeJl0wpZqXsfuBh3FhOGg4Y/8678/TlEMuQV5iRHYGtiEZiUeQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from hyd1ajoseph-dt.caveonetworks.com (115.113.156.2) by SN2PR0701MB1072.namprd07.prod.outlook.com (2a01:111:e400:341f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Fri, 5 Jan 2018 06:18:56 +0000 Cc: anoob.joseph@caviumnetworks.com, =?UTF-8?Q?N=c3=a9lio_Laranjeiro?= , Sergio Gonzalez Monroy , Radu Nicolau , Aviad Yehezkel , Liran Liss , "dev@dpdk.org" , Jerin Jacob , Narayana Prasad To: Adrien Mazarguil , Boris Pismenny References: <20171212143800.ggdtdfnbknttr45g@laranjeiro-vm.dev.6wind.com> <047cadcf-13dc-5368-4ad5-a27ff25c42f8@caviumnetworks.com> <20171213100237.uvpbg2qewhxqgaln@laranjeiro-vm.dev.6wind.com> <817bec1f-4bff-ebdc-07b4-f8f24ec2084a@caviumnetworks.com> <20171213125353.2zyllxk7pwkncm76@laranjeiro-vm.dev.6wind.com> <577d100a-d021-1219-89e3-721e02b77b90@caviumnetworks.com> <20171213144710.tyqvcvpkrymzqriv@laranjeiro-vm.dev.6wind.com> <3a91e865-ca96-09d4-b842-7e5d0a5ad6e1@mellanox.com> <20171221142235.GL5377@6wind.com> From: Anoob Joseph Message-ID: <6de0bb26-11dc-f7b3-cc87-dd1f3a00723c@caviumnetworks.com> Date: Fri, 5 Jan 2018 11:48:50 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171221142235.GL5377@6wind.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BN6PR16CA0039.namprd16.prod.outlook.com (2603:10b6:405:14::25) To SN2PR0701MB1072.namprd07.prod.outlook.com (2a01:111:e400:341f::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 582f4031-6ad0-4e3b-75f4-08d5540435ab X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:SN2PR0701MB1072; X-Microsoft-Exchange-Diagnostics: 1; SN2PR0701MB1072; 3:vXg9vUZ/R48qE5vdGtWorAItJfecMk9o0q4Jpl2rvxsa01LyCLdWfKaLvQaaMf/oUAk2p7rvm50fZDLkTpSR0UszY0iERLEa2XgaskEbQw3Wu7jp1lF5UXajWNL0cc0GNdyPx6sgNReQrf2LYK84BUwAty2w+hziu9RQ5zRqg+U+HhjcgIVMJ+IRrHB6tpCqdtWz7NWcxLcbuTHfplBgob/ACYgvVscn24j/Jx57fNzFVsuzNVkhYgL+5/j8Gx4C; 25:4DT8X2OLOqC+SGEle54SHGletwXmoueyK97/obK2v8ceCp4dVA2bFW1PD7wKBaGifspwoIE2zoE2UofNvpRABRyYX/A/6ZrKG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sNmRrHRYkoTd4X/Tj7GFN8UoU2zZFkts2kEltVE968V33hX0eQ1JZNbIdcjOt3gFnjWDQ6O65gYdTnAkZJIjlho0BF7q/OJJDIf+VD9LY=; 4:G4IfzFbH8gUoGDuCw1pT1RKG1IhqrRMrV3KMC1MyjunrqA/LVPMPgnkV0Rym7u9xCyNzrlPtxg39vNhRnsr35HYt58frejb3m2PGfDyy0AGXr20KV/BEbYQM3goMUmLkIBeP2rlHGjIjxFlaNhP7YZayoanUiSUNLm3PJ3/UJTil3SNWiwnN5890inyCTZF4oasSNKyYCVWdQWIBwJ67XidM2tNMVFPotE0QqUkk/HsDtHCkgLC3/lX6wgoECnW32/XnQdPt0U5dUAoXgkb9wQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3231023)(944501075)(3002001)(6041268)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:SN2PR0701MB1072; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN2PR0701MB1072; X-Forefront-PRVS: 05437568AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(39860400002)(396003)(366004)(39380400002)(51444003)(189003)(199004)(24454002)(107886003)(6246003)(31696002)(5660300001)(2950100002)(16526018)(67846002)(6666003)(42882006)(229853002)(6512007)(6486002)(50466002)(31686004)(65826007)(25786009)(53416004)(105586002)(305945005)(4326008)(7736002)(69596002)(53936002)(2906002)(66066001)(53546011)(72206003)(230700001)(36756003)(478600001)(106356001)(64126003)(93886005)(3846002)(8676002)(55236004)(386003)(6506007)(83506002)(68736007)(316002)(81166006)(97736004)(6116002)(110136005)(47776003)(65956001)(23676004)(76176011)(52146003)(2486003)(81156014)(54906003)(65806001)(59450400001)(52116002)(58126008)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR0701MB1072; H:hyd1ajoseph-dt.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjJQUjA3MDFNQjEwNzI7MjM6VDRTSzdMeCtyWit2WFJVWmlINENaQVZD?= =?utf-8?B?V3lzQVQzdWN1NGdaRE9DUWZKUDV1S1M2ZElsd0ZGOUgzQ1daWFlpelFNVVV0?= =?utf-8?B?VStpSkNSZlZOUnEyRTJoNDRQa1doZllrL3R0WjJHWEFQa3ZLejJSbnZRR1Nm?= =?utf-8?B?L2R5TTUrNnFMSksrRHVtMmRiayt0WTZYMzNKcnZIZmhaV1JHbUNrWWp6bHZZ?= =?utf-8?B?WnI2ZEZvellSTnRuMUFrOWxQZGlWcWs2K0VmOFhBUSt4RjRENzZETG91SGNF?= =?utf-8?B?U2pnN2FHbUVQeFNaQllXREF5dUpMRjd0emFEYkdGVzgraGkxakhFbk1RaXhF?= =?utf-8?B?QzkzOEthWHdsbytyTndNVnE4Rmd1cVJ0MEx4K1RGNXFRV3ZkR0Y5bXg3K09r?= =?utf-8?B?NmhWV0hxSGtXUGV2b0hPODd6UlRCKzB3eTEvRitGVmdodlcveEVaMnNTVTRV?= =?utf-8?B?c3ZpcjMyVVhmMVpOb2w0K2FUOUtHYUlESmZoMG9CTDVKZ1g3aHkya3NrdFI5?= =?utf-8?B?MndCVXN4aUNRN09Tb09qTk1xK0dnazY5Y05BcXJqSUpNRXhYNDRsZExVVWg2?= =?utf-8?B?N1drNkc0bDNiV1Y4VkxOZFgxQmQ3aHFEc0U1cUFtZzVsL3h5SHVhN0RMRGpw?= =?utf-8?B?N2NNQXFmTGVKcVVVMVNNcTFpVTFDSXNUeHhnNkNERHYxZEkzUTJKRzFGTXRo?= =?utf-8?B?WUZGZS81WjFnUmduQ0pmTGROcWo5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d3k0Mqx+0qmrEFi4GsquZmJsuWXZ7Nr6HRSZJm1Bt0DBcWCphPHD2Dncij9gzUevaRTYcEHp92V0F/UYu1mH72A=; 24:lM7BH3ndl8FJqbPEHAEXNRCsBMPOj12IK4IiOKN+2Qk7KviWyHGhjOq2pXTPVld6eEJcUC1OQv/Du7XF/ZD1qw908t9RsYlnnh8F70ZLBQo=; 7:kdHgrgha883zLrk464SFkCpaIzeUijJjoaR6AJuYfvt05/jpdKyWnY3L6HNgO8YkllElhwGl2bgbdDWi/MHWvuKEbgnPjYThz1Aapks6f1m9T2j8RTIW5QM0wnp3jno8F41Y73mb4aBcFD0WWL8WBVeDWF5TNZquQkgMOPg/7Vl85shhX7jQqxqjn8n5PkRu4YURS5AFrLnNSDKwVWiLEoiqRfXQOsp13lK3ght/ar4mI3IXcTaXdiJMLJKSkXoJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2018 06:18:56.0136 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 582f4031-6ad0-4e3b-75f4-08d5540435ab X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR0701MB1072 Subject: Re: [dpdk-dev] [PATCH v3 2/2] examples/ipsec-secgw: add target queues in flow actions 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: , X-List-Received-Date: Fri, 05 Jan 2018 06:19:02 -0000 Hi Adrien, On 12/21/2017 07:52 PM, Adrien Mazarguil wrote: > On Thu, Dec 21, 2017 at 12:12:29PM +0200, Boris Pismenny wrote: > >> On 12/21/2017 10:06 AM, Anoob Joseph wrote: > >>> I can see the benefits of using rte_flow in both rx & tx, but this >>> unnecessarily introduces hardware requirements for supporting inline. >>> Rte_flow would do two operations: >>> 1) Pattern matching >>> 2) Perform some operation with the above matched packets >>> >>> Issue is with pattern matching, not about performing the operations >>> specified. If we need rte_flow in the tx, the PMD should support pattern >>> matching in software or hardware. Since the application will have to do >>> a lookup in it's space to determine the SA, the secondary lookup in the >>> PMD may not be necessary. But making rte_flow mandatory would make tx >>> side pattern matching mandatory, which may not be supported on all >>> hardware (with inline crypto/protocol). Also the pattern matching >>> hardware module should be able to submit to inline performing module for >>> this to work. >>> >>> May be the right approach is to decouple pattern matching from actions >>> to be performed for the flow. In other words, add a new API to allow >>> application to submit a packet to a flow. In such case, application >>> could do the lookup and submit packet to a flow. The packet submitted >>> could be validated to see if it is matching the flow properties. If it >>> is matching, then the actions specified for the flow would be performed. >>> Adding such an API will allow rte_flow to be used with hardware which >>> doesn't have packet filtering features. >>> >>> The flow could have a "pattern item" which would say whether application >>> can submit packets to the flow. Submit would be allowed only for those >>> flows. flow_validate would give PMD the option to accept or reject such >>> a model. This may need some thought before we can start implementing, >>> like, whether we should support "submit" for flows which doesn't have >>> terminating action. >>> >>> Any thoughts? >> I think that your suggested API is more or less the intended use of rte_flow >> egress actions with rte_security. >> >> Would it be wrong to say that you could use rte_flow without doing pattern >> matching in HW or in the PMD in the data-path? >> Suppose that your HW doesn't support pattern matching on tx. But, you do >> support IPsec inline crypto on tx according to user provided pointers that >> you set in the set_pkt_metadata callback. The user will call rte_create_flow >> with some pattern, in response you check that the driver's set_pkt_metadata >> could handle such patterns and actions on tx. If yes, then return success, >> otherwise return false. The successful creation of the flow will indicate to >> the user that packets with this format will be offloaded. Packets with other >> formats will not get offload and set_pkt_metadata for such packets shouldn't >> be called! >> >> When using rte_flow with IPsec, it is used not to indicate that HW must do >> this pattern matching. But rather to indicate that software will send >> packets that match a pattern with proper metadata and expect an action to be >> applied. Software cannot expect this action to be applied unless the packet >> matches the pattern and the proper metadata is provided. For example, >> packets with IPv6 extension headers should not go through IPsec inline >> crypto offload if the pattern is IPv6/ESP because the next IP protocol must >> be ESP. > I think there's already a way to satisfy everyone regarding context > requirements on TX without the huge penalty of SW parsing in case HW doesn't > support matching on egress. > > While seldom used at the moment, rte_flow patterns can match packet > meta-data (see meta pattern items); for instance RTE_FLOW_ITEM_TYPE_PORT > matches a physical port of the underlying device. This works both with > ingress and egress. > > For ingress, RTE_FLOW_ACTION_TYPE_MARK can be used to add meta data to > selected packets. While for egress such an action doesn't make much sense at > the moment, the converse meta pattern item (RTE_FLOW_ITEM_TYPE_MARK) could > be useful to let PMD know what needs to be done with packets submitted by > the application and containing a given mark. Good suggestion. For ingress this would help. The only problem with this is the size of ID. Since it is 32 bit, this particular mark cannot be used to save and retrieve application pointers. If it was 64 bit, this could've solved all the metadata problems. For egress, PMD would still need to do a lookup as, the mark ID would be 32 bit and has to be matched with the same in various flows. Though this is better than what we have right now(with flows), this may still be more costlier than "set_pkt_metadata" method. > > That way, PMDs that do not support egress packet matching wouldn't need to > lie and would reject rules such as: > > flow create X egress pattern ip / udp / end actions whatever / end > > But would accept: > > flow create X egress pattern mark is 42 / end actions whatever / end > > PMDs could also support combinations (remember the position of meta items > within a pattern is not significant) to only perform whatever for UDPv4 > packets marked with 42. Non-marked packets would go through unmodified: > > flow create X egress pattern ip / udp / mark is 42 / end actions whatever / end > > This is just to point out how leveraging meta pattern items on egress is one > possibility using MARK as an example. >