From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0059.outbound.protection.outlook.com [104.47.42.59]) by dpdk.org (Postfix) with ESMTP id 279852A62 for ; Thu, 30 Nov 2017 11:46:36 +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=8Jm880j+1/QT9gMwnZE8SDgiTRS7UXOch7fZJI2UvsI=; b=Zwl2sYB/ovwclK7vgE/3tojKyv/ISIGyaYYXfwgH4UMH2yoluIGFr3blzgDAt8Tq8KHvLsFa9DHyh5d54u1PfmR2rk+wGroJq7AVX22O6bxKwj2P+lRzE//4OV8i1QL3+DcYSygNEr62M31oCWQJ988hNuIl6jOWcaGEWU/dvJ8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph.in.caveonetworks.com (14.140.2.178) by SN4PR0701MB3647.namprd07.prod.outlook.com (2603:10b6:803:4d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Thu, 30 Nov 2017 10:46:31 +0000 To: Nelio Laranjeiro Cc: Sergio Gonzalez Monroy , Radu Nicolau , dev@dpdk.org, Narayana Prasad , Jerin Jacob References: <6ac80a2be156911ee35c894924a02f04c43f49fc.1511449894.git.nelio.laranjeiro@6wind.com> <532499c2-b00e-870e-625d-9aa13302a8a3@caviumnetworks.com> <20171129125045.lqfs6xmqradolz4x@laranjeiro-vm.dev.6wind.com> From: Anoob Message-ID: Date: Thu, 30 Nov 2017 16:16:23 +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: <20171129125045.lqfs6xmqradolz4x@laranjeiro-vm.dev.6wind.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: CO2PR05CA0083.namprd05.prod.outlook.com (2603:10b6:102:2::51) To SN4PR0701MB3647.namprd07.prod.outlook.com (2603:10b6:803:4d::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d5e6261-0ec9-417a-4044-08d537df9fe7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(2017052603284); SRVR:SN4PR0701MB3647; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3647; 3:KGv+h4QQDDI2TkAsUhfgNsZ/ZF3IOrvb+tSYUvNXK+pQ4lfAxLO3CWGfIUTQNIW3juyVpmq4yPca8QO7+WeB4on4WgDqbwq67Zcj+g41meAMvMYwJ32T4RmD7d8/irXJPeIEmmLLG4cojnBUwxtWDoDK+h+VuVdVO0Qi6Qx4x8VJJI7ztomp+sOwUtI8OuVJbzkdVwTIMjh/ta/Ps62GWZW2Jr/LrzQfsg0p7UmsfBKC3yef6BTSX5nfhDnyRhYe; 25:9+oGvzeFg/r6sj3RfvNA+TsGU+rUeiij3kkK/I30UfJDLrjT6PHrxdqq27Abuew+/mmmUJtr6KvAi82GHe2qgH4Rn4npp4n95TDuRI9/QIY2hvAsIrEcouY4T2NpYDb+gD7gvGsm/3mF4ii4BEX7NFJEjtTNo1lzaIHbimaZZvOeB+1tWcyLC5Us0pFL9QV8Dryz1QCLIx3sQ+EyTFBPFCnpzEgQoQTMCOJMns/a/LFgHHLwmJIiG4MPLTzsZUnmOKPvMGey03e06qHy4kcOITHhSYl+TieX+2GG5Jy3jA8CjFHKHK67VNPSLYX4R/YGPXeq80hCAIzibv0CHwtOjtzDOvQ1h6rB0tOpgp+HD7s=; 31:/DQXOt3Gdenw9f86Z6uqbC+OEtnXx1DJYyvY4FCMh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OH4Y5in0GBlyza8AMY1l4b2Rqr4v9uy+8LhKcXTAA6mQq6Y7umvBL38lYMoiuIQuXz53tp9bJJ6fO4mHn33vrxBR0xw0akyq17TKALyjpBBIXDxk65qjQaGUEuXQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231022)(93006095)(6041248)(20161123555025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(6072148)(201708071742011); SRVR:SN4PR0701MB3647; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN4PR0701MB3647; X-Forefront-PRVS: 05079D8470 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(366004)(189002)(199003)(51914003)(24454002)(31686004)(52116002)(53376002)(229853002)(106356001)(93886005)(31696002)(23676004)(72206003)(2486003)(6246003)(105586002)(50466002)(47776003)(53936002)(107886003)(83506002)(65956001)(66066001)(65806001)(6512007)(67846002)(33646002)(64126003)(52146003)(478600001)(16526018)(8936002)(54906003)(55236003)(58126008)(6306002)(54356010)(50986010)(966005)(101416001)(76176010)(5009440100003)(189998001)(68736007)(316002)(81166006)(305945005)(7736002)(5660300001)(8676002)(6916009)(65826007)(81156014)(6666003)(230700001)(2950100002)(97736004)(6506006)(6486002)(42882006)(4326008)(15188445003)(3846002)(53546010)(36756003)(2906002)(25786009)(6116002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0701MB3647; H:ajoseph.in.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?MTtTTjRQUjA3MDFNQjM2NDc7MjM6WVVvTWNTVmJKWWVsM1FBTmtlMTNBR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PkKPwoXyyTZcbWstwvhyb6dQHq1HSqmWjuY=; 24:08a9VwaMltPFM59RSa5RtmeFqO6D7hG34hTYSQZXfgnUZmC4ZwY6sGH6X+toPsVmd4F0tvKYFDcpkqEC3x0GOEZqw0REmi57yiw2DXLzB78=; 7:FK05cXtciA2jxpRhe7DqfIkkA7OmXyjj+jHdoZYhbxfFvq7TpPqs+Q0cmXGyfto80bMT2+RuYVorxIRdteNuBnJjPYxSrUh05cDXJC6R9GnQUibTEQ0oTJyvVCEe2xk8z9yt2p+Hvlw0QVDhvsp/nL/oer9lo8vJcFkRRQpkVqxIRrAQiwTVoRVKGx90WePUQirdaD5RfHwNWd3Ce0Z7eTC2K1vnrw+1dFTI23Qh4b9LUrwhObPMwsVoAaTeRVjl SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 10:46:31.8697 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d5e6261-0ec9-417a-4044-08d537df9fe7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0701MB3647 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: Thu, 30 Nov 2017 10:46:36 -0000 Hi Nelio, Please see inline. Thanks, Anoob On 11/29/2017 06:20 PM, Nelio Laranjeiro wrote: > Hi Anoob, > > On Wed, Nov 29, 2017 at 06:00:38PM +0530, Anoob wrote: >> 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. > There is a real issue here, RTE_FLOW API needs a terminal action, security is > not one [1] you must have one of the followings: QUEUE, DROP, RSS, PF, > VF or PASSTHRU. > > Flow API does not work with "capabilities" as the application can verify > the rule using the validate(). If it cannot be validated the > application can test another kind of rule until the PMD returns a > success. > > Here, I am proposing the RSS as RSS with a single queue is equivalent to queue. > > On Mellanox NIC we need the RSS or QUEUE in ingress and for Egress PASSTHRU > is good. > > What are your needs? Thanks for the clarification. Understood the issue here. On Cavium hardware SECURITY will be terminating. So a better approach would be to first check from the application (using rte_flow_verify()) if SECURITY is terminating action. If it fails, then application can do RSS/QUEUE. That should solve the issue. > > Regards, > >> 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 [1] >> --- >> 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; >> >> References >> >> Visible links >> 1. mailto:nelio.laranjeiro@6wind.com > [1] http://dpdk.org/doc/guides/prog_guide/rte_flow.html?highlight=rte_flow#actions >