From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id E4060397D for ; Fri, 15 Dec 2017 14:52:24 +0100 (CET) Received: by mail-wm0-f41.google.com with SMTP id b199so17747921wme.1 for ; Fri, 15 Dec 2017 05:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=FAL+jwLX/xk+AGHGYgq/lZvslorzj3Agbkz+uybjy0A=; b=TkweiMZ1QAYTrs61fFB1EPJk4OhxGWvbvinjNRJEArJYldHoClHaG+GvBXF2/HpqII Q9iK6zb59UEqxZMoQUtDFmi5O+dh8lGqnQVmuNuTykkfW2Ch4hIDNoHkazF9V71dsKMY EhT0qpGw3C67Vz3ohGqJIF6HxjH9hZM5GtfzNoHU7hLL8XrXlZsEVUsHDg4x0hDf7CWl 2GodWtpsuDoXdcHkLTY+OTkU8fPM6WNMa/lqV4gYjXyeuZdEN48DrEv0bPw74D8AdmOC i4iHNMNwqSzaEZSiQBgdrYSAuBTLTtdahjhRGOnyYKF05qH5g8MmDFZOsarhoa9yfews 8uhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=FAL+jwLX/xk+AGHGYgq/lZvslorzj3Agbkz+uybjy0A=; b=PHZ9nVK/h/2pWnBvOlGlhQMJzuA6ez9Zw2zPEZLdVHvF5zgrRMn+kiNhzhLUEe5J8e 69NTnICxFUccHUF4okwQh1nVmXtGxHwk8poJAV6K9X1UQHnO0h13KBqvzab5CQ17IWF8 ohFIyR7Wv+r4u6prPHxgW0yia+crcOLB2O2zzxx6meArKfJNsw9JZt8z58BN9Q+tg5KP 0fw1QIqP0QShYpG2FFUvtM1+WhmSWROP2HixHwrm3QADFuwxYOz4/cWOYHcIkKEYLmgu Z5J07lQmQkQOauYrR0wYAuii2W7KY7F0dYLkHGnMe6aAe9SWEf7xD6NzOI2YsJn1e4lU OT/g== X-Gm-Message-State: AKGB3mIaKQ0X+hbZVAUjy+shl7yscuWhH6+QqzLXNk47BhbGW7nZPHjb gYaP1u4h+mPR4+5GiEUJZyRp X-Google-Smtp-Source: ACJfBosGk3iiZF0WQE6NwYHOv9v3E+psVr2mAF8Ve5Fb1MLBtOOSswAROwylPHqVRJEo8So2oDvU8g== X-Received: by 10.80.202.72 with SMTP id e8mr17422017edi.60.1513345944667; Fri, 15 Dec 2017 05:52:24 -0800 (PST) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id c2sm5321663edi.66.2017.12.15.05.52.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Dec 2017 05:52:24 -0800 (PST) Date: Fri, 15 Dec 2017 14:53:00 +0100 From: Nelio Laranjeiro To: Anoob Joseph Cc: Sergio Gonzalez Monroy , Radu Nicolau , dev@dpdk.org Message-ID: <20171215135300.zm6ubao24qqxstpl@laranjeiro-vm.dev.6wind.com> References: <5d3fdd0c05d5f8afd3f8e38ca03eaf25187d5c98.1513000931.git.nelio.laranjeiro@6wind.com> <89add3272024fefe644a9e636a476c85d39e398b.1513264386.git.nelio.laranjeiro@6wind.com> <78f97959-bf6c-33cc-e758-d232013ea159@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <78f97959-bf6c-33cc-e758-d232013ea159@caviumnetworks.com> User-Agent: NeoMutt/20170113 (1.7.2) 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 13:52:25 -0000 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 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? > > + 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, -- Nélio Laranjeiro 6WIND