From patchwork Thu Aug 24 12: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: 110895 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp5564537qge; Thu, 24 Aug 2017 05:06:22 -0700 (PDT) X-Received: by 10.55.207.86 with SMTP id e83mr7736014qkj.108.1503576382044; Thu, 24 Aug 2017 05:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503576382; cv=none; d=google.com; s=arc-20160816; b=Aqke7f3JmWxed/yn9VzcagEeQTVa9b/EWRnge1ePOxx84clsMEti1TwGIouMt/DCnD Zy9vP/uAsKAc7jKNM1xmuyxOtb6MQe4xfXA9I4ZG4MKwHZeyXdLH1/eyeHt3K4XSVTRD 7Sxf/7NPOESWXtyMj5tnV5rJHUh2snXNTdQwqgZWLUSX/U+cjeYVhspoekTq4JU5hB/9 9BFQ3qW9Avzomn+pjxTbSePpEhtSyngqIJ0JTHwh56MIBGOdSyGnZm6BBX3uBXf5GDt0 meSzJMZYIs1Schv84DUN5ZyA1jGT4LHc+Luaw01Q/yCiyh2PhC3nJjkEvRXWPglCmXUc nZgg== 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=8x3tng24EdIYNVyqACWLPZ4vihGpcU6vGGsPesc+oO4=; b=UKwUzbYuvlEZcCikKLtTlmKCG/RS/C3e+ueoadNWlDevpbO9aNeKu9Vzjnjih25382 F42xYNNpUD1KiT2gAMXf0decOpGNN5OxQtlf7sF/tRJpjQMeIU9lTvo5sYS5zUKfQJBD KZb5pY5EUg9OjFdcuucjXrbpPc/D68td8Cmofa8dk1GzJprC0n+x2ucd+vwXfzDQ/dyq wTRTXKtMwRaU5fq5Wylz8CeClwdGw9fKH3AIOWLINcEomWPp4jHDb+J5chRHn2vPmEd2 65MeM8C4MpeHN0la4E8xxu+975G92gBaxi+ynUqNwG3eqDqpNDaYmye4BNqsQqXnXPxo lS/A== 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 s63si3734177qkc.312.2017.08.24.05.06.21; Thu, 24 Aug 2017 05:06:22 -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 9B3EA64490; Thu, 24 Aug 2017 12:06:21 +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 A13CF64465; Thu, 24 Aug 2017 12:01:55 +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 9326164468; Thu, 24 Aug 2017 12:01:32 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 7272B64464 for ; Thu, 24 Aug 2017 12:00:40 +0000 (UTC) Received: from mxback7g.mail.yandex.net (mxback7g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:168]) by forward103j.mail.yandex.net (Yandex) with ESMTP id 321BE34C56C3 for ; Thu, 24 Aug 2017 15:00:39 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback7g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id hRdpLKyA2g-0d24wsxm; Thu, 24 Aug 2017 15:00:39 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id u96GvWqCzR-0cD4s5pP; Thu, 24 Aug 2017 15:00:38 +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, 24 Aug 2017 15:00:17 +0300 Message-Id: <1503576024-15965-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503576024-15965-1-git-send-email-odpbot@yandex.ru> References: <1503576024-15965-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v12 1/8] 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: 859293ad9b3c862264bb0fbfe8e7037b5e04d084 ** Merge commit sha: 3c4b4ab58168f2d1ffc93503027bbb5a5d2847d8 **/ 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 68abb6d8..c755d0b6 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -162,6 +162,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); @@ -211,6 +227,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; }