From patchwork Tue Nov 28 14:00:07 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: 119866 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1750212qgn; Tue, 28 Nov 2017 06:05:23 -0800 (PST) X-Google-Smtp-Source: AGs4zMaK9OGdcRiK8xZfS5cIsFfHUMMWinRmhzPp2cGlMl5skpE3tTsbDaRjVy11emAVqOXltEaR X-Received: by 10.129.38.195 with SMTP id m186mr4472772ywm.323.1511877923004; Tue, 28 Nov 2017 06:05:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511877922; cv=none; d=google.com; s=arc-20160816; b=xRGyxsPgfMOo/EniVqKLt1hf2GUaGqL4ee5w1/CcfSmpYeEYjz33rZ37I9Azikvwxt XHbwtJTLXuXfMKlPOBHsDIVNqOXPIRNTt3zAqNvBAn6Fw7f04ML/8UeRSGU27WHu35hM jHPfbyGoOqhm1rkCYxIUA4faXIYMnKvoSHz+AgIMXVGEwwu3r8Lsr5Xo37P3pLkwBpWa kiKRv2k+HvLcDLAP9jv3ce5s5kit25lb3Qp2h/sq6rBFB4RYfntaNLUaBDeO+PpdjeRQ Yv8ohNjIl39JH8XqiM6trsJ8mT6B5oBK8Ml3/VDivJ/3x3q2ert3895InkbEredlNhJk +6Ug== 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=pI+QCWFtTAdQQOOaUV+Q5/QpRfIABVH8j3nP44f7Vo4=; b=YJ1iGUNFTD0xlyu65eh31Bs/ufXKYs2IFqQqyRPLv3crdz6B2vqmQrTABpKMq/izSO udzPzndDfbfLi1OL7fPpHGa600q1yvrV4VLU7Xx9Fwr/IJhMsCP87zmkQ5EEUTOZ7+WA tU/0cjtEUOwpl37EuUvuhObUBbplJB6Ia+B418x5YNma1sI2bSRbm8UQ9iOIRV5U4lX+ fp81DgWOHNh8fiCTFWVux+yC+3U7wkhBEF/us0oZebJas/YvehmhR4e3aAL8gg/VgJI0 tOEmH8rv0MA95pFH5o/ZhRzzX/wxaWExiu+AxsO6CNu/MRBam/vDgc50HJ7QB/PwV3ky RE7Q== 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 o15si6387662ywm.737.2017.11.28.06.05.21; Tue, 28 Nov 2017 06:05:22 -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 8CB8860918; Tue, 28 Nov 2017 14:05:21 +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 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 AC64060925; Tue, 28 Nov 2017 14:00:49 +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 E3372608E7; Tue, 28 Nov 2017 14:00:26 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 48035608CD for ; Tue, 28 Nov 2017 14:00:12 +0000 (UTC) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward101p.mail.yandex.net (Yandex) with ESMTP id C828D6A83104 for ; Tue, 28 Nov 2017 17:00:10 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id x3OImVVhi6-0AHubXoI; Tue, 28 Nov 2017 17:00:10 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id R6uPpMU1hR-0AQSjPrX; Tue, 28 Nov 2017 17:00:10 +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, 28 Nov 2017 17:00:07 +0300 Message-Id: <1511877607-32699-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511877607-32699-1-git-send-email-odpbot@yandex.ru> References: <1511877607-32699-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 311 Subject: [lng-odp] [PATCH API-NEXT v1 3/3] api, linux-gen: ipsec: constify in/out params 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 Mark all input and out params as constants Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 311 (lumag:ipsec-caps) ** https://github.com/Linaro/odp/pull/311 ** Patch: https://github.com/Linaro/odp/pull/311.patch ** Base sha: 4cb02e1caccb9179575e95448fd46979e17d0905 ** Merge commit sha: aa57ba9cce8dd6a7ae0d02117c362aa07d0985a4 **/ include/odp/api/spec/ipsec.h | 6 +++--- platform/linux-generic/odp_ipsec.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 697278f90..daa5d92ce 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -1030,13 +1030,13 @@ typedef struct odp_ipsec_out_param_t { int num_opt; /** Pointer to an array of IPSEC SAs */ - odp_ipsec_sa_t *sa; + const odp_ipsec_sa_t *sa; /** Pointer to an array of outbound operation options * * May be NULL when num_opt is zero. */ - odp_ipsec_out_opt_t *opt; + const odp_ipsec_out_opt_t *opt; } odp_ipsec_out_param_t; @@ -1064,7 +1064,7 @@ typedef struct odp_ipsec_in_param_t { * * May be NULL when num_sa is zero. */ - odp_ipsec_sa_t *sa; + const odp_ipsec_sa_t *sa; } odp_ipsec_in_param_t; diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index b17e4cd7b..18ae8ece4 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -582,7 +582,7 @@ uint32_t ipsec_seq_no(ipsec_sa_t *ipsec_sa) static ipsec_sa_t *ipsec_out_single(odp_packet_t pkt, odp_ipsec_sa_t sa, odp_packet_t *pkt_out, - odp_ipsec_out_opt_t *opt ODP_UNUSED, + const odp_ipsec_out_opt_t *opt ODP_UNUSED, odp_ipsec_op_status_t *status) { ipsec_sa_t *ipsec_sa = NULL; @@ -998,7 +998,7 @@ int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in, return in_pkt; } -static odp_ipsec_out_opt_t default_opt = { +static const odp_ipsec_out_opt_t default_opt = { .mode = ODP_IPSEC_FRAG_DISABLED, }; @@ -1022,7 +1022,7 @@ int odp_ipsec_out(const odp_packet_t pkt_in[], int num_in, odp_ipsec_sa_t sa; ipsec_sa_t *ipsec_sa; odp_ipsec_packet_result_t *result; - odp_ipsec_out_opt_t *opt; + const odp_ipsec_out_opt_t *opt; memset(&status, 0, sizeof(status)); @@ -1130,7 +1130,7 @@ int odp_ipsec_out_enq(const odp_packet_t pkt_in[], int num_in, odp_ipsec_sa_t sa; ipsec_sa_t *ipsec_sa; odp_ipsec_packet_result_t *result; - odp_ipsec_out_opt_t *opt; + const odp_ipsec_out_opt_t *opt; odp_queue_t queue; memset(&status, 0, sizeof(status)); @@ -1222,7 +1222,7 @@ int odp_ipsec_out_inline(const odp_packet_t pkt_in[], int num_in, odp_ipsec_sa_t sa; ipsec_sa_t *ipsec_sa; odp_ipsec_packet_result_t *result; - odp_ipsec_out_opt_t *opt; + const odp_ipsec_out_opt_t *opt; uint32_t hdr_len, offset; const void *ptr;