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 D88D0A034C; Tue, 11 Jan 2022 17:04:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C7B442732; Tue, 11 Jan 2022 17:04:02 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 3FCE341143 for ; Tue, 11 Jan 2022 17:03:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641917040; x=1673453040; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=3sT/BfgXAPfaYlDZdMSDO5kX2e08QKTCRPQaRcJWgho=; b=Nw1+Sc6wVThiBrxINFlPDfbeRO5a1a9TF8tcQsjVZTRD4hIchqzB109E lWLvYnAbg35YcKABVHEPq6G2tIL4ItXtkFNhBCWf67fPNg7YukTqXpqWS JvyNjlH+awaVXQAr4eIunbTqFw6Bxa1LQxaW78kOe0D65oVk9uct+e/Ea 6crOh1djXVQEhxY0AtK7D47s9GMHov5ECEBGDDO2cq7rtxx1tzW/re1Q4 yCLDz/HCJc9se0cPPcORMPkOI0VVjIwIzXjNePns3W+1sDpmjw2HT3/QT qm/LKa2O/mw/WS9taeJ9pPOPrRz5Qy8wzqtKyW1+jWIBmJsNjaxlYRIpV A==; X-IronPort-AV: E=McAfee;i="6200,9189,10223"; a="230857711" X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="230857711" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 08:03:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="472505196" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga003.jf.intel.com with ESMTP; 11 Jan 2022 08:03:58 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.2308.20; Tue, 11 Jan 2022 08:03:58 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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.2308.20; Tue, 11 Jan 2022 08:03:57 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 11 Jan 2022 08:03:57 -0800 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.40) 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.2308.20; Tue, 11 Jan 2022 08:03:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jreKBbljW54jBQDfWf3MFABvTvT/aUaJquaBAFsGTyH1duxpURUSuw17RxXhxq1jRCsj8tNiubTaHtBlWDMgHh6FmLi3RQrKfYSpr18LnDbC1ytx6kArljYf8vGSbjHoONnEmWRF61JkxUXpDpMLdAYXt9QwQjuUo4JIE4vqC0ktZy6DjjnkYivQqflKZwY9WGz264oexIe8crMYPiqiIpm+qwej1aCjt+doAtwGNMV4V1JmEx2Bl9nV1mc7L4OmdT8m/PUKyDWCGOGiopNBwigMkhdna8YSOOO+U1sWzQFssdp200SCwHjPKVU71IDA3kJ2BR/9MYb7xVuNU1UMyg== 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=h+POZYu/XTxhl05hG270shF79vCR03amEqK1hQk2EEY=; b=MNE6nudvcfFsD2Db/lDE8mkMfqmarcKOU3FXLU/ZDGzwBYqJ9P8FGLw1kDLdVI2QTQ0PQ1L1D69Svb9UQZJaH39be/+xyOxplxva+54sqONWiWvcqauG3jdXNKT2w8GkFi+7vdWS3vjo59qSPWlNp3Q21NrsPq3VlOYzGV4dZU8yEtv+pJq2od6qTh/Umq/8GtLjuvuyZfI8x9ATw6HxVWSZpV1S1rxmIFhPgSpTmNy4dcOiP7soa1AM250qIoB40qNeLbTVh4poDE8tKTdYgfhhJOAHmgHWW3D3KJH/eJ/8IXd5VSAic5DdPFZNkfG7/tcKCbXMuMWt+L/NkZJw9w== 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 DM6PR11MB4298.namprd11.prod.outlook.com (2603:10b6:5:204::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.9; Tue, 11 Jan 2022 16:03:55 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::7de4:731c:cee2:49c2]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::7de4:731c:cee2:49c2%3]) with mapi id 15.20.4888.009; Tue, 11 Jan 2022 16:03:55 +0000 From: "Ananyev, Konstantin" To: Akhil Goyal , "dev@dpdk.org" CC: "anoobj@marvell.com" , "Nicolau, Radu" , "Doherty, Declan" , "hemant.agrawal@nxp.com" , "matan@nvidia.com" , "thomas@monjalon.net" , "Yigit, Ferruh" , "andrew.rybchenko@oktetlabs.ru" , "olivier.matz@6wind.com" , "Xu, Rosen" Subject: RE: [PATCH 1/8] ethdev: introduce IP reassembly offload Thread-Topic: [PATCH 1/8] ethdev: introduce IP reassembly offload Thread-Index: AQHYALPm3A4ocrgtrk2+GkMBRsm/nKxeB1Wg Date: Tue, 11 Jan 2022 16:03:55 +0000 Message-ID: References: <20210823100259.1619886-1-gakhil@marvell.com> <20220103150813.1694888-1-gakhil@marvell.com> <20220103150813.1694888-2-gakhil@marvell.com> In-Reply-To: <20220103150813.1694888-2-gakhil@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: 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: 15574940-cc50-416f-ae66-08d9d51bf870 x-ms-traffictypediagnostic: DM6PR11MB4298:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GE9jLBPPzkLT8pW41PkDCfJbdoygvhUpRX/oOBG9DRb1T+kCWNdHsW71Guc4OR1AW4sfnr7pbXB+hfo3sW9IdQgy2YW1uYzvFBpG2HLum7poHqS3Z8jQ4RNnxR+er3hNn+XSjfeL+fKvtabInoWhk0wkYYchrTUXalwnl9PoYPXHGVw8bJI6cbouI6q0FcbhoSaI/XHn5pM6plk4NQJ8Z+Kyt3zqv0+uSnn+27YKth1RXq0zNJwsHpazoBBsjLvscPo1g5JXMbCPcQyaSUTrK5Fw82Il69KgL0vK4IwKP2UIBEE/md7/Hz2QnuhDsRBKMX+yhYOlX5rjEqTtLzsrr3k2J3iarU+sYBmKYtrMtw4TQFtBIIqVrS2TylKqU3ai7PBwmv0ostDhIoeyexdN90sgDeOUvbGQUXzAcF4pkn4oBxa+yx2oNJEZgFytpuQLrZeTxBRsN49nUlEaw69el7342aWdopwLk8ZqMrpo1oiaC03oIckna2O46EBFpQ3d5v8I6a1cP7v+LMo/Tt78A70bazmQycv5JCI2TzjOxa1Iuf7uqr5gOzUbcXLDFSNgc9qOB8UJIhrqAPagMDr7SPbtVC5OWxLJ6uduZ7HcTeaqL80UlN5tNlmJ0mK3e1hH/1JoX6arze2v0xS0xG+Iu8d7e3p/gcC1o4CLBhMhQi+jepiPdq2PxbAYG/Bl/PI5wvLD5i2QGpQNMVjDGqwRkdZYbWsNEzR8sKuKVmu66fs= 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:(366004)(5660300002)(7696005)(4326008)(316002)(6506007)(71200400001)(33656002)(26005)(186003)(9686003)(8936002)(110136005)(54906003)(107886003)(52536014)(8676002)(38070700005)(55016003)(2906002)(66476007)(66556008)(64756008)(66446008)(122000001)(76116006)(82960400001)(66946007)(508600001)(83380400001)(86362001)(38100700002)(21314003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?tg3f2L9Z99GZsym2MXX45FcxpKhqbqDq29jyiCGL9Mo9pUYfERlVGAN3k+ks?= =?us-ascii?Q?D6f2NHVvpnQ+9mBU9Zitf3/NHfnEG7CsbNpqz/RMS6Lxr/Mfqno0pBay85em?= =?us-ascii?Q?y1/y05fb442uYRNucxXxRxXCmAVZLxDUVmUvZGHXLKL3B3sKuv/iB+EaZuow?= =?us-ascii?Q?q4Ojm8PsJvoxHwfXshiDS697pMMCQTeYhSuEUcUdi9BCitNnmkWIDApFt9bX?= =?us-ascii?Q?ZtB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OsUSOmU2zo4sv70QiLAajn/gKt9XwGL3?= =?us-ascii?Q?dhr8fzrVtOoyyUHBkLDexKJs1H0raa7/FlYMpBGn32sG+2NtzfecmyrzMgv2?= =?us-ascii?Q?odjFV74nNYU23EmrbaAgK6BQ0Gceo7nZQ8lerozNpbpgfBHFSHaHwvl2MEUA?= =?us-ascii?Q?wts8x+62VPiwsQPC3FDhsu951EkD66SB+Ndntq4GPFKcsc25JY07I3yud9Na?= =?us-ascii?Q?MjXuPvxOq55kuh01tiOlVF1l3TN8fW6yI/3Zor/TzUU7OgUnueOVgHGCPT1D?= =?us-ascii?Q?cMWGdfCSuFdYXrLuEhUu8P3CIl3QsOBa2rYOjb+plBh8R7/9JHdFBlOTSMB5?= =?us-ascii?Q?JLwm+f7g4iQXI9taITXQmxqXU+LQLqWdkkh9ar2AiHItCxJqwwoGOr+o+qJ1?= =?us-ascii?Q?cvSCShPEZkGjvr63LYd0YkN1Z3KYiBBVykGMdKaZXR8CNuUlWEyOjmbXAjve?= =?us-ascii?Q?is1UrYU28ICxJvtqjx9OEli+4m5VUYTDuqPSvW3fLA8o26P2juXuiNefTueS?= =?us-ascii?Q?U83XNcw2vVIxmP3sev+NFpX1FuPm18CaQLxbnRWdJoVqfkYlCNhC3F0geWhh?= =?us-ascii?Q?2HvG/A=3D=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: 15574940-cc50-416f-ae66-08d9d51bf870 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2022 16:03:55.7353 (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: t8QfSyNnXvAk+C3FtvJneFLYJqhcPezhPijNw1VopfW1P8yzPDPJTnM9feRJCi37C/n7aHTFBQi5fA/8E+l2CXT8UAtvWXDF3ejfRsdfnmo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4298 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 > IP Reassembly is a costly operation if it is done in software. > The operation becomes even more costlier if IP fragmants are encrypted. > However, if it is offloaded to HW, it can considerably save application c= ycles. >=20 > Hence, a new offload RTE_ETH_RX_OFFLOAD_IP_REASSEMBLY is introduced in > ethdev for devices which can attempt reassembly of packets in hardware. > rte_eth_dev_info is updated with the reassembly capabilities which a devi= ce > can support. >=20 > The resulting reassembled packet would be a typical segmented mbuf in > case 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 ol_flags can be updated. > This is updated in a subsequent patch. >=20 > Signed-off-by: Akhil Goyal > --- > doc/guides/nics/features.rst | 12 ++++++++++++ > lib/ethdev/rte_ethdev.c | 1 + > lib/ethdev/rte_ethdev.h | 32 +++++++++++++++++++++++++++++++- > 3 files changed, 44 insertions(+), 1 deletion(-) >=20 > diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst > index 27be2d2576..1dfdee9602 100644 > --- a/doc/guides/nics/features.rst > +++ b/doc/guides/nics/features.rst > @@ -602,6 +602,18 @@ Supports inner packet L4 checksum. > ``tx_offload_capa,tx_queue_offload_capa:RTE_ETH_TX_OFFLOAD_OUTER_UDP_C= KSUM``. >=20 >=20 > +.. _nic_features_ip_reassembly: > + > +IP reassembly > +------------- > + > +Supports IP reassembly in hardware. > + > +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:RTE_ETH_RX_OF= FLOAD_IP_REASSEMBLY``. > +* **[provides] mbuf**: ``mbuf.ol_flags:RTE_MBUF_F_RX_IP_REASSEMBLY_INCOM= PLETE``. > +* **[provides] rte_eth_dev_info**: ``reass_capa``. > + > + > .. _nic_features_shared_rx_queue: >=20 > Shared Rx queue > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index a1d475a292..d9a03f12f9 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -126,6 +126,7 @@ static const struct { > RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM), > RTE_RX_OFFLOAD_BIT2STR(RSS_HASH), > RTE_RX_OFFLOAD_BIT2STR(BUFFER_SPLIT), > + RTE_RX_OFFLOAD_BIT2STR(IP_REASSEMBLY), > }; >=20 > #undef RTE_RX_OFFLOAD_BIT2STR > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index fa299c8ad7..11427b2e4d 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -1586,6 +1586,7 @@ struct rte_eth_conf { > #define RTE_ETH_RX_OFFLOAD_RSS_HASH RTE_BIT64(19) > #define DEV_RX_OFFLOAD_RSS_HASH RTE_ETH_RX_OFFLOAD_RSS_HASH > #define RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT RTE_BIT64(20) > +#define RTE_ETH_RX_OFFLOAD_IP_REASSEMBLY RTE_BIT64(21) >=20 > #define RTE_ETH_RX_OFFLOAD_CHECKSUM (RTE_ETH_RX_OFFLOAD_IPV4_CKSUM | \ > RTE_ETH_RX_OFFLOAD_UDP_CKSUM | \ > @@ -1781,6 +1782,33 @@ enum rte_eth_representor_type { > RTE_ETH_REPRESENTOR_PF, /**< representor of Physical Function. */ > }; >=20 > +/* Flag to offload IP reassembly for IPv4 packets. */ > +#define RTE_ETH_DEV_REASSEMBLY_F_IPV4 (RTE_BIT32(0)) > +/* Flag to offload IP reassembly for IPv6 packets. */ > +#define RTE_ETH_DEV_REASSEMBLY_F_IPV6 (RTE_BIT32(1)) > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice. > + * > + * A structure used to set IP reassembly configuration. > + * > + * If RTE_ETH_RX_OFFLOAD_IP_REASSEMBLY flag is set in offloads field, > + * the PMD will attempt IP reassembly for the received packets as per > + * properties defined in this structure: > + * > + */ > +struct rte_eth_ip_reass_params { > + /** Maximum time in ms which PMD can wait for other fragments. */ > + uint32_t reass_timeout; > + /** Maximum number of fragments that can be reassembled. */ > + uint16_t max_frags; > + /** > + * Flags to enable reassembly of packet types - > + * RTE_ETH_DEV_REASSEMBLY_F_xxx. > + */ > + uint16_t flags; > +}; > + > /** > * A structure used to retrieve the contextual information of > * an Ethernet device, such as the controlling driver of the > @@ -1841,8 +1869,10 @@ struct rte_eth_dev_info { > * embedded managed interconnect/switch. > */ > struct rte_eth_switch_info switch_info; > + /** IP reassembly offload capabilities that a device can support. */ > + struct rte_eth_ip_reass_params reass_capa; >=20 > - uint64_t reserved_64s[2]; /**< Reserved for future fields */ > + uint64_t reserved_64s[1]; /**< Reserved for future fields */ > void *reserved_ptrs[2]; /**< Reserved for future fields */ > }; >=20 > -- Acked-by: Konstantin Ananyev > 2.25.1