From patchwork Mon Apr 10 13:28:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 97164 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp1355819obc; Mon, 10 Apr 2017 06:28:22 -0700 (PDT) X-Received: by 10.107.30.67 with SMTP id e64mr52418099ioe.54.1491830902582; Mon, 10 Apr 2017 06:28:22 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y75si14286662ioy.127.2017.04.10.06.28.22; Mon, 10 Apr 2017 06:28:22 -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 1610663C9A; Mon, 10 Apr 2017 13:28:20 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id DE742635B7; Mon, 10 Apr 2017 13:28:18 +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 9F03563A2E; Mon, 10 Apr 2017 13:28:17 +0000 (UTC) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) by lists.linaro.org (Postfix) with ESMTPS id 5A09663548 for ; Mon, 10 Apr 2017 13:28:15 +0000 (UTC) Received: by mail-lf0-f54.google.com with SMTP id 75so10968508lfs.2 for ; Mon, 10 Apr 2017 06:28:15 -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:subject:date:message-id; bh=DJPdzfsFZy32NbK50mPemO5j+5qrCSoRFUpp7xKuLcI=; b=KSGD0zG9zfvf+xTDJT7Lk5t0AoWW2omuZJ0NM9xDwKplRoAC8hv2I73ToWbQaQCy8O M8NoypgdtMgsNuPfi0WC0/JKz5M+0tYyuoQs6U4O9RExw3uVmVpjjkAdMdwdmAbmsBmF LEvrSU5FMoytEbsBuYjoM8fTbfEAdbto3BqrppJ1LMR4T1MpWNS7Fp8c4RMjBTNq6XcI BqYtgM91wQvh6R1LVEjM6//pYiJhpljAEJs0bYaE51kaxw8UNX2rVK21srpUXbu2J/fA OOBMz3fifLiAC4WfqlGS6wbSGwV+Z7bxgqH2zvANiYHUAcxDanedHuc08/EDeG4Shg1k 11ew== X-Gm-Message-State: AFeK/H3f7FgkdGNX+UgZAU0Euqf2tNY7I/62VLWQ6RveebFqjFugFFXPlRVd+joKfTZHN5e3CaHmBw1U X-Received: by 10.46.15.9 with SMTP id 9mr15584636ljp.108.1491830893885; Mon, 10 Apr 2017 06:28:13 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([94.25.228.46]) by smtp.gmail.com with ESMTPSA id i1sm2901803ljd.47.2017.04.10.06.28.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 06:28:13 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Mon, 10 Apr 2017 16:28:09 +0300 Message-Id: <20170410132811.19300-1-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 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" It does not make sense to specify negative amount inside num_*. Make respective fields unsigned instead. Signed-off-by: Dmitry Eremin-Solenikov --- include/odp/api/spec/ipsec.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.11.0 diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index a0ceb11a..56553519 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 patchwork Mon Apr 10 13:28:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 97165 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp1355822obc; Mon, 10 Apr 2017 06:28:23 -0700 (PDT) X-Received: by 10.36.215.129 with SMTP id y123mr11845657itg.17.1491830903048; Mon, 10 Apr 2017 06:28:23 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id a19si7726295itc.97.2017.04.10.06.28.22; Mon, 10 Apr 2017 06:28:23 -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 90BB463A32; Mon, 10 Apr 2017 13:28:22 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6E0F663A32; Mon, 10 Apr 2017 13:28:20 +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 9A52263A2C; Mon, 10 Apr 2017 13:28:18 +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 523F1635B7 for ; Mon, 10 Apr 2017 13:28:16 +0000 (UTC) Received: by mail-lf0-f46.google.com with SMTP id s141so35063076lfe.3 for ; Mon, 10 Apr 2017 06:28:16 -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:subject:date:message-id:in-reply-to :references; bh=rmQ1sFJSeoNA7URQxie2j1JxOYSDcBmqE9sYgfETF/A=; b=bxhMGoEiqTeTJTpdwxMrCLcflyG5o0iWjYCO0giRkRKeiMl36+LkAyokc/8ow4tQwG qY5jn20zXQQ+L/3oT5ugDVSjgVhGkjG90RIwZspRfnt3OB7w3wtgHlXquH0IHaBfI1xJ 5XqcEKiPxUsM8IRkGfd3Hz7Y6qtCx4EtYtxIJc7DhKYRoJto+3sbmvabkVvOkAJ5hRrI XZWhM9IYSaWUCqMVls4c2PDmLAGrPnXojiALbzHIEGitSZsVTIf0FE7ZWkarYbRa7POY h2dpJfT69AzOLMqyPzbAXmVr2HkNGKoznoDqZIhaSkI4VDnMUt5QOHh7ssonX3fOGLqr OFxw== X-Gm-Message-State: AFeK/H0aswCWKCJpByH2c6YxMDNK0xLgorifcjz3K3shJU+aQJ78OLzTkix1J2HBNSpg4+0OIP63Gwxy X-Received: by 10.46.80.21 with SMTP id e21mr13773065ljb.105.1491830894869; Mon, 10 Apr 2017 06:28:14 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([94.25.228.46]) by smtp.gmail.com with ESMTPSA id i1sm2901803ljd.47.2017.04.10.06.28.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 06:28:14 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Mon, 10 Apr 2017 16:28:10 +0300 Message-Id: <20170410132811.19300-2-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170410132811.19300-1-dmitry.ereminsolenikov@linaro.org> References: <20170410132811.19300-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [PATCH 2/3] api: ipsec: mark odp_ipsec_sa_create argument as constant 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" odp_ipsec_sa_create() should not change its argument. Thus mark it as a constant. Signed-off-by: Dmitry Eremin-Solenikov --- include/odp/api/spec/ipsec.h | 2 +- platform/linux-generic/odp_ipsec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 56553519..33a84eef 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 5eb1be30..10918dfb 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 patchwork Mon Apr 10 13:28:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 97166 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp1355849obc; Mon, 10 Apr 2017 06:28:26 -0700 (PDT) X-Received: by 10.36.122.135 with SMTP id a129mr12270555itc.16.1491830906108; Mon, 10 Apr 2017 06:28:26 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o80si7731195ito.126.2017.04.10.06.28.25; Mon, 10 Apr 2017 06:28:26 -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 9B98063B50; Mon, 10 Apr 2017 13:28:25 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 7A09263A34; Mon, 10 Apr 2017 13:28:23 +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 24F6D63DB1; Mon, 10 Apr 2017 13:28:21 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id E8B6663A2C for ; Mon, 10 Apr 2017 13:28:18 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id h125so70594665lfe.0 for ; Mon, 10 Apr 2017 06:28:18 -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:subject:date:message-id:in-reply-to :references; bh=6S2Lb0Tqvm8pn/ABl4N7M8HYa+BNv0qf2Q/pdtR78FQ=; b=iF873Nnqm4KgPVGkjDBkTvko4ma0r35IqjNVJm2DZt1o/7muRGOoVs8GoadofIyoZP Ag4nRsvserShdDJrVn1VcLyQO5GBc8S9LA5EH9h6hQUGXT3l2mBIQapA7ct7Et6L2rrt taabB+EjG4NbKRZy4Bd3GCiTNlod0bzwWJhSl6Zd3rA/eP2qdsN7r9KRUX7i/bcSiy32 QkJTLFamkMXKA5JBnu+RDGQw53o8wSCDU+MIF90uVqyNNn4/MFuauuHof0mCEKqRrf7s G3omFPLn2yAN++Wb6yJ2AFcOl1zXRKjduYlLLzLU+zXuZnW8pm7Tdmn2YuQxti3gh9wB tiUA== X-Gm-Message-State: AFeK/H3wRwF++dPCiTteUBUh+x6xH9M0EELFdusIRBPpUNGhHuTINS3PxHnMK6iLnYDPziBPZl55WMNy X-Received: by 10.46.84.7 with SMTP id i7mr15141500ljb.74.1491830897538; Mon, 10 Apr 2017 06:28:17 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([94.25.228.46]) by smtp.gmail.com with ESMTPSA id i1sm2901803ljd.47.2017.04.10.06.28.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 06:28:17 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Mon, 10 Apr 2017 16:28:11 +0300 Message-Id: <20170410132811.19300-3-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170410132811.19300-1-dmitry.ereminsolenikov@linaro.org> References: <20170410132811.19300-1-dmitry.ereminsolenikov@linaro.org> Subject: [lng-odp] [PATCH 3/3] api: ipsec: add default queue for outbound events 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" 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 --- include/odp/api/spec/ipsec.h | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.11.0 diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 33a84eef..4e3ec16f 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