From patchwork Thu Aug 24 12:00:18 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: 110898 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp5568251qge; Thu, 24 Aug 2017 05:08:46 -0700 (PDT) X-Received: by 10.55.82.197 with SMTP id g188mr7607376qkb.132.1503576526800; Thu, 24 Aug 2017 05:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503576526; cv=none; d=google.com; s=arc-20160816; b=DQVknOxDRxJ0pGEikd8UZehnzuXo7yKY5n6GRE2Y0WglinBRfUYHHoTQUnbhMUXaKR 6YAElF9U6HGyzPLoTFFhqW0hRUPEI3R259QD/5Fcb37uFYwwq6ehQRyM/4glaZv/jvnb fpGOycmMVAUgdB4ItUdMnhOjhn1I8drJEAwMGN4XpyOaIVA5XBPzpEoUfj++ZSBkFi/n +03AfHjGbO6gA8eD9OVED7olYrVLq0qkuVS+o1+FcVFyDZDOfpICHznB9POFUcb1JB89 Z2911x2rH/0IfwlCAQdGqakgydp0MWo2d6n1HaxbuIpYFETkTQgvoay2f/uWI9wxxpRH 0YDA== 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=axxQqUGR7X4BocaUyUvBIE0sMajzNN+N++RCoakWMgc=; b=Rwwb12PWoCVgpyuaBTp5hyA8bsPcQebxu97Gy6ciuTuwizb1Et9j1doT58qKUFkBh3 ZLpxrXyzxFPiR8zoVzbgOqHKUm33eoCuNnzW+x47UA07VC4x/702CVEIwKKxSXIzAxot qh6Z3/W3Nn5eHKrEgUtK82wWBDO8hcDrfW2Hr/afpkG/ewGUmZzoowbJ+mnbXsYP5meY sNczAVN9WYBW0nP18ByRKj2iQ4klLA9vO+1tG3D5brpuh9hygkYPcRyvg+OmhrFDsuRZ LVd9VOPBLD+yEfXdn2nTTQi/BiANevnrcrRKp7yJnUv9zE/Ns8/5zIS8oL0UhCe+Ps92 I5Ow== 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 v75si3931748qkb.35.2017.08.24.05.08.46; Thu, 24 Aug 2017 05:08:46 -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 49291644B0; Thu, 24 Aug 2017 12:08:46 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, 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 B9487644DA; Thu, 24 Aug 2017 12:02:09 +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 D7AAF64464; Thu, 24 Aug 2017 12:01:34 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id C83B6644BF for ; Thu, 24 Aug 2017 12:00:44 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 925305884495 for ; Thu, 24 Aug 2017 15:00:39 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id dhXVdjeQA0-0d38BOnq; Thu, 24 Aug 2017 15:00:39 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id u96GvWqCzR-0dDqV2tR; Thu, 24 Aug 2017 15:00:39 +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: Thu, 24 Aug 2017 15:00:18 +0300 Message-Id: <1503576024-15965-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503576024-15965-1-git-send-email-odpbot@yandex.ru> References: <1503576024-15965-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v12 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: 859293ad9b3c862264bb0fbfe8e7037b5e04d084 ** Merge commit sha: 3c4b4ab58168f2d1ffc93503027bbb5a5d2847d8 **/ 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 c755d0b6..19f1d029 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -133,6 +133,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; } @@ -227,6 +234,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;