From patchwork Wed Jun 30 11:12:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Archana Muniganti X-Patchwork-Id: 95052 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ADBB0A0A0F; Wed, 30 Jun 2021 13:13:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F12440141; Wed, 30 Jun 2021 13:13:24 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id EDC1440040 for ; Wed, 30 Jun 2021 13:13:22 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15UB8Vi8011209; Wed, 30 Jun 2021 04:13:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Eo5Ng1QP935Vs8+epMoOvhF+rte6AMKXAL937+zPHwY=; b=YwnrfqsfkO27QO29BjEyK9rQIWCpKM5G8HQrroo65d6TlK9yZIqPztfIfMeE5bAAyny8 I13Hps3e//BQcutayGy6Vair/R7rngBptmJDWMiTUX7UlXwnJ0DPMBM4X6H02tczdnQ6 fL/Ih9Hx56Szeje/VaCnVOmxC/2xFsSb3TYfnByMVgfXJN3q0ZOgL9AQri3FRHMs78ns hfDa2tULaAIPD8ZJgCaT98TL79PCRmZpbzDxfC4OM0HL5qHzq6PNKZZeWDA95r8erYJU GX+JfA7WdHW3d9E5nayL8LEFCUIXTbcNoJniSVCgjosGOhLIosRvWt0BG3jqQiVrlIgK aQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 39g93du5ph-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 30 Jun 2021 04:13:22 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 30 Jun 2021 04:13:20 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Wed, 30 Jun 2021 04:13:20 -0700 Received: from hyd1409.caveonetworks.com.com (unknown [10.29.45.15]) by maili.marvell.com (Postfix) with ESMTP id AF3803F7094; Wed, 30 Jun 2021 04:13:17 -0700 (PDT) From: Archana Muniganti To: , , , CC: Archana Muniganti , , , Date: Wed, 30 Jun 2021 16:42:48 +0530 Message-ID: <20210630111248.746-1-marchana@marvell.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: KWwIxlERMkBwyIc7MnwVBVDozKC2p49U X-Proofpoint-GUID: KWwIxlERMkBwyIc7MnwVBVDozKC2p49U X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-30_05:2021-06-29, 2021-06-30 signatures=0 Subject: [dpdk-dev] [RFC] lib/security: add SA config option for inner pkt csum X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add inner packet IPv4 hdr and L4 checksum enable options in conf. These will be used in case of protocol offload. Per SA, application could specify whether the checksum(compute/verify) can be offloaded to security device. Signed-off-by: Archana Muniganti --- lib/cryptodev/rte_crypto.h | 9 +++++++++ lib/cryptodev/rte_cryptodev.h | 2 ++ lib/security/rte_security.h | 17 +++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/lib/cryptodev/rte_crypto.h b/lib/cryptodev/rte_crypto.h index fd5ef3a876..3510ed109f 100644 --- a/lib/cryptodev/rte_crypto.h +++ b/lib/cryptodev/rte_crypto.h @@ -52,6 +52,15 @@ enum rte_crypto_op_status { /**< Operation failed due to invalid arguments in request */ RTE_CRYPTO_OP_STATUS_ERROR, /**< Error handling operation */ + RTE_CRYPTO_OP_STATUS_WAR = 128, + /**< + * Operation completed successfully with warnings. + * Note: All the warnings starts from here. + */ + RTE_CRYPTO_OP_STATUS_WAR_L3_CSUM_BAD, + /**< Operation completed successfully with invalid L3 checksum */ + RTE_CRYPTO_OP_STATUS_WAR_L4_CSUM_BAD, + /**< Operation completed successfully with invalid L4 checksum */ }; /** diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index 11f4e6fdbf..6a6a2d0537 100644 --- a/lib/cryptodev/rte_cryptodev.h +++ b/lib/cryptodev/rte_cryptodev.h @@ -479,6 +479,8 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum, /**< Support operations on multiple data-units message */ #define RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY (1ULL << 26) /**< Support wrapped key in cipher xform */ +#define RTE_CRYPTODEV_FF_SECURITY_INNER_CSUM (1ULL << 27) +/**< Support inner checksum computation/verification */ /** * Get the name of a crypto device feature flag diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h index 88d31de0a6..2fdefab878 100644 --- a/lib/security/rte_security.h +++ b/lib/security/rte_security.h @@ -181,6 +181,23 @@ struct rte_security_ipsec_sa_options { * * 0: Disable per session security statistics collection for this SA. */ uint32_t stats : 1; + + /** Compute/verify inner packet IPv4 header checksum + * + * * 1: In tunnel mode, compute inner packet IPv4 header checksum + * before tunnel encapsulation, or verify after tunnel + * decapsulation. + * * 0: Inner packet IP header checksum is not computed/verified. + */ + uint32_t ip_csum_enable : 1; + + /** Compute/verify inner packet L4 checksum + * + * * 1: In tunnel mode, compute inner packet L4 checksum before + * tunnel encapsulation, or verify after tunnel decapsulation. + * * 0: Inner packet L4 checksum is not computed/verified. + */ + uint32_t l4_csum_enable : 1; }; /** IPSec security association direction */