From patchwork Mon Sep 25 22:00:21 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: 114191 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3114526qgf; Mon, 25 Sep 2017 15:14:04 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDvxzfSdos9flSB5qXxguRNgq/qpcTX8ATVhVGau43ddWyMlenj9ss8oshhL3GE9l4fvcJv X-Received: by 10.36.98.10 with SMTP id d10mr2711153itc.110.1506377644239; Mon, 25 Sep 2017 15:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506377644; cv=none; d=google.com; s=arc-20160816; b=KP++Z05o5GSIQ+mrhAwnJlvU6BUGgNUcrsM3fH1t6uxIHUyvNbgjUcCDOG1ZsUIFY+ ZIoWXXviBEqDTzZ68jnpdSOg+6p09ZckJefjznsAJqmgMDnDVwMpWGCpmnrLmbloxtMg jHPOuVKCpevcrPitCjf34YCl3uUMGNf9v1euXu8Rlp5H79uSIiVojeqn5Qj1/4R3PuBm VwV8h3KA+5aLqNo4fyq4C3R6kbwNrNf7iNeQiBesdNJPjPqtX6+MxStWoqE+KdSbzyZV 9i/0TSYwYLq7fEb28jOMSyMwQszy8PfVg3Hex4fr6gZlgPHFWR3z0wr9FMcL+x1erTG4 1IjA== 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=iD9NiRrdvA8uuTlNQkHdBFEs9bsl6SOF++xrdPy7r3Q=; b=CM8yH4KcIEJe5zIg8pejitl0rsxXa3Mb2/K85UrNNlbeLkDgZj3lscKkWBTBVy6/qP T4U0gxM0NxzxryEOgFb559fwy7CIJ38PW972wQKaz/NoZGiKjqW/GrnYpaP5qrv+f+4T JkgFCR5fK49L162YlE3QQW0EGfswetnMmzvw9pz8JZdh0EKvU+4n0R1kBYxNVSNneYov YjdUNpwcoDIbGOkP/tVO2XmpSn4RXUteqwegVj3Yhuf150ZyWRP5P6XK2dd9uQfqWuRF cWVo6jGoGWZvdFQ9CHlP1fE0Xm7mQr9XDSwhSG2l7kVDMs6eUmgqa9gjRaXqO79WiLPN 3CjQ== 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 u186si462885itc.9.2017.09.25.15.14.03; Mon, 25 Sep 2017 15:14:04 -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 B306B60D3D; Mon, 25 Sep 2017 22:14:03 +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 722B460CD1; Mon, 25 Sep 2017 22:02:52 +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 E919660CD1; Mon, 25 Sep 2017 22:02:48 +0000 (UTC) Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net [37.140.190.179]) by lists.linaro.org (Postfix) with ESMTPS id EBAF7607F1 for ; Mon, 25 Sep 2017 22:01:03 +0000 (UTC) Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward104o.mail.yandex.net (Yandex) with ESMTP id DF6E6703756 for ; Tue, 26 Sep 2017 01:01:02 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id RlQco5qLVA-12oqT6fO; Tue, 26 Sep 2017 01:01:02 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id y0gxWEywlF-124Odidc; Tue, 26 Sep 2017 01:01:02 +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: Tue, 26 Sep 2017 01:00:21 +0300 Message-Id: <1506376827-27848-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506376827-27848-1-git-send-email-odpbot@yandex.ru> References: <1506376827-27848-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v19 3/9] 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: 13322ca632f8ffba292bec058e597719bc54142d ** Merge commit sha: 04f37d8f29d26df3744151a85a19ef9b55b3d1f7 **/ platform/linux-generic/pktio/loop.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index 6cc86e6af..1b36034fd 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -135,6 +135,13 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, packet_set_ts(pkt_hdr, ts); pkt_hdr->input = pktio_entry->s.handle; + + /* 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 +236,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;