From patchwork Mon Jul 24 14:01:23 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: 108571 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp3888257obm; Mon, 24 Jul 2017 07:03:30 -0700 (PDT) X-Received: by 10.55.34.67 with SMTP id i64mr11478813qki.128.1500905010771; Mon, 24 Jul 2017 07:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500905010; cv=none; d=google.com; s=arc-20160816; b=emGpjnh8FtstEKlPUpZDd5LupEiTXrb9NZqqWjVFFluK9uaHy7nDmqAKakc/K4EiwY W5oRCQ5/zgpFtuERqGE4ZtnV/9E6rx5Vn8xSt+bKbdfCqK2HDoOf5Dtkhwop+YPwjE5T sYHpV7W1BjNAU8pNmV1hcLlONJxSQQyLIb3PgiwH9dY24nWAhpp8epK1ITR+RgfhHWeW EsRduddfLXFOQopENMkpmlAol5UDAKEsjbql+b+4Nq5axUR/i/TSBpKhKIgB/xT61N8N 3PbzFUnGibtFK7KYquwebI4sFGqgv9PNFSYb1KOOTKtL59XeY4ido0zl/iSTID0YEFw7 XyRA== 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=r2UhutUQv56AQj2nqbbu2u6i5XdpRUAmD8M43Vyb9uo=; b=UfLz36fgA9GOvrDHnz4aVJ8s2C79ASPITZaokQzh5SMJ5+VoRHaCqRLA3v7cDSV9lw Q61SgmZKTmpcqTInEI1Q97wQ+RNFwfvpVYcr+Q+6vqL44K+dEAPvsvhQc03mnRG7Hhoa SmOlsoU48LB0vXBwY8CJVPG6t6AnpZJqVsUmKEk1aQ38o0qvhRZD4yb8Cds2LJZTzK6a Ys0HZ6PWVw1ieAs3lfGvc/Fx3ui+nMIqkg8eMn1jqI3ZUCot8Pd7/mBSdtWZTzGof+k3 fZ6v3lhF+3gKPtiJD/oZ5yU6CjOgHVyrBtYDEuwl4GI0rMx2El/JjWBdFiRIkXrYTpF/ r4Tg== 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 j186si1748227qkd.339.2017.07.24.07.03.30; Mon, 24 Jul 2017 07:03:30 -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 7128B64479; Mon, 24 Jul 2017 14:03:30 +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 DE63F64481; Mon, 24 Jul 2017 14:02:05 +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 AE56C64471; Mon, 24 Jul 2017 14:01:55 +0000 (UTC) Received: from forward1j.cmail.yandex.net (forward1j.cmail.yandex.net [5.255.227.19]) by lists.linaro.org (Postfix) with ESMTPS id 060EE6447A for ; Mon, 24 Jul 2017 14:01:43 +0000 (UTC) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [37.140.190.28]) by forward1j.cmail.yandex.net (Yandex) with ESMTP id 5A09F20E9D for ; Mon, 24 Jul 2017 17:01:42 +0300 (MSK) Received: from smtp3o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3o.mail.yandex.net (Yandex) with ESMTP id BBE302940E22 for ; Mon, 24 Jul 2017 17:01:41 +0300 (MSK) Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id xiIIHlGTcI-1eLO0MMv; Mon, 24 Jul 2017 17:01:40 +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: Mon, 24 Jul 2017 17:01:23 +0300 Message-Id: <1500904888-11014-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500904888-11014-1-git-send-email-odpbot@yandex.ru> References: <1500904888-11014-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v4 2/7] 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: db7cc41aeb559dd296f3a6d8570aa10326a31d5e ** Merge commit sha: b783305474c8ca3a4ce862c64e2ce5aa8348f2df **/ 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 5b7a9692..54fff691 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;