From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0074.outbound.protection.outlook.com [104.47.33.74]) by dpdk.org (Postfix) with ESMTP id 6E88729CF for ; Mon, 18 Dec 2017 09:24:00 +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=t8WQqr6A7pQ1uBsg6d/dmCgqd93t74L5rMR6ChALPWg=; b=IfFL/SUavs2an+T7WVNmP+HYNSxvh7z/S1vAlT8gVzS7rNq7jjj52/2AJCNIKE5Fe6imfz2OASLznni5qCyOSzf0jcu8Gz1TFVxTifUWOGPyF1vRAa9QKTkW9KNV0V5AxoilDnj/1leLLJRSYd5NLCpoE+zjrrUHLIb49h2VYE8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from hyd1ajoseph-dt.caveonetworks.com (115.113.156.2) by MWHPR0701MB3643.namprd07.prod.outlook.com (2603:10b6:301:7d::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Mon, 18 Dec 2017 08:23:55 +0000 Cc: anoob.joseph@caviumnetworks.com, dev@dpdk.org To: Nelio Laranjeiro , Sergio Gonzalez Monroy , Radu Nicolau References: <5d3fdd0c05d5f8afd3f8e38ca03eaf25187d5c98.1513000931.git.nelio.laranjeiro@6wind.com> <8467f1cab647d72d9e52fe03faffd408761e66d9.1513264386.git.nelio.laranjeiro@6wind.com> From: Anoob Joseph Message-ID: <0f1dcd1e-6c15-fb6e-e4b6-fb7a0383cd54@caviumnetworks.com> Date: Mon, 18 Dec 2017 13:53: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: <8467f1cab647d72d9e52fe03faffd408761e66d9.1513264386.git.nelio.laranjeiro@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: MWHPR22CA0034.namprd22.prod.outlook.com (2603:10b6:300:69::20) To MWHPR0701MB3643.namprd07.prod.outlook.com (2603:10b6:301:7d::36) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2150fbf8-d689-4a16-cdd2-08d545f0af23 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:MWHPR0701MB3643; X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3643; 3:37EnwuWQ5ECKdDePiHq+4omoVAV0kafzE2ZtdloYSmK1W2KVqg5W0H1iXZkzb7vITLrbkBNsPId4g0L9EiyhVMn5hXI00Q+QfsyRwDnmVWliMlP1AAE2jfFmezNfNpCsb5sWXIpefeJ76M8gqCAqpxkKmvs9ox1jOs18bYI70G2vHpxHH5oRFFMS7wfsO3X+V+ARu1+poUBmgkZk9vSvRrmllrZnCdCBJo4KQ/zcQbo2pzWvFsyUEMsasb5pgQ3o; 25:nuRhrUYOeC317gY0i5gY6bKcMIGf1qtLiX0QM46luoK0DXSUwDbC5B7wF17RlmK9AxpTOX6vDsQ/wmHhjjvDnSkR90YJAwZVzOhZdbF1hNWP78TTwTCW89H9OMS9jyC45vc3LaVjX0GQ5ewzun5dd9aQbnTQnlDvoH0RyQQH029rqj8Jnrr07TxXbM5AMzSqLoWNL7Ef9CzzORHGbes+Isv7e6EBDKdl2PRkzbRO984CjI7D124Xp0qeyRZMEUsWNUo4TppmyAtAK0vgmUELmeO7+WMihIzhULp6K7BnjcYttzbwCWii0TnxTrsdb8Ao3BKTdSy3W0uRRbdtwEs8iQ==; 31:oCSFZgaQ67WXXeWPPigJvOL0aqy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TxSXDuf1BYisxMNaVlxVKWOmuHhs4iNeZl7ShQaNOim42anzPGx8KV9uCl44lcBrcQ409HvhvR0vD/4v1CP2OIwgM4RmW+VlQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3231023)(93006095)(10201501046)(3002001)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011); SRVR:MWHPR0701MB3643; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR0701MB3643; X-Forefront-PRVS: 0525BB0ADF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39850400004)(396003)(346002)(366004)(189003)(199004)(24454002)(53936002)(81156014)(4326008)(25786009)(31696002)(81166006)(76176011)(65826007)(110136005)(58126008)(52146003)(105586002)(316002)(52116002)(31686004)(59450400001)(8676002)(36756003)(53416004)(16526018)(305945005)(5660300001)(7736002)(2486003)(55236004)(72206003)(47776003)(106356001)(53546011)(6506007)(67846002)(50466002)(2950100002)(386003)(66066001)(65956001)(6666003)(23676004)(65806001)(42882006)(8936002)(6486002)(6246003)(2906002)(64126003)(6512007)(68736007)(6116002)(3846002)(478600001)(83506002)(229853002)(69596002)(97736004)(230700001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR0701MB3643; 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?MTtNV0hQUjA3MDFNQjM2NDM7MjM6RjYwQmk2clByU01LcENQNkhEQkJ5UmJH?= =?utf-8?B?TnJoK1NVSEpKeXVWL2dhYUw3QWVQcElnTkVLSDhyV3QyNXM2Sk5rakpqenVw?= =?utf-8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: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2017 08:23:55.9526 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2150fbf8-d689-4a16-cdd2-08d545f0af23 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0701MB3643 Subject: Re: [dpdk-dev] [PATCH v4 2/3] 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: Mon, 18 Dec 2017 08:24:00 -0000 Hi Nelio, On 12/14/2017 08:44 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 v4: > > * remove Egress code. > > 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 | 53 ++++++++++++++++++++++++++++++++++++++++++-- > examples/ipsec-secgw/ipsec.h | 2 +- > 2 files changed, 52 insertions(+), 3 deletions(-) > > diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c > index 17bd7620d..8e8dc6df7 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,63 @@ 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; This is reverted in the second patch, right? Are you planning to revise the patch fixing this? I'm fine with the changes, otherwise. > - > 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; > + } > +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;