From patchwork Wed Oct 18 14:00:22 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: 116309 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6121439qgn; Wed, 18 Oct 2017 07:18:44 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TdIodzswUcNUzvqMBuOtOdbUiRyz1876L8ZU0D6WdKPIutehZiYKGimtbxccK56N0iUZAt X-Received: by 10.107.138.10 with SMTP id m10mr22772982iod.164.1508336323595; Wed, 18 Oct 2017 07:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508336323; cv=none; d=google.com; s=arc-20160816; b=hHyPIGecCvM1Bvwj4RzjXFTm+tmrTSr8iSM4xQaGohodQs8cHe3c7emmT2PJM91wCe 0/hI7XbiIVxamSQmD53h3zuoS1SF9YP0jU6QYUqSKdw/+x/JVQM11+Y8EGYmJqaau74C 1WMLl8AlDd/fuiOhuueD2w5KSaHd9+OlLeTA264SCSRkNUbDIn1UxLfG/drWrpTzhTES kiu+9FaxyPO1OsDapYToFu16F96eYGBVqdP8k9drPFsH1oLmEUFqOCX8TduFMAK4fqAE kkUN+HtGQRniHs/rCJcxwF1ongQ0SK9NGGWuEZ9u29sUCJqlagr/zaBMtVKPBqlYBbCw a0YQ== 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=e4ZHASfneCauxjZmO104p6IzHBDl0h4Jk9DIgx86/uI=; b=dadYBNhqRmDty0yWYIloNYQuLL2Cc08G9r/Ps3zD0JRYIl+EU3HK9j0GgxC3p2ATdp ftyJ7GRY+wAF7Qiwc4c9xABMVeJovypUbbceQRb1mwRrXoEkG3zgiSf/unpRt2lJ0FsM J9NeaelV9MAXkfusB/6b2ZRnE++4AwiFmU8APT4FeU2/1TAtGykdzpDrPfkrorXiiXDt FigdxMaQFPxZFjT0vi9a9GBy2wHSpysyL85ResaaxVLRDHbuIbqD0Ux84RyK9jXCEXnk cyoUWkLsTFsXknGlf6TVm4/p1paPRyXBmCpO2tBbKB5aj5LqnKyanb9ujwZx7o6THd0u h14Q== 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 f186si4790173itg.136.2017.10.18.07.18.43; Wed, 18 Oct 2017 07:18:43 -0700 (PDT) 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 120C662DCA; Wed, 18 Oct 2017 14:18:43 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, 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 35196628DB; Wed, 18 Oct 2017 14:02:24 +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 B014C62A7E; Wed, 18 Oct 2017 14:02:07 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 23B35628D5 for ; Wed, 18 Oct 2017 14:00:50 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward105j.mail.yandex.net (Yandex) with ESMTP id BA9C0182FE3 for ; Wed, 18 Oct 2017 17:00:48 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vOcPszYhJT-0mEuqrnP; Wed, 18 Oct 2017 17:00:48 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ELMppi1EYu-0mjiohN1; Wed, 18 Oct 2017 17:00:48 +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, 18 Oct 2017 17:00:22 +0300 Message-Id: <1508335223-15608-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508335223-15608-1-git-send-email-odpbot@yandex.ru> References: <1508335223-15608-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v20 9/10] linux-gen: pktio: loop: support IPsec outbound 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 Add support for outbound inline IPsec packet processing on loop interface. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 81 (lumag:ipsec-packet-impl-2) ** https://github.com/Linaro/odp/pull/81 ** Patch: https://github.com/Linaro/odp/pull/81.patch ** Base sha: edca8cd1e55898826f79383b689c2c4bd2c28b3a ** Merge commit sha: 750318196a0c07a634c4755e4da9131a9f11f6f1 **/ platform/linux-generic/pktio/loop.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index eba6d3b03..f36dcee48 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -164,6 +164,22 @@ static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED, bytes += odp_packet_len(pkt_tbl[i]); } + if (pktio_entry->s.config.outbound_ipsec) + for (i = 0; i < len; ++i) { + odp_buffer_t buf = buf_from_buf_hdr(hdr_tbl[i]); + odp_ipsec_packet_result_t result; + + if (_odp_buffer_event_subtype(buf) != + ODP_EVENT_PACKET_IPSEC) + continue; + + /* Possibly postprocessing packet */ + odp_ipsec_result(&result, pkt_tbl[i]); + + _odp_buffer_event_subtype_set(buf, + ODP_EVENT_PACKET_BASIC); + } + odp_ticketlock_lock(&pktio_entry->s.txl); queue = queue_fn->from_ext(pktio_entry->s.pkt_loop.loopq); @@ -213,6 +229,8 @@ static int loopback_capability(pktio_entry_t *pktio_entry ODP_UNUSED, odp_pktio_config_init(&capa->config); capa->config.pktin.bit.ts_all = 1; capa->config.pktin.bit.ts_ptp = 1; + capa->config.outbound_ipsec = 1; + return 0; }