From patchwork Sun Nov 12 16:00:05 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: 118665 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp866355qgn; Sun, 12 Nov 2017 08:01:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ+z6B3PlWeURr195o70bx1L6au8H0oTr4Wkktn+dyv3F1o9u4JKwWis+bMvRyW/E2aJ2bD X-Received: by 10.200.24.25 with SMTP id q25mr9247198qtj.266.1510502473185; Sun, 12 Nov 2017 08:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510502473; cv=none; d=google.com; s=arc-20160816; b=rMwL+mN+DgeaYDO33cJuNRTXQ+1nTI5UjhtdbvHkLgs9uPMVNWuVcAKAzRg9/vepFm zT5JN5xMTBJVyCGjLXd0NmSI81I4tGj20duyoN8D0rz2HHvGuppTXT/JCo/TkD+790Fm QLjelMCCRsgWN+M41l/wE+8AEJpFUHgvQl+xK0/bdX1wFLuq4/Sp3OVP1qeH+DpODJ/V bhEw1dKPnbb7QnnM/QqE8Sm9wL4kDrO892uPqsG+2cRdcTh/9NKxx7F9fThmD43SiIzQ koNvrRtOre0hZAc7vx3EeAW0RrRxJJLn5EZvh7/GWH4xZx4JKWKTRX8NTfdVe27Fgn38 S8+g== 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=vcqRVCbUWe5vGZCNOSkslOqofoCqNxazH/T6EtpSaHU=; b=QthOseBvNOUgM5SNV+XQLgHcFprf2j24hVsfMb7duDRrh+wjiEzJyMv3R1ELuEBYYk +c54nRRNQyOTxdxF5VQx4hPIKc2Y9hMto3G7TSh7lnMGdTtY3nC5SARzynpxlc03f50y DDLK4tT/nFt29BaSAxneAqWkyGiDdrPyYxXKdMdRIeyG2aDaHX2bo0hcM+7qdTYMA3+h aOrdxNgppirVpvS59UgDChb02x7Mg66NdK066F/RL6yeXgCOKH9avOMFoi2rQv26JAo4 09Y/RwRZTDhYE1RfeDthxCP8iFSUcjj/6UIHJI1V7BnS654Ky2XfGDkCaLBrKSHZVUrE NdmA== 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 r51si7027996qtc.116.2017.11.12.08.01.12; Sun, 12 Nov 2017 08:01:13 -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 CDE7760A4F; Sun, 12 Nov 2017 16:01:12 +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 21665609C4; Sun, 12 Nov 2017 16:00: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 D8779607A0; Sun, 12 Nov 2017 16:00:11 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 68135609C4 for ; Sun, 12 Nov 2017 16:00:10 +0000 (UTC) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward100p.mail.yandex.net (Yandex) with ESMTP id A6056510DFD8 for ; Sun, 12 Nov 2017 19:00:08 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id qQ5uhZYUzV-08g4eEZJ; Sun, 12 Nov 2017 19:00:08 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lXMUguEPPe-08vChN57; Sun, 12 Nov 2017 19:00:08 +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: Sun, 12 Nov 2017 19:00:05 +0300 Message-Id: <1510502406-25607-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510502406-25607-1-git-send-email-odpbot@yandex.ru> References: <1510502406-25607-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 294 Subject: [lng-odp] [PATCH API-NEXT v1 2/3] linux-gen: crypto: set packet error flag depending on crypto result operation 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 To speed up fast path of crypto packet operations, set error flag depending on the crypto result operation. This allows applications to fast-forward packets w/o errors and inspect crypto result only for erroneous packets. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 294 (lumag:crypto-err-flag) ** https://github.com/Linaro/odp/pull/294 ** Patch: https://github.com/Linaro/odp/pull/294.patch ** Base sha: a908a4dead95321e84d6a8a23de060051dcd8969 ** Merge commit sha: 5a1039aa1f26df3ca3cbb44a047116fe285b5dbc **/ platform/linux-generic/include/odp_packet_internal.h | 1 + platform/linux-generic/odp_crypto.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index fc10d61c8..6473a1aae 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -55,6 +55,7 @@ typedef union { uint32_t tcp_err:1; /**< TCP error, checks TBD */ uint32_t udp_err:1; /**< UDP error, checks TBD */ uint32_t l4_chksum:1; /**< L4 checksum error */ + uint32_t crypto_err:1; /**< Crypto packet operation error */ }; } error_flags_t; diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 79be510d4..ea49e9807 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -1161,6 +1161,7 @@ int odp_crypto_int(odp_packet_t pkt_in, odp_bool_t allocated = false; odp_packet_t out_pkt = *pkt_out; odp_crypto_packet_result_t *op_result; + odp_packet_hdr_t *pkt_hdr; session = (odp_crypto_generic_session_t *)(intptr_t)param->session; @@ -1214,6 +1215,9 @@ int odp_crypto_int(odp_packet_t pkt_in, (rc_cipher == ODP_CRYPTO_ALG_ERR_NONE) && (rc_auth == ODP_CRYPTO_ALG_ERR_NONE); + pkt_hdr = odp_packet_hdr(out_pkt); + pkt_hdr->p.error_flags.crypto_err = !op_result->ok; + /* Synchronous, simply return results */ *pkt_out = out_pkt;