From patchwork Wed Feb 7 03:00:06 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: 127106 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp55848ljc; Tue, 6 Feb 2018 19:00:50 -0800 (PST) X-Google-Smtp-Source: AH8x226lIuztkF++xS9bqT7SdP5oHBk34vxFXM+UFp0dB2sGpHZjvSIZJpAEHC/+e/NOch5jldXi X-Received: by 10.55.15.169 with SMTP id 41mr6827529qkp.91.1517972450683; Tue, 06 Feb 2018 19:00:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517972450; cv=none; d=google.com; s=arc-20160816; b=Kw6WuEm91j1yATTJ4R51hcEouxjp6YVgvJJBZ+1XPveB6ZK8JkB5z05GfgQt1n5FM3 0iy9Br3e0JoCsyRvNNGldQC6i2eAn92IR4+QLmTJtfeF9lY26N3Qnp6jNgvveYhHD/2+ I1d8LHevCfl46WNKPfpdOqwq2yCEMmVeUBSwqf1Ukp/yeeLTHXzJ0IFszZSD630zah5v lxLbRcKU6ik1h/4pvuyRG73MUXFxnAF1m4JW4LFM+mWMQ2ojK9m6n9E+4S3KUVdvCaWz ibubKLDL+FibO38YpIfQFqe+GPB3bQZB+vbU+iQyjxP+ctyJi4WAHqFAddVO77O5LbDm +7xg== 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=WD+yE34MbUir3rwa1glPm7Svs+j/PjhooCibJvxQwSU=; b=Iv85i4KAg+YEVUL/iWjooE84gT4cUL3LLdoP6s+6KSCIbkNMrCxRpg8iRXnAon93mN VzSBO27vbSeFjPbTrrYT9gNQMWyxMQxJusqDVeddt130juYKQ4aHOjVVIT2QaSU+eU9L XUPxPgjjp8stNIBTEnWO938+zLz7e/AthvrRTGFoJ+p0xibNOUq6tcAegec1KHpT3Eg3 QfK6C4WKwxJG0vKFZF5K8+6wTRoHETKkqZjCsa+EERBeRfaUUIyVjRdos5cXA5qq/Fc1 7evEdRJ3wpJfhfY/WlniRBSlTR/nPw5w6hi8UAtXgfKO1p/bGtiYqh4MJVxi1TpekUAB GZ/Q== 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 31si465233qth.439.2018.02.06.19.00.50; Tue, 06 Feb 2018 19:00:50 -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 5FA0F61746; Wed, 7 Feb 2018 03:00:50 +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 12AAB6077E; Wed, 7 Feb 2018 03:00:22 +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 C76A662781; Wed, 7 Feb 2018 03:00:13 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id D7BFE619CA for ; Wed, 7 Feb 2018 03:00:11 +0000 (UTC) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 39456408200A for ; Wed, 7 Feb 2018 06:00:10 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ukYAsCANwq-0Ad8Xnew; Wed, 07 Feb 2018 06:00:10 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id HEgjZvZOzR-09ratgdt; Wed, 07 Feb 2018 06:00:09 +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 06:00:06 +0300 Message-Id: <1517972408-19360-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517972408-19360-1-git-send-email-odpbot@yandex.ru> References: <1517972408-19360-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 456 Subject: [lng-odp] [PATCH v4 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: eb3880eebfb94c83205c92a87e99dfd372a9c064 **/ 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;