From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0070.outbound.protection.outlook.com [104.47.42.70]) by dpdk.org (Postfix) with ESMTP id 16D2D2C55 for ; Wed, 29 Nov 2017 13:30:48 +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=RDSFHwCZHhvMaB2Z0H0AKx4MOc953BhI6VhL/GCXMd4=; b=n99ILu1hSppvAU5pzrfCsxsHkHlYVLY5ocyHjQDUITEa7cwIrmYF97WOED8+LNN28P5iO6PZyFv3c+7rhibKOyXsZuDanemLAogFouTmuUQ4AXYVDqgbEbd1ldcBe8cyEz1kMY7KX1zcOsRQqKbSyo+xvkmpTHs/fiTrljBpNT0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph.in.caveonetworks.com (14.140.2.178) by CY4PR0701MB3634.namprd07.prod.outlook.com (2603:10b6:910:92::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Wed, 29 Nov 2017 12:30:44 +0000 To: Nelio Laranjeiro , Sergio Gonzalez Monroy , Radu Nicolau Cc: dev@dpdk.org References: <6ac80a2be156911ee35c894924a02f04c43f49fc.1511449894.git.nelio.laranjeiro@6wind.com> From: Anoob Message-ID: <532499c2-b00e-870e-625d-9aa13302a8a3@caviumnetworks.com> Date: Wed, 29 Nov 2017 18:00:38 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <6ac80a2be156911ee35c894924a02f04c43f49fc.1511449894.git.nelio.laranjeiro@6wind.com> Content-Language: en-US X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: DM5PR20CA0017.namprd20.prod.outlook.com (2603:10b6:3:93::27) To CY4PR0701MB3634.namprd07.prod.outlook.com (2603:10b6:910:92::36) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a657a967-0da7-46e0-1084-08d5372503e7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603199); SRVR:CY4PR0701MB3634; X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3634; 3:sujU10mJnKNq8IgRAdg9CLmyK2mlQ8Wni31PYF1hwtIxnQIhCFcmsCSljp2hwrdVSvmhXD3b35HTeTzpo/Ynmi8Z6BVI7dDuPr1hP3j7uI3/qYpM2l/iYu+Z5MEub8CDNfcJTrzifWhNpVho5aZe3XqG+Nj2DNi6t7ikgATiUYF+jhkM6ty2WYQ3CKwNaJbOT7TiXmWYzoAlYQdbsGa2m2r6WTpn5YWtQRcz0x7Jf1wJvJBtqev6CRR2xfYCg4E0; 25:gLmA0wJGNeXOL2/Cjhrr9C7l1cSkxsbKvynyMEtFBWxrr4xjXM39Rjxsde4+b/RMawtcaqwxGJGKZcLyIlcTWXl8Buta+voTiBDUztAEm/UxH10m2fuTDVg3CvqnX1WvKe8GdbYBXebphJz3mG6VifN71sir0utjI6VOlSoNlEWrB6yjeA3DHMV3H1z5fBN7yVnGsIPRk1WT9imZgaGYzICkKf1KKCePhm3q5MFuuYa9p5VM4J9xjJl6QW21RlogjmFv7sxVYOfso27wuu9T7Tp51r20YYduGXofwAcLXzrOGE9Roc2cnWbvLVhB4j6tEbBZ5Oyp2cvd4iuEIG5DRmxPCkWZdpUA4dFcc0x0WCM=; 31:Hq9r2X1Jz7kM2HDf5BF5A4Gj4rPuWUdvPG6L4aT1Abt7lgutZBleQS//WzbDNwdHKFLqhORLmPeZbgRzx+XkdiBqxfG14jkZRlWIzwVXEQGgDoOqxRlc0wu/PH7sl6lvNN9Cma0bKh7OW0KkhdwDoNevP7JlKV8DIEDw3fXZ+sQPjrbNUhWSlGtxyndn/JK+bL6a3/tsZ4jonbqWlnqttypP6xXkUoMl6pEha1etqcM= X-MS-TrafficTypeDiagnostic: CY4PR0701MB3634: X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3634; 20:k299Ob9nTfwqdH4lj+YHp3C74kBZtdUQDKTQCBKz8+TWVIDqwfG27Y5JKzAPSZoXvo4pSCoO1SHDl8OkUanE34EwzKfcRHDndvI764IA8qsBdvgibF1BGEooM8nF9pPauyDnUtROCEVW/Q9Jedzo0NGeNhM/V0N0TeMYna0dJmdnucDGVhHXJ0XtefojBiIQIm4GZUkX3Hv+xsNzbWrTSDUy5wKyqVr4MfQAEsDhG0/x4ERWif5c4yT391wUphI31E7gzsgSnX/QhuJdh2qXp3mi6XOExG2BBZ5L9vb7U0G3cbWIGaI33Eq1B4bQJ9ri/LrJE84z65PeFAOiFkg0LQSSF0CZpTnB7ZjJYtsB1DL2DV1h1Kg7Y7r8BK/aWI8w7NF25hwTFpZApA+LKVGu2p10nTCg1lw66FY22H+6bWe87Hk0j+SEktKMukkj839a8zno/vzAQHVIezNufALY/6RqC4a7816gItxTrpj+YaKJuwF8Mc1CIAATeT6b1MlsPbn3MRgZndH26T/lpJ23ypgxAlsnshtBMdOKaHL/WUuGmUX2puOMRTMX30SgF94wkrCUk+ThM0xhNlqLiqAdGtyCN4Ds8mQYcOgt93fBUbQ=; 4:YMewVdjuiiwUkPSnGMLe1h/MBb/vVT5EtYhBfZOtosgmQvQgTBxoJknPQvMNjam4yQX52OWhrMYsdUK8P8DyJSbKTCKJXFh2i41y7wX/XIgsn1ogfmduOa/iSMnUO5WPP3Ku7DoXumojo4csIpwCTFJiIrWJbrLttY+3XmuBQiayGY+RWYAXPXhQlSYIahkO99myWP3lQShORrqT67W5hgzu+4ob2vs86dAGSJyWBivV9zcvmfq1ico/DcZYzj6WfWiIk4E0zRp3oCBCwnFePA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3231022)(10201501046)(93006095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148)(201708071742011); SRVR:CY4PR0701MB3634; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR0701MB3634; X-Forefront-PRVS: 05066DEDBB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(24454002)(199003)(189002)(6116002)(3846002)(42882006)(478600001)(2950100002)(6666003)(65956001)(105586002)(25786009)(66066001)(106356001)(5009440100003)(270700001)(65806001)(36756003)(52116002)(2906002)(83506002)(16526018)(54356999)(50986999)(76176999)(55236003)(64126003)(72206003)(33646002)(189998001)(31686004)(101416001)(97736004)(53936002)(6506006)(5660300001)(6486002)(316002)(84326002)(81166006)(236005)(8676002)(4326008)(81156014)(54896002)(16586007)(8936002)(6512007)(58126008)(68736007)(229853002)(110136005)(37036004)(6246003)(53546010)(65826007)(7736002)(31696002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3634; H:ajoseph.in.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR0701MB3634; 23:GtEbCitoVQPxzP4OH2/hUI/YWE+XuoUmLNIEvAQ?= =?us-ascii?Q?rJWCwoIMROuScuIiMa5jq2m2tS/MzUCJq+oq+smQLyE4OEDXy9TKKfGlOBgd?= =?us-ascii?Q?ecJA5FJ/ppxTQa/GigmQl2EHcORFjG1LdIkgc5yi+y3u7710eqW0oi0YZ0Gn?= =?us-ascii?Q?n3eR1YsiX6AfmQaa1WCJ2W9t2LgnartcqN+xpdL6DzICP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hJ9MF8szgwrV23k1ljcFP9Ft/Ey+AngfujtoUrOY+r7DMEVE+r4=; 7:kR6Dz21tDJeobqtFvE969+J6jXNA9TX7rCdi1OLMBwMMrhNSvkE9IolSFgkKTV/SWOCZFJ6ditTtM7kKaV343eUgBBpCTw1ekk+D8tWDVazw0r4Bi20/+LcZauHHkF8gQB+1fYZqAY0ieJ+7f9L2Gt1MdRiZaNoofuihfjwi7RuVJUZFpnq7QXSDR8Gh9ycrlVLrsXF/YJ03+uwo+pa1hJvlyLvLe1lRNO+oL5N2a4V8txH03JLqhl7LyFdEpSTt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2017 12:30:44.4710 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a657a967-0da7-46e0-1084-08d5372503e7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3634 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] [PATCH 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: Wed, 29 Nov 2017 12:30:48 -0000 Hi Nelio, Since support of RSS with inline crypto/protocol is hardware implementation dependent, it would be better if there is some sort of capability check before setting the flow parameters in the application. If the hardware doesn't support RSS with inline processing, then the RSS flow action will have to be ignored in the driver. This wouldn't look right from application's point of view. And also the PMD would need application-specific logic to handle such cases, which may not scale well. Thanks, Anoob On 11/23/2017 08:42 PM, Nelio Laranjeiro wrote: > Mellanox INNOVA NIC needs to have final target queue actions to perform > inline crypto. > > Signed-off-by: Nelio Laranjeiro > --- > examples/ipsec-secgw/ipsec.c | 27 ++++++++++++++++++++++++++- > examples/ipsec-secgw/ipsec.h | 2 +- > 2 files changed, 27 insertions(+), 2 deletions(-) > > diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c > index 17bd7620d..e967f88b3 100644 > --- a/examples/ipsec-secgw/ipsec.c > +++ b/examples/ipsec-secgw/ipsec.c > @@ -142,6 +142,22 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa) > rte_eth_dev_get_sec_ctx( > sa->portid); > const struct rte_security_capability *sec_cap; > + uint8_t rss_key[40]; > + struct rte_eth_rss_conf rss_conf = { > + .rss_key = rss_key, > + .rss_key_len = 40, > + }; > + struct rte_eth_dev *eth_dev; > + union { > + struct rte_flow_action_rss rss; > + struct { > + const struct rte_eth_rss_conf *rss_conf; > + uint16_t num; > + uint16_t queue[RTE_MAX_QUEUES_PER_PORT]; > + } local; > + } action_rss; > + unsigned int i; > + unsigned int j; > > sa->sec_session = rte_security_session_create(ctx, > &sess_conf, ipsec_ctx->session_pool); > @@ -201,7 +217,16 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa) > sa->action[0].type = RTE_FLOW_ACTION_TYPE_SECURITY; > sa->action[0].conf = sa->sec_session; > > - sa->action[1].type = RTE_FLOW_ACTION_TYPE_END; > + sa->action[1].type = RTE_FLOW_ACTION_TYPE_RSS; > + sa->action[1].conf = &action_rss; > + eth_dev = ctx->device; > + rte_eth_dev_rss_hash_conf_get(sa->portid, &rss_conf); > + for (i = 0, j = 0; i < eth_dev->data->nb_rx_queues; ++i) > + if (eth_dev->data->rx_queues[i]) > + action_rss.local.queue[j++] = i; > + action_rss.local.num = j; > + action_rss.local.rss_conf = &rss_conf; > + sa->action[2].type = RTE_FLOW_ACTION_TYPE_END; > > sa->attr.egress = (sa->direction == > RTE_SECURITY_IPSEC_SA_DIR_EGRESS); > diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h > index 775b316ff..82ffc1c6d 100644 > --- a/examples/ipsec-secgw/ipsec.h > +++ b/examples/ipsec-secgw/ipsec.h > @@ -133,7 +133,7 @@ struct ipsec_sa { > uint32_t ol_flags; > > #define MAX_RTE_FLOW_PATTERN (4) > -#define MAX_RTE_FLOW_ACTIONS (2) > +#define MAX_RTE_FLOW_ACTIONS (4) > struct rte_flow_item pattern[MAX_RTE_FLOW_PATTERN]; > struct rte_flow_action action[MAX_RTE_FLOW_ACTIONS]; > struct rte_flow_attr attr;