From patchwork Tue Sep 5 10:06:59 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: 111656 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp2650773qge; Tue, 5 Sep 2017 03:36:56 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4yR0YjaW1xK7W0oA6lxpxhH31xZtamzIcrArIGGiLoLx7kuQN5+qmuUs0bpuiY+NeKt1zi X-Received: by 10.55.51.9 with SMTP id z9mr4228132qkz.65.1504607816490; Tue, 05 Sep 2017 03:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504607816; cv=none; d=google.com; s=arc-20160816; b=nxSp0QTLlAWwd65fD01A0m9SZ3gmUiLWpPJWaAyUwRHDtV2wfElSloXKvyS8k6S6DK LIsjnwcchyVg+2AFuBdZCjdEfnecnA0DpS8Pi7flwUQUwCnqSirP/kJ4X+gmepl4tPZZ eS19OiCqS7KhUOYxm1nyfLxhhGCkiJPjTY2Cj26D6SY8pPsdlppyqbxFSW7qauAR/3iV grysaomqkUe96/K7UgsEcCNkMd6gzstdlqjSij4Nj5k57R2zyhACDR6VRq4jzIJnGOyc VkL15vyMGKhhQGpylmF56GRxdFxJsR/Aceeh26adhfPfwccWha+CZ9Lo16P+lSS1SWdn BPVg== 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=Llfpv87dU6lNqIAYceFeHJOsUrdHq3jsS90BaF0whGI=; b=EZxezRbuBlh8jj7+zZjRlCgPzB8meL7NBAV7iHkZiwaKVKKKOTWp1r/2ygmSjLfJaf UIvAvOlU8P5whLOahQdCV6tk3QzN/qJ5GxUWG93cXGr5/peaMOZryyqtCQdNN0eQGfiU jmqEb8XtgVmq1YV0KPwZN7ad5dRiMe3xRWCOP455uMUcFH8ypghRQSdkdhjVK1DHm9zl sat+fre5S7+TZKeIOtd0DsX01lz9UFFS3Nf0Y9TOstKq5bRzmz8U6rODc3RH/4yuTO/x 9tEu3gVowBmYlzBXz2nh+/0A1AaHd3JfJeWVrHyLbEdS0d6Qn6IEX9rHH9sWEVqY3WaJ QsAg== 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 v31si358536qtc.174.2017.09.05.03.36.56; Tue, 05 Sep 2017 03:36:56 -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 16C0761056; Tue, 5 Sep 2017 10:36:56 +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 B2AA360F1D; Tue, 5 Sep 2017 10:11:58 +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 1E1C060D8D; Tue, 5 Sep 2017 10:11:39 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 3687E60C63 for ; Tue, 5 Sep 2017 10:07:16 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward106o.mail.yandex.net (Yandex) with ESMTP id A34AA78472F for ; Tue, 5 Sep 2017 13:07:14 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id eZkKlq9RTn-7ExCpBRs; Tue, 05 Sep 2017 13:07:14 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7CWa9Tztus-7Eeqf1XG; 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:06:59 +0300 Message-Id: <1504606026-28181-3-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 2/9] linux-gen: pktio: loop: support IPsec outbound 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 outbound 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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index 428b6ceb..6cc86e6a 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -164,6 +164,22 @@ static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED, bytes += odp_packet_len(pkt_tbl[i]); } + if (pktio_entry->s.config.outbound_ipsec) + for (i = 0; i < len; ++i) { + odp_buffer_t buf = buf_from_buf_hdr(hdr_tbl[i]); + odp_ipsec_packet_result_t result; + + if (_odp_buffer_event_subtype(buf) != + ODP_EVENT_PACKET_IPSEC) + continue; + + /* Possibly postprocessing packet */ + odp_ipsec_result(&result, pkt_tbl[i]); + + _odp_buffer_event_subtype_set(buf, + ODP_EVENT_PACKET_BASIC); + } + odp_ticketlock_lock(&pktio_entry->s.txl); queue = queue_fn->from_ext(pktio_entry->s.pkt_loop.loopq); @@ -213,6 +229,8 @@ 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.outbound_ipsec = 1; + return 0; }