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 C9147A034F; Sun, 3 Oct 2021 23:09:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B02CE41278; Sun, 3 Oct 2021 23:09:53 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 865D54125B for ; Sun, 3 Oct 2021 23:09:51 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="248483513" X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="248483513" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 14:09:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="542840804" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP; 03 Oct 2021 14:09:50 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Sun, 3 Oct 2021 14:09:50 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Sun, 3 Oct 2021 14:09:50 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Sun, 3 Oct 2021 14:09:50 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Sun, 3 Oct 2021 14:09:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AGZSIfYIiYVp4r4aSOCOKcvYIIUPqMyGrRphObw2UpHZcQG5OxX5/tUiya0tXKlPG0UaI5+u3n4wu1tin66mPjSyBrEg+tWoDvclkbl5kYGo2yPIPmaxamFGkYVZzNHsSRauTx5p4It2AJfKr/racN8Pv+es4L6A5Q8dxCT7X3PZ+faZqTbmKaxJmfcvVH+Hy1Bd8u+CbgJoWyQmLrdTaKIpmhRfq3IQmpZcxbcICFhhTEq5vvo1SeaHTczuXPEPXqxwmSY2+UmJrlAjbNSBXXzma+eDylvZVh1fmrsfvLQcWrtcVtrlGudzW9kiIBRSPLDhIdVBSTJbN+Q4ZQKVSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EnZVoVZrg9ymOzGzcnJWVLDYd9Egt6mK3BmRD4I1PUw=; b=NLcLZa6GN7fZxmY8SE/f++A4fMY5Pfu+xZOPy1hOOxiVPj89rqyQ7bTEQr4ENAfFZiT37UXzZa/Ouktw849F42UFor/eeHq1LDR5tMYGZn+MXsd48Jha1RvKzlpvWQzKvK3RIc3lEhhxjS6f4zcJm3Pl3dq3wXeo6dFerqHoL966eF700YHGv4LskANj9gNHddjzfVdvU9kF51FeGpY2wTFKdD4tGShfFPerpmjN1/JyZpXgpFZQpbuzdRBInV0jcM9Joolr7ZzRrQ65tKFiOYPXDFkg+YruXrXVkxOXnI5l7pchcz8pfSAf6okfYHflbmgJ+DD3wnCbE10vU9wBSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EnZVoVZrg9ymOzGzcnJWVLDYd9Egt6mK3BmRD4I1PUw=; b=EfXRNUjdsCEfYIoYFLISvFfhFNg5Zhfn9B6o42Bnr89Pd/FJPCLNBrJUOwiMNuQ/GEZFlQr4vdQxd/KeyeX4sj+cUC8omlWF5qwOzgl4sbh7Bf6OFHcQkx7hyjW1aX7/Xnj559xm8gDBsEDz2usjng+fllRNyzcbh8DSH4gt1jI= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM8PR11MB5686.namprd11.prod.outlook.com (2603:10b6:8:21::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.19; Sun, 3 Oct 2021 21:09:47 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4566.022; Sun, 3 Oct 2021 21:09:47 +0000 From: "Ananyev, Konstantin" To: Archana Muniganti , "gakhil@marvell.com" , "Nicolau, Radu" , "Zhang, Roy Fan" , "hemant.agrawal@nxp.com" CC: "anoobj@marvell.com" , "ktejasree@marvell.com" , "adwivedi@marvell.com" , "jerinj@marvell.com" , "dev@dpdk.org" Thread-Topic: [PATCH v4 1/3] security: add SA config option for inner pkt csum Thread-Index: AQHXtfryGE97kbysgEO7+YI21UJXN6vBySnQ Date: Sun, 3 Oct 2021 21:09:47 +0000 Message-ID: References: <20210930125832.15807-1-marchana@marvell.com> <20210930125832.15807-2-marchana@marvell.com> In-Reply-To: <20210930125832.15807-2-marchana@marvell.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0567ce71-0e92-4295-38aa-08d986b221d2 x-ms-traffictypediagnostic: DM8PR11MB5686: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4714; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Hjfql6SHjrBCJOSXT2ZvI1ltreoyrjeNEQ6lEkcDzdLo+WLnbl0+ml0Fyc9pj3WQ+leHZ60zTLD193bSwKUWOs3v96EoA18bI9CoXDFf+w+drOrk0K1yYgdBT3cmmJzFr1/gZ9hLjRgZs1qYXLFLrKaQUq+Oeyx2LnRni35GyBacRxmJfYZUumwV5QmoNfCgBAzEz9TPdTChovHtnWhGysLkwYbs6yLdpB7LOdNDRe2AdjHgb/5MSUs0DeOeLDOi6qn94dcEA0lDqm6WWu1pOCYItdaTnLSOukaQli65/HISQASodusecUwTg56ubn2HouHeRcWOVscMdd3c4ODkfhDKARiGSFC5gNg8ih55I+CLWHMLF+xti8k2sdQCG7cTw97idZOp2OuZs0csKJHSmR/cwgEKV0iKay1UtwkM6jteGk64gUsSTjgT7Jw7uOCwBk2JYvcUOHpDvmv/fgWfuSKUVxLO/NJR0dA78JlxL7rChAUYVZuXO2HHzTHqkBgtALnFSLt8qw4+n+fKauhrQuI52/WLKovQJ9WF1Li5DBUtie3cwX0QXOyIyk3fsBojo3+1CrAZBCRpMjAoF/+vL1j7bqMFKT8cwxw+ZsITQQ0dmTOQd9HnElV7Ld2/ISYZhOnCCaRCvBRaHDBhYXaXVmI56WjCYztJF8hTmu6lJoMrcHZAxINwo1m9pIF+H3CAONtP5tWFuuJzJAnqIRsaZkuIHBSm8h+kHnwZ2jp65UI= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016002)(5660300002)(508600001)(86362001)(122000001)(83380400001)(55236004)(9686003)(54906003)(110136005)(316002)(71200400001)(52536014)(15650500001)(33656002)(38070700005)(186003)(38100700002)(6506007)(66556008)(66476007)(2906002)(64756008)(66446008)(66946007)(8936002)(76116006)(8676002)(4326008)(7696005)(26005)(21314003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LlvR6TwMZv1mLZHijRsmDwBYi12BjTKVBgxs7700bNSMyFDDlBnyGJYEKTCy?= =?us-ascii?Q?msW06JY51IhtsUxgd0la5azNEPb/VwZUTiMf628zLV4X1nnJbjUG/wYCx3hL?= =?us-ascii?Q?PfSYFOt0SF3Dyi3pmcMDyi+S69elOhm5SfpyldMyPCGyc7NDJfR6M8jJnW2p?= =?us-ascii?Q?Vr90guhj8stK/sSjyoPu9a9la4m4xVUZlAAdklreFDdqqze2GkfVa6gf6RXr?= =?us-ascii?Q?b/KbLh39eXjUXbkzBwTf/KDwZGW/jo4Bs5DntNxCRFOnrWsYAvRfCHvmplA8?= =?us-ascii?Q?YC3Ta011LkbZnJHzW9ykyLAlyjl/bpkYTBRNrwet+LXaipDcaqeLWm2o6X/y?= =?us-ascii?Q?3LPCZF+jrLrVye4Z1OCwvxzGLiuCrm0Rf16+fBA8Y62GnY5raTw3L0QOUwit?= =?us-ascii?Q?hSRe0Rc+vlQT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m6gpxsGCCq?= =?us-ascii?Q?kWPaMxWnGiueZI0QE1wx8J6R?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0567ce71-0e92-4295-38aa-08d986b221d2 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2021 21:09:47.7962 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OTOW8n9Ie2wkmFEkOpIJ20osbxVc+cwgUB2hn6RUoN3wT9oXZZlmBVQVj7JuIVZm3TH00wfada/YmZSsINnwIe7nEkKv/LUMoTX8EOIVen8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5686 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4 1/3] 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" >=20 > 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. >=20 > Signed-off-by: Archana Muniganti > --- > doc/guides/cryptodevs/features/default.ini | 1 + > doc/guides/rel_notes/deprecation.rst | 4 +-- > doc/guides/rel_notes/release_21_11.rst | 4 +++ > lib/cryptodev/rte_cryptodev.h | 2 ++ > lib/security/rte_security.h | 31 ++++++++++++++++++++++ > 5 files changed, 40 insertions(+), 2 deletions(-) >=20 > diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryp= todevs/features/default.ini > index c24814de98..96d95ddc81 100644 > --- a/doc/guides/cryptodevs/features/default.ini > +++ b/doc/guides/cryptodevs/features/default.ini > @@ -33,6 +33,7 @@ Non-Byte aligned data =3D > Sym raw data path API =3D > Cipher multiple data units =3D > Cipher wrapped key =3D > +Inner checksum =3D >=20 > ; > ; Supported crypto algorithms of a default crypto driver. > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/= deprecation.rst > index 05fc2fdee7..8308e00ed4 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -232,8 +232,8 @@ Deprecation Notices > IPsec payload MSS (Maximum Segment Size), and ESN (Extended Sequence N= umber). >=20 > * security: The IPsec SA config options ``struct rte_security_ipsec_sa_o= ptions`` > - will be updated with new fields to support new features like IPsec inn= er > - checksum, TSO in case of protocol offload. > + will be updated with new fields to support new features like TSO in ca= se of > + protocol offload. >=20 > * 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_note= s/release_21_11.rst > index 3ade7fe5ac..5480f05a99 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -196,6 +196,10 @@ ABI Changes > ``rte_security_ipsec_xform`` to allow applications to configure SA sof= t > and hard expiry limits. Limits can be either in number of packets or b= ytes. >=20 > +* security: The new options ``ip_csum_enable`` and ``l4_csum_enable`` we= re added > + in structure ``rte_security_ipsec_sa_options`` to indicate whether inn= er > + packet IPv4 header checksum and L4 checksum need to be offloaded to > + security device. >=20 > Known Issues > ------------ > diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.= h > index bb01f0f195..d9271a6c45 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_asy= m_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 */ >=20 > /** > * Get the name of a crypto device feature flag > diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h > index ab1a6e1f65..0c5636377e 100644 > --- a/lib/security/rte_security.h > +++ b/lib/security/rte_security.h > @@ -230,6 +230,37 @@ struct rte_security_ipsec_sa_options { > * * 0: Do not match UDP ports > */ > uint32_t udp_ports_verify : 1; > + > + /** Compute/verify inner packet IPv4 header checksum in tunnel mode > + * > + * * 1: For outbound, compute inner packet IPv4 header checksum > + * before tunnel encapsulation and for inbound, verify after > + * tunnel decapsulation. > + * * 0: Inner packet IP header checksum is not computed/verified. > + * > + * The checksum verification status would be set in mbuf using > + * PKT_RX_IP_CKSUM_xxx flags. > + * > + * Inner IP checksum computation can also be enabled(per operation) > + * by setting the flag PKT_TX_IP_CKSUM in mbuf. > + */ > + uint32_t ip_csum_enable : 1; > + > + /** Compute/verify inner packet L4 checksum in tunnel mode > + * > + * * 1: For outbound, compute inner packet L4 checksum before > + * tunnel encapsulation and for inbound, verify after > + * tunnel decapsulation. > + * * 0: Inner packet L4 checksum is not computed/verified. > + * > + * The checksum verification status would be set in mbuf using > + * PKT_RX_L4_CKSUM_xxx flags. > + * > + * Inner L4 checksum computation can also be enabled(per operation) > + * by setting the flags PKT_TX_TCP_CKSUM or PKT_TX_SCTP_CKSUM or > + * PKT_TX_UDP_CKSUM or PKT_TX_L4_MASK in mbuf. > + */ > + uint32_t l4_csum_enable : 1; > }; >=20 > /** IPSec security association direction */ > -- Acked-by: Konstantin Ananyev > 2.22.0