From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0085.outbound.protection.outlook.com [104.47.34.85]) by dpdk.org (Postfix) with ESMTP id 610DCE5D for ; Tue, 19 Dec 2017 07:22:52 +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=OLhJ8nQIFxoR0b0KJoE/8WtOgg8ybCZ6f7AzKBGBdfA=; b=g1on40Cuq4fO6PrHqvPm7KX5biljMRpEFKnBv7vFCAhxRdDTc2tH54V54vGXwnpDTnx0HXaE6khgqmc43U97aNDHuVy/7PHkV+/5trgxY/S13vzkDKK+m+vJMIKPcwoPYb15Td0iyYPUPyajmIxGJidc+9kAI2A6E1MMPu/wjCU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from hyd1ajoseph-dt.caveonetworks.com (115.113.156.2) by DM5PR0701MB3637.namprd07.prod.outlook.com (2603:10b6:4:7d::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 06:22:48 +0000 Cc: anoob.joseph@caviumnetworks.com, dev@dpdk.org To: Nelio Laranjeiro , Sergio Gonzalez Monroy , Radu Nicolau References: <89add3272024fefe644a9e636a476c85d39e398b.1513264386.git.nelio.laranjeiro@6wind.com> <16eb9d91cde0655713228efb9519d15d1ea7f1f8.1513592582.git.nelio.laranjeiro@6wind.com> From: Anoob Joseph Message-ID: Date: Tue, 19 Dec 2017 11:52:42 +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: <16eb9d91cde0655713228efb9519d15d1ea7f1f8.1513592582.git.nelio.laranjeiro@6wind.com> Content-Language: en-US X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BN6PR21CA0005.namprd21.prod.outlook.com (2603:10b6:404:8e::15) To DM5PR0701MB3637.namprd07.prod.outlook.com (2603:10b6:4:7d::38) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d8148bbe-fa80-4fa4-264e-08d546a8edb7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:DM5PR0701MB3637; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3637; 3:+oYDH677z+tX88jenUN+ztqxe6qMhm7PhrzXrVvUHslhhTPKOCffwMwzG9qGoRtnJRO6N1kyqqXtLJ5lzjW4WJ3fTzv0uat+up6ZeN60gN04ugb4xGnFFHwZamPfM1L8rlcMP0KNlnfWepPngMmT9V1hlRBk5eO04bTByR5nk+jf/iXUVNiZTBvNaJdsShTo4CH5bMUO9qoLjOJq5Em/7Dk3wHlisDGo+YO/QQDE4h7jmJANR38G+8DQQ9g2MLXp; 25:x540bBnE76mkhiFB0kjEucRygYdsUBDIu8aNJ27hzurGIS59ch89MKGkuhkRZEvdcj2T36mHNNIMRocbcYEyIEIVZN2+IesPdhwPNcYQXloiQQkYfC43HO/uF2Rxa00TH3hKvMNLocwYUKRRaHq8flk+cWiWNKAwdkRP54LgrQ05hj6EObyLlzYUjd1AC71J46ECXA1ElQ9LyJz0Ka/Hu998R8F+Swc7asHvxjMTFQEpGQHtVyZM7MAGzcYU7e4DiD6hL3axPelsP40izCOciQ9p583YDbbAyJYAZhQsSPlXqfAv+A5HWLR7L/YUsdZLBrjaPBSpuRIiHK4yz37//Q==; 31:5GtSkM/W1gJ8l54LEIAZa+SA4oY5VJDmKvuLeZJzrEmLyHLVFsC4q1p2B93qn7r63nmJJsf69j9RKwtJUFjfBPn+NxXEWaSC430TUeWIpErxnhYkQTOiCfCIeXdc2YSNT3Jk0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mZnFjA== 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)(3002001)(10201501046)(93006095)(3231023)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR0701MB3637; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR0701MB3637; X-Forefront-PRVS: 052670E5A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(366004)(376002)(346002)(24454002)(199004)(189003)(81156014)(33964004)(81166006)(6116002)(68736007)(8676002)(3846002)(52116002)(8936002)(76176011)(59450400001)(4326008)(53416004)(42882006)(2950100002)(72206003)(31696002)(6506007)(31686004)(53546011)(6666003)(386003)(316002)(83506002)(16526018)(6486002)(16586007)(110136005)(37036004)(58126008)(229853002)(25786009)(97736004)(105586002)(64126003)(106356001)(270700001)(69596002)(6246003)(236005)(478600001)(65826007)(55236004)(53936002)(54896002)(2906002)(6512007)(5660300001)(84326002)(66066001)(65806001)(36756003)(7736002)(65956001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0701MB3637; 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: =?us-ascii?Q?1; DM5PR0701MB3637; 23:2jDL+lsmXhbNj8pHxDtyC9MOVqj8uJN9VoTQv8o?= =?us-ascii?Q?h5BLynzoZbTRkIsXIswqE+eeScGvWZTe7bBQcU48lZZNme3Ss0m0TQLiFnnx?= =?us-ascii?Q?bRRNiLRjbJ2gbsh6K0/+ysVv+JQCZlzq6tj30MnO+cKVDGI8/+XMq51tYnEa?= =?us-ascii?Q?4nYh+HpOQWOfdS9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DmTv8k5IA4G9wX+/lsJdiKwZXqMp8NTalWEQkvVPgBGJNntz4DR0pUhsGG8+PdvPwTu1Rj/oGndyI=; 7:uacidYJPd3fC4CepMuukukGY6UJmizdoBqdWGJ0gvYt9IZ7vt+WUH8Bb8srcM1P2kuBm1GYIN3I1z9OebJhFKRG3MUfzbs1d61jzhOkxZ47dSMcLYo2WdiwZL4PInpw9lE+DktNcDNACPOw/l4zefpC2OyrL9KMFV6V/WTgwsYP/763CluzEsyp8ejCRBGSXvlaSwIHF+h5J3nAMwlA9QPyRfu960zBIE6CMUcsdaZgS9SHw+KbfVcePQQeGc+s8 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 06:22:48.2102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8148bbe-fa80-4fa4-264e-08d546a8edb7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0701MB3637 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 v5 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: Tue, 19 Dec 2017 06:22:53 -0000 On 12/18/2017 03:54 PM, Nelio Laranjeiro wrote: > Mellanox INNOVA NIC needs to have final target queue actions to perform > inline crypto. > > Signed-off-by: Nelio Laranjeiro Acked-by: Anoob Joseph > > --- > > Changes in v5: > > * Add back default second action. > > 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 | 51 ++++++++++++++++++++++++++++++++++++++++++++ > examples/ipsec-secgw/ipsec.h | 2 +- > 2 files changed, 52 insertions(+), 1 deletion(-) > > diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c > index 17bd7620d..37a6416ed 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); > @@ -207,9 +208,59 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa) > 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;