From patchwork Wed Feb 7 02:00:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127103 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp20233ljc; Tue, 6 Feb 2018 18:00:57 -0800 (PST) X-Google-Smtp-Source: AH8x227pFMiLfM+SA6FFG9SWY86rUygPN8Ef4nUqNFGDK+DJLZpse8oPUxcjx3k/4kIxoBWI/uc3 X-Received: by 10.55.40.167 with SMTP id o39mr6184240qko.294.1517968857430; Tue, 06 Feb 2018 18:00:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517968857; cv=none; d=google.com; s=arc-20160816; b=zXjGzWM4qOpopW9f6AOElHfQ+KzNm8NChouyj+wUGvkjhG+RxjPNvwaonW/tAeqWRM ycN1Gv4VWqhtVMS65gPvePzO1bsuFJ/hOrrwFS/Ozdd54FBglXcYjevs0edOjJJ1x6ji IZ7D/dixTxzs24ay/5Y1s277c4ulKHLfna78piwnlNnWweRU3KCYoyKamrR/Tx5PK9SQ V9BPUcpEjJgScZ8anm57r1rinlFMJnSY4IAadW/a3fmDMPfrfYHbHDeBxADEwbm9Xmta JxqXJVVylLOwdWgP2EvYj228IV7bFiO2/lIDzyb9RIRkDWvQgP6m75pe68IMsaEliQZL LANA== 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=iar6Hhzvs6BnKvcyYPqbG+nIVO8UAZiWeIyaW0MjJBY=; b=UigdAOKzcSx1/UNQ6YWifZ1NF4BuzSxC4jNIbTBtFUzBhZUyTx2W74CWPfyLv78iCs vI8h2uC+Rs3Hd+7m0Jvo6yjT5VCM1upaPxi0AdtWtTgdOZ54AIk5dIJiCcbEezfjwniG Hk0Z3mZel+WTTKeYhnZIvUgCpVhYQEJSKPxUmmNfEnntUkxlZ5uJHh7WdsaoatyqUGQ6 yzoO9m26YAhRTmPyp94BmTCHGflJTm3kTujlAeSekqn1l2yo38n/OOVW/TAYfFSBlegN Ss0bKdIo08ohtYM1IpGRgGLG3SW+ViVd7avuqoH4af1i9+DYsINGJIqEpJO1/gfaV+bQ jHmw== 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 1si375215qko.286.2018.02.06.18.00.57; Tue, 06 Feb 2018 18:00:57 -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 0717A61764; Wed, 7 Feb 2018 02:00:57 +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_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 9CA356074A; Wed, 7 Feb 2018 02:00:51 +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 916456074A; Wed, 7 Feb 2018 02:00:48 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 478DD608A9 for ; Wed, 7 Feb 2018 02:00:22 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 7A2E65A0461D for ; Wed, 7 Feb 2018 05:00:20 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id AUDbBVtdyK-0KDOIC5E; Wed, 07 Feb 2018 05:00:20 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nKioYpbuPJ-0DVOqtLt; Wed, 07 Feb 2018 05:00:13 +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: Wed, 7 Feb 2018 05:00:05 +0300 Message-Id: <1517968807-18097-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517968807-18097-1-git-send-email-odpbot@yandex.ru> References: <1517968807-18097-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 456 Subject: [lng-odp] [PATCH v3 1/3] linux-gen: use packet pointer in _odp_ipsec_try_inline 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 _odp_ipsec_try_inline() can change packet handle during decryption. Return new package handler via packet pointer argument. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 456 (lumag:ipsec-fix) ** https://github.com/Linaro/odp/pull/456 ** Patch: https://github.com/Linaro/odp/pull/456.patch ** Base sha: 257b08b35ceea41bad5a7f1c626496cf111e657a ** Merge commit sha: e8666889f21113d1d24bf1d03ccd0bde538eabf0 **/ platform/linux-generic/include/odp_ipsec_internal.h | 2 +- platform/linux-generic/odp_ipsec.c | 10 +++++----- platform/linux-generic/pktio/loop.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/platform/linux-generic/include/odp_ipsec_internal.h b/platform/linux-generic/include/odp_ipsec_internal.h index bdb86c400..8a7b42c50 100644 --- a/platform/linux-generic/include/odp_ipsec_internal.h +++ b/platform/linux-generic/include/odp_ipsec_internal.h @@ -262,7 +262,7 @@ int _odp_ipsec_sa_replay_update(ipsec_sa_t *ipsec_sa, uint32_t seq, * @retval 0 if packet was processed and will be queue using IPsec inline * processing */ -int _odp_ipsec_try_inline(odp_packet_t pkt); +int _odp_ipsec_try_inline(odp_packet_t *pkt); /** * @} diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 586653d4e..0ef8b88a7 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -1628,7 +1628,7 @@ int odp_ipsec_out_enq(const odp_packet_t pkt_in[], int num_in, return in_pkt; } -int _odp_ipsec_try_inline(odp_packet_t pkt) +int _odp_ipsec_try_inline(odp_packet_t *pkt) { odp_ipsec_op_status_t status; ipsec_sa_t *ipsec_sa; @@ -1637,7 +1637,7 @@ int _odp_ipsec_try_inline(odp_packet_t pkt) memset(&status, 0, sizeof(status)); - ipsec_sa = ipsec_in_single(pkt, ODP_IPSEC_SA_INVALID, &pkt, &status); + ipsec_sa = ipsec_in_single(*pkt, ODP_IPSEC_SA_INVALID, pkt, &status); /* * Route packet back in case of lookup failure or early error before * lookup @@ -1645,14 +1645,14 @@ int _odp_ipsec_try_inline(odp_packet_t pkt) if (NULL == ipsec_sa) return -1; - packet_subtype_set(pkt, ODP_EVENT_PACKET_IPSEC); - result = ipsec_pkt_result(pkt); + packet_subtype_set(*pkt, ODP_EVENT_PACKET_IPSEC); + result = ipsec_pkt_result(*pkt); memset(result, 0, sizeof(*result)); result->status = status; result->sa = ipsec_sa->ipsec_sa_hdl; result->flag.inline_mode = 1; - pkt_hdr = packet_hdr(pkt); + pkt_hdr = packet_hdr(*pkt); pkt_hdr->p.input_flags.dst_queue = 1; pkt_hdr->dst_queue = queue_fn->from_ext(ipsec_sa->queue); diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index 0cf45acbd..79c21ee7a 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -156,7 +156,7 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, /* Try IPsec inline processing */ if (pktio_entry->s.config.inbound_ipsec && odp_packet_has_ipsec(pkt)) - _odp_ipsec_try_inline(pkt); + _odp_ipsec_try_inline(&pkt); pktio_entry->s.stats.in_octets += pkt_len; pkts[num_rx++] = pkt;