From patchwork Mon Jul 31 12:00:20 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: 109003 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp3568182obm; Mon, 31 Jul 2017 05:06:59 -0700 (PDT) X-Received: by 10.200.47.146 with SMTP id l18mr20566626qta.176.1501502819545; Mon, 31 Jul 2017 05:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501502819; cv=none; d=google.com; s=arc-20160816; b=t4PrgrraO+w8qPU2Q3oGq6jhjSuja3zv8juyrZ7FN53yxXlFvn/D2+WLKsFKuVO8Qd aZx0cALKoN8Z0jyV8pZ0qgpGw54yXaBg/oHR8GA9poGRxoO/tN39qtLJe2fICJOxgC+g AOVMTCt4AxmMgchKJm9TkVUz80LpH/AW4koEdPLvk9JUiFN1+fbHgvlS1cKFuof/HEZF HoPFqr8Jc223DmiBznnZm6Wh9PgZIKwxRRq/urOytKnOcgFlm8rSJLusbbLx0QUx0nOp JPqA+ihOPEIoqj2N2giKjzknBlc8gblB0DQKD/vpzpRMxsi+/tkpy4/u5AsM7QW0Edzd PdSA== 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=drVlzNtZhZVDJiCSxrTz6VU7CHWw6ZrpHDNEKSVz68s=; b=nHtDFF2pavRWWmrEf/HkpjBwi9unUESxL84kX7ihNjPB9XBb1x4R4tm6Mc4rr0xW12 TUqzykIU97l5ESttYElf/DBxvgs8TShmcKGUYQqRZLMy1i56Q6i1MWCF9EEDVhWnmctB qIHLMmvItcUUDDRdKN1/YVRWjuQuKgPg/mpvUzQ0tJbs/6GIU+rKPmvTwg5Rqpz3NTaB 90zqAWJurSlGBKPxKzuj1v7Y3JdK0yeaTT4tPQvRFhUt5VRF9F/FtM88uOGMa5Jm03z/ yTYculRBbH3B/LQML+iltmDRR7sKk/DMyVjMbuYTcnJjxmkPZ7uistZyK5eNxQEVPPO2 5LJg== 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 b6si6535981qte.178.2017.07.31.05.06.59; Mon, 31 Jul 2017 05:06:59 -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 2F3C9608AC; Mon, 31 Jul 2017 12:06:59 +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 B47E4644A6; Mon, 31 Jul 2017 12:02:01 +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 3F13E64491; Mon, 31 Jul 2017 12:01:41 +0000 (UTC) Received: from forward1m.cmail.yandex.net (forward1m.cmail.yandex.net [5.255.216.2]) by lists.linaro.org (Postfix) with ESMTPS id C73B760843 for ; Mon, 31 Jul 2017 12:00:46 +0000 (UTC) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b6:7]) by forward1m.cmail.yandex.net (Yandex) with ESMTP id 780F720FD9 for ; Mon, 31 Jul 2017 15:00:45 +0300 (MSK) Received: from smtp2p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2p.mail.yandex.net (Yandex) with ESMTP id 406E91A800D5 for ; Mon, 31 Jul 2017 15:00:40 +0300 (MSK) Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lFGCprsgrc-0dOSRkMK; Mon, 31 Jul 2017 15:00:39 +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: Mon, 31 Jul 2017 15:00:20 +0300 Message-Id: <1501502427-31731-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501502427-31731-1-git-send-email-odpbot@yandex.ru> References: <1501502427-31731-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v7 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: c16f1363303cd5fc11324acbc4dfebe0a9680a41 ** Merge commit sha: ba0b39db1fc90b24a3db1e85e00c2c485b235a47 **/ platform/linux-generic/pktio/loop.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index c825393a..5b7a9692 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -166,6 +166,18 @@ static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED, for (i = 0; i < len; ++i) { hdr_tbl[i] = packet_to_buf_hdr(pkt_tbl[i]); bytes += odp_packet_len(pkt_tbl[i]); + + if (pktio_entry->s.config.outbound_ipsec && + _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_tbl[i]); + + _odp_buffer_event_subtype_set(hdr_tbl[i]->handle.handle, + ODP_EVENT_PACKET_BASIC); + } } odp_ticketlock_lock(&pktio_entry->s.txl); @@ -217,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; }