From patchwork Mon Apr 10 12:42:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 97106 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1343824qgd; Mon, 10 Apr 2017 05:43:06 -0700 (PDT) X-Received: by 10.55.79.130 with SMTP id d124mr7313629qkb.92.1491828186627; Mon, 10 Apr 2017 05:43:06 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 3si13343983qtz.30.2017.04.10.05.43.06; Mon, 10 Apr 2017 05:43:06 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B98BA61FC4; Mon, 10 Apr 2017 12:43:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id A0E3362B8D; Mon, 10 Apr 2017 12:43:03 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id ADAD462D7E; Mon, 10 Apr 2017 12:43:02 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by lists.linaro.org (Postfix) with ESMTPS id 66BC361FC4 for ; Mon, 10 Apr 2017 12:43:00 +0000 (UTC) Received: by mail-lf0-f46.google.com with SMTP id h125so69862606lfe.0 for ; Mon, 10 Apr 2017 05:43:00 -0700 (PDT) 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; bh=aqxftdnberK8ZFhrygMBdlxzf5JruJRb8PtCg9iRVNM=; b=b8xGgJvyjOe4ooOPpsCvNdvtgolhEjKbShwVHVbLZ9AOYrtUZPYB7Y+i+ZSKhEUJB3 OploaoXow/C6jVpHFKPPFlK54DvGD4mNaUPNxgGYYSCxikvw8tMe05ZVpSnt1v9KMwy9 K+SnX9qunq1gcfccKqZSPI9/uVxpcyHYdhNAfw+GViBjnk9XdrQFtddqjzfn3/NE+MP9 fnP2XE0ZTgnSHeSoDui/VeC+axrZ+K4sRt1lfI0DffYsm2NaB7edeQZ4h3C4PU+xo25D SUcNgzlb75g6pcDB/GHnAJnXY/ECf/aI81azAM8tadkpkKyLWqqSuLsykX/ekhlQza5i T61Q== X-Gm-Message-State: AN3rC/7Ei/+u2JWsuwe9nsceUEMG3aBexPc3OtFEXNpO6zzDNVFQQAoLf78fgEd9kPFZbS8H0hDob4S5 X-Received: by 10.25.181.23 with SMTP id e23mr4615855lff.98.1491828178935; Mon, 10 Apr 2017 05:42:58 -0700 (PDT) Received: from localhost.localdomain (ppp95-165-131-83.pppoe.spdop.ru. [95.165.131.83]) by smtp.gmail.com with ESMTPSA id 26sm2852811lfs.19.2017.04.10.05.42.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Apr 2017 05:42:58 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 10 Apr 2017 15:42:43 +0300 Message-Id: <20170410124243.17861-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.11.0.295.gd7dffce Subject: [lng-odp] [PATCH 1/3] api: ipsec: make num_pkt/out/sa/opt unsigned X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov It does not make sense to specify negative amount inside num_*. Make respective fields unsigned instead. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 13 (lumag:ipsec-api) ** https://github.com/Linaro/odp/pull/13 ** Patch: https://github.com/Linaro/odp/pull/13.patch ** Base sha: 38485719c028918b019c6a5fc67cf05053421c83 ** Merge commit sha: 80f41ee9602b2b4282da8907c9d2fa78fdb6aeb8 **/ include/odp/api/spec/ipsec.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index a0ceb11..5655351 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -920,7 +920,7 @@ typedef struct odp_ipsec_op_status_t { */ typedef struct odp_ipsec_op_param_t { /** Number of packets to be processed */ - int num_pkt; + unsigned num_pkt; /** Number of SAs * @@ -929,7 +929,7 @@ typedef struct odp_ipsec_op_param_t { * * 1: Single SA for all packets * * num_pkt: SA per packet */ - int num_sa; + unsigned num_sa; /** Number of operation options * @@ -938,7 +938,7 @@ typedef struct odp_ipsec_op_param_t { * * 1: Single option for all packets * * num_pkt: An option per packet */ - int num_opt; + unsigned num_opt; /** Pointer to an array of packets * @@ -1010,7 +1010,7 @@ typedef struct odp_ipsec_packet_result_t { * fragments. All the fragments (of the same source packet) are stored * consecutively in the 'pkt' array. */ - int num_out; + unsigned num_out; /** IPSEC SA that was used to create the packet * @@ -1051,7 +1051,7 @@ typedef struct odp_ipsec_op_result_t { * The operation updates it with the actual number of packets * outputted. */ - int num_pkt; + unsigned num_pkt; /** Pointer to an array of packets * >From 40213f318cc323b9d2b2a0c9b8dde0d45d8b9a0f Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Mon, 10 Apr 2017 14:23:35 +0300 Subject: [PATCH 2/3] api: ipsec: mark odp_ipsec_sa_create argument as constant odp_ipsec_sa_create() should not change its argument. Thus mark it as a constant. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 13 (lumag:ipsec-api) ** https://github.com/Linaro/odp/pull/13 ** Patch: https://github.com/Linaro/odp/pull/13.patch ** Base sha: 38485719c028918b019c6a5fc67cf05053421c83 ** Merge commit sha: 80f41ee9602b2b4282da8907c9d2fa78fdb6aeb8 **/ include/odp/api/spec/ipsec.h | 2 +- platform/linux-generic/odp_ipsec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 5655351..33a84ee 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -785,7 +785,7 @@ void odp_ipsec_sa_param_init(odp_ipsec_sa_param_t *param); * * @see odp_ipsec_sa_param_init() */ -odp_ipsec_sa_t odp_ipsec_sa_create(odp_ipsec_sa_param_t *param); +odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param); /** * Disable IPSEC SA diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 5eb1be3..10918df 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -52,7 +52,7 @@ void odp_ipsec_sa_param_init(odp_ipsec_sa_param_t *param) memset(param, 0, sizeof(odp_ipsec_sa_param_t)); } -odp_ipsec_sa_t odp_ipsec_sa_create(odp_ipsec_sa_param_t *param) +odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param) { (void)param; >From 330973e1c1b029f67d629159761c559f4e9060e8 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Mon, 10 Apr 2017 14:24:55 +0300 Subject: [PATCH 3/3] api: ipsec: add default queue for outbound events If SA lookup fails for outbound IPsec packet in async mode, there is no way to report it back to application except using default queue (which does not exist at this moment). Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 13 (lumag:ipsec-api) ** https://github.com/Linaro/odp/pull/13 ** Patch: https://github.com/Linaro/odp/pull/13.patch ** Base sha: 38485719c028918b019c6a5fc67cf05053421c83 ** Merge commit sha: 80f41ee9602b2b4282da8907c9d2fa78fdb6aeb8 **/ include/odp/api/spec/ipsec.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 33a84ee..4e3ec16 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -188,6 +188,13 @@ typedef struct odp_ipsec_inbound_config_t { * Configuration options for IPSEC outbound processing */ typedef struct odp_ipsec_outbound_config_t { + /** Default destination queue for IPSEC events + * + * When outbound SA lookup fails in the asynchronous mode, + * resulting IPSEC events are enqueued into this queue. + */ + odp_queue_t default_queue; + /** Flags to control L3/L4 checksum insertion as part of outbound * packet processing. Packet must have set with valid L3/L4 offsets. * Checksum configuration is ignored for packets that checksum cannot