From patchwork Wed Jul 19 11:00:07 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: 108267 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp659981qge; Wed, 19 Jul 2017 04:01:16 -0700 (PDT) X-Received: by 10.233.221.131 with SMTP id r125mr116807qkf.267.1500462076502; Wed, 19 Jul 2017 04:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500462076; cv=none; d=google.com; s=arc-20160816; b=ccu6e9Pn6i0A6J6G5beTN6zmT7cVxn4j0P6Fd959MLNMMSIXz1zrN0eun70g9m8jv1 9ndCBzNcpdtE8PfK/liMsUIh+8kttDIMd/xP+oLXfCQCszKTSC0B9zEfT8uW02My9jiU uGTEv1ksfmxwRFFeybi6ZsPj8lXKfJV/ggWm+/RlLLxGtMnreoDqZ0n0qKfsgAQw1V/2 CUGrPqj5Y+ynxtzaQsQnQL/1sRzCjhCfI6YwKUMxIRkvnJUSqZK8CkhFxMytRE6nYU+b utRgEKzAf7qi7od1f/HAnCl0InlAn3n72wvUmb5BZD+LDMKSP3fE2vEr4pUrlgEEQ2rN BUlg== 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=uC6a3qtA99pp28hEA8+qiQESwmaYiAI2Gyov+OqWG7w=; b=ldduigOfOiVQmsXceU+xGBBuTsdVP/nfp8hfFbLvqHUX1TgKAuocLMHzvl3I/NfJLB CbsTKLSQTDHGd21WeMfKTm1qPvrnqy/SCH5XW+9BMH6hvqJ0OPklQ6ToDY5DICS3tgLM oBGxDO/zdJ8NCMFo26RWuLQPp7yZ0S8yPO5aGKFADJgZTyp4/kcdncPJKqCZtGzRUcOr L0scsAJ5Y7vyt1/4ZfOjcVVoWvcddkB28OxcrxspybXdYO1GoiFgXFOsjdCNfN8YfYRm NLQqtww7Sk+B70+Mc/pm5gTXY8QG0BXVkBTFta2uHeqmxl0vzzsQ67UOqXWz4rG3sxyy kMfQ== 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 c13si4694855qkb.54.2017.07.19.04.01.16; Wed, 19 Jul 2017 04:01:16 -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 203FA60D1A; Wed, 19 Jul 2017 11:01:16 +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 E3BBC6090B; Wed, 19 Jul 2017 11:00:26 +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 91BAC60A4C; Wed, 19 Jul 2017 11:00:23 +0000 (UTC) Received: from forward1h.cmail.yandex.net (forward1h.cmail.yandex.net [87.250.230.16]) by lists.linaro.org (Postfix) with ESMTPS id 6FC97609A4 for ; Wed, 19 Jul 2017 11:00:22 +0000 (UTC) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [95.108.130.59]) by forward1h.cmail.yandex.net (Yandex) with ESMTP id EE6A621308 for ; Wed, 19 Jul 2017 14:00:20 +0300 (MSK) Received: from smtp1j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1j.mail.yandex.net (Yandex) with ESMTP id 34F6A3C81068 for ; Wed, 19 Jul 2017 14:00:19 +0300 (MSK) Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2fmNox5Cmm-0Ia4821u; Wed, 19 Jul 2017 14:00:19 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 19 Jul 2017 14:00:07 +0300 Message-Id: <1500462011-17433-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500462011-17433-1-git-send-email-odpbot@yandex.ru> References: <1500462011-17433-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v1 2/6] 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: db7cc41aeb559dd296f3a6d8570aa10326a31d5e ** Merge commit sha: 2ea07e66ca00decd7d3013275277a30a03d29c22 **/ platform/linux-generic/pktio/loop.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index 27c9566d..e5803b39 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -85,6 +85,14 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, pkt = packet_from_buf_hdr(hdr_tbl[i]); pkt_len = odp_packet_len(pkt); + if (_odp_buffer_event_subtype(hdr_tbl[i]->handle.handle) == + ODP_EVENT_PACKET_IPSEC) { + odp_ipsec_packet_result_t result; + + /* Possibly postprocessing packet */ + odp_ipsec_result(&result, pkt); + } + /* Application can send arbitrary packets, but expects to * receive basic packets from PKTIO */ _odp_buffer_event_subtype_set(hdr_tbl[i]->handle.handle, @@ -221,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; }