From patchwork Fri Dec 1 00:00:16 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: 120297 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp471939qgn; Thu, 30 Nov 2017 16:20:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMbuBQrRlaVpVKweAj+/ry8VUa4+CucorjhSbJp2SfYONq/3/LCmrREqEpGtyBB3iGRAm8n1 X-Received: by 10.55.22.221 with SMTP id 90mr5267454qkw.284.1512087620645; Thu, 30 Nov 2017 16:20:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512087620; cv=none; d=google.com; s=arc-20160816; b=XiGrZLYup4ty4CFqlK5ICoezJAYXesBwDbM/syyRwNH8p9PF8VlfYVLVuH91ezZpMk nLqxEJJwE0YZfm4YQdLn6JlePupKGVdIUIMz8V8HqAzhfTf15xIGdm2j2ATLWjHBG/EA b6H9e70N09CitXqR0JUZr/hFUEsnEd6KIHuYZ6ilB7cZ4Fxb1YrpwabzZ+3Byz4UnMVq t138bi6RFXbKMvWfXA7VP4VJ64iAVYef7RcU6QZ26iblfTQnEyYGQqUQ0MbZuM9fkcgA sdyYiaIxhgGmfN8LkKUPylVdhiJ+U8vzIk+CGq/np6rwNKr90qpnD02KHcizOA7W9ssv odIw== 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=6t9UlRVXjo6KshaKeRcmUfTVdVCl5sBIBTWh+R0eJz0=; b=YYbO3iRSpTAi0ZVs32z2sPs+jvQ0zioCGKMzJWWqOY+QI60WH1e99+atJF1yLDsV+8 uci+je6U+VIuoWAwAJ9y0Ftvs3okzdb60WQIWy5a1XqufG36N1tiTVZAzazSFrLJAMsi wEzEy3BKK4mfOiqJJNK6FKfv2OzVnWGZ3lyohIHATEjGg5rOp1f6/Nr0VboeSW0YwkN/ 7ma5UfgjftzA6Nk0eJRolsy0dCzA4KWv2+2dPUhLmbkOjMov8pVPQsR/nvNedYB0wvMj w3vm20Gf/fncvOrU5eLQxuv7VIisDmzSq04kr7cVYwJLXKUNuAp9tGt8cP3Y2DTsKp4h gzUw== 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 l3si5580272qtb.307.2017.11.30.16.20.20; Thu, 30 Nov 2017 16:20:20 -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 44144609BE; Fri, 1 Dec 2017 00:20:20 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, 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 67C0C609EF; Fri, 1 Dec 2017 00:03:32 +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 3E6BB60988; Fri, 1 Dec 2017 00:03:01 +0000 (UTC) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [77.88.28.109]) by lists.linaro.org (Postfix) with ESMTPS id A7A066097C for ; Fri, 1 Dec 2017 00:00:32 +0000 (UTC) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward106p.mail.yandex.net (Yandex) with ESMTP id 2F4892D86B18 for ; Fri, 1 Dec 2017 03:00:31 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id rHLeJ4988j-0VGG6vH5; Fri, 01 Dec 2017 03:00:31 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id aHHHtahweJ-0UHOEQ3s; Fri, 01 Dec 2017 03:00:30 +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: Fri, 1 Dec 2017 03:00:16 +0300 Message-Id: <1512086419-25786-13-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512086419-25786-1-git-send-email-odpbot@yandex.ru> References: <1512086419-25786-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 304 Subject: [lng-odp] [PATCH API-NEXT v9 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: bdb7cbf620ada8682c89b5ae5a97cb84f16c0ed0 ** Merge commit sha: f0a7b395adeff8e67fc86f5ee4ed6edfbe3fabaf **/ 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)