From patchwork Thu Sep 7 11:00:18 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: 111876 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp637678qge; Thu, 7 Sep 2017 04:02:06 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDEzCxos2ZogmW5L1l7mgMQ1tWW4UzH2kFRXLcj8nG7R9zVExXX0lbNwvOaZVFtBAJGch7o X-Received: by 10.237.59.26 with SMTP id p26mr2961850qte.304.1504782126406; Thu, 07 Sep 2017 04:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504782126; cv=none; d=google.com; s=arc-20160816; b=gVXGaoqr4W5btDB5Kpr8+puDSMTPXu6oyJhkTTcOp6R9SawHHmcB2sRwqZN42Drm65 +wFYcnrEpWgJx3zPHWt11A7elWpiGFNRV/wSDpTxkkDcyC0XAi14f0yB2A39IqdM2L1R XxHehLuwj2DGV8IjRJxsBjXESgePIo7ZnzRUQZCTT8W1h23zQbe4hO7gZworQjlGiqZ1 35q4Y5/qDDL5wbX8bzj092gAgBVBn+Of2Z53nt7dHaU0O8VLTmUgtpJ3fcvCcT6pmMZy dIsmyDjCWdTYCWhYoMoZEALWzY6rFz1lNZSnWGW9sVpSXKtv+u43YsPSMKirCdyzX5OG Kd3Q== 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=by274Ugr5gEfBplmxKXJkq54WR4KwlBgYP6cqXzkChs=; b=MXEDDvpmSBIERc1RWAvIKcVvBoEZiq0PUl1XeokrTUg0KGEXq6dxM5ZqLueJdozjwS eD+kV1t8OxcLtfTlpL5bgswHLzeEBIJD4GMkzSlpmesJeBS9UXE3RlnW3JG7YOeoBVLC XL2WIybmrAhjskBg8rjqe/D7lO+8pHzCMtUtpLVGG8n8tWYxiAsG00UGRuNJJsPlRw/U 3cuHy2aYtM1fdJJLJc4tO1cV4085/IE6PR0KyJKxOpZvRO4Y2hwetNgbQdUXG71Y0knI CnfFuJFXbsa5Cz4CNJNgk4hru9g5dQt474fs0EK85DpwUPmdjgkbuO8b1BPTASRAioOQ KoUA== 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 e37si2580298qtb.465.2017.09.07.04.02.04; Thu, 07 Sep 2017 04:02:06 -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 778F9644B9; Thu, 7 Sep 2017 11:02:04 +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,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 C6EFF62D29; Thu, 7 Sep 2017 11:01:46 +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 C470062D29; Thu, 7 Sep 2017 11:01:36 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id ABD956449F for ; Thu, 7 Sep 2017 11:00:49 +0000 (UTC) Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 6F6B31346472 for ; Thu, 7 Sep 2017 14:00:48 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id XrbkmOH1ZO-0mr4hY7r; Thu, 07 Sep 2017 14:00:48 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id r5PzEbFEu0-0ldegf9I; 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:18 +0300 Message-Id: <1504782024-26631-4-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 3/9] linux-gen: pktio: loop: support IPsec inbound 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 inbound 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index 6cc86e6a..1b36034f 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -135,6 +135,13 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, packet_set_ts(pkt_hdr, ts); pkt_hdr->input = pktio_entry->s.handle; + + /* Try IPsec inline processing */ + if (pktio_entry->s.config.inbound_ipsec && + odp_packet_has_ipsec(pkt) && + _odp_ipsec_try_inline(pkt) == 0) + continue; + pktio_entry->s.stats.in_octets += pkt_len; pkts[num_rx++] = pkt; } @@ -229,6 +236,7 @@ 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.inbound_ipsec = 1; capa->config.outbound_ipsec = 1; return 0;