From patchwork Mon Sep 18 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: 112901 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3524835qgf; Mon, 18 Sep 2017 04:03:39 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDqpax3kCyvWmWqm2PGoV/SSnYEhVsQMq9Ti6gW1tpZwlPXOsSsD9FoQ/GfolVLnWaha5E6 X-Received: by 10.36.200.10 with SMTP id w10mr17976607itf.4.1505732617662; Mon, 18 Sep 2017 04:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505732617; cv=none; d=google.com; s=arc-20160816; b=kG5zI/pGibeW0+VZh8Yl7dQFhjQ20hyn7z2653htoQ1BijCJB54WMmGDHRvRVbMjJP 5J5R2yCuIoTjI4vMsUFmkkhbK3EI+qnG1Pb1zr1Ue6P2DfSB0h0igePWdxl2tyrV3neh a7gt4th880RD+haxy4MxY3DKnXqtw1uFyd/HcxzRsTkg8Z2NaIVPpvdJsOP3NTHbJPhR RFOtjTXQruM1MQpELJLOzSgYMBUKOAOvAoHRtmGmcOTe2it+x5W4RKOxao1Iv1Olmoi6 NKBoSluG/G7WCL4Sa8tEU7aIRZhc0Fd+v87GaBXQg7Yx4qaT7xZ7iSmVdLNqj1CpnEJr jYTA== 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=I0TjUgY64u9XQyPVQ6JAXYzytVlMV4hIuAkzHrISOKw=; b=OvVCxRhaoA5JynggT9f4KyUAzCmG/gE79BGM2MGKOcKN6UePdN07lq421KtIPsH6lI 1t70Z9iqZSjd9/VKFgbeC3O5N5KeSV/E29ME1LpXxf5m95xCyeBAh2RbQ9hfDaSWhXhz /S7dubtkSnAKapp7GEwLQW/wMpl27jvcQ9AygbMpxB0Dh4+hELH1ab0igiZoXIyyEBS5 QFeEVJOPZ87Fk3Z+ps94vdxYd+QjeuTdt77PRyaZbkA8MC6AR9EM4N2kaKgqW88TDvJ+ 5FUZA4GmsdB3uyBE9c1c8NydzmrVmCBdXqQLZYsz/b2ucKK50AkxC8S2aYTujfTj1tlx PkWA== 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 102si5490083iop.387.2017.09.18.04.03.37; Mon, 18 Sep 2017 04:03:37 -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 E6D4960CE0; Mon, 18 Sep 2017 11:03:36 +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 2831360CE4; Mon, 18 Sep 2017 11:02:00 +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 E5D1260CA4; Mon, 18 Sep 2017 11:01:40 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id DA8B360D4A for ; Mon, 18 Sep 2017 11:00:34 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 6FE355A02BA7 for ; Mon, 18 Sep 2017 14:00:32 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id t56PacUiJ1-0WD8sce0; Mon, 18 Sep 2017 14:00:32 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Q0MY2IdQni-0VLKtuAb; Mon, 18 Sep 2017 14:00:31 +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: Mon, 18 Sep 2017 14:00:18 +0300 Message-Id: <1505732425-16969-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505732425-16969-1-git-send-email-odpbot@yandex.ru> References: <1505732425-16969-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v18 2/9] 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: e344e4364f771f32b86d822d0c447770588fe65d ** Merge commit sha: a16b0229af913f1d1f74b7d97bc0ecf8c7542e04 **/ 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 428b6cebd..6cc86e6af 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -164,6 +164,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); @@ -213,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; }