From patchwork Thu Jun 22 06:55:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bogdan Pricope X-Patchwork-Id: 106148 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp2311936qgd; Wed, 21 Jun 2017 23:56:22 -0700 (PDT) X-Received: by 10.200.36.194 with SMTP id t2mr1231024qtt.147.1498114582887; Wed, 21 Jun 2017 23:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498114582; cv=none; d=google.com; s=arc-20160816; b=TDWXEIt/SxHIF5UlPTI1DENntEuu+sN8w46e/8BqwvwHjUEiyckHYux9ORkLGqGmPE P/VG2W67xC7H4jUJk5sAdlQOJIkBZ1q1XoPZdVeRKzkTv+SikKqLL2I+RI9X1DAdxcan lg9Jo3yiDdbwS8OTYjtJcjGxHZSBkeZ5FV4LCXZ9Mjxn6YlddEu0n3I0i2afZAx9yJcF KRczhIcRGDVKbPrxtYeht/yHc8VAnizVB0Ve4IfpVvWhwPw2BYZUHV40ZRAJEg0A+EM6 /2wEcVO0t5Ob5utdLfRqqfDw1cA2SkCIyDPUfko2nr8El/SK+56YpRqX+uG7MA2vIq61 nJJg== 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=DFw5jcdZ1NPYyNPF/mOmcZL1nHePsCyP4bIz1RSZBqw=; b=r8sGyAW8o0pbUswSGRGzifxAnNWlU8ncnfruP334PyJvtUPPedIe/DpTImd6eDIhhm yLVE1Z981ia6elPAy5nap30K58RaXXx658jqG6UhXTaH09Ql0NLBFtUqMXiOpluKz0CB gu1xcIjHO45EW830xh1ys+jrU5cKx+epmpe5GLD/jv1bJCXGdNhiQxba3XEJoWlESbT+ Q6eZ+zclvBdoBqRNPVbnrKQd+6gojlpggL3MS1DpozkAfmoDB42HuWTjIT3YZESqRNdr YNiMEqMs+vL6QvkcPC2BFG1jOsX6I2ra9+i11LYsHsMaZhF8EREW3JOKI2wfQJCUbRDu 7Bug== 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 p97si717499qkp.32.2017.06.21.23.56.22; Wed, 21 Jun 2017 23:56: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 92FFB60C02; Thu, 22 Jun 2017 06:56:22 +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=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED 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 06F3B60A45; Thu, 22 Jun 2017 06:56: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 345E060967; Thu, 22 Jun 2017 06:56:16 +0000 (UTC) Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) by lists.linaro.org (Postfix) with ESMTPS id 1B2E560967 for ; Thu, 22 Jun 2017 06:55:59 +0000 (UTC) Received: by mail-wr0-f177.google.com with SMTP id c11so9813861wrc.3 for ; Wed, 21 Jun 2017 23:55:59 -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=DFw5jcdZ1NPYyNPF/mOmcZL1nHePsCyP4bIz1RSZBqw=; b=oYVBvUE5veOmANgZXYEoSowmHNxFgynlsJni+9miJowxFK0GEb8nCVVgHYqTjvHFVC i6PV9k9yJLGmPkmzzt8Ky9sDS20AwhmcOcIcvMXqrFlAt/5wFKqaRT+RofxE78fEaElG wtfzsLXjjhzLkRo3B3XgnfoJkAzRpiXaw1pacWz17VwzrMXJFqXDaYHS0jOSDOdjg6+v GslBAjRmacQbxHUWxcw3F4TAZ2TGnkXxz8IGhZNuPRZwsqUuusxZaLFTt1E8AL6RAXSC MCJFoN7Kq+16i/MSC/xJv2/vJ9pir+5FT/0dxPu9oNzG9/Psxfkyohp0rL08Bi1/wZMh YDfA== X-Gm-Message-State: AKS2vOyMlh5jmxBx7d3EVDFZRvYyvzlh8JELX5GrUd9bEYI6RkXrvvVs NyJo37MOsHwNsEAV0IJJ5+Py X-Received: by 10.28.92.13 with SMTP id q13mr491658wmb.20.1498114557858; Wed, 21 Jun 2017 23:55:57 -0700 (PDT) Received: from netbricks-team.enea.se ([193.202.22.66]) by smtp.gmail.com with ESMTPSA id y77sm1137373wrb.39.2017.06.21.23.55.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Jun 2017 23:55:57 -0700 (PDT) From: Bogdan Pricope To: lng-odp@lists.linaro.org Date: Thu, 22 Jun 2017 09:55:47 +0300 Message-Id: <1498114547-3372-2-git-send-email-bogdan.pricope@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1498114547-3372-1-git-send-email-bogdan.pricope@linaro.org> References: <1498114547-3372-1-git-send-email-bogdan.pricope@linaro.org> Subject: [lng-odp] [API-NEXTv2] 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..5373ede 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; + } inbound; + + /** 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; + } outbound; + }; + + /** Various SA option flags */ + odp_ipsec_sa_opt_t opt; /** User defined SA context pointer *