From patchwork Tue Sep 5 10:07:00 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: 111657 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp2653509qge; Tue, 5 Sep 2017 03:39:57 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5GfLNcOZJAWRM+ubSICkb7mBGHy1NTxC29T+KtrMNToR9Ok+xI9lUFEIEmX16xETVkNMXe X-Received: by 10.55.33.216 with SMTP id f85mr4816042qki.176.1504607997641; Tue, 05 Sep 2017 03:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504607997; cv=none; d=google.com; s=arc-20160816; b=br1Ix8Z2WBQmZiKa/uDUGvQW6xdPMf7+tt1eGKXteTGsFPjLsU6qay0sChQSmbpWe/ Q+IHUltYPd92ODDD4gXPMv5k+qQb7i1kfQ5PcmBzMIDe5syqduolgHG/o6X4HG3vqtwW 9V3A0devzzGSFpoamEBSFD3s3S/KVTMEt+aJMOGSw8zCjkLH8eQV+TPRgjCCEe7NdgSO ZPpUKgOpUjrtC/Ex99xgg1ZzDcUxmo4jbvvPduBtujIDTrHkYMR66AeKWX68piD7wjuQ AeuZEzhy85OydMEMnExb/qCHqgHMmAeS/j7mQfK+lmQndUrN/ITJ6v/Lj7wv1VCVzEhJ y2JQ== 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=qL30xadXidgD+Yat4lD0pXV+cMs/6+i+bR0GQRipIjg=; b=ChZ4k3vmihaa5P7CHzqeQxjTfET+JOnRpVFy4oCN05t4hS1MTGgo+N2VpC/9oBSyyC RX+bTQ4GbfBnLS6mJSzFELKO2Q99oghAYkgOEM9MsqHCct07XpyvaK53NwHgyo+N1OEA YcUrRvvi+IjxI/wvupBaTzq/vmRbTlrgQHSUJXDoTaj2sSTcgg+JVIZJzkdFZL25A9z7 /JTy7Y3/f1hOQx1rK3HNwOGTKjuEZldVVL6KVyA9XlGYQqk1XX/4tHqaqWgmCWIrV08g HhFa5864KgG0wVBYllECryRIqVTYAiVyhU5zVLPlbbxJU1GWe9r1RqIwjpLx+6VxVtyX 3XHg== 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 a10si81891qkc.472.2017.09.05.03.39.57; Tue, 05 Sep 2017 03:39:57 -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 56B8962876; Tue, 5 Sep 2017 10:39:57 +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, RCVD_IN_DNSWL_NONE,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 3918762DF5; Tue, 5 Sep 2017 10:12:20 +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 6138160D87; Tue, 5 Sep 2017 10:11:41 +0000 (UTC) Received: from forward103o.mail.yandex.net (forward103o.mail.yandex.net [37.140.190.177]) by lists.linaro.org (Postfix) with ESMTPS id 7FAF060DC9 for ; Tue, 5 Sep 2017 10:07:16 +0000 (UTC) Received: from mxback5o.mail.yandex.net (mxback5o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1f]) by forward103o.mail.yandex.net (Yandex) with ESMTP id 2900D58833B0 for ; Tue, 5 Sep 2017 13:07:15 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback5o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ojKvnAMzvA-7FdS03LG; Tue, 05 Sep 2017 13:07:15 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7CWa9Tztus-7EeqFXVM; Tue, 05 Sep 2017 13:07:14 +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, 5 Sep 2017 13:07:00 +0300 Message-Id: <1504606026-28181-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504606026-28181-1-git-send-email-odpbot@yandex.ru> References: <1504606026-28181-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v15 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: 91c0b58fc87ba0431241818758cea94438cd5498 ** Merge commit sha: 3ec7da960bd3d497e998f18cb30a2480296e7b6d **/ 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 6cc86e6a..1b36034f 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;