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 9E66BA0C56; Wed, 8 Sep 2021 08:34:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2110E4003E; Wed, 8 Sep 2021 08:34:20 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id D7C1C4003C for ; Wed, 8 Sep 2021 08:34:18 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10100"; a="217235743" X-IronPort-AV: E=Sophos;i="5.85,277,1624345200"; d="scan'208";a="217235743" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2021 23:34:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,277,1624345200"; d="scan'208";a="513142986" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga001.jf.intel.com with ESMTP; 07 Sep 2021 23:34:16 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 7 Sep 2021 23:34:16 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 7 Sep 2021 23:34:15 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 7 Sep 2021 23:34:15 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Tue, 7 Sep 2021 23:34:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nr5cikViIlALjZ6kzzMAEyvD0G7uNd+VfdIBXyomnUMKFsK3BbPtFtwhrWeDFE8Xk2eE8Pk1qnZ2k5Vqlw0QdkDalYEFkfIvqKyprtMoLJNd7s3HNDT3L4S9gKJRvLNtry3pPS8fvP917Wi/wknB2q/xsYwx8Xgx6ztt9EXZRvRjkNiQw+9fc2U80DoMuFeclQEs1UIq8b/yrQwtyO6fOhCM8cQFMBv3CXiM73JEA4nTskCJAStVVhUeBx41MGMk5dT5O9D98yeh1v8N5uG/GTFPmnHIS/uxJucdFCTmr/7Dk3hDQfQS/WnLmn0UHgM9npHpdoayzStRqPXRTyG3EQ== 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=Avv3M2FjXY60bPSujKj0JqR7Wy+GKK9UO34kzhMfetI=; b=EOGdrFMZuvgaKu9JQfoO00lyrFToFF4duE4bU/VtGGMvXh7bM1OHK9m+13hMTjDttsXv8R42F5n7PUZAH2UwCaFMLNXMOtl1V+dA3mo6kcnh7HmNA3URATmBJolvNYLUNjuh3vZrgKalr/qh20rNtVzRysC/0rkG51JG6rBkjEeIxRCci5hwxiYWte10xVRJMtYatuQarIl3wbek9ewWKADZYOxbM5C6g2XmYG8lrjKGpBVTh3Uj+uNldcdgTUt+s8q3KedegXSLItF1bPUyYzFbRjdP9d+SeEOc//3oT6r/dkeYBTE7Tp9xMilzvDIXe+Q/d2k8oSVjXdnrDfha8A== 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=Avv3M2FjXY60bPSujKj0JqR7Wy+GKK9UO34kzhMfetI=; b=jZU7lyzinAETK/4iHoBaL1NHzt40LCJ4iUiKEEJ+udZaqt+YKLcjYIMDu5bYr1NHL58NHEivDrkrb3mD9009Dd1VZ0Nkwq3IoB7kW7pIJUQMp86gqdWe7/NC61qm+HG9lswST98LpKWIWItECbSUCFwe8OAwyB8FHyGmSu9Irbk= Received: from BYAPR11MB2901.namprd11.prod.outlook.com (2603:10b6:a03:91::23) by SJ0PR11MB4815.namprd11.prod.outlook.com (2603:10b6:a03:2dd::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 8 Sep 2021 06:34:14 +0000 Received: from BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::954c:3fe0:a7af:7c96]) by BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::954c:3fe0:a7af:7c96%3]) with mapi id 15.20.4500.015; Wed, 8 Sep 2021 06:34:14 +0000 From: "Xu, Rosen" To: Akhil Goyal , "dev@dpdk.org" CC: "anoobj@marvell.com" , "Nicolau, Radu" , "Doherty, Declan" , "hemant.agrawal@nxp.com" , "matan@nvidia.com" , "Ananyev, Konstantin" , "thomas@monjalon.net" , "adwivedi@marvell.com" , "Yigit, Ferruh" , "andrew.rybchenko@oktetlabs.ru" Thread-Topic: [dpdk-dev] [PATCH] RFC: ethdev: add reassembly offload Thread-Index: AQHXmAYjbm2O6B2tG0qOtxkgOvDhw6uZxOLw Date: Wed, 8 Sep 2021 06:34:14 +0000 Message-ID: References: <20210823100259.1619886-1-gakhil@marvell.com> In-Reply-To: <20210823100259.1619886-1-gakhil@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.5.1.3 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmQ1MDU5ZTEtZjZlMy00ZjgyLTk0ODQtNDA4ZTJkMmQ1OTdlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUmkwSGhFbURLMm16aEsyNzFiUXZEYUdpWm5HZGtZRHhKNUVYcTYzajlMaTEwWlEyaDY1aHlFWjVxYzR2N3lwbiJ9 x-ctpclassification: CTP_NT 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: 79e2d493-e297-442a-fcdd-08d97292ad08 x-ms-traffictypediagnostic: SJ0PR11MB4815: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: A251s3xzU5ulYrFSOZvZuZiwB2vjXzhjwpwUr5NdgMdNKUxX/8M7aeBpsIFlw6zijx4D/R9/qOBFVdnvUvU5GWJ9YvIufF2J2dnvrHoJ2THn7BcHBxgC8sRqGq0txBJjLrthb3eDUb3qiZuW1LGZmzPvUH5k64bB8dmNdCa4jyPMvThHqi+yceZtaTQvFm99R+jn/FngMP0C/SwNRyUQU6rtAZFZTMHjYFr2BhiitrTyFeUCjE58X0kidxXaMZbI9avHVmGwO7iqwxhiLzakDXoxiPf5ULVP6ukHJYflRXv96ovpkZJ13XoE7HxmGjz1pwZ8Uj+yJ81PKtF01gOFjx6wIPQARsf3/Jhgf03rHjQ8/B/cg7j+kDLP+lJmbuE1/aSp1l5FVntLGHMA240Imwyg0rqCGKhG2BvcxlV59OGj5dnL1MBzEhPri8PSR4TiRl1F91uQG2ACscPfXEptiUfo94C96O9VXEDHsIpTD+UdaT7+xVJC2/xkSWEKq9EYl4QQ7eedn2FK+mJTjagZriToTfbgmwULaWLzIC6mE6wYNi4BXBUNgD5yRhPpFXhstRa3PU9vioo5EDKpZcaTGDVTBJs9/4w21bB8Rkdjt4Sr8rvmD/IggszI/jwma7AE5emTZ+JeFYnanpMNvztVjoQypMuHyc82yo/4KY+8rLhtyIWEbLmnEUNKfPi7oCsIUwbWg7nvRssg+qkFXpSVWw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2901.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(346002)(376002)(396003)(366004)(66556008)(86362001)(2906002)(316002)(83380400001)(478600001)(122000001)(55016002)(110136005)(38070700005)(64756008)(4326008)(7696005)(9686003)(54906003)(71200400001)(52536014)(33656002)(186003)(26005)(66946007)(6506007)(5660300002)(76116006)(66476007)(8936002)(8676002)(66446008)(53546011)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?cEqlTnrzMFmF1hrPlaCRp7AXpIPSbNU8ZkmYDZI8Gj1cc+EfKIa/hHLXGzbS?= =?us-ascii?Q?nBmz7utJkr2TzLVSMxBFXRNSYeCjZt9EG+DqzoyFGTbIO1yt76m/lqkGptsn?= =?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iKKgj0Z/8ZWJocKD969e1hj+UberOgXQ?= =?us-ascii?Q?xIGmw+YyXRrh6+b0JSxPdWkcogZBoSxEaKSkZ9rawO9AHc21J4ZVqYQcHKaN?= =?us-ascii?Q?RZzKQpSfIF4m0H7q9Lp2VCbK6t5pLlJzOOd032WVZ031Cgqmz1KElzHuyaC9?= =?us-ascii?Q?9z0TOsfTgchj68X7BAC2oj6fWowo38LNO+wzhhgAKd7aADutcAS0DUrVKbWi?= =?us-ascii?Q?XgjcdEJmSEyVBTbC67VT+TcRzC2xqvE7aFp/+n8ddPF3YbOaU8lkvmvpQnUm?= =?us-ascii?Q?V/bl8oeiD1xIM3CTQHdHJVldbg9SasCLJbEta3pA1oKGZk0CKM4bSX4mof5t?= =?us-ascii?Q?B1OHMzz12j9y1XTJbm19WRn8?= 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: BYAPR11MB2901.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79e2d493-e297-442a-fcdd-08d97292ad08 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Sep 2021 06:34:14.1496 (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: Moq9RktOvnXGyeUqYZaEcWtqkzoZCkrAiz+EFxKbq30WHbZuChSkXUkajGTLJoxC9hZeyGdK1BplUGZqyihpuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4815 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] RFC: ethdev: add reassembly offload 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" Hi, > -----Original Message----- > From: dev On Behalf Of Akhil Goyal > Sent: Monday, August 23, 2021 18:03 > To: dev@dpdk.org > Cc: anoobj@marvell.com; Nicolau, Radu ; Doherty, > Declan ; hemant.agrawal@nxp.com; > matan@nvidia.com; Ananyev, Konstantin ; > thomas@monjalon.net; adwivedi@marvell.com; Yigit, Ferruh > ; andrew.rybchenko@oktetlabs.ru; Akhil Goyal > > Subject: [dpdk-dev] [PATCH] RFC: ethdev: add reassembly offload >=20 > Reassembly is a costly operation if it is done in software, however, if i= t is > offloaded to HW, it can considerably save application cycles. > The operation becomes even more costlier if IP fragmants are encrypted. >=20 > To resolve above two issues, a new offload DEV_RX_OFFLOAD_REASSEMBLY > is introduced in ethdev for devices which can attempt reassembly of packe= ts > in hardware. > rte_eth_dev_info is added with the reassembly capabilities which a device > can support. > Now, if IP fragments are encrypted, reassembly can also be attempted whil= e > doing inline IPsec processing. > This is controlled by a flag in rte_security_ipsec_sa_options to enable > reassembly of encrypted IP fragments in the inline path. >=20 > The resulting reassembled packet would be a typical segmented mbuf in cas= e > of success. >=20 > And if reassembly of fragments is failed or is incomplete (if fragments d= o not > come before the reass_timeout), the mbuf is updated with an ol_flag > PKT_RX_REASSEMBLY_INCOMPLETE and mbuf is returned as is. Now > application may decide the fate of the packet to wait more for fragments = to > come or drop. >=20 > Signed-off-by: Akhil Goyal > --- > lib/ethdev/rte_ethdev.c | 1 + > lib/ethdev/rte_ethdev.h | 18 +++++++++++++++++- > lib/mbuf/rte_mbuf_core.h | 3 ++- > lib/security/rte_security.h | 10 ++++++++++ > 4 files changed, 30 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index > 9d95cd11e1..1ab3a093cf 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -119,6 +119,7 @@ static const struct { > RTE_RX_OFFLOAD_BIT2STR(VLAN_FILTER), > RTE_RX_OFFLOAD_BIT2STR(VLAN_EXTEND), > RTE_RX_OFFLOAD_BIT2STR(JUMBO_FRAME), > + RTE_RX_OFFLOAD_BIT2STR(REASSEMBLY), > RTE_RX_OFFLOAD_BIT2STR(SCATTER), > RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP), > RTE_RX_OFFLOAD_BIT2STR(SECURITY), > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index > d2b27c351f..e89a4dc1eb 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -1360,6 +1360,7 @@ struct rte_eth_conf { > #define DEV_RX_OFFLOAD_VLAN_FILTER 0x00000200 > #define DEV_RX_OFFLOAD_VLAN_EXTEND 0x00000400 > #define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800 > +#define DEV_RX_OFFLOAD_REASSEMBLY 0x00001000 > #define DEV_RX_OFFLOAD_SCATTER 0x00002000 > /** > * Timestamp is set by the driver in > RTE_MBUF_DYNFIELD_TIMESTAMP_NAME @@ -1477,6 +1478,20 @@ struct > rte_eth_dev_portconf { > */ > #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID > (UINT16_MAX) >=20 > +/** > + * Reassembly capabilities that a device can support. > + * The device which can support reassembly offload should set > + * DEV_RX_OFFLOAD_REASSEMBLY > + */ > +struct rte_eth_reass_capa { > + /** Maximum time in ns that a fragment can wait for further > fragments */ > + uint64_t reass_timeout; > + /** Maximum number of fragments that device can reassemble */ > + uint16_t max_frags; > + /** Reserved for future capabilities */ > + uint16_t reserved[3]; > +}; IP reassembly occurs at the final recipient of the message, NIC attempts to= do it has a fer challenges. The reason is that having NICs need to worry a= bout reassembling fragments would increase their complexity, so most likely= it only can handle range length of datagrams. Seems rte_eth_reass_capa mis= s the max original datagrams length which NIC can support, this features is= better to be negotiated between NIC and SW as well. > /** > * Ethernet device associated switch information > */ > @@ -1582,8 +1597,9 @@ struct rte_eth_dev_info { > * embedded managed interconnect/switch. > */ > struct rte_eth_switch_info switch_info; > + /* Reassembly capabilities of a device for reassembly offload */ > + struct rte_eth_reass_capa reass_capa; >=20 > - uint64_t reserved_64s[2]; /**< Reserved for future fields */ > void *reserved_ptrs[2]; /**< Reserved for future fields */ > }; >=20 > diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h index > bb38d7f581..cea25c87f7 100644 > --- a/lib/mbuf/rte_mbuf_core.h > +++ b/lib/mbuf/rte_mbuf_core.h > @@ -200,10 +200,11 @@ extern "C" { > #define PKT_RX_OUTER_L4_CKSUM_BAD (1ULL << 21) > #define PKT_RX_OUTER_L4_CKSUM_GOOD (1ULL << 22) > #define PKT_RX_OUTER_L4_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22)) > +#define PKT_RX_REASSEMBLY_INCOMPLETE (1ULL << 23) >=20 > /* add new RX flags here, don't forget to update PKT_FIRST_FREE */ >=20 > -#define PKT_FIRST_FREE (1ULL << 23) > +#define PKT_FIRST_FREE (1ULL << 24) > #define PKT_LAST_FREE (1ULL << 40) >=20 > /* add new TX flags here, don't forget to update PKT_LAST_FREE */ diff = --git > a/lib/security/rte_security.h b/lib/security/rte_security.h index > 88d31de0a6..364eeb5cd4 100644 > --- a/lib/security/rte_security.h > +++ b/lib/security/rte_security.h > @@ -181,6 +181,16 @@ struct rte_security_ipsec_sa_options { > * * 0: Disable per session security statistics collection for this SA. > */ > uint32_t stats : 1; > + > + /** Enable reassembly on incoming packets. > + * > + * * 1: Enable driver to try reassembly of encrypted IP packets for > + * this SA, if supported by the driver. This feature will work > + * only if rx_offload DEV_RX_OFFLOAD_REASSEMBLY is set in > + * inline ethernet device. > + * * 0: Disable reassembly of packets (default). > + */ > + uint32_t reass_en : 1; > }; >=20 > /** IPSec security association direction */ > -- > 2.25.1