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 8D587A0547; Wed, 29 Sep 2021 12:56:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 12BEE410D7; Wed, 29 Sep 2021 12:56:35 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 12E6640685 for ; Wed, 29 Sep 2021 12:56:32 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10121"; a="288571546" X-IronPort-AV: E=Sophos;i="5.85,332,1624345200"; d="scan'208";a="288571546" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2021 03:56:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,332,1624345200"; d="scan'208";a="617396260" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 29 Sep 2021 03:56:31 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 29 Sep 2021 03:56:30 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 29 Sep 2021 03:56:30 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 29 Sep 2021 03:56:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fbO8a5WPPkXt/JUh/hLloXuP4kmuS1FB3E8wFgJrzJQWZHP5oXmQSEklZ3aTsyBO7Du85CfsyfLk0JoxupxflxTyS704SbdbRWxavCvtoMMe9VS8p/KYhrC/aT/yeMUU/tGZw87dgishlk9TzGUtT2xj3DlIqBlUoci0OS3jG7QW7/26+KJI83LArOfapuSsAR/J/rbSHUpo++tUeyBxmtIodkd5bZuYVsCYDKvAbKkXwx6BR40a0UMgmERtPPT6tBFPfLl8NzYGefIgOknHsb2OsdZ+fm8xu3+UbQQ5dz54wnMbUgVubX86JPLvcWGsrx61cs4saLsdsWtiU7RAng== 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; bh=DWFWjz+sRlMLVKD192KviinYkubCGIi+lFol/TWUfio=; b=KcuFDgektGCSukp6h5RGQ2qJ5pnaTZEqWkEENLmdH85PNXU86ZU9q5CjgfWzyhRQ5j+KkI6+SzbMK2bMKYYDyzirpVn/GteeIndqVOEi/KxS19DWvTNLjsKf6BuS6JFsl2ZFXFVA/f73dCRk+CC4Zd0gGEZJtRL+Bfo3+aJ+pdwlrHrh4f7AmRotnGYIdOC97WJ/FP8Pqe3+MoeDIUZVPszKt4oTYexaEHO4evr+tTedVQ33Chnth7RExtyiLOP9yyPI0BrSnzmOIkfA/JMGsMlvlyrG3fxkeSX+dKgVh2hQnisKcrVzXmkI+RyfU3Ghk09o7LgE+Okt0uKKlIuuyw== 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=DWFWjz+sRlMLVKD192KviinYkubCGIi+lFol/TWUfio=; b=BFTwT1LQV4wA88tgHuVnMYIVupV02YY0avbpkmS5lhOcmAjI0e41Xe5BKCCvBmsX9QrEqXHktjmMnKQu/Vk4RCJ83I67nHPpOjP4+ni8Q6RawFVK9rLrSq6P0c1h4zhEnve+9e3+iDXUXIcw7o44eK8HKoATOiwZ5r3ZsME5Wlo= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3897.namprd11.prod.outlook.com (2603:10b6:5:4::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Wed, 29 Sep 2021 10:56:30 +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.014; Wed, 29 Sep 2021 10:56:29 +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 v2 1/3] security: add SA config option for inner pkt csum Thread-Index: AQHXtRGeCPn6nQ6nNUGVM+AYjgaWFau61TOg Date: Wed, 29 Sep 2021 10:56:29 +0000 Message-ID: References: <20210929090811.21030-1-marchana@marvell.com> <20210929090811.21030-2-marchana@marvell.com> In-Reply-To: <20210929090811.21030-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: df8f781a-be2a-48a0-44c5-08d98337cae3 x-ms-traffictypediagnostic: DM6PR11MB3897: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: a8kJpF2PKTpM4kqpZnWctX8Ql9DagaXFBsgL4cSmV5RU2UZcllUVwu3ZX6ha1m5z7gas3mgOq5oAoZmyV/LNpzNhypYA7K657kBBkpRtqAe9NKZj8aH3+czbacrwYGgVDYKBenjp5UoVf/iW3W/veV0Rzf/MGM8rRh+Ghkop3O2XGfRDDeP6gz5qa5LDHqwmERW30LzlfQy5rS+qUz+xwlWpDdhOHVc8RBzfEwWqJi8UbRYEKYFWVyrVLdXqyfPs7Alr9p0t/lKrHEFOwErn4TJVToMNUx7vdR/7vHCqYOHi+cQJsHWJTopXOBbweSgDhQuSIOxTp/F7PfdHm2BfoXOGNFVcOfRkVNL5yQ3VnD86NTi4pJ3hCs2J0uXfIrYG7e+97jVdWyQf4qN3pdOIms+PLDSNGvPYoC1OVrX0GXKPbojehrDJZG/1XbHQd/BGZZDCpNuQ0t8z9pAzxQyMA2jeja/k5yJNfIqhNTIP4kuxtxpYhPFqryi/UTbtnrYovnpwlqqJA5YDqpT7ck9I0niyA/yOZSVd0ry2jR9Vgg8Lks/oBbnJOx+kgP+HM6FM+Ihoz6PEpzkVDiGmiicTh1XKbVqSl9tdiQv1+lpPzHxq+TCYeBVJAHyPDdjgGY6+i6KligkuEhpcwNZhCHhUFmdCij09Ifgi1LKjE71VUHicaHpKw47+hZ1puaH1fZIvj4QW5xNS3Jz6rRXDfJN3Ag== 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)(38070700005)(86362001)(8936002)(316002)(64756008)(66446008)(9686003)(83380400001)(76116006)(71200400001)(55016002)(66946007)(66556008)(66476007)(8676002)(5660300002)(2906002)(54906003)(52536014)(4326008)(15650500001)(6506007)(110136005)(38100700002)(26005)(55236004)(508600001)(186003)(33656002)(7696005)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LgT5+zXC5n9DemQ6POGPTIZwzR/HSV4B7rbS3/Jkws/EzW5C4iOEhbt2A1/k?= =?us-ascii?Q?g4oGFZKxPliDc+EEw9LLOTjbMcC2ZDXW35JPUj63aIp7OzVxd3D61mwGRrou?= =?us-ascii?Q?qrAvTizWAJgpjek/b7vBJwyqr4r/BLOalldVBY512vIAelXFdx6r+QJWYY73?= =?us-ascii?Q?gxk0HTgUarfj13q5JuoxKU473hmg/Hi1rAgsluauz0obXF1KjB0z35iKfAOz?= =?us-ascii?Q?c8deyZhltNQp09pM91vjhjw9VEt+N4oFieaYlXE7MZYfEJbu03hq0iG6A6vK?= =?us-ascii?Q?YlbOu2Nfb6Uibdm9GEKbidg+Q4ATH0o6jtgPJXs1jmMjN8R7eA5Wv3ObEZGk?= =?us-ascii?Q?iQnHmyYOI4wYmEMiCB0cbAzzUvdVliWqjYFz5gjnolvG6oIS7Jrlng4yKrQx?= =?us-ascii?Q?JfrBkg/3IDqXEuuJMuz5BPJEoBxRXkbfIIo1AV9Q/DL6E0ZW/BTt+4iUI2B5?= =?us-ascii?Q?GLaUg2IXEs91PCY6fa6nkxzsWQz8yqd62sm8r0N65afZ5WQFSqZvlvKtB8Kb?= =?us-ascii?Q?68jjIjJUZrJjoneLeLm4pW/tOS83tkwFT+gLKQ6z6Es413PkPEE2M9G0sJE4?= =?us-ascii?Q?jnJCTL3lzwdfFYkZWqUwMKEZHgZQIkalTr3o1q1adCkRCbi4HMCmqtzl+rUi?= =?us-ascii?Q?vHQFmT8clC7AhKuqc9wUljCDWAhOdGcBvGOleZXOl4m9RXQrxbwWy0zAx+xQ?= =?us-ascii?Q?IyA0DEU58jPq7hgLTpsUePwWVyAAhv68Xv+dpPXbteU+tuDeJXHzAIAUS/js?= =?us-ascii?Q?Yh39OFqXRc6dD30Cx3UFYfncHn2IKc1Q7dxdRyrmkbcxjkOLbiwsEJehgyVy?= =?us-ascii?Q?DMlDsgfafE24f7kIJFVEu99kUu5Mi/Wmk/3vwlMkgZiECYzINlr8eUBJ56CA?= =?us-ascii?Q?QLT654a+RUBmmBOGv7QFwMIf04vwXtbwRV8MlKhxMOfSohhdd9AEutaBMb0g?= =?us-ascii?Q?0NT+V6ROLkejOuL72RAGoSl7vb/Hr5yhV+beatVHq7DvYKYU9d9nzlq2LU0K?= =?us-ascii?Q?BUiAC/uI8DMdcXWCAVbOGX3r8zfp9Q+FgvhuGLCtGlrqNd+nJrUoOu1PHj7I?= =?us-ascii?Q?lGZo56KY23fg4fYXJ3OqZh3j1nfBjh/MB8LCVy0NJMdYLpkcXW8d2gScQdcC?= =?us-ascii?Q?YHIb1g36EzE5cNWKupxnMBKqp4/8395bGjU6sFKzEvgIwZ5SPWBh0hAsIRVY?= =?us-ascii?Q?AozMqyinujWCihZ8beo6KSU5hwIHkA/hk+Mmrm/YUp07sqdqRmpyfGW2I8h6?= =?us-ascii?Q?SRh3mKY/e+rCtVgJiLs3EAFKcBqvJyRn/bgAs76NiOQ8fusWAsTEeb6hftiU?= =?us-ascii?Q?0JTSA0mKl8iZKPiW1b8s/CzD?= 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: df8f781a-be2a-48a0-44c5-08d98337cae3 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2021 10:56:29.8358 (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: 84hE2om3B9r9RVX7z7iBJVWUC4u7eFpZw5SY6M7Y3WQE3fbZSd+I2DKtX1ZIRfYUv3zCQVQwAeifbDtlOY15GYpLEkZ72SzL8aUDYDCDSXE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3897 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 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" > 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 | 18 ++++++++++++++++++ > 5 files changed, 27 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 8da851cccc..93d1b36889 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -194,6 +194,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..945f45ad76 100644 > --- a/lib/security/rte_security.h > +++ b/lib/security/rte_security.h > @@ -230,6 +230,24 @@ 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. > + */ > + 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. > + */ > + uint32_t l4_csum_enable : 1; As I understand these 2 new flags serve two purposes: 1. report HW/PMD ability to perform these offloads. 2. allow user to enable/disable this offload on SA basis. One question I have - how it will work on data-path? Would decision to perform these offloads be based on mbuf->ol_flags value (same as we doing for ethdev TX offloads)? Or some other approach is implied? > }; >=20 > /** IPSec security association direction */ > -- > 2.22.0