From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A30B1A0032; Tue, 28 Sep 2021 13:14:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D229410F4; Tue, 28 Sep 2021 13:14:13 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 9DE44410EF for ; Tue, 28 Sep 2021 13:14:08 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18SAIJVD020820; Tue, 28 Sep 2021 04:14:07 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=EGvcVk+ezziEkWI/agKM8ykGXRy9K0u9cFzLks7XGlo=; b=J8Eph9+haCl+eJ9YNaJyIBHlKoeP0FuZI8IkIA23gzToRvpscZkP9Og/HGYtEBZGgMWm A0QmQ4ypf+jUfc//xrToNGDY9rrOvAfABDIknKmleMsJxG5k2oaXkbnC2bM3e913PZ0c qBS2Gq5teVYn7EILRACMqoyj2awVjlW8lolmbZWBK/YMv3pbSNpKK09/9dvXru8skYO+ 4aWE8hucuH/irZChJlHIXbCPJQgBrIvH+0Pnozj56ShkxN9QcllkhTHyF4c0FQQLv7KC pnUfy4DT0JGvuqhRgU2cUPFsU0YSiBxK+LWHt4N4wu1Mi7HE6EElmkQGE4NqpIE9m439 Yg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3bc16205vp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 28 Sep 2021 04:14:07 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 28 Sep 2021 04:14:06 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Tue, 28 Sep 2021 04:14:06 -0700 Received: from hyd1554T5810.caveonetworks.com.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 7B2973F70BC; Tue, 28 Sep 2021 04:14:02 -0700 (PDT) From: Tejasree Kondoj To: Akhil Goyal , Radu Nicolau , Declan Doherty CC: Tejasree Kondoj , Anoob Joseph , Ankur Dwivedi , Jerin Jacob , Konstantin Ananyev , Ciara Power , Hemant Agrawal , Gagandeep Singh , Fan Zhang , Archana Muniganti , Date: Tue, 28 Sep 2021 17:37:39 +0530 Message-ID: <20210928120741.16674-2-ktejasree@marvell.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210928120741.16674-1-ktejasree@marvell.com> References: <20210928120741.16674-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: qNn4B_GkKpOVorJqh4MEtDZD8zW6xyy6 X-Proofpoint-GUID: qNn4B_GkKpOVorJqh4MEtDZD8zW6xyy6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-28_05,2021-09-28_01,2020-04-07_01 Subject: [dpdk-dev] [PATCH v2 1/3] security: add option to configure tunnel header verification 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 option to indicate whether outer header verification need to be done as part of inbound IPsec processing. With inline IPsec processing, SA lookup would be happening in the Rx path of rte_ethdev. When rte_flow is configured to support more than one SA, SPI would be used to lookup SA. In such cases, additional verification would be required to ensure duplicate SPIs are not getting processed in the inline path. For lookaside cases, the same option can be used by application to offload tunnel verification to the PMD. These verifications would help in averting possible DoS attacks. Signed-off-by: Tejasree Kondoj Acked-by: Akhil Goyal --- doc/guides/rel_notes/deprecation.rst | 2 +- doc/guides/rel_notes/release_21_11.rst | 5 +++++ lib/security/rte_security.h | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 69fbde0c70..80ae9a6372 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -238,7 +238,7 @@ Deprecation Notices * security: The IPsec SA config options ``struct rte_security_ipsec_sa_options`` will be updated with new fields to support new features like IPsec inner - checksum, tunnel header verification, TSO in case of protocol offload. + checksum, TSO in case of protocol offload. * ipsec: The structure ``rte_ipsec_sa_prm`` will be extended with a new field ``hdr_l3_len`` to configure tunnel L3 header length. diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index 0b7ffa5e50..623b52d9c9 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -181,6 +181,11 @@ ABI Changes soft and hard SA expiry limits. Limits can be either in units of packets or bytes. +* security: add IPsec SA option to configure tunnel header verification + + * Added SA option to indicate whether outer header verification need to be + done as part of inbound IPsec processing. + Known Issues ------------ diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h index 88147e1f57..a10c9b5f00 100644 --- a/lib/security/rte_security.h +++ b/lib/security/rte_security.h @@ -55,6 +55,14 @@ enum rte_security_ipsec_tunnel_type { /**< Outer header is IPv6 */ }; +/** + * IPSEC tunnel header verification mode + * + * Controls how outer IP header is verified in inbound. + */ +#define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR 0x1 +#define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR 0x2 + /** * Security context for crypto/eth devices * @@ -206,6 +214,15 @@ struct rte_security_ipsec_sa_options { * by the PMD. */ uint32_t iv_gen_disable : 1; + + /** Verify tunnel header in inbound + * * ``RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR``: Verify destination + * IP address. + * + * * ``RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR``: Verify both + * source and destination IP addresses. + */ + uint32_t tunnel_hdr_verify : 2; }; /** IPSec security association direction */ -- 2.27.0