From patchwork Tue Jun 20 09:17:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Pricope X-Patchwork-Id: 105932 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1268533qgd; Tue, 20 Jun 2017 02:18:27 -0700 (PDT) X-Received: by 10.200.49.73 with SMTP id h9mr2378141qtb.13.1497950307154; Tue, 20 Jun 2017 02:18:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497950307; cv=none; d=google.com; s=arc-20160816; b=SIsxNo36YqWyzzvphO6c2WYFH1NpY3xXJIXbOiviaiar3RszIa2suYUPGHrg/nK3Pk jaKJU35FezMUvXbHoLRXRm/JlHy5WXsR/ydiNCIz+0jzn5qpLtmWdfrqUkpu54v7Hpe4 c93RXTtBJM0o9rto0aPfKNZ7NzDCMVtYUWzU5LNCZ+YEWqARXgiB1lIbwmug5/FaHxtB v73Bj9EWHZbVtJda1HQcnCXM+h1pvGbW5U2rRhrkWQUjNSKW3umE0vcrV+xIO6aaSH9V +036PKqmxixOj7/IMwH3D2vMbcL31WozBUKelTr4eovmLdb6+b5YTYg7pDujIpTk9Pge cgVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=kS5y5XZF52DooK4ZnN3J/Yt/Lb/BfpfcMTJvKqlw8hs=; b=qANAENWhCjCl4+0VlJbhTQk1lRPmrFg2qUWxAivsvlCuF3VXo+Pz7czbiNTgmSAuz9 ZnKB3CN6ms3AXXtO/M0BDIK/Ww0Ij+gGduhEItpOHSjxkSeivI2snO/x50pDtHbwGXeX 7QQJhzNQ48Huh3XwdCFS97iSi0mC62OSPZNJ9UUlnFWg0/SblgdDZA1+xdPNPffyrTrI NQTFHEjx7AU13snIr7/l2+iyvaulDfB7UeqMSnke5maVQrgi9cB4DuqaguxQb0oIM8hm 6/0grQRhAsnmclUGhjRcevzqUIrVYTxUEg/KIdKpQxC/BFsm4npOq1iLEr59ZdSmWOQc VKpg== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w197si11337568qka.296.2017.06.20.02.18.26; Tue, 20 Jun 2017 02:18:27 -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 CE4CA60A59; Tue, 20 Jun 2017 09:18:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 5AA8360A76; Tue, 20 Jun 2017 09:18:05 +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 964CD609CD; Tue, 20 Jun 2017 09:18:02 +0000 (UTC) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by lists.linaro.org (Postfix) with ESMTPS id A56A06097A for ; Tue, 20 Jun 2017 09:18:00 +0000 (UTC) Received: by mail-wm0-f54.google.com with SMTP id u195so14090642wmd.1 for ; Tue, 20 Jun 2017 02:18: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:in-reply-to :references; bh=kS5y5XZF52DooK4ZnN3J/Yt/Lb/BfpfcMTJvKqlw8hs=; b=mp67D4lPCr0YpsZmziFeCpVfUXeb2A+09SYDNkGzlMcRngsVqV4w0nJxzojDL3Cqe2 4UB70g5+9QVKwzuGhAHG2UMtiLzRg9lgPgtaH8I054vemGhIotpM4U/533McqmueFBL6 1rEHetzfii3NWrgdFq+rL+nDxWoH3P7Ax6lXqp6B4Y0N3a61RSGIzxRERdtd5ZJ864hO c1StWH0TpVci/FFq20VlvBNafxwaoenJCoujgSFkGQ/vzovpt3ehthrQMJR6ZtdTUtgd XFaT9kHGRZr3+007mvBBF0dWYGonXtkIgKRFYgYPWHGXqMdJPH7nZ3Cj+fsHmE3svpHh SeYw== X-Gm-Message-State: AKS2vOzgXRFVM10lT4i+0FAai7AP74qZDj3UyiW7KFysJne6e/ygtpKB bS7DHictPyBlISHqbwvUXMV+ X-Received: by 10.28.8.72 with SMTP id 69mr1879722wmi.102.1497950279385; Tue, 20 Jun 2017 02:17:59 -0700 (PDT) Received: from netbricks-team.enea.se ([193.202.22.66]) by smtp.gmail.com with ESMTPSA id m40sm19751254wrm.4.2017.06.20.02.17.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:17:58 -0700 (PDT) From: Bogdan Pricope To: lng-odp@lists.linaro.org Date: Tue, 20 Jun 2017 12:17:53 +0300 Message-Id: <1497950273-26702-2-git-send-email-bogdan.pricope@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497950273-26702-1-git-send-email-bogdan.pricope@linaro.org> References: <1497950273-26702-1-git-send-email-bogdan.pricope@linaro.org> Subject: [lng-odp] [API-NEXT] api: ipsec: reorganize odp_ipsec_sa_param_t structure based on SA direction 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" Signed-off-by: Bogdan Pricope --- include/odp/api/spec/ipsec.h | 114 ++++++++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 51 deletions(-) -- 1.9.1 diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index e602e4b..08c820e 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -604,8 +604,8 @@ typedef enum odp_ipsec_ip_version_t { * IPSEC Security Association (SA) parameters */ typedef struct odp_ipsec_sa_param_t { - /** IPSEC SA direction: inbound or outbound */ - odp_ipsec_dir_t dir; + /** SPI value */ + uint32_t spi; /** IPSEC protocol: ESP or AH */ odp_ipsec_protocol_t proto; @@ -616,51 +616,12 @@ typedef struct odp_ipsec_sa_param_t { /** Parameters for crypto and authentication algorithms */ odp_ipsec_crypto_param_t crypto; - /** Parameters for tunnel mode */ - odp_ipsec_tunnel_param_t tunnel; - - /** Fragmentation mode */ - odp_ipsec_frag_mode_t frag_mode; - - /** Various SA option flags */ - odp_ipsec_sa_opt_t opt; - /** SA lifetime parameters */ odp_ipsec_lifetime_t lifetime; - /** SA lookup mode */ - odp_ipsec_lookup_mode_t lookup_mode; - - /** Minimum anti-replay window size. Use 0 to disable anti-replay - * service. */ - uint32_t antireplay_ws; - /** Initial sequence number */ uint64_t seq; - /** SPI value */ - uint32_t spi; - - /** Additional inbound SA lookup parameters. Values are considered - * only in ODP_IPSEC_LOOKUP_DSTADDR_SPI lookup mode. */ - struct { - /** Select IP version - */ - odp_ipsec_ip_version_t ip_version; - - /** IP destination address (NETWORK ENDIAN) */ - void *dst_addr; - - } lookup_param; - - /** MTU for outbound IP fragmentation offload - * - * This is the maximum length of IP packets that outbound IPSEC - * operations may produce. The value may be updated later with - * odp_ipsec_mtu_update(). - */ - uint32_t mtu; - /** Select pipelined destination for resulting events * * Asynchronous and inline modes generate events. Select where @@ -677,16 +638,67 @@ typedef struct odp_ipsec_sa_param_t { */ odp_queue_t dest_queue; - /** Classifier destination CoS for resulting packets - * - * Successfully decapsulated packets are sent to classification - * through this CoS. Other resulting events are sent to 'dest_queue'. - * This field is considered only when 'pipeline' is - * ODP_IPSEC_PIPELINE_CLS. The CoS must not be shared between any pktio - * interface default CoS. The maximum number of different CoS supported - * is defined by IPSEC capability max_cls_cos. - */ - odp_cos_t dest_cos; + /** IPSEC SA direction: inbound or outbound */ + odp_ipsec_dir_t dir; + + /** IPSEC SA direction dependent parameters */ + union { + /** Inbound specific parameters */ + struct { + /** SA lookup mode */ + odp_ipsec_lookup_mode_t lookup_mode; + + /** Additional inbound SA lookup parameters. Values are + * considered only in ODP_IPSEC_LOOKUP_DSTADDR_SPI + * lookup mode. */ + struct { + /** Select IP version + */ + odp_ipsec_ip_version_t ip_version; + + /** IP destination address (NETWORK ENDIAN) */ + void *dst_addr; + + } lookup_param; + + /** Minimum anti-replay window size. Use 0 to disable + * anti-replay service. */ + uint32_t antireplay_ws; + + /** Classifier destination CoS for resulting packets + * + * Successfully decapsulated packets are sent to + * classification through this CoS. Other resulting + * events are sent to 'dest_queue'. + * This field is considered only when 'pipeline' is + * ODP_IPSEC_PIPELINE_CLS. The CoS must not be shared + * between any pktio interface default CoS. The maximum + * number of different CoS supported is defined by + * IPSEC capability max_cls_cos. + */ + odp_cos_t dest_cos; + }; + + /** Outbound specific parameters */ + struct { + /** Parameters for tunnel mode */ + odp_ipsec_tunnel_param_t tunnel; + + /** MTU for outbound IP fragmentation offload + * + * This is the maximum length of IP packets that + * outbound IPSEC operations may produce. The value may + * be updated later with odp_ipsec_mtu_update(). + */ + uint32_t mtu; + + /** Fragmentation mode */ + odp_ipsec_frag_mode_t frag_mode; + }; + }; + + /** Various SA option flags */ + odp_ipsec_sa_opt_t opt; /** User defined SA context pointer *