From patchwork Tue Dec 12 16:00:19 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: 121558 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4329086qgn; Tue, 12 Dec 2017 08:20:54 -0800 (PST) X-Google-Smtp-Source: ACJfBotCiOjPma2Ec8OKFajUsW4sWl2PnvAXAEv84IIs48S3KQALoMjs6763cqiLZyAMOTKUqC1T X-Received: by 10.55.18.92 with SMTP id c89mr6059173qkh.297.1513095653880; Tue, 12 Dec 2017 08:20:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513095653; cv=none; d=google.com; s=arc-20160816; b=KRgd4WSK+aMLpVSxZzHKDpoh+reDA7WLaWgzzXDt4ivRf4icmtNh/yHbBMkGOxOyN6 tjWOWLW0JOuvWcK4mBh+Emq/Eip8ypig4B+xdYQyBcK/Ch+rOEjfjmXDkmafnUjkFgrm w6iSaHfPoGKAs9OOQeHkIugzZMmGBIINYtVaSwmOK8dHIyJrp2L/V0pUxc08/TJv3nQC h5t2e+fcvXZ5P9JpPgKi2B0NHNm/POCimqt14SwPJklOwL8sTtx2+hdqsYuo83Sk/HkX mTG6ibHeCqVSHrsc3Dk2RtI1OP3/RBTu8k6w1zYYTqkbucS+eQlEDHgDhZQd3RrGqt0q Dvhw== 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=2A71flASoKAYLuhmZwayB5b9a4jOt8yxr8ut4QWQzhc=; b=kQ9mrJquDbHOvZTpFMVUPH4oEGQVvSDbGNUukqAgrp62fOJXQZ/eluFcn4zHIeWVQ3 SC5Enm2ab/3kiXv1DMfs5AR1Tgk6r4JfACT9pIKA53yaRA/KsUB1ZCwHtH8xgUel2f9J ugweoq2I6hVcvbTNWek4QcbYW73juD1E0vzfi6g3x1EPgQT6nKu5kyQnUxoPAET5Tylq j+sErYEa1t4TtbciyuqYbLW0JcRuMEvf1A1DgC8pp5FvYSGr4P9L8+UUAre/8g1zQ0sL QWkuOVs9vTb9Ff6kdv1INiJVP9KwMBNYYh0/hZ6PMwClxKWeQowLIgQ8Nzs8ANWWVmoq nFFw== 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 p88si1533819qtd.225.2017.12.12.08.20.53; Tue, 12 Dec 2017 08:20:53 -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 6E5C860800; Tue, 12 Dec 2017 16:20:53 +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 E7F4F6098A; Tue, 12 Dec 2017 16:05:31 +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 D123D608EE; Tue, 12 Dec 2017 16:05:20 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 5DABE608EE for ; Tue, 12 Dec 2017 16:00:40 +0000 (UTC) Received: from mxback13j.mail.yandex.net (mxback13j.mail.yandex.net [IPv6:2a02:6b8:0:1619::88]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 4C0FB1801865 for ; Tue, 12 Dec 2017 19:00:39 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback13j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id GeoO8yCXby-0dAqVqRc; Tue, 12 Dec 2017 19:00:39 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id P8VUaNg7sx-0cFSMlhT; Tue, 12 Dec 2017 19:00:38 +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 19:00:19 +0300 Message-Id: <1513094423-671-13-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513094423-671-1-git-send-email-odpbot@yandex.ru> References: <1513094423-671-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 304 Subject: [lng-odp] [PATCH API-NEXT v11 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: 2212038b2ceac423819d283ce07106fabe438631 **/ 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)