From patchwork Thu Nov 30 12:00:18 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: 120163 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp594666qgn; Thu, 30 Nov 2017 04:21:02 -0800 (PST) X-Google-Smtp-Source: AGs4zMY0F5SVTQY2vDoVjZ3kRugX+LyOzWRVvDWaMahUnNANJy/tyFZNF+dw9qNVdQzrtbCZ9zLK X-Received: by 10.200.55.75 with SMTP id p11mr3082966qtb.298.1512044462665; Thu, 30 Nov 2017 04:21:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512044462; cv=none; d=google.com; s=arc-20160816; b=nr6Ji0hN+0B0v6BjJUkYJqaFA2puMsL89Z4aKbB6zfPkI8IvfrSA2lwWoJpUepOVd6 s0F1x2BctpPiYPczGbcoU/jR6HBs81X6+fESID1IaoRoNCesoHzPzjbytxUVQa3AH6ND TRH+umMbOjc0ND88TTixln9ljKOW9Y+MtgqhieC/gV42b7HuJ1IY13Qibpp3bSz+GLzN 5wAOFOAUAfVotaP9wIKJv5sBrxUW0frUPtavrjq90UMty5F3tOL19TlXtuGsVPFh161a fwsyySAYA9Z+k9abVqsRMu5Fzyxtzm1Yy6OoVj7BuakV5QC0Q6lYMtaePP0dWATS2h5u ojcA== 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=xsz7svs1ri6nzQNNDGRDxnTu/3AG6P8/9qLaaxLB8Ao=; b=kcGP821n7NgR+m0F01ixw/07QMk4wCZEIYgHJ/3BTcizqcm8OSwwbhStuZDhaxX/gD j+McMxo53LPzRhZGng2EthXLRPXDXIm9tyqDvmv6yaS31DtlM3fotJNQfgupMIIzPcDs M/4hWR5H6XkjVU8UImiu8efNmFvRfsXefUdKD9BlFu2iFUBKP0DCQKfgWsOLjJOTdVMp 109RguyjqSGDRhWkmnvbjtp7aSupRdS6E659kPAMfR+zzXfIEraFqOFdNm38loUn4JJj upD67F3X5vzD4Alh8D3z9X27INcEjWo318so8QxySAjwHw05iM3yVEtubs/rdUS0tqLi kgMA== 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 b31si4089353qtc.303.2017.11.30.04.21.02; Thu, 30 Nov 2017 04:21:02 -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 442E260948; Thu, 30 Nov 2017 12:21:02 +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 720656094A; Thu, 30 Nov 2017 12:03: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 E49FE609CA; Thu, 30 Nov 2017 12:03:37 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id DFC6560981 for ; Thu, 30 Nov 2017 12:00:52 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward100p.mail.yandex.net (Yandex) with ESMTP id C9DE551036C1 for ; Thu, 30 Nov 2017 15:00:51 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id IeCu0WJM23-0pbOKIT9; Thu, 30 Nov 2017 15:00:51 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LFgKy9hcr4-0p24gqAk; Thu, 30 Nov 2017 15:00:51 +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 15:00:18 +0300 Message-Id: <1512043220-8803-14-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512043220-8803-1-git-send-email-odpbot@yandex.ru> References: <1512043220-8803-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 304 Subject: [lng-odp] [PATCH API-NEXT v7 13/15] 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 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: 32adfc64ec5b4cc2948ab55456aeba75ae6816ff **/ 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 4a33af8ea..cd168d080 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -1021,13 +1021,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; @@ -1055,7 +1055,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 8bf4ced4c..3c539b515 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -1228,7 +1228,7 @@ static void ipsec_out_ah_post(ipsec_state_t *state, odp_packet_t pkt) 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_state_t state; @@ -1402,7 +1402,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, }; @@ -1426,7 +1426,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)); @@ -1534,7 +1534,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)); @@ -1626,7 +1626,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;