From patchwork Thu Nov 30 13:00:11 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: 120182 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp651471qgn; Thu, 30 Nov 2017 05:12:49 -0800 (PST) X-Google-Smtp-Source: AGs4zMZVjOW/ShkSMLYJRQASxdB71l65gDyvoKb8pCvOyRAKMJJt12b0mmpW5mqfFSQ8LuIYi3Qp X-Received: by 10.55.221.80 with SMTP id n77mr2590536qki.279.1512047569129; Thu, 30 Nov 2017 05:12:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512047569; cv=none; d=google.com; s=arc-20160816; b=M83cGCjGT0r0R0RYMvblBM3ejxHB51vkEEmODNXWa7dimHucopnS2iOv0ZhseVrcTE eKXvUp05RomBdUpfAM6YEZ2/jscLeMrPuySUmy5b3uC5RZjHu2hEt6BhqtozSDpSfszh gRHd3Z7SqFfPqV0EtbKBCz440c/xdowwK/1j7LR5SwJ3nePpR5YG8UZdtYMPLPnDwfZh tAvqkbx7CiXpiJfEFKyyDWrFUlxqU0NDkgyk+K4tjH+wkwyb6N/EHcJBKtZyxRfyZs5W 0EbRDcWnV7UvGwYWjKbxeH46bYGbXdI1zjL0KxinPWTfOMMPlhUrYBm7Ux/+J848RqVW 774w== 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=soyQvONBMmVDouG+JFW1dInH7gO79o87Hx7HDxIgTYk=; b=ixDFcCd23/2T2fvoQd3Qv0xUZ7SR9loDtg68GGE34PJEsO7ibIO6At+rd63r4hBJ0V dSFHSi2JM8pzLz1NJs1s+VpayTy67OTYVlS1X/LU3FCWV23N7M2wsje6u1jTDdRt70IW mwLOeFaZ7snGHo/P3z69xlxlxMD6ybKlFRoWuNsgMvhcC1wx6ByM3HUGabOF+1lz/fky gyJfm/HtHwEC0k42zKGHqR94ZhV5KDQs/QjsfWc+emjxUODrCVBTPux6rLvw4Sty4/CW vrwPecMhchLF4nrG/ihrqk63d5zwMeZo8XHtGJOhzmc/dHZCSx2Nm8wR4ri8f7iw/VFI tA7g== 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 d200si742247qkc.60.2017.11.30.05.12.48; Thu, 30 Nov 2017 05:12:49 -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 BDA1B6097C; Thu, 30 Nov 2017 13:12:48 +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 1913260982; Thu, 30 Nov 2017 13:01:46 +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 4A3DC6092C; Thu, 30 Nov 2017 13:00:50 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 10E2D60190 for ; Thu, 30 Nov 2017 13:00:29 +0000 (UTC) Received: from mxback4o.mail.yandex.net (mxback4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1e]) by forward102p.mail.yandex.net (Yandex) with ESMTP id F2D0D4306B2D for ; Thu, 30 Nov 2017 16:00:27 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback4o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id iwD2xyR7Am-0RJ4E9j4; Thu, 30 Nov 2017 16:00:27 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nOB9mYWTNF-0RGabuiV; Thu, 30 Nov 2017 16:00:27 +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 16:00:11 +0300 Message-Id: <1512046815-10630-13-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512046815-10630-1-git-send-email-odpbot@yandex.ru> References: <1512046815-10630-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 304 Subject: [lng-odp] [PATCH API-NEXT v8 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: 4cb02e1caccb9179575e95448fd46979e17d0905 ** Merge commit sha: 6f6906b608f0626d119b255b3733a4a0863aa8d1 **/ 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)