From patchwork Fri Jul 28 17:05: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: 108896 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp689015obm; Fri, 28 Jul 2017 10:05:50 -0700 (PDT) X-Received: by 10.200.51.101 with SMTP id u34mr7055640qta.156.1501261550161; Fri, 28 Jul 2017 10:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501261550; cv=none; d=google.com; s=arc-20160816; b=LTt2d1MOe6KdlpaHUoXBXr3dPyC93MQI/7wr3Escfd56+ZRokwFq9AzAZ01Rs3mnhv j1ZD21nn2NQ8EgkL+tU9/kBPwcP9qXfxoxRDtCDV5Jf7cQxP4V7oFbx8TqXXNmdaGY81 ie+q1I1ZkEl+13qWqd2hOjkumE45osC8V17WdCte55EeEwolNy1BiIfB43tXGBQN50qN etyNP+MOkdiXODSbSHjMBwdfmTmB+p3CVo0qwlgvqlcjwTMiKK4Mgwm+q1hJXLx6Sh14 oU0WQ7V6Dqg87mdd36H63Q3GZcF06H9VhqnFwdsNE7DGFckyU7K4ocJtcbqCOY5OxKOW YoOA== 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=rya439XjLQL3GjJCm/8Ywpx9WaSW4L9nH0K7c0DXbuQ=; b=Q4JG13s4ZUv2q56QgZ1THihzOKcOQPDHy4V9j1Ej8RkxjV+6KgFIUOPbn6j6yf9+fx wNimXIkk1aJs/LA8kXVSt5l7CibDFf006HsvHNvJVa5In/PqjdD1gkvS73hCSJutYw6Y pNC3GXY+xl8NRN79ezhb7Qs6rnNwEpaB1cxsrT0pWPz8u9XTplIH0WwJd1JiiAoZCTkC f6UM7taKwhNc/IHp1+UK+g4r9Sl/iEP1+sziTO75QvssEh2FmWWzOyux71WD3anKm4Vw LC5MhbvqFMbhy70/Y+nDm5tbZjzxG6EHk6F98Q23OT2kGpGz2fmUPrw31TvmpKnQxXgD RkSQ== 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 t9si17815172qkt.381.2017.07.28.10.05.49; Fri, 28 Jul 2017 10:05:50 -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 5E95D60ACA; Fri, 28 Jul 2017 17:05:49 +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 25867607BA; Fri, 28 Jul 2017 17:05:45 +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 6DF59607BA; Fri, 28 Jul 2017 17:05:42 +0000 (UTC) Received: from forward2j.cmail.yandex.net (forward2j.cmail.yandex.net [5.255.227.20]) by lists.linaro.org (Postfix) with ESMTPS id 302B360679 for ; Fri, 28 Jul 2017 17:05:41 +0000 (UTC) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [95.108.130.60]) by forward2j.cmail.yandex.net (Yandex) with ESMTP id 5FA4420BF5 for ; Fri, 28 Jul 2017 20:05:39 +0300 (MSK) Received: from smtp2j.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp2j.mail.yandex.net (Yandex) with ESMTP id 31D523EC0F5B for ; Fri, 28 Jul 2017 20:05:38 +0300 (MSK) Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id bONARX2tzS-5b7SJ9KD; Fri, 28 Jul 2017 20:05:37 +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: Fri, 28 Jul 2017 20:05:00 +0300 Message-Id: <1501261507-8618-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501261507-8618-1-git-send-email-odpbot@yandex.ru> References: <1501261507-8618-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v6 1/8] 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: 56dbc8702500f7d7e518fcea4f3b1ff853722004 ** Merge commit sha: ba0b39db1fc90b24a3db1e85e00c2c485b235a47 **/ platform/linux-generic/pktio/loop.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index c825393a..5b7a9692 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -166,6 +166,18 @@ static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED, for (i = 0; i < len; ++i) { hdr_tbl[i] = packet_to_buf_hdr(pkt_tbl[i]); bytes += odp_packet_len(pkt_tbl[i]); + + if (pktio_entry->s.config.outbound_ipsec && + _odp_buffer_event_subtype(hdr_tbl[i]->handle.handle) == + ODP_EVENT_PACKET_IPSEC) { + odp_ipsec_packet_result_t result; + + /* Possibly postprocessing packet */ + odp_ipsec_result(&result, pkt_tbl[i]); + + _odp_buffer_event_subtype_set(hdr_tbl[i]->handle.handle, + ODP_EVENT_PACKET_BASIC); + } } odp_ticketlock_lock(&pktio_entry->s.txl); @@ -217,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; }