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 9AFAFA050A; Thu, 14 Apr 2022 16:07:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F32A40694; Thu, 14 Apr 2022 16:07:13 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 3A74B40687 for ; Thu, 14 Apr 2022 16:07:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649945232; x=1681481232; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=xdRqfAeCI31I769XdaKi0uBs5k4bga6ddmHZ8RNOwfI=; b=MyajdKrtZzefE101ssyl8O2sRyzwZ9SWG46vhL8tYXajKsCRh0kVvj/X meboOVx5n/jfcfTsX8QqKHNXoKHQl6jtpeQy8ThwLaeWPR3cJWtmmwQzl s9eJJVoaK3y2+TqjcyodAqZHtvwpOjkmuaZfYYze8UR1wW+JZ+6N0LnyG CIGV5ZDa1vqX8CwnhNrJTYFeMxOpHgGRUiOzToI7BoTdKWDGnyK9J+2we kJx5/6Z++KlEhhtkPI3L+rhfoxMAgDBDDQIWgAAMrzIiBSkqCDkYq/T8w 1ieu7Gqh7baj5S1osxQ774KUS0qXP6zbii9VOvmLJcwl/NdEg7kg/5ExB g==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="287991643" X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="287991643" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 07:07:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,259,1643702400"; d="scan'208";a="645635998" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by FMSMGA003.fm.intel.com with ESMTP; 14 Apr 2022 07:07:11 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 14 Apr 2022 07:07:10 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 14 Apr 2022 07:07:10 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 14 Apr 2022 07:07:10 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.177) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 14 Apr 2022 07:07:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ihqVznSUc8a1SlCv9WOZcuWw7uB1YuvqqBqMxoVOpD+o0JWSPXEE3e62ynkxJ0Wy76rC6mXN1JQsr2AYxOalQ6P94qJmhkE6+geMZ5oOr6+PUhcTn2BjnlFiv/gh6Ydy+L80otZOCzI0aWLwBgDjeTPjc9Md2dSH5uVbAVfD5ssBDxrVigZYlcXOHOccI5NkSW/ITNZ7XUfu6aOOhthS0hRef17HOD41/Y5j2Mzw0iE9Sp2rEHFS22IdsRWSXkU7rVn1A8/OZcpAZefshNk8bQe4S0Gor5nHF7b5ozKxtLM3G+E8gXPxx56aYegEbgJoAKFc8E5PNATs2qHBh3+rHw== 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=xNlHMl+i3X6O90jQyzqi+/cDsWE3ktg/sS7cCbaq5hE=; b=VMfjdOCqKKY4GNgVbQumpq0PBCNNdWon/EmEz6jpIQwVkVivoiaKUoqVpB5Ypo6ZXZTq1/1a2AjZMTDXwBR2vRyuieyILf17C7Wf0fqCRiYxCCEM/ApiHXFBEEe0O1IoLR5TmAJ3/oX1F/4pWSdUy4CJ/HSzgrQS1NpHfajnqEhutSMDAxamJ854rNYLOVdmiHqYIs4NWE4PSJ0B0nHb3UEZWYsulcWkqaeUQJFUm1UBfysViOkmcK+I1risYSnjMbpuZ+FxfyHyrtOvRe+NtSbTPlslroQfu2rzbzoXA+dHzQdSVgmCcSoUA9KYGRxBXO7n5k8KYDkVxKEuTHnTxg== 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 Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by PH7PR11MB5766.namprd11.prod.outlook.com (2603:10b6:510:130::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Thu, 14 Apr 2022 14:07:08 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::dc35:d5af:9936:eef3]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::dc35:d5af:9936:eef3%3]) with mapi id 15.20.5164.020; Thu, 14 Apr 2022 14:07:08 +0000 From: "Ananyev, Konstantin" To: Nithin Dabilpuram , "jerinj@marvell.com" , "Nicolau, Radu" , Akhil Goyal CC: "dev@dpdk.org" , "anoobj@marvell.com" Subject: RE: [PATCH 1/7] examples/ipsec-secgw: disable Tx chksum offload for inline Thread-Topic: [PATCH 1/7] examples/ipsec-secgw: disable Tx chksum offload for inline Thread-Index: AQHYPhacaELn337pMEOlhWOTBLnqlKzvj2yg Date: Thu, 14 Apr 2022 14:07:08 +0000 Message-ID: References: <20220322175902.363520-1-ndabilpuram@marvell.com> In-Reply-To: <20220322175902.363520-1-ndabilpuram@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.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 532984cc-60ca-4ff7-45ac-08da1e201017 x-ms-traffictypediagnostic: PH7PR11MB5766:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KpztydCouZ40v98bsmYjbbV+nedcr/oxm0gCIUUrfX2+SF98irfgm/8BNo2Zv8mywAo/2/kU7C3Oy3d7aef7ttdYSgu//khMXo8AR1FbkRXhUvNxyhmYss0uNwh3WyaljnrSUKMqOVoGvuYnG1wrhP5lO2SzMqvDoodtKXQchDaPEXjbL5QD7ifDc1ovv3tfr/I0pfP174/ZrRPPxr5w93xv6VEegtUBVh8IozlW1vm7v7k8hYSwVZ3ZNbeo6Ys8/N71E7SsiJz5ySXUE6/aTmgzUgq4TrhzlGMyj1VPRYQZbl3/9tsBF/+c3FGhle7qWUoSicfSPlaLTvJXAkm2HQaOLyL0/zFp3b4qRarTVAbmGDyNPymVZNhw1bhEdNuVUuc9UHd/vvk1at0XsF5pSwjQSR90YbbIQQeoSX4X6G1/0dfkT85KD7rV04skSQ0a1hY5cCGy6AIjr5gsJApEw7sBAIF6EK0wFTQsuVjeKtkEXFgQwCTwiy1X2IK1DmeUP+CA01QH77/Bpb8os7WeYk00DT6pkalRmtEMV4rsT9tfUGecEdCKTPkvMe3AruUnB7UwSOgIX3vPZuV1yEVJsLj7fJvWN16X4w67z+BagZVP+xmdZfnCguxyz83qDYWj9ohvW1RvKU6pyfNAp50pzj+RFr230LttJzclARal++te3m5DFIt9GwDEAWMEN06vDbKbrm4uG3c2rALT4ERBYHEiIFNqpG0fcehNitbywnjAEzNiyg6Q9lWnc7TcM0R5dxlkopQOfK9p5fTZIC/RNlpJezjgmecRBEk4So2Pnbg= 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:(13230001)(366004)(6506007)(38100700002)(122000001)(966005)(82960400001)(71200400001)(508600001)(38070700005)(5660300002)(54906003)(316002)(8676002)(66946007)(86362001)(76116006)(64756008)(7696005)(66476007)(66446008)(186003)(26005)(4326008)(110136005)(52536014)(8936002)(55016003)(66556008)(9686003)(33656002)(2906002)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?EUtT3db+4f9T5WjNMukOtg2JgLlmscGoHd+bYq0TMZ7+6njM9HdL7BrqE2fH?= =?us-ascii?Q?3P/P4aPwOp/czVThMQblG4dX0hlKq3rPwUKdB8aEy56wEPij1ZIExT/ZSu2T?= =?us-ascii?Q?yCpVik7Q2slsdv7E0A3Gx01V/QVAR0xIdLJRnMJZz6hwvx9H5qDBg9XR/ZGN?= =?us-ascii?Q?0DcOETEFSe7zxhu+FrfmCob/U0MINpNdWHlze2s/bprG2EBxrAYbB1GsqZIS?= =?us-ascii?Q?74AOa5ekmnysEO+zqKPjkXZqnc6F53sRsDHTDPEGS0D+cO5Rue9PNhDj91m4?= =?us-ascii?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2PQLYR5356W7?= =?us-ascii?Q?WeR0GwOHq4qruoTi4CgfWaW/V+sf76knVXVhJcbFUn/NDT/kmXQi46ilUvtc?= =?us-ascii?Q?5LLNDG/vguPfPRcegB9C5okmOMPZkE4N25vLcpxcHf094hHeSq2Q7OPOlt4B?= =?us-ascii?Q?Nrdodz8bJuuX0MhH1gwcrfdGF37Cnoe1hEqpRGc0wFOPC/AAae+pms5BVCfl?= =?us-ascii?Q?6JTHWaBlFz3x0fNVHKoPrndcaTLvk20gQjeVHWoQ9rAPEsPu+MaToHGFqXbZ?= =?us-ascii?Q?5x3n8Eyz7s/ZLYJmdumLrEBhiGOgImTqlBX0wsumxTfbkRJa52qMTzdMHlM3?= =?us-ascii?Q?q2eVirdt1yti7oGVdBrly+xr1sfFkoUtXvduSQhL2EGAXRusdz9Ni1f1o47I?= =?us-ascii?Q?eHQBM/Yf1p9Eja2GYOokCpX/auFuP73uy9spkW57+VZhzYCRrKulcgKVQ4XY?= =?us-ascii?Q?QqMuEFOtZbS0kklK5suYXCzPYqUYXm+KAF2me1N/mqNCPcUV1Rz9LyjVq/mM?= =?us-ascii?Q?IgTojF6iHFfSxwRdi6SKfRZVa52RA1IrWjhEp432zGq1RjF+yJoIYtSNcy9z?= =?us-ascii?Q?QqVkS0sHqNSyCaJU/dXBo1HDppPlG0g=3D?= 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: 532984cc-60ca-4ff7-45ac-08da1e201017 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2022 14:07:08.3156 (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: Xq3Mi1qV1yMX/s/GHjU2+NGjoWqZmQfVVHF17ehvIuzg2fM6nQqswvF4TCwg473ej9xm4BAY/IhEIjKUWH0LxrK5y1AoQHLqayEpFByzBr0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5766 X-OriginatorOrg: intel.com 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 Hi Nithin, > Enable Tx IPv4 checksum offload only when Tx inline crypto, lookaside > crypto/protocol or cpu crypto is needed. > For Tx Inline protocol offload, checksum computation > is implicitly taken care by HW. The thing is that right now it is not stated explicitly that RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL implies TSO support. It says that = it 'might', it is not guaranteed. At least in dpdk docs. >From https://doc.dpdk.org/guides/prog_guide/rte_security.html: "22.1.2. Inline protocol offload ... Egress Data path - The software will send the plain packet without any secu= rity protocol headers added to the packet. The driver will configure the se= curity index and other requirement in tx descriptors. The hardware device w= ill do security processing on the packet that includes adding the relevant = protocol headers and encrypting the data before sending the packet out. The= software should make sure that the buffer has required head room and tail = room for any protocol header addition. The software may also do early fragm= entation if the resultant packet is expected to cross the MTU size. Note The underlying device will manage state information required for egress pro= cessing. E.g. in case of IPsec, the seq number will be added to the packet,= however the device shall provide indication when the sequence number is ab= out to overflow. The underlying device may support post encryption TSO." So, if I am not mistaken, what you suggest will change HW/PMD requirements. AFAIK, right now only Marvell supports RTE_SECURITY_ACTION_TYPE_INLINE_PROT= OCOL, so in theory I don't mind if you'd like to harden the requirements here. Though such change probably needs to be properly documented and acked by other vendors. >=20 > Signed-off-by: Nithin Dabilpuram > --- > examples/ipsec-secgw/ipsec-secgw.c | 3 --- > examples/ipsec-secgw/sa.c | 32 +++++++++++++++++++++++++------- > 2 files changed, 25 insertions(+), 10 deletions(-) >=20 > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ip= sec-secgw.c > index 42b5081..76919e5 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -2330,9 +2330,6 @@ port_init(uint16_t portid, uint64_t req_rx_offloads= , uint64_t req_tx_offloads) > local_port_conf.txmode.offloads |=3D > RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; >=20 > - if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM) > - local_port_conf.txmode.offloads |=3D RTE_ETH_TX_OFFLOAD_IPV4_CKSUM; > - > printf("port %u configuring rx_offloads=3D0x%" PRIx64 > ", tx_offloads=3D0x%" PRIx64 "\n", > portid, local_port_conf.rxmode.offloads, > diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c > index 1839ac7..36d890f 100644 > --- a/examples/ipsec-secgw/sa.c > +++ b/examples/ipsec-secgw/sa.c > @@ -1785,13 +1785,31 @@ sa_check_offloads(uint16_t port_id, uint64_t *rx_= offloads, > for (idx_sa =3D 0; idx_sa < nb_sa_out; idx_sa++) { > rule =3D &sa_out[idx_sa]; > rule_type =3D ipsec_get_action_type(rule); > - if ((rule_type =3D=3D RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO || > - rule_type =3D=3D > - RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL) > - && rule->portid =3D=3D port_id) { > - *tx_offloads |=3D RTE_ETH_TX_OFFLOAD_SECURITY; > - if (rule->mss) > - *tx_offloads |=3D RTE_ETH_TX_OFFLOAD_TCP_TSO; > + switch (rule_type) { > + case RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL: > + /* Checksum offload is not needed for inline protocol as > + * all processing for Outbound IPSec packets will be > + * implicitly taken care and for non-IPSec packets, > + * there is no need of IPv4 Checksum offload. > + */ > + if (rule->portid =3D=3D port_id) > + *tx_offloads |=3D RTE_ETH_TX_OFFLOAD_SECURITY; > + break; > + case RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO: > + if (rule->portid =3D=3D port_id) { > + *tx_offloads |=3D RTE_ETH_TX_OFFLOAD_SECURITY; > + if (rule->mss) > + *tx_offloads |=3D > + RTE_ETH_TX_OFFLOAD_TCP_TSO; > + *tx_offloads |=3D RTE_ETH_TX_OFFLOAD_IPV4_CKSUM; > + } > + break; > + default: > + /* Enable IPv4 checksum offload even if one of lookaside > + * SA's are present. > + */ > + *tx_offloads |=3D RTE_ETH_TX_OFFLOAD_IPV4_CKSUM; Shouldn't we check here that given port really supports IPV4_CKSUM offload? > + break; > } > } > return 0; > -- > 2.8.4