From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0053.outbound.protection.outlook.com [104.47.36.53]) by dpdk.org (Postfix) with ESMTP id 97C33271 for ; Wed, 13 Dec 2017 07:41:27 +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=E5CDufmbRGp0vy6pN2ecahisZThenbUsKxIuFEkuNWY=; b=YPWYRz4lbmuDoNsWfCl2JH/k+RCD8qoTTPcOoUzEtC8zFqqV7Vca5PbirBTRrcXHPL5Lv+UCq91u2TtkOp6mKVczjDmhTfqPin+bsnNTExOaD2hElPkZV2wv8lwL7dyfAKZTlHJPnYSeptbipx/5Ihl6tJE1+WhtK5Ynxdr4XUM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from hyd1ajoseph-dt.caveonetworks.com (115.113.156.2) by SN4PR0701MB3646.namprd07.prod.outlook.com (2603:10b6:803:4d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 06:41:23 +0000 Cc: anoob.joseph@caviumnetworks.com, Sergio Gonzalez Monroy , Radu Nicolau , dev@dpdk.org To: Nelio Laranjeiro References: <5d3fdd0c05d5f8afd3f8e38ca03eaf25187d5c98.1513000931.git.nelio.laranjeiro@6wind.com> <5777791b-3dd6-f746-aa37-d572c108f042@caviumnetworks.com> <20171212134456.4x3uaus2poovddlf@laranjeiro-vm.dev.6wind.com> <20171212143800.ggdtdfnbknttr45g@laranjeiro-vm.dev.6wind.com> From: Anoob Joseph Message-ID: <047cadcf-13dc-5368-4ad5-a27ff25c42f8@caviumnetworks.com> Date: Wed, 13 Dec 2017 12:11:18 +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: <20171212143800.ggdtdfnbknttr45g@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: [115.113.156.2] X-ClientProxiedBy: CY4PR14CA0047.namprd14.prod.outlook.com (2603:10b6:903:101::33) To SN4PR0701MB3646.namprd07.prod.outlook.com (2603:10b6:803:4d::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d8454b3b-af16-4931-c788-08d541f48817 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:SN4PR0701MB3646; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3646; 3:ErXVlwYkmf3mBErGCCGUoMz3Gg1acO2pAfdj0rFLEWkp00jTstrl7Vz7VFNlrkVHTGsTazFZgp+E6MuBmltOiqgrB+E87NzIhsaJ7UtNlTBBQUYpDusJNOH6oPtiN5Vb/gYDX8ZHEeBkR2StU5Q9YUd8K3fTjJ90XYAbHtKRy61Hj3jxBrFgFuN06vawpE6G44y8v7oDMSYKvwrS2AJcaCaRB19LScY3A6TlQl1L+wPSrlG/NE2Epqq9VJEIMLU/; 25:DrUs2U0BBTfPhMdd97V47jvGOACi0uY7iRlG2Ku2/pIJVIoHr8+6wEsYYY2mRUFgdvAN82pthphok35jH3WSlRBokc/7EGa8l6Zf2jrkhH30v5qa5MUALXnF4GUs62SFWtjmxHzrEBNDnrGX8H7XzgYWFF4Ee1ISQBjkcbo6c+uB1+W5h4TXCY5ju5S225sdKDEefYatuavfBwGnpV/WtbuT+CEyvb+NED54Fzo3KHj+mEPLrBUtoYnuh521BTDgbH9JQJDQrJtKbVK2qa5VXhAKjMmTRp8Q5caX7RpDctJVWlklMfXzBjEbV+X06pTRehy5sWo6pSE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04Bbd5gIzxcRQ0RWP3Py3wv+pB5kHCkXMMmzHd4QjN1WaRxDbzo6Z39keUBXixVZQug8DpzAi7yPUJQXUbfgbFPXvczcJTxIzJIBVVbNKrgJGlLY3fF5i62ndN9IhLJRG7SVXXpHmgsGOi6/NSKiu5JWmPgjiSCgCGFZE/0b/02QWG0nGx0bJ/d9uISAYqxwjCUY/Ip X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231023)(93006095)(10201501046)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011); SRVR:SN4PR0701MB3646; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN4PR0701MB3646; X-Forefront-PRVS: 052017CAF1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(52314003)(199004)(189003)(24454002)(230700001)(7736002)(6486002)(6116002)(58126008)(76176011)(229853002)(54906003)(106356001)(3846002)(36756003)(97736004)(93886005)(81156014)(6506007)(16526018)(8676002)(105586002)(65806001)(81166006)(4326008)(386003)(25786009)(52116002)(8936002)(478600001)(66066001)(53416004)(316002)(65956001)(47776003)(83506002)(53936002)(2486003)(6246003)(67846002)(52146003)(23676004)(31686004)(55236003)(72206003)(59450400001)(69596002)(68736007)(305945005)(5660300001)(64126003)(50466002)(6666003)(2950100002)(42882006)(65826007)(6512007)(2906002)(31696002)(6916009)(53546011); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0701MB3646; H:hyd1ajoseph-dt.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: =?utf-8?B?MTtTTjRQUjA3MDFNQjM2ND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w1oOGDPakqc3D9cMVgyEOaHt5fUcIeMAQqAQvNJai7CLYYMIxJarqgLJ6hws6EOgwZEkXi11NZgkJf4v4Ix39P7ztSZlTsG7gnLII2nsqxjoRFf1GN/+HjrJKPK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 06:41:23.4815 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8454b3b-af16-4931-c788-08d541f48817 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0701MB3646 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: Wed, 13 Dec 2017 06:41:28 -0000 Hi Nelio, On 12/12/2017 08:08 PM, Nelio Laranjeiro wrote: > Hi Anoob, > > On Tue, Dec 12, 2017 at 07:34:31PM +0530, Anoob Joseph wrote: >> Hi Nelio, >> >> >> On 12/12/2017 07:14 PM, Nelio Laranjeiro wrote: >>> Hi Anoob, >>> >>> On Tue, Dec 12, 2017 at 06:13:08PM +0530, Anoob Joseph wrote: >>>> Hi Nelio, >>>> >>>> >>>> On 12/11/2017 07:34 PM, Nelio Laranjeiro wrote: >>>>> Mellanox INNOVA NIC needs to have final target queue actions to perform >>>>> inline crypto. >>>>> >>>>> Signed-off-by: Nelio Laranjeiro >>>>> >>>>> --- >>>>> >>>>> Changes in v3: >>>>> >>>>> * removed PASSTHRU test for ingress. >>>>> * removed check on configured queues for the queue action. >>>>> >>>>> Changes in v2: >>>>> >>>>> * Test the rule by PASSTHRU/RSS/QUEUE and apply the first one validated. >>>>> --- >>>>> examples/ipsec-secgw/ipsec.c | 57 ++++++++++++++++++++++++++++++++++++++++++-- >>>>> examples/ipsec-secgw/ipsec.h | 2 +- >>>>> 2 files changed, 56 insertions(+), 3 deletions(-) >>>>> >>>>> diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c >>>>> index 17bd7620d..1b8b251c8 100644 >>>>> --- a/examples/ipsec-secgw/ipsec.c >>>>> +++ b/examples/ipsec-secgw/ipsec.c >>>>> @@ -142,6 +142,7 @@ 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; >>>>> + int ret = 0; >>>>> sa->sec_session = rte_security_session_create(ctx, >>>>> &sess_conf, ipsec_ctx->session_pool); >>>>> @@ -201,15 +202,67 @@ 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->attr.egress = (sa->direction == >>>>> RTE_SECURITY_IPSEC_SA_DIR_EGRESS); >>>>> sa->attr.ingress = (sa->direction == >>>>> RTE_SECURITY_IPSEC_SA_DIR_INGRESS); >>>>> + if (sa->attr.ingress) { >>>>> + 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->action[2].type = RTE_FLOW_ACTION_TYPE_END; >>>>> + /* Try RSS. */ >>>>> + 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; >>>>> + ret = rte_flow_validate(sa->portid, &sa->attr, >>>>> + sa->pattern, sa->action, >>>>> + &err); >>>>> + if (!ret) >>>>> + goto flow_create; >>>>> + /* Try Queue. */ >>>>> + sa->action[1].type = RTE_FLOW_ACTION_TYPE_QUEUE; >>>>> + sa->action[1].conf = >>>>> + &(struct rte_flow_action_queue){ >>>>> + .index = 0, >>>>> + }; >>>>> + ret = rte_flow_validate(sa->portid, &sa->attr, >>>>> + sa->pattern, sa->action, >>>>> + &err); >>>>> + if (ret) >>>>> + goto flow_create_failure; >>>>> + } else { >>>>> + sa->action[1].type = >>>>> + RTE_FLOW_ACTION_TYPE_PASSTHRU; >>>>> + sa->action[2].type = RTE_FLOW_ACTION_TYPE_END; >>>> We would need flow validate here also. And, for egress, the application will >>>> be able to set metadata (set_pkt_metadata API) per packet. So flow may not >>>> be required for such cases. But if the flow create fails, the session create >>>> would also fail. It might be better if we check whether the PMD would need >>>> metadata (part of the sec_cap->ol_flags). >>> Seems what you are describing is outside of this scope which is only >>> related to correctly implement the generic flow API with terminal >>> actions. >> Since SECURITY+PASSTHRU won't be terminal, this code segment might be >> misleading. > Well, I don't mind adding an extra verification even if the create > should fail if the validate fails, as there is no other option it > is just like adding another if statement considering the validate() > cannot guarantee the flow will be created(), other errors like ENOMEM > are still possible in the creation stage. Good point. I was thinking of a scenario when flow for egress itself would be optional. > >>> I'll suggest to add it in another patch. >>> >>> Anyway, the flow validate is useful in the ingress to select the best >>> behavior RSS/Queue, if the flow validate may fail, the flow create >>> should also fail for the same reasons. >>> >>>> If the driver doesn't need metadata and the flow create fails, then >>>> the create session should fail. Any thoughts? >>> How the create_session() can fail without having all the informations >>> (pattern, metadata, ...) the application wants to offload? >> Is flow mandatory for the egress traffic? My understanding is, it's not. >> "set_pkt_metadata" API gives application the ability to do the lookup and >> pass the info along with the packet. In such cases, flow creation is not >> necessary. > Some NIC need to apply a flow rule for Egress and they don't need > metadata for the packet. Understood. In that case, what I proposed could be a separate patch. The ingress path is proper with this patch, but we can keep egress open for improvements. > >> I do agree that this is outside the scope of this patch, but I was just >> curious about the behavior since you touched the topic. >>>>> + } >>>>> +flow_create: >>>>> sa->flow = rte_flow_create(sa->portid, >>>>> &sa->attr, sa->pattern, sa->action, &err); >>>>> if (sa->flow == NULL) { >>>>> +flow_create_failure: >>>>> RTE_LOG(ERR, IPSEC, >>>>> "Failed to create ipsec flow msg: %s\n", >>>>> err.message); >>>>> diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h >>>>> index 775b316ff..3c367d392 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 (3) >>>>> struct rte_flow_item pattern[MAX_RTE_FLOW_PATTERN]; >>>>> struct rte_flow_action action[MAX_RTE_FLOW_ACTIONS]; >>>>> struct rte_flow_attr attr; >>> Thanks, > Regards, >