From patchwork Fri Jul 21 07:00:28 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: 108459 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp455072qge; Fri, 21 Jul 2017 00:02:26 -0700 (PDT) X-Received: by 10.200.43.163 with SMTP id m32mr8619307qtm.296.1500620546719; Fri, 21 Jul 2017 00:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500620546; cv=none; d=google.com; s=arc-20160816; b=upt3umeZt2WFUToTtca22agrKrgxObltkKBBjBE0H8tQ3xdRgbn06cjAj4Y1RFvm2D VY1JMClcWuVfv9Xs1/K0rVE1AJ2l5IfXtfm0ISy8uaCVqijarj5S0gv3uAVpDx93NIoy /3DmP0CSy9lUaSUMzcm8eRnYGIkF7VwbtZqU8tGVNhPUq3okqD/SYIVMTfZxKXw7PeFo Ulvvdia93AI0O6fxbXGi+ONo6s4xrCkJMjF0jfKF6SxnmKXGFuD6RsgDlwUFKJU+/eNi lAMuFG/5Uevvoa57tRkMzIH2WKTkHxAfviNjVQ8Ol0vW4RjMfaLEwN3ViuyH5m/SHPx3 pmig== 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=LufQdHNC/x42NP856qcOLNHyqHqseEy8iLO+MRqnwdU=; b=vjRZhXf79PXlsjKH27j4DwBuR2kw0bf5DGJU+r/lSB0LQik7IKL+9jgWGZ4LpfBB3V EbsS5/RClSo0ptb6g7A57QVncXfEMA+jaU1F4boAfgdnnt75efnsrIQH8K/X+Zq2lSKs CdLD+YE4bBDfykua60XXCWVx4c4u8ifEoZeBLsFed3s0OCr/QJlYSjsOgQpGYSdnUs0S chAcd144D2mCfJfNTOUz8XId/6k6ttnEMFxWNNBmkxZLNl3zp1AXBhZMrEx5tFlm7kjf G8xO963by39DsJ5FsLgBt3J7BxTEpsKRXTl0j8XafALoj6Yt8HWS67IIY52ZiBft8z2R 3P+g== 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 c129si3305199qkf.312.2017.07.21.00.02.26; Fri, 21 Jul 2017 00:02:26 -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 606D560D25; Fri, 21 Jul 2017 07:02:26 +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 EF20F60BEF; Fri, 21 Jul 2017 07:01:14 +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 0AA2D60694; Fri, 21 Jul 2017 07:01:01 +0000 (UTC) Received: from forward5h.cmail.yandex.net (forward5h.cmail.yandex.net [87.250.230.20]) by lists.linaro.org (Postfix) with ESMTPS id E2EAE60A58 for ; Fri, 21 Jul 2017 07:00:44 +0000 (UTC) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [37.140.190.27]) by forward5h.cmail.yandex.net (Yandex) with ESMTP id 62950213A8 for ; Fri, 21 Jul 2017 10:00:42 +0300 (MSK) Received: from smtp2o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2o.mail.yandex.net (Yandex) with ESMTP id 6B67C50811B7 for ; Fri, 21 Jul 2017 10:00:33 +0300 (MSK) Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id c5PyUBeQ6c-0XsKIoxD; Fri, 21 Jul 2017 10:00:33 +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: Fri, 21 Jul 2017 10:00:28 +0300 Message-Id: <1500620428-6609-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500620428-6609-1-git-send-email-odpbot@yandex.ru> References: <1500620428-6609-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 68 Subject: [lng-odp] [PATCH API-NEXT v6 1/1] 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: db7cc41aeb559dd296f3a6d8570aa10326a31d5e ** Merge commit sha: 6a70a500faf4645366c07567d58d3253a31a5efa **/ 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; }