From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0080.outbound.protection.outlook.com [104.47.40.80]) by dpdk.org (Postfix) with ESMTP id 943572C37 for ; Fri, 15 Dec 2017 10:05:22 +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=mFbEF/GUcAsM0djIHQlWfTFj+QxqM0KJVJif5VpKp20=; b=jeNfPBmh033uX1FQWNlo6nRfoaruW34Gi2RNBzRJq5421h1ClnMtoef78NP+h/ib8DtI2rlCT1Lo6ciRCzW7/N3oSXukx7Djf4JJidZfF9COCm1HGZuC6/NlfYNCZep6bAiPDNZcoU2UG1uOVQya82EYL7WqOAyrypvbmPTIXxg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from hyd1ajoseph-dt.caveonetworks.com (115.113.156.2) 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.302.9; Fri, 15 Dec 2017 09:05:18 +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> <89add3272024fefe644a9e636a476c85d39e398b.1513264386.git.nelio.laranjeiro@6wind.com> From: Anoob Joseph Message-ID: <78f97959-bf6c-33cc-e758-d232013ea159@caviumnetworks.com> Date: Fri, 15 Dec 2017 14:35:12 +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: <89add3272024fefe644a9e636a476c85d39e398b.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: CY4PR1101CA0010.namprd11.prod.outlook.com (2603:10b6:910:15::20) To SN4PR0701MB3647.namprd07.prod.outlook.com (2603:10b6:803:4d::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3e898f2-47cf-4d93-1364-08d5439af7e1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:SN4PR0701MB3647; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3647; 3:uOa3LhkDv7/oMmdkcLiNz7YE4W4TAgngy/Oi3dk1sOCxKGFtm3eiMjhV8lU/XJ4i80gG8kge1Bi+JBeCwW1F1gwGX5xHPX1qcHWtJTNc4pE8ymYlEL7/MbspnKOQz0CJFjJ1GNiADni0O91SjYJRzi6NbM19FUZtLiLns9ubcDppPS2b2srZ1fXUIG8r/Myr/tAMlq5OM3Du36QMo27dlmRhDsJGq5391DYqtETM8aENxWBPWNmDYAEKuXmXsJy6; 25:qiwxGoGAu59e+XhoO3ZFVLlRSDdCC/ybhnLUrHAfesUMR1ieECOsVf+did7ovUtvayN2u1yovZ0iBeY0HM6jHV+reEmAFCp0SCxpnuGFuvCH7gsoOmde6xrcSgxvm35+4r0R9M72IIZia94irGg72YZvi24LBcm80cj4nVpWpGATZ6xO85Blw+QCf2Pd4CQPmLj34mA+Vu2Hlb5Qg5WrzzkMxhq8VQmgMFqfB3X6uQH3bMI0DN4imAwvPEmo/HfG3wUqKm9KIzSK7+escDjnG94ByTk5VGYddqFKMjbxI0qM2r4aMwzC6lh7kHjay7dTcvX691g1QKrMWNIyocXj8g==; 31:Q0ppWBspBHxKqZeTqGrjqxyak1HxaYzow/wMmNHzSEHwAUt00KaJi/gb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lLicDhsvT1DT4HixSpL4PhzBfuhhXGIb3P8mTKIWh2O8+vldZ6FIEiYNXumWAsVwzfsdAqSYnsJsn7MAaBw2fTDuaKGL6hqNXysND7wkb 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)(3231023)(93006095)(3002001)(10201501046)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:SN4PR0701MB3647; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN4PR0701MB3647; X-Forefront-PRVS: 05220145DE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(366004)(376002)(24454002)(199004)(189003)(64126003)(52116002)(4326008)(31696002)(106356001)(53416004)(105586002)(50466002)(66066001)(65806001)(53936002)(67846002)(31686004)(65956001)(16526018)(47776003)(8936002)(110136005)(316002)(6512007)(2486003)(23676004)(52146003)(6246003)(58126008)(83506002)(478600001)(81166006)(8676002)(72206003)(81156014)(68736007)(305945005)(7736002)(6666003)(65826007)(42882006)(2950100002)(5660300001)(3846002)(97736004)(230700001)(69596002)(6506007)(386003)(6116002)(229853002)(6486002)(2906002)(53546011)(25786009)(59450400001)(36756003)(76176011)(55236004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0701MB3647; 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?MTtTTjRQUjA3MDFNQjM2NDc7MjM6dy8xV0JWVUZ0S1VLallUckRGcVJRWHVG?= =?utf-8?B?b0ZSZzFVeVV2US9NOVF1dTNYQVhROTFQaTlHNVM0b2xpM3FtMHpjVzM1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agnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2017 09:05:18.6477 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3e898f2-47cf-4d93-1364-08d5439af7e1 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 v4 3/3] examples/ipsec-secgw: add Egress 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: Fri, 15 Dec 2017 09:05:23 -0000 Hi Nelio, On 12/14/2017 08:44 PM, Nelio Laranjeiro wrote: > Add Egress flow create for devices supporting > RTE_SECURITY_TX_HW_TRAILER_OFFLOAD. > > Signed-off-by: Nelio Laranjeiro > --- > examples/ipsec-secgw/ipsec.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c > index 8e8dc6df7..d49970ad8 100644 > --- a/examples/ipsec-secgw/ipsec.c > +++ b/examples/ipsec-secgw/ipsec.c > @@ -201,6 +201,7 @@ 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); > @@ -253,6 +254,13 @@ create_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa) > &err); > if (ret) > goto flow_create_failure; > + } else if (sa->attr.egress && > + (sa->ol_flags & > + RTE_SECURITY_TX_HW_TRAILER_OFFLOAD)) { If this flag is not set, the following code won't be executed, but it would still try to create the flow. And if the flow create fails in that case, then create_session would fail. I would suggest moving the flow_create also into the block (for ingress and egress). Or may be initialize the flow with actions END+END+END, and add SECURITY++END as it hits various conditions. I'm not sure what the flow_create would do for such an action. This would look ugly in any case. See if you get any better ideas! > + sa->action[1].type = > + RTE_FLOW_ACTION_TYPE_PASSTHRU; > + sa->action[2].type = > + RTE_FLOW_ACTION_TYPE_END; > } > flow_create: > sa->flow = rte_flow_create(sa->portid,