From patchwork Mon Jul 31 21:00:19 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: 109047 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp663777qge; Mon, 31 Jul 2017 14:03:54 -0700 (PDT) X-Received: by 10.55.131.65 with SMTP id f62mr21416269qkd.290.1501535034038; Mon, 31 Jul 2017 14:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501535034; cv=none; d=google.com; s=arc-20160816; b=ftDRTmXfLyWjk4jSY8F0C9l74qe+4yXtjNHL79xm+sDnvwZC/2VSmfVhun/nKwdWbq twady1OUpWNVg4bpXJFqk3jWUH2Nj1Bjv9SU0bNQAKAojzd7zXAwfPcFGU/5xxC8qBNU zs6ekJdWQEf+g2uNV48JYTHiGubJkllZ2UOmWs6cm84PdbyixiOYSVmJAOczpH36aXIN XFzfBC+XJGEGJ7JwvmYprWIr9OKNJQtp2Sdi91/shHy6fuGUtFYMysZziMcHQI/ito4y 8dyEZjNvoi2hvrx2ycze2VsOJ4P7tL9h9N5qnpGWYLwb5nDyzb5Kc1riWiQvkjSTuIkx ZlZw== 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=rVoW5+ICLvy4k//9ciB8fposDG1IJirPoJUemI6ug+M=; b=TT8pcqRT4sQ+0PtrhDIgsXiRywVf1K3iwrnw6Lt/tGydPEWNWWEAmG4pLQZBSlekHO dZef0UQ3MlCce++0W0vta22laHkhBPsZn0yXU+6gzdENzQwoSHd7IdpENsJ1Emq05OMU apG7BxJyYGYHodi6hV35Ry1afkYa1qm6O74xjVD3TmJJI2VNV1MtFtj25V2XlGR0dR++ NwoOh8jkVq77j8w/mGOEOxuD71sH1VAkXNXGVdrm3nxkvKkZ342SXJ9D8AdcllflBrpF B7kt773IUHyXEEl0goRWxzz/zkOF3AcDnvHwao0ewc+ZTHuusCMREo6zGcv9OKsAb8L4 Pfkg== 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 8si25256901qkb.152.2017.07.31.14.03.53; Mon, 31 Jul 2017 14:03:54 -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 64812644D6; Mon, 31 Jul 2017 21:03:53 +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 9B905644D1; Mon, 31 Jul 2017 21:01:44 +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 A478265C35; Mon, 31 Jul 2017 21:01:36 +0000 (UTC) Received: from forward5j.cmail.yandex.net (forward5j.cmail.yandex.net [5.255.227.23]) by lists.linaro.org (Postfix) with ESMTPS id C02EE65C2F for ; Mon, 31 Jul 2017 21:00:37 +0000 (UTC) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::28]) by forward5j.cmail.yandex.net (Yandex) with ESMTP id 28BFA20C0C for ; Tue, 1 Aug 2017 00:00:36 +0300 (MSK) Received: from smtp4o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp4o.mail.yandex.net (Yandex) with ESMTP id F34346C00A78 for ; Tue, 1 Aug 2017 00:00:34 +0300 (MSK) Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 71jwvRBPdT-0YrCDAXc; Tue, 01 Aug 2017 00:00:34 +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 00:00:19 +0300 Message-Id: <1501534825-20687-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501534825-20687-1-git-send-email-odpbot@yandex.ru> References: <1501534825-20687-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v8 2/8] linux-gen: pktio: loop: support IPsec inbound 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 inbound 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: 0200589a1a6a31f0d0a93454a68bffbfe56d325c **/ platform/linux-generic/pktio/loop.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index cee438ab..0229f0a9 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -138,6 +138,12 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, packet_set_ts(pkt_hdr, ts); + /* Try IPsec inline processing */ + if (pktio_entry->s.config.inbound_ipsec && + odp_packet_has_ipsec(pkt) && + _odp_ipsec_try_inline(pkt) == 0) + continue; + pktio_entry->s.stats.in_octets += pkt_len; pkts[num_rx++] = pkt; @@ -229,6 +235,7 @@ 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.inbound_ipsec = 1; capa->config.outbound_ipsec = 1; return 0;