From patchwork Tue Aug 1 07:00:10 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: 109105 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp1140187qge; Tue, 1 Aug 2017 00:01:57 -0700 (PDT) X-Received: by 10.233.237.211 with SMTP id c202mr24533124qkg.1.1501570917554; Tue, 01 Aug 2017 00:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501570917; cv=none; d=google.com; s=arc-20160816; b=pTqRk0k43Edh7OlhnibYxInKU0PNR83+L4FHrdaypaQnhzUE6gHr6LpeIuis/X/LhO HW1mgkDT2J9YMIgpyjZHdgVOpbvJz0Jwr8cYz5C3UunwyTF0eibqzBDrAjSBz7p5BpYq P4wSDBR25co/NaewJ37agFTWTfgr1V01fAXhLZLxJNFClDjRHdzClWB3GD4zOt28cMyz pDNvBdoMEVUuRV5bj/gG3OlWiqnZMHd3V5Dxu13Fc2q4ZrYJBiETamYA2/wbWsgD7F0S KF9ci3TuDxNwOJVCOEAjBlSn7CIJrWCDYyGJVZvaa54yo0Pe1tJL3G65oCg+3f9k3fam r2BQ== 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=K+GcbQ7MX+WW9oP+ndUl+vIwVz4anaCcrG7V+47QCDA=; b=HygeUPG7mq4C7GHIdo0PuyQ5w4XOdKowdg3Lh2pTx1Gl9NKzbjMqje2q2xmwoQtk5Q AK+CLw98OCO+ScAoFhEp/5UINjCItW3ticiYeLNt4t+jP+cxa36E0ABT1xyFfF8kqjOg w6NrcHSzJYVN0XZ0ryBZh1uy4AMBZuJXFczDnt90DwA7zh2vw+BFcBwLBa7BK+z+EnFo PWLMTBLHxXRCmZ2gRl0FocCTZgcA6uUChlqgE45lZyy5tNIyImuvcGHg5ZQIuZW+NZwu xBvSvOtFWlEVBjss4cCwk84gq/aS2lYA4KEnJX+Th7Jrq9HSztFpEdG9HVzsEuw9GaJG rm7w== 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 w17si25640958qtg.65.2017.08.01.00.01.57; Tue, 01 Aug 2017 00:01:57 -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 1BC3B65D38; Tue, 1 Aug 2017 07:01:57 +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 F078765D3A; Tue, 1 Aug 2017 07:01:38 +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 4E36665D29; Tue, 1 Aug 2017 07:01:36 +0000 (UTC) Received: from forward2h.cmail.yandex.net (forward2h.cmail.yandex.net [87.250.230.17]) by lists.linaro.org (Postfix) with ESMTPS id 48AA1609ED for ; Tue, 1 Aug 2017 07:00:50 +0000 (UTC) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [77.88.29.84]) by forward2h.cmail.yandex.net (Yandex) with ESMTP id CB19020D9A for ; Tue, 1 Aug 2017 10:00:48 +0300 (MSK) Received: from smtp1p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1p.mail.yandex.net (Yandex) with ESMTP id D38241780FAB for ; Tue, 1 Aug 2017 10:00:29 +0300 (MSK) Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Ca8Lni7XUb-0SYm9qZ5; Tue, 01 Aug 2017 10:00:28 +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: Tue, 1 Aug 2017 10:00:10 +0300 Message-Id: <1501570817-9260-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501570817-9260-1-git-send-email-odpbot@yandex.ru> References: <1501570817-9260-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v11 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: 38d17798a2db32c26fbd413245d59dde8e3011d9 **/ 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 c825393a..b62652a0 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -168,6 +168,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); @@ -217,6 +233,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; }