From patchwork Tue Dec 12 17:00:43 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: 121596 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4399513qgn; Tue, 12 Dec 2017 09:23:41 -0800 (PST) X-Google-Smtp-Source: ACJfBouU0Tz14BxOMJrnvbiNch1BbAxPbkTUSVmCWTHLDEooon+8nqxqsmXtdwt3u0w/YxDArlKr X-Received: by 10.55.138.68 with SMTP id m65mr6178273qkd.129.1513099421300; Tue, 12 Dec 2017 09:23:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513099421; cv=none; d=google.com; s=arc-20160816; b=Z1EHLRJET54b/9DRK+5vz6m6lVT2EBoHz6vl39s24wjNu6ktcOoyYSW6fE5CSPG5uB +YQYmEA8MrIgczAQx1yR2rUVEYQs6kbrKhMoUh8Feegcyl7p18kGvE8mG3g953hJ68mJ kPMAO87vfsRJH3UJKwLeTVnb7Wzi7V3xwD+uSklzpuaqUdmLJpiC8djceILuSqKXEKFa VPi3st1H59eUAMr/bw9q51XyZppKHrrGSnGdrhVWVGfL5oq8ku0xt800bt6SIM60LHZD NoQmdEpg+SaaY6CgmemHMhwFge7JuzcdxFLbdacA3BZ4dKhtMncsgIaUJEk5PbEtcbok lD8A== 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=Gb3rx4bDqjpm2NjbB8A/fwQGeBD4HTo4kNb43OQInqg=; b=xeWDeentJRj+s5A9m54GPqOU9mJnZaa959DjTk8Jb4+RV7brg7In4G4N/lz2b6OIGs Z03vLRwtYS310KRKVOS798ll4RvrQUzF349m6WopnFU2OqsU3yYU9NVVbC8gAqYupBNW RAamjA1QsjvtBgTQuEmQ4UC8dYPfuIs2jZ2Rp8n6xTLrJgLo4kVddxr47OX5m+snYFQG h+GcMA2iJinRy2v1tzMpTur/XejSsiD675pj3Vg0yVPkNLcLxRFob0xsjaLRRBT4G8Ni Llgasg2DfS74hcx+cu61aNUG/6eLn8qaxn9tf6dkiapprRoMl/cCmp8rCX7VlS4JYCGS fosw== 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 f30si1594180qtf.297.2017.12.12.09.23.41; Tue, 12 Dec 2017 09:23:41 -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 E471660840; Tue, 12 Dec 2017 17:23:40 +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 C5D1260981; Tue, 12 Dec 2017 17:03:33 +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 2D7946097F; Tue, 12 Dec 2017 17:03:17 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 4B1FD608BC for ; Tue, 12 Dec 2017 17:01:06 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward100j.mail.yandex.net (Yandex) with ESMTP id DA68F5D8394D for ; Tue, 12 Dec 2017 20:01:02 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id EjW1RDl6Se-12iK4bgA; Tue, 12 Dec 2017 20:01:02 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id O5YE7TQVzQ-129mxMkq; Tue, 12 Dec 2017 20:01:02 +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: Tue, 12 Dec 2017 20:00:43 +0300 Message-Id: <1513098047-19804-13-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513098047-19804-1-git-send-email-odpbot@yandex.ru> References: <1513098047-19804-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 304 Subject: [lng-odp] [PATCH API-NEXT v13 12/16] 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: 65d690fbcf03c6a4d5eb3f01bde36807833feaaa ** Merge commit sha: a17bf2b46352969fad4fbaf801dc8b5da0de7a78 **/ 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)