From patchwork Tue Dec 12 16:00:23 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: 121561 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4332679qgn; Tue, 12 Dec 2017 08:23:52 -0800 (PST) X-Google-Smtp-Source: ACJfBotHkwwnNHyk0ENztXb0RsC3qDBZejFUfQgAuFZlxuQujT3Tq/QaNXkAqgn7aO7rTMW9Sia0 X-Received: by 10.55.109.4 with SMTP id i4mr5917881qkc.17.1513095832509; Tue, 12 Dec 2017 08:23:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513095832; cv=none; d=google.com; s=arc-20160816; b=CrGpoUgH9Y/moTZNdAYBzkjH+zOZ9vs23f8ftphWwyHTXnFVsrebhaaYEVZEDrqTPo R0OMJDP3Lhr3bXADV/Or2K7RX5MSCqXPd9vSJPgUP3cNUxX4tnzPtnpJ5XYdnaVAbMiH LpjrnrfRZ6VTuQZU3xwEvAilqyo3UwA875PIR7LdTSfF5EpRaLZqDyoPPyn9AuVF+d8K N6JHqWZfxkiAOeZcGd6/bxUvFy96qvTRB7orcs1ry9qXYkeJtRR4iZovIau6eyKsmMm2 Z/Rag7HFXQbraclwd4Cg4Rtbh8psPzolOM993RuGm0xDg7ln/RAgWhZaRKmrtcnSr6AU hrxw== 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=7EYvM/CvsPNRByW33pxnZ5SWisXvwlifBm0yevtICp8=; b=Xc0Dur9K3uJSDmZLNX8K+ekW/xLierd2zo2jI3BgJ99VbUTcNjVAKiKfvZq/YOxtTE G4bZBncjmWQSkAkXTJHYzqgsLOd/aWALUo7CfO/bM07mqC4sckVbt8S1eoL94qbxGuPK HaJSZ1y5gM6CUpErAtWsjbYzdYq8Q+QdtW2IMTxfQeiZ8qGUH0OA3Aunafxjbu1QQqg6 IGBXU7zdqWMOmBrjo4lpDBOXNTtCOmDq+OLN82hqaxM0QCITvkkZahUNnV+OVA9hWBd/ v7VasrfrDeGOenrn0wIQbeqJQFN8lVgaVVzpKoCmXwbKFpJ9NIUZh7DIy++AcvtGnkHg RiXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 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 (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id d26si9298374qta.64.2017.12.12.08.23.52; Tue, 12 Dec 2017 08:23:52 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 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 36273608DF; Tue, 12 Dec 2017 16:23:52 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 43556608ED; Tue, 12 Dec 2017 16:05:49 +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 B4C16608ED; Tue, 12 Dec 2017 16:05:42 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id A97F6608ED for ; Tue, 12 Dec 2017 16:00:42 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 78B526A838DE for ; Tue, 12 Dec 2017 19:00:41 +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 T6ydH33CBw-0fIOVS9c; Tue, 12 Dec 2017 19:00:41 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id P8VUaNg7sx-0eF4ngcO; Tue, 12 Dec 2017 19:00:41 +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, 12 Dec 2017 19:00:23 +0300 Message-Id: <1513094423-671-17-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513094423-671-1-git-send-email-odpbot@yandex.ru> References: <1513094423-671-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 304 Subject: [lng-odp] [PATCH API-NEXT v11 16/16] linux-gen: ipsec: pass checksum flags to packet parsing code 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 Pass checksum and protocol parsing flags to packet parsing code. Checksum checks are not yet implemented by odp_packet_parse, it will be done later. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 304 (lumag:ipsec-ipv6-2) ** https://github.com/Linaro/odp/pull/304 ** Patch: https://github.com/Linaro/odp/pull/304.patch ** Base sha: 65d690fbcf03c6a4d5eb3f01bde36807833feaaa ** Merge commit sha: 2212038b2ceac423819d283ce07106fabe438631 **/ platform/linux-generic/odp_ipsec.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 6568924a3..c27de1d51 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -605,6 +605,7 @@ static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt, odp_crypto_packet_op_param_t param; int rc; odp_crypto_packet_result_t crypto; /**< Crypto operation result */ + odp_packet_parse_param_t parse_param; odp_packet_hdr_t *pkt_hdr; state.ip_offset = odp_packet_l3_offset(pkt); @@ -770,15 +771,15 @@ static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt, goto err; } - pkt_hdr = odp_packet_hdr(pkt); - - packet_parse_reset(pkt_hdr); + parse_param.proto = state.is_ipv4 ? + ODP_PROTO_IPV4: + ODP_PROTO_IPV6; + parse_param.layer = ipsec_config.inbound.parse; + parse_param.chksums = ipsec_config.inbound.chksums; - packet_parse_l3_l4(pkt_hdr, parse_layer(ipsec_config.inbound.parse), - state.ip_offset, - state.is_ipv4 ? - _ODP_ETHTYPE_IPV4 : - _ODP_ETHTYPE_IPV6); + /* We do not care about return code here. + * Parsing error should not result in IPsec error. */ + odp_packet_parse(pkt, state.ip_offset, &parse_param); *pkt_out = pkt;