From patchwork Mon Sep 25 22:00:20 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: 114190 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3112012qgf; Mon, 25 Sep 2017 15:11:06 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCx/sGSpPAoA0rmXgrzB2mdgvHApL5pupbHR8qdBz5hi4/c9x2PrgkqeoViQLfIrLLpY8vZ X-Received: by 10.36.82.145 with SMTP id d139mr2816149itb.86.1506377466709; Mon, 25 Sep 2017 15:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506377466; cv=none; d=google.com; s=arc-20160816; b=LyfOHmUOS7x/MW+p4z4htzd8n9MzWPBej9OPYuO2qWETZvuT49gUPnKjqNQNInQgbg f7vP5vcIFonr+L0ZWlDs1YVPPKK4OlhzRo8a8G35w43tWH8ZoOa0zvGF6AtUsM2EBmci dSfLJFzNWkECXzp4eNZDyxlWGAHfVQwsHQdDLsM5NoTKNn5un+yYDZmUfcqGaVroZzs7 BXavIIXfZXlRqI6ra3CNwOq/6CHdRSU1z07HEPxTTLX7j8tuc/H1FIxmJIlGaC2G2pUR XYfHubHBCxWEhO3fqLNDOOmPaBO4NIgkka8JLUOIklZ6OxpNDs67gTrQv0hg7sbLa+s7 QsDA== 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=9wrhiOWUC1whT8eJklsm+ztgzEJuqt/Hs8H6VDoqr68=; b=MOO+YOZZs4qOnMj6LLob6l/Ots87YSUvQFAkGsJiwOMWbGBZD+bhqyITN8KLzWKJ8F /ecGPFDoW+4HI8ooeqmuc2gnWsCKdaGIlLJuMK5Z482kBbasKK1magAJK1aD/iwXIIWb FSDHyRAdOGkmSapKobHTCvKZie5fjXeTQsS+p6u8o14aEWLBeFUED3z1XQQ6VIlkQ3mt kBUuZsoxljnRhUa+RlLu1v72mpAZ8D8HW78+fU0QiaZFVlgHhFgwuqrMNpf8VKHvqb3Z g2CjbSQA5WgmS/1ZvlI8cAkP0i1jVP5WZGD6S/YYfHtD14Ne5rVOUR8pzIuQm5r9LUbo srxQ== 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 a198si437349itc.70.2017.09.25.15.11.06; Mon, 25 Sep 2017 15:11:06 -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 2418560D79; Mon, 25 Sep 2017 22:11:06 +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 D783960CA0; Mon, 25 Sep 2017 22:02:42 +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 45C2A60BDB; Mon, 25 Sep 2017 22:02:28 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id C509E60BE3 for ; Mon, 25 Sep 2017 22:01:03 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 4BA551343A11 for ; Tue, 26 Sep 2017 01:01:02 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id eCviJh4cLY-0cQahepT; Tue, 26 Sep 2017 01:00:38 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id y0gxWEywlF-0b4KrL4Q; Tue, 26 Sep 2017 01:00:37 +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, 26 Sep 2017 01:00:20 +0300 Message-Id: <1506376827-27848-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506376827-27848-1-git-send-email-odpbot@yandex.ru> References: <1506376827-27848-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 81 Subject: [lng-odp] [PATCH API-NEXT v19 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: 13322ca632f8ffba292bec058e597719bc54142d ** Merge commit sha: 04f37d8f29d26df3744151a85a19ef9b55b3d1f7 **/ 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 428b6cebd..6cc86e6af 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; }