From patchwork Thu Sep 7 11:00:17 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: 111877 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp639005qge; Thu, 7 Sep 2017 04:03:09 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDBZsA8kGYJexMhW3vEzlY0Rc87rnRZ/MMCDDHqxJsux+dykCHQf0iO5nxIfT/GGWXmxbxV X-Received: by 10.55.22.218 with SMTP id 87mr3006078qkw.248.1504782189828; Thu, 07 Sep 2017 04:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504782189; cv=none; d=google.com; s=arc-20160816; b=lFd7TyU+e/iebUjP/NUMv9+MJSiSAKKMv69IM9hgZX1W3Zp1U37mAYFvlMpZx2fQYW mbxzZEMXxsSdqIYhNiGUKKvBUwRG+3lcptMpEm8hYVRTA6Mk22UtsCJHPLegz6IXfTco zK7ItMbX9PY8mod0jCQhfgcM3egy3rTTh6aFXaZZYNgqWOgFQiZDaQ5IdPnZSKHZLOLq gBmCLir7Wqbp9UJRBuWaSYE4aHFMCeSyyzYOhHdfWdxQqJUajV/odtpa7W80cLewAShZ 7QmBab3yxWExYsKA9EvoG/r8/+zwif8Fn5UZNGtyGMkX+bUo9PX89MJxXBty9dM0yBN7 tudw== 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=aP8KkhldgF/Ngknohd9xjGtgIb3qMQ43nQdZPMYNc4g=; b=Lrog4KqCk4Zoo5Por3OLkGjTp2owNO4oZl66gQiR5zkJcHOZmNkpyBl5drP/hHHCVX hxOio7aay60RdiXLQrk5tePvGDNIwRcFEUp1jHgX0LUq1YXY9bm2MZzYjkLeMi2SeCfI 6T3eXzBqDc+WMwGn2JnJyDIKt3/vzo5aTT3GjlAuBYvRQ4AdQ/Zctuk/Dd1e3jqgSoGq SmJOf41aEl+NzLx2sjD4QYBuAIw2WaLNnxCiNSjuqL8O4w6CXlov1bFYKTd3rqwpt3la 61fzwOXnNKPYKIKYJgWEVPA3N5OX3dAjeZWQx2OfM/WG4ifenFE914nv/gVLuRupuqCB EMlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h200si2358666qke.36.2017.09.07.04.03.09; Thu, 07 Sep 2017 04:03:09 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 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 421756449C; Thu, 7 Sep 2017 11:03:09 +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,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 33CC264479; Thu, 7 Sep 2017 11:01: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 C9A9063CB3; Thu, 7 Sep 2017 11:01:38 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id B3468644AE for ; Thu, 7 Sep 2017 11:00:49 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward105j.mail.yandex.net (Yandex) with ESMTP id B9D5B180ECC for ; Thu, 7 Sep 2017 14:00:47 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kZWBHObEFc-0lQaClje; Thu, 07 Sep 2017 14:00:47 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id r5PzEbFEu0-0ldStuZw; Thu, 07 Sep 2017 14:00:47 +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, 7 Sep 2017 14:00:17 +0300 Message-Id: <1504782024-26631-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504782024-26631-1-git-send-email-odpbot@yandex.ru> References: <1504782024-26631-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v16 2/9] 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: 7fa8e2c97ed18f8dd6e95cbc78b7e668ccb98869 ** Merge commit sha: d0f4ea10655492b00c1a40e85a0ba837f06f97c5 **/ 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 428b6ceb..6cc86e6a 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; }