From patchwork Thu Nov 30 12:00:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 120164 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp595529qgn; Thu, 30 Nov 2017 04:21:47 -0800 (PST) X-Google-Smtp-Source: AGs4zMYOMZJ/DIM+EdYP00nc5mP5WWTzQZ6tdoASNyVHL5bqIhTTfdel8mN8lzcpEFCnKAkeY0y5 X-Received: by 10.55.27.88 with SMTP id b85mr2319453qkb.144.1512044506976; Thu, 30 Nov 2017 04:21:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512044506; cv=none; d=google.com; s=arc-20160816; b=TFvaG2jjATyIy+ejdMYrkvzj0joMLc1RJndjlmM/0JPj1eSyAK0GQNdYDdKfa3DAou +K0fKsqlp1DvbZHSjxsDiuo4cgNbqHtVRI4luiaJF2ddeTkwA99xzy3ZNgwpntLrUQO2 icA39DFeKc4YTz9D/HnDk8hB0c3v/oLPEH+ouHTiKhN+Tk7zGhkMNySgEenfk2nXvpD6 e3Z2NTDnaV/EV3n0sRu8GwWwy8TgNgXtpNB15XneGhExKYce1qLEyVrktxjRcUNzJtJF Sr2UcZyp61q3MANPTNbMigcYQY50aF3cUjWeBgB7jD2iwA2GZpsdEBhuNYN5cUc/Pr8v UGpQ== 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:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=5X+O3OOk6xLskE/dQYV/caYo+x/KQ1ja6Z8vTPfdKuU=; b=a4yQiO2ciXw9n8G8eQvOM74yWKRpmDC9ZCN+01ASPJLZPFJmI/uz5vHd109Q1S4VIY ywmUHwdguFZ0a3Wm8kDz23zKFzCBt1mjOq15mfzh3PuMoe6H5uSRFVOFRWYydWvyFVGK zZcJytl05fx/rsovlaDVmBEaMU9HsVIoryOEUhYDgbB4cjjKrL5XQMWo/jCnzkelKqP2 654lFmAfggyBGpS+816eQgzSUTh6usO3Z9UkMjNrxF0ksIlpzBZ1wso474bW6waI8kHZ G4H/gbtP/6h/dSd4+4f5nsw1lBzwPqcfBcEDM8TXfbRoiNzMj+RLcD7SEajQCQ87BAWb yMWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id a20si1009362qtk.136.2017.11.30.04.21.46; Thu, 30 Nov 2017 04:21:46 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 9EE1560950; Thu, 30 Nov 2017 12:21:46 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 C19B760969; Thu, 30 Nov 2017 12:03:52 +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 AA7D060981; Thu, 30 Nov 2017 12:03:38 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id 937896097D for ; Thu, 30 Nov 2017 12:00:52 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 2B2881347B92 for ; Thu, 30 Nov 2017 15:00:51 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id PaxsITGMGs-0pga76jM; Thu, 30 Nov 2017 15:00:51 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LFgKy9hcr4-0o2WJIDj; Thu, 30 Nov 2017 15:00:50 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 30 Nov 2017 15:00:17 +0300 Message-Id: <1512043220-8803-13-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512043220-8803-1-git-send-email-odpbot@yandex.ru> References: <1512043220-8803-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 304 Subject: [lng-odp] [PATCH API-NEXT v7 12/15] linux-gen: ipsec: store mtu and frag_mode in SA 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 Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 304 (lumag:ipsec-ipv6-2) ** https://github.com/Linaro/odp/pull/304 ** Patch: https://github.com/Linaro/odp/pull/304.patch ** Base sha: 4cb02e1caccb9179575e95448fd46979e17d0905 ** Merge commit sha: 32adfc64ec5b4cc2948ab55456aeba75ae6816ff **/ platform/linux-generic/include/odp_ipsec_internal.h | 2 ++ platform/linux-generic/odp_ipsec_sad.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/include/odp_ipsec_internal.h b/platform/linux-generic/include/odp_ipsec_internal.h index 822c9016b..c6f241fac 100644 --- a/platform/linux-generic/include/odp_ipsec_internal.h +++ b/platform/linux-generic/include/odp_ipsec_internal.h @@ -156,6 +156,8 @@ struct ipsec_sa_s { struct { odp_atomic_u64_t counter; /* for CTR/GCM */ odp_atomic_u32_t seq; + odp_ipsec_frag_mode_t frag_mode; + uint32_t mtu; union { struct { diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 82b3c4522..2d6321166 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -230,6 +230,8 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param) odp_atomic_init_u64(&ipsec_sa->in.antireplay, 0); } else { odp_atomic_store_u32(&ipsec_sa->out.seq, 1); + ipsec_sa->out.frag_mode = param->outbound.frag_mode; + ipsec_sa->out.mtu = param->outbound.mtu; } ipsec_sa->dec_ttl = param->opt.dec_ttl; ipsec_sa->copy_dscp = param->opt.copy_dscp; @@ -489,10 +491,16 @@ uint64_t odp_ipsec_sa_to_u64(odp_ipsec_sa_t sa) int odp_ipsec_sa_mtu_update(odp_ipsec_sa_t sa, uint32_t mtu) { - (void)sa; - (void)mtu; + ipsec_sa_t *ipsec_sa; + + ipsec_sa = _odp_ipsec_sa_use(sa); + ODP_ASSERT(NULL != ipsec_sa); - return -1; + ipsec_sa->out.mtu = mtu; + + _odp_ipsec_sa_unuse(ipsec_sa); + + return 0; } ipsec_sa_t *_odp_ipsec_sa_lookup(const ipsec_sa_lookup_t *lookup)