From patchwork Mon Jul 24 14:01:22 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: 108573 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp3890224obm; Mon, 24 Jul 2017 07:04:58 -0700 (PDT) X-Received: by 10.237.56.73 with SMTP id j67mr22301763qte.51.1500905097863; Mon, 24 Jul 2017 07:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500905097; cv=none; d=google.com; s=arc-20160816; b=GAVjlfxEMOWGUtXallH9Jdnlfy3wMcvM1hWVTtxUzRLd98RWSWRckAHO06g20y3Py9 A6fd7SC1c2Mvrq6ZAPOpioHpx6Ug/AYcTWUkzfycZtRaIV9jxnuWgPPnPYdnxw1Ee5lR +fVWoegbQLoVbDHQ1MGHo+a1Xrs7z387ldVrpd5NsSUqXLHXG919z1ds1hYJucVE7uz2 7UnOhh8uB+P4SAjp+gjovBltRgfU4003Whe/dgSK8I100zPRlZjVsykOzepFlpwjMCki psrR2E/PKkgKFcDBfTbNk8X/R1jwQaCRXN26SIA1j2C/OPnBufI/cV4H+Q5I9iYZj5s4 vpVA== 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=/+6ynfEF4mWldI3onMLoDVFCPd8xjPemX3cMwppSHOE=; b=WSQWAXHtZiNyTYW4kXeC6N5r+lyVkn5Tdy/dhQUVIhiDFkeTwfD3mar1LhiStc3VdC H5jA+yNMA8Tq1qdM90ygETMDMTCFMN8Hl/Ocymcffkzy7/XfVBKgMTFkOjMPFroD4N/n Xe94JRPPKdUM+AyeBnIEk4xYywdFh47vEiqMdL9ZIICvERrjbsSodLiZ5mwbZjFL8x2h WzmPC/ehzBoNRPefYQJYew+py/5Q5OgmMlluFbeGzyQmt8dZjX+x+/z6jUdVpkmx98uc RWylpizV7S1rn7SqPl7ycs+jFobEfqYp9r8ARAL2+6ymVtNYoG4HNBGnuHjEyzoQXtQc eppQ== 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 u26si8375680qtf.218.2017.07.24.07.04.56; Mon, 24 Jul 2017 07:04: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 BD4A164482; Mon, 24 Jul 2017 14:04: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=-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 BE80B6448C; Mon, 24 Jul 2017 14:02:26 +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 685EE64471; Mon, 24 Jul 2017 14:01:59 +0000 (UTC) Received: from forward1m.cmail.yandex.net (forward1m.cmail.yandex.net [5.255.216.2]) by lists.linaro.org (Postfix) with ESMTPS id 06B3464475 for ; Mon, 24 Jul 2017 14:01:42 +0000 (UTC) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::27]) by forward1m.cmail.yandex.net (Yandex) with ESMTP id A7A2A2107A for ; Mon, 24 Jul 2017 17:01:40 +0300 (MSK) Received: from smtp3o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3o.mail.yandex.net (Yandex) with ESMTP id 716A02940D8E for ; Mon, 24 Jul 2017 17:01:39 +0300 (MSK) Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id xiIIHlGTcI-1dL8lVoP; Mon, 24 Jul 2017 17:01:39 +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:22 +0300 Message-Id: <1500904888-11014-2-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 1/7] 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: db7cc41aeb559dd296f3a6d8570aa10326a31d5e ** Merge commit sha: b783305474c8ca3a4ce862c64e2ce5aa8348f2df **/ 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; }