From patchwork Tue Aug 1 03:00:14 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: 109094 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp958587qge; Mon, 31 Jul 2017 20:01:42 -0700 (PDT) X-Received: by 10.200.45.98 with SMTP id o31mr23732398qta.43.1501556502199; Mon, 31 Jul 2017 20:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501556502; cv=none; d=google.com; s=arc-20160816; b=jAA3VdqNsizVTzmqAutfYmfyQ/akUrSVkxD8udFsEX7C4YvXKImB/Yz8gt4te9qVA9 mf/FJMP1grund10VkSQ5uaDSKm0fsyod838ik+pkXSWoJImoEIQVD63nULKbWYEyG2Y9 yEUcEuNZZcAQFc6QRegyJYPO/5PwD95PkLPF16OhT0+wKIr6yEdhMqzvkHzHJRNO6Ui6 wAFWduyJ2ioJaKNsMbcciP8YL4YhjZCecd6Uym5kO2Og4tCL1OWFh8+T0xqw/nej8SqT Y1HtPwDmjkYohXcd4owkn/Uz5skKLPla6SfBQEH9UStTzL0SNgnJPUg1Z7l2SvVNTfh0 XIVA== 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=PN/iUoHy+8+HWPi/eWJB9jp9xNjT6IcVI/sD6XF/g/E=; b=yJ5VnnHxSao3tRLGyrLxOVDxyi1j9r6OfWav0cZUvAQCQ5iE7mGeBfTexo+Un/o1c6 iPwJ8ZUN5u053xR+gho5Sf1Xd2jBUEoTfdOVPhzIz4XCiHrOxDWQO7Ho5b0RWZzfBkQ6 a8IkFXzZdjqmT/m0xtz5XVfNl18juzmZoZZGkHgRuMtBm5X28kcdFd0NQ5Fd+GKVP3rP jPjt1Om1MtgZet55PXxdi3tTitCZy23+WmDrkbBlR68m4GYc+x1RFR/JF3Jx6ys5og4u hD+I6dBPCOebkVLKMogUNUbYZ5PIl40pf1OLvBiXwB0/7RGmRT6iyjgUfA3yUpTkFkrV sVkg== 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 s24si24853203qks.555.2017.07.31.20.01.41; Mon, 31 Jul 2017 20:01:42 -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 C2AA465D25; Tue, 1 Aug 2017 03:01:41 +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 98EBA6448C; Tue, 1 Aug 2017 03:01:19 +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 416D9644BD; Tue, 1 Aug 2017 03:01:15 +0000 (UTC) Received: from forward3o.cmail.yandex.net (forward3o.cmail.yandex.net [37.9.109.247]) by lists.linaro.org (Postfix) with ESMTPS id D03446448C for ; Tue, 1 Aug 2017 03:00:32 +0000 (UTC) Received: from smtp3m.mail.yandex.net (smtp3m.mail.yandex.net [77.88.61.130]) by forward3o.cmail.yandex.net (Yandex) with ESMTP id 11B4F20DDC for ; Tue, 1 Aug 2017 06:00:31 +0300 (MSK) Received: from smtp3m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3m.mail.yandex.net (Yandex) with ESMTP id DE9E12840CC1 for ; Tue, 1 Aug 2017 06:00:30 +0300 (MSK) Received: by smtp3m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id fhHHAuvzj7-0U6uRRIa; Tue, 01 Aug 2017 06:00:30 +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: Tue, 1 Aug 2017 06:00:14 +0300 Message-Id: <1501556421-14133-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501556421-14133-1-git-send-email-odpbot@yandex.ru> References: <1501556421-14133-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v10 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: c16f1363303cd5fc11324acbc4dfebe0a9680a41 ** Merge commit sha: 3b68f39ef3adaf4551e78d31bde736a535ae7ba6 **/ 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..cee438ab 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(buf_from_buf_hdr(hdr_tbl[i])) == + 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(buf_from_buf_hdr(hdr_tbl[i]), + 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; }