From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0072.outbound.protection.outlook.com [104.47.42.72]) by dpdk.org (Postfix) with ESMTP id A9848397D for ; Fri, 15 Dec 2017 16:39:24 +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=9o3Ufxx8g77Q3qip/XERvvp0UbGBjYHhyzHfVyKDV6s=; b=kwsLbv/oYzy6wmEccqOXeC9HWz8e/SFqtBz81cquZjeAUS7YmbBozVo5zaUzYxoQFI82b5CgEMfrwho9G//lao/5WTrOrjk3mOYuHSy2lry6jcnC88f4XGvWpH+X0ekV/vS6o3RwhN8uYBTksQoD9HLAJEaE022E4XXuhHI+O3Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from [192.168.0.107] (183.82.140.80) by CY4PR0701MB3633.namprd07.prod.outlook.com (2603:10b6:910:92::35) 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 15:39:20 +0000 To: Nelio Laranjeiro Cc: Sergio Gonzalez Monroy , Radu Nicolau , dev@dpdk.org References: <5d3fdd0c05d5f8afd3f8e38ca03eaf25187d5c98.1513000931.git.nelio.laranjeiro@6wind.com> <89add3272024fefe644a9e636a476c85d39e398b.1513264386.git.nelio.laranjeiro@6wind.com> <78f97959-bf6c-33cc-e758-d232013ea159@caviumnetworks.com> <20171215135300.zm6ubao24qqxstpl@laranjeiro-vm.dev.6wind.com> From: Anoob Joseph Message-ID: Date: Fri, 15 Dec 2017 21:09:00 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171215135300.zm6ubao24qqxstpl@laranjeiro-vm.dev.6wind.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [183.82.140.80] X-ClientProxiedBy: SG2PR0601CA0010.apcprd06.prod.outlook.com (2603:1096:3::20) To CY4PR0701MB3633.namprd07.prod.outlook.com (2603:10b6:910:92::35) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5dab44d9-558c-44c6-3baa-08d543d20370 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:CY4PR0701MB3633; X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3633; 3:dVecZnEkHVT5IDETHV2gzthqLSu2wgMyHZbNmDRX5qYJY8dbOCB7YbxuQ8uGskR2LZFlN8afUpIabGVJnAwYPotC/1elWsyQAPuKf1obVCjokZ3oBJN1ju/C03qkvno84P9NhKL0u+DxyrXw+W1Z+hmEw3+lsL2UdmlMq2uAcbOOa3VmuSi75bQPlcOx33CHgrihbsIg8qaxpPznih2MF9SlSEiw7553OOC9dDlg8crOJqo1tt0sEVhBSqkARu+f; 25:09Jcx8T3xD07uR26v90tjuoFrceV8gquXhyGOQ8pBQWU9MWRDM8zWO52Cw5L0DnLTi6U9GK4UfUoStEApOAB0+qnLh0ocjSuVbi++tknlaNo1xhxmgbsyXi24Nrhv8w0wRJekbK1f+n0GOsx/u8nIhurVPPAot9dwOGOC/Lw3HGkddhEHpeC1O2lquP0KPrWKsWIHIswfBZrpoGCdl5mUf5E11nDX3snZxVere+EnZJBFdtSHPmm56XY80/j9aiUEwRbnxgUne4b5M2yoxeT5ATraEpjxgU1roBbJM7S/DUxcyNhmE/8qWtdGVw9gzzn/xlCp2YL/S79m5vhhie+XQ==; 31:/IM01AWEkqjwRDl4+JYZHHXU2wOVN9/aaZRulIGSgqPAVma4CKUUrprXE1UaIkvOkcL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+9DfT9Bo7nOeeewJbFxklO28NHuLrqBmLIHamztTDe4i62oETuAfASIcVpfUZ0aTvFUeXQz0L0PMstkEVapJfqeGhMzgiiLvJ 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)(93006095)(3231023)(3002001)(10201501046)(6041248)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:CY4PR0701MB3633; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR0701MB3633; X-Forefront-PRVS: 05220145DE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(396003)(346002)(366004)(376002)(39850400004)(199004)(189003)(52164004)(377424004)(24454002)(52146003)(316002)(117156002)(7736002)(8676002)(2486003)(76176011)(97736004)(52116002)(93886005)(81156014)(81166006)(305945005)(72206003)(478600001)(23676004)(31696002)(6246003)(77096006)(53546011)(67846002)(53936002)(229853002)(42882006)(68736007)(3260700006)(58126008)(16526018)(16576012)(65826007)(59450400001)(54906003)(25786009)(5660300001)(6916009)(2950100002)(83506002)(386003)(6666003)(6486002)(105586002)(2870700001)(2906002)(36756003)(3846002)(64126003)(8936002)(4326008)(106356001)(31686004)(66066001)(47776003)(65806001)(65956001)(50466002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3633; H:[192.168.0.107]; 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?MTtDWTRQUjA3MDFNQjM2MzM7MjM6R0xpeUlEcTRZaVk2bk9ubTlpeXBON3Z5?= =?utf-8?B?aGQvTEVJblF3SjRiSmk4cjhRVHZaMUp3L3ViRlBWenZMajRXdVpYaGhH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Q2/uM02pQVLbU57ekEuf1A6Fjse2gtPUD9IAddIHbnLTnMeuDOtDsw0mcCGzmFDbUYqqx8BmTv7p29vsSQbdnQe34vSUcV2xwGqdgzed8ygVZYeNWZO+O SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2017 15:39:20.7829 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5dab44d9-558c-44c6-3baa-08d543d20370 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3633 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 15:39:25 -0000 Hi Nelio, On 15-12-2017 19:23, Nelio Laranjeiro wrote: > Hi Anoob, > > On Fri, Dec 15, 2017 at 02:35:12PM +0530, Anoob Joseph wrote: >> 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. > Right, with actions Security + END as the original code. > >> And if the flow create fails in that case then create_session would fail. > Do you mean the original code is also wrong? I would say it's not handling all the cases. Just like how we finalized the ingress, egress might also need some work. Or may be we can retain the original behavior with this patch and take up this issue separately. > >> 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! > I think this comment is related to second patch where the > "sa->action[1].type = RTE_FLOW_ACTION_TYPE_END;" is wrongly removed. > > Can you confirm before I send a new revision? No. I was suggesting an alternate algorithm to handle the situation when egress may/may not create flow while ingress would need flow by default. What I suggested is something like this, sa->action[0].type = RTE_FLOW_ACTION_TYPE_END; sa->action[1].type = RTE_FLOW_ACTION_TYPE_END; sa->action[2].type = RTE_FLOW_ACTION_TYPE_END; if (ingress) {     sa->action[0].type = RTE_FLOW_ACTION_TYPE_SECURITY;     ... } else if (egress && FLAG_ENABLED) {     sa->action[0].type = RTE_FLOW_ACTION_TYPE_SECURITY;     ... } flow_create(); On second thought, this may not work well. Another suggestion is, if (ingress) {     sa->action[0].type = RTE_FLOW_ACTION_TYPE_SECURITY;     ...     flow_create(); } else if (egress && FLAG_ENABLED) {     sa->action[0].type = RTE_FLOW_ACTION_TYPE_SECURITY;     ...     flow_create(); } // Here if flow_create fails, create_session should fail. // Either flow or metadata flag is required if (sa->flow == NULL && !(NEEDS_METADATA)) {     return -1; } > >>> + 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, > Thanks, >