From patchwork Mon Sep 18 11: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: 112905 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3534756qgf; Mon, 18 Sep 2017 04:13:42 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBC4BFY5hZ0qmfBL1USetvhPLG31vM49atk1zl4T0Xw0CCbWt7MRU6Vd6LYiz5QitYRyiJN X-Received: by 10.107.131.155 with SMTP id n27mr18417130ioi.200.1505733222720; Mon, 18 Sep 2017 04:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505733222; cv=none; d=google.com; s=arc-20160816; b=FS5d1C3LM0pbgNmZ+9Hq1g7YKCazkN4tFzzAKsO4RyVUPHGv5/wOQzSoyDZLGFBcuD ntjvOtbcmrrIsb284dhsKgN8xzyX8OY8ieAGaoZ6Jxk7d70wTKptWzcPbSoQbScNSch/ Qyjawx/nQyLg72+VaM3uLxup7v4NYpOI7U0R3I4M6jgdEi1XLhXRjtECKGtXQD8cjUy4 iHiznDIgMKjqzKudIDmEPJ1hxFtbKrs4i3/JndCXxUZJofNHZEGZRRgsxIZCtGSZoTUN Ox9qIgsAYxPKKxufzGV7XmLRNqsf/1Bvo1Lqm/4HSCIn+WF8UFDFt+J4SsnQL2cxdELV 5iyg== 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=RxcCN34DoTlKDiNkl4omEEm0UnZpikWhJcJXImJr0BI=; b=TyRDUpXerw8sAxf4tbJvwRaH4H/wjTeZYxhjYj5Ee3YCTcl/mwOX6QDwDlqG+CP5UQ A+M/aE/81YdQ056EGQdWCE/BTFXkjIDWwmOraSQhszv7hZ4WvYXXsP3qyC6Urk53PeNU l5gU1wdz4ouH138fCYR1koILjAGxzrWJahOh4lw2qJxBriVQl/jxBVR5zP4q+qQCA93Q BR6QllZmLQ8S/EvJfrytGnb2PO6x/NmRbVjhFfSKDgG8Xudq+kmk/M3I+MqZSKLhosvF Q94m4gxDnEXAHMQqayD4pVVr6ZrXSUzwmQoVJzHKMIJ//cvt4s/ZBGuW9m+FPecq2M4m fvDA== 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 i100si5643506iod.98.2017.09.18.04.13.42; Mon, 18 Sep 2017 04:13:42 -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 2F0DB62D05; Mon, 18 Sep 2017 11:13:42 +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 ACE7760D50; Mon, 18 Sep 2017 11:02:34 +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 ABA0660D75; Mon, 18 Sep 2017 11:02:20 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id CB4B460D4E for ; Mon, 18 Sep 2017 11:00:35 +0000 (UTC) Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 1A13C5A02C47 for ; Mon, 18 Sep 2017 14:00:34 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Sxn655KGZY-0Xw80buC; Mon, 18 Sep 2017 14:00:33 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Q0MY2IdQni-0WLWZkwQ; Mon, 18 Sep 2017 14:00:32 +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:19 +0300 Message-Id: <1505732425-16969-4-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 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: e344e4364f771f32b86d822d0c447770588fe65d ** Merge commit sha: a16b0229af913f1d1f74b7d97bc0ecf8c7542e04 **/ 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;