From patchwork Tue Jul 18 11:00:22 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: 108104 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp5747225obm; Tue, 18 Jul 2017 04:06:17 -0700 (PDT) X-Received: by 10.55.101.135 with SMTP id z129mr1089838qkb.164.1500375977379; Tue, 18 Jul 2017 04:06:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500375977; cv=none; d=google.com; s=arc-20160816; b=x6zY0B6ytuKih3+j2xiCgX03WUxRPWXJaFhO3zjNMNs7frfD5h36DIPp3Who+nIREW lRH25RfHJtEKMaiEx090EQmW3zdPgL5n9FMLfOpIWcGYyi3hxG+qM8M0Qp5a64L6OPwt npoCtMVICNF3PRBga/xfqvmNAxgEgSJilqOJ1bfN/7umecvlQpZnjfKv5bCoZlBJy/p6 SGH7okdSyjPaPYYAlVvhae+ufVEjjd2APKh2KP2gzm7iHK+zxsA6P4Vr3vCRfxBEvvFV KwadyBb2XHcutaP6I0RcvHZFqWiK5agBkJoz1NY2Z6HsG7f9XiXB75AuVaVrHmZJ/AvT NQOg== 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=DrI5xu3RLG8+i4rkAsqUnkwHIxTIfcNZU47WKaHEVys=; b=aE9BkIxEU1+CnXdshL++huZm4fvciN5KrbC3rwcLSQ7tJ/dT79lOeLeisJv/Hse8Dk uHlebdDYh1CZMOG+/Ky5yC0ablbDYcoqK0SxNcTvm52VkZqBwRW6C/fy3cWuXxWaz0mt RM8HrbyJmpeZVLgEdISqB8FqsF5jV7aaPFJ16S05HbTS2JnrlV6TU1LGbnuCWNC/wnB5 pmbcEBHqtnj0SpmBBExS5uwxZXtgKjjD3r+C218r7sxp9MSssNpPkhsw7iuXE9+URZj3 FjEARpCse5NC0CuGEHOBSQq45xj1uCiYdcllyQALsM4WOG3fBtGIDQu28YM74oMiYkOz hGwA== 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 n28si1860074qkl.181.2017.07.18.04.06.17; Tue, 18 Jul 2017 04:06:17 -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 0BC0D644A9; Tue, 18 Jul 2017 11:06:17 +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 6B346609EB; Tue, 18 Jul 2017 11:02: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 57DCE644B5; Tue, 18 Jul 2017 11:02:33 +0000 (UTC) Received: from forward3p.cmail.yandex.net (forward3p.cmail.yandex.net [77.88.31.18]) by lists.linaro.org (Postfix) with ESMTPS id D3A33609EB for ; Tue, 18 Jul 2017 11:00:38 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [95.108.130.60]) by forward3p.cmail.yandex.net (Yandex) with ESMTP id 95FF720D42 for ; Tue, 18 Jul 2017 14:00:36 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id 28FE13EC0E21 for ; Tue, 18 Jul 2017 14:00:35 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id w24Kewu5DC-0ZbikQ9L; Tue, 18 Jul 2017 14:00:35 +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, 18 Jul 2017 14:00:22 +0300 Message-Id: <1500375622-10605-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500375622-10605-1-git-send-email-odpbot@yandex.ru> References: <1500375622-10605-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 68 Subject: [lng-odp] [PATCH API-NEXT v4 2/2] 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 68 (lumag:packet-loop) ** https://github.com/Linaro/odp/pull/68 ** Patch: https://github.com/Linaro/odp/pull/68.patch ** Base sha: ae42f98c1a1c309c0718a3b5fc8589660de0f867 ** Merge commit sha: 9e86e068c2d928aa3d64d15b76780d43d6403cff **/ 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; }