From patchwork Thu Dec 14 15:14:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?N=C3=A9lio_Laranjeiro?= X-Patchwork-Id: 32283 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E09341B014; Thu, 14 Dec 2017 16:13:50 +0100 (CET) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 8236131C2 for ; Thu, 14 Dec 2017 16:13:46 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id f206so12017572wmf.5 for ; Thu, 14 Dec 2017 07:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=iB98PREPiCc/yMb+iHt5dx8jgIKordGAbG3MT5ETlBU=; b=gXBj6VsDueXPpqpVPstWZBcX/I1nw9o/DseSa9xRWv5f4aULkLG67j8LVPzzhT0GTe Xq/hoNCLnDVWWDWg7wAbeL3aHI/AG6HzEoUUvNC8WJSCB3gSGyA3dr0zg59qRrc7htIR TMJOwa2isSvAcCwIVSFYg53xZ6qC0y4Dye+4YpvFrOZqbCqwSLeT3dUSHUwLS54RgBcB waVd4SmzlnNLkTfTf+h1dJFc39hhXpPrlXtt048OHrnn/WnAU2IT1CwYJBXeU/rIsIng ce6QRuvRyPYvfNjF2WAO7SmhXRkpzNvR89iTXdxIWGAvDK3qrXWS1x2+NycLQBAy/lQh pcYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=iB98PREPiCc/yMb+iHt5dx8jgIKordGAbG3MT5ETlBU=; b=csbsHwPGa91bLfy/Mr/DGijYXvIDPM7ECl2cbvjALzMKGL9dOBV/nk8MM6ub5AaLc4 i1bq+O2wGDCaP9vc03KYIddaplsQFV+yabrjISsCniURoT/7GZmtYksVdQd2WuvQJWb0 g61YpJiopiZ6tdzSsAfwMf9yv14yCK1JMIk4AgO2gN8IzmCJvm3R30HFQfkJy+QC5TKa GmnRLTZ8CjeuLsNBLRQl4b0eee3I8Sa7xnvO5BjN72upNf5kRjhy2816xjQU4+yAX+vz FfJu7yJz6P2yrUc8Zo6MOhCRNjjnTzrXZDR2sBAExpoavtA5OivPBP9GhxJ7w0Vumzbc zsOg== X-Gm-Message-State: AKGB3mIv57g8VZHah/q/AbBSnpKTC3U/uHWOLfind3niRd2xomT4bTTi xMcENNPHIP6Y5RpiBWWblH12 X-Google-Smtp-Source: ACJfBou1m/qkqW+A12jx/5jBtZytCGVtO2qVK1brEZhNZfHHYf27eB627P5eCy8zWHYcueGrQdVlzA== X-Received: by 10.80.142.201 with SMTP id x9mr12931227edx.285.1513264426226; Thu, 14 Dec 2017 07:13:46 -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 d9sm3876178edb.18.2017.12.14.07.13.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Dec 2017 07:13:45 -0800 (PST) From: Nelio Laranjeiro To: Sergio Gonzalez Monroy , Radu Nicolau , Anoob Joseph Cc: dev@dpdk.org Date: Thu, 14 Dec 2017 16:14:10 +0100 Message-Id: <89add3272024fefe644a9e636a476c85d39e398b.1513264386.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <1838395b74a2f9e63e0c3d32fee0356f915cf88d.1513264386.git.nelio.laranjeiro@6wind.com> References: <1838395b74a2f9e63e0c3d32fee0356f915cf88d.1513264386.git.nelio.laranjeiro@6wind.com> In-Reply-To: <5d3fdd0c05d5f8afd3f8e38ca03eaf25187d5c98.1513000931.git.nelio.laranjeiro@6wind.com> References: <5d3fdd0c05d5f8afd3f8e38ca03eaf25187d5c98.1513000931.git.nelio.laranjeiro@6wind.com> Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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)) { + 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,