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 EC183A034C; Tue, 11 Jan 2022 18:04:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 708D342748; Tue, 11 Jan 2022 18:04:11 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id DD172410F1 for ; Tue, 11 Jan 2022 18:04:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1641920650; x=1673456650; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=XffPhOJSQTuFPpagCeJ13LPBbq0E2mto9HJhxLicVwA=; b=bQoDwPk2YiWJImaKG+0EA9wSLz3X2BFbRv7nCys0vKtGhNxT4ozaVeVu eXGnOmzN3fCmsGXB0dg9KzMx+pMYQZ22Wcno3YmEKpqtI/7UfM/2IWk8K iW43MneuC30WOQ4rLcw0R7dps2uup98B/Tl2Cem0iSzKWhOcAaJZNvIzP WkjfsrFOidDsd82NpTsW+gJJ5bDuGIzcQAQeun5+J1GZQ0kKPTLwyR0Uv k9kKFTf8GNUS4gbVKx/0mAwW4CzsCevOuVOjD2m4LhQXH2xBQwKTMXF3i fTrVtgiKp+Wd5k9oMF3ZZ3667aJjqZ2GgdMacqVvuFEqYSv7yVr+UdQNT A==; X-IronPort-AV: E=McAfee;i="6200,9189,10223"; a="243738424" X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="243738424" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2022 09:04:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,279,1635231600"; d="scan'208";a="528815600" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga008.jf.intel.com with ESMTP; 11 Jan 2022 09:04:05 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx606.amr.corp.intel.com (10.18.126.86) 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 09:04:05 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx607.amr.corp.intel.com (10.18.126.87) 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 09:04:04 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx602.amr.corp.intel.com (10.18.126.82) 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 09:04:04 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.175) 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 09:04:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TGsJBR9mbW2LVF1JYwU369H42O5KUbKgBgkUgukqDwcJmZKc9wHHOY/UAldZALPrC1UTejjKogqVsJB13dLMoOdOy9bx4lr6IkcqmdAiUKsIag5hys+EO3pTZppApFD7bglK6ssS/wHHl7iHhLYVEaTI0IvY+I1hlq1yfiYRArBLg660DNt7wrai4eZkSAWM9D+1LpX+gfzQcFr7qKCbHdK14whAFki3x7f2LfmDLlxfeSrOvxdfwK/89r14U+ZmP6VY/FkK9S45s0BSVnCwNjJQvXhE2nLKCsp1HNcDJZ4Ds8UeGo5cvdbZDqUiOnk7ySPM4JhndzYFvQiSi7AI+w== 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=N9j7R+cd2PVZEnqEp7aHdj8bljkAKAPwX73NbmryDHc=; b=SuYjmmUGMVkNq5sJbU+SUNW17zTHPSCaVPuuh+Vp9BY/sZxHFrhMfIz+/LrRERCyO8P4MU+ddLompg0RWV6qTHC01y+npYXAUE2j2KVp526gFuFya5t6AipnjYxPz6CT7BP5A7XO2o5vHOt4x2mj6PefYLELl5BS1h8OqPACpuaf1pRGX1QZSxqGsIF+NoH7ENbdArBW9H/6Tq877D1WzaRqH7JHhejzJvsSRmiBB9uW5VDUYGhB39JXUHqEh9h4EzNCni/jyre3yKK8+07VdXXFompmVl15ibvFSzzjTsSctcGS/nUATKn73qNAv7TtbGJmIDrkl6q9W2waM3XKDg== 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 DM6PR11MB4531.namprd11.prod.outlook.com (2603:10b6:5:2a5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9; Tue, 11 Jan 2022 17:04:03 +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 17:04:03 +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 3/8] ethdev: add mbuf dynfield for incomplete IP reassembly Thread-Topic: [PATCH 3/8] ethdev: add mbuf dynfield for incomplete IP reassembly Thread-Index: AQHYALPm5GZXp3/J5kytklOWiwFqV6xeCiiA Date: Tue, 11 Jan 2022 17:04:03 +0000 Message-ID: References: <20210823100259.1619886-1-gakhil@marvell.com> <20220103150813.1694888-1-gakhil@marvell.com> <20220103150813.1694888-4-gakhil@marvell.com> In-Reply-To: <20220103150813.1694888-4-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: 6c6a1848-675a-4878-5b20-08d9d5245ede x-ms-traffictypediagnostic: DM6PR11MB4531:EE_ 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: NrLXHcmC1MCXtld2Q04Zm+P2JMCwp6r9Uu6Mp8xJ8WuYdU4hQeSzWtBgZ/KcoAM+4l1aUQ3lU4Z0UP4KN2ROht1bRWv75zNbumvDsrpZC9aSvSz2yawQtzG9jjr0ljg8c+VZjJoVgygsa+eT1tHsBQsUIGPwiOEmPjHooKPAebE6iIIzEncFZhPFttLzgohvMJ4BXY2GVy+LHXO10Sr6D/CHVR54WRxOXE5R4GQKTN2pYwK7BAkPbIuzD/iZu8PtMlO82bFj98xIDH2z6n3P5g67iX2G1RN4Cc5sQR0nKAX0NTEO1t8+llvnPhn+4/ipQb6CDGKnyM7Q6y12E8Q68s3cG4K5YJ0h5uOlijeKX7zzUo7mbX20VSnkofJy1CLGTjlv6pMBUTja1fyK/ONniGUogMXEP6WNgipa6Qh2DJkgmpFwy2icdNwngSx76rxQI/spifkF0B7eyzZGn7N4NPfRr+THA1/8FTghHOT8lpaFaddUNMBw1BUC6aBWCOzSgOwrQKRirN1Yc90z5ZYzWeSRAJSL6XwE6wlUffU5azqUG9/wVmP5OfhcNLYhm13Jm/i7B2dIAIcBtVXKt/JaCsEIfuvimfOIhS8v0ie2MzeMVbWQ+hRpFR7rqqgfDLDIHnCifaSuah4m64RMqyfv9NUAcJUIfW1M0xapx2vbH+ABnUl7mzzumzYcWhCHjM2V9+hN71ZkqKypi9Z0aVOGrA== 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)(71200400001)(33656002)(66946007)(76116006)(5660300002)(52536014)(66446008)(64756008)(66556008)(66476007)(82960400001)(38070700005)(2906002)(38100700002)(122000001)(7696005)(4326008)(8676002)(8936002)(26005)(107886003)(508600001)(86362001)(9686003)(83380400001)(316002)(110136005)(186003)(54906003)(6506007)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?/FoZr/7NwTQd2Z9egV1JJh5tTK5xPsnzoIPZHFZvcIeeWFFcxvYO23zODOPM?= =?us-ascii?Q?gFA6DrC9oyqHhOSF7j+GR4+IZoOG2I8vIZcvh6cZ1r0W7jS/SL/GTrazTJFB?= =?us-ascii?Q?3iuhgvn9O03P+qmw+ltF40FgxYzbaf1JN+MgUl/tqW9/u57QHp2mQbHXcPAG?= =?us-ascii?Q?I/hP//WjJRY+VMWtn1cHTl3k7YdngL3KuTxwiWSY3k65wrj3riu2zrMkw26c?= =?us-ascii?Q?7/Hk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JtTl9EM?= =?us-ascii?Q?3Z13ji54hKybPsIIikLGdarmcije2aVNEt68b8SEdN+sau3yNSuGG3K2ZFOB?= =?us-ascii?Q?WkhZs6Up4vx0jWBlB20Qa0YREIt+WNlNuDRQfY4Rw1J9KIs/Ivq7CuzgjwDv?= =?us-ascii?Q?KdTcOffcEHJ3xozYpk/n1wVp04bNnm8zeVWRjkSilrPRY4DdSiuhAM1pAz2f?= =?us-ascii?Q?0VunyfkSlPaXlpyUtupyL3MRauEfFJZDvy5LDH726tcuyoe+T5otGzy55Uy+?= =?us-ascii?Q?vm9CfaBKlcb81ICCjbsUFpYMO1D215Kz/sPc4skQC6qMB2UNYSfg4MjNVwng?= =?us-ascii?Q?TZEj2RLsSBT+/4lk8TGdvQ+A/PBtZnttuQV6PxauEb/mc4z9N9ZpPANw81mD?= =?us-ascii?Q?CALdljpHr7bujHn8zgNtkIRtPbKSNZ5DeN+b+i3qfv8+eQCXbUcShdP4Ufqa?= =?us-ascii?Q?ceeKVczA6YDQPSYXBEaTXwYL/1pg6+r4uikS4hFmtUYIZLGrMFDltcWSbLPQ?= =?us-ascii?Q?Zc0QZPh3yyBfmbAuMQPa0jSuzJ4HeCG8Zt8B3nYQGi8Ie+XCGsZK2vOcIJXT?= =?us-ascii?Q?ux3A3g=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: 6c6a1848-675a-4878-5b20-08d9d5245ede X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2022 17:04:03.5711 (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: UMshqN3SjexoqQnsOon6e4mqTdDwTtKfUQ/OrRyYCqMOLjZmmEc688upGIPSDzUC45i9Z5Ym9Vuz+p5A2pHdC7jQ++atXIPWUPgfjpArlcI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4531 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 > Hardware IP reassembly may be incomplete for multiple reasons like > reassembly timeout reached, duplicate fragments, etc. > To save application cycles to process these packets again, a new > mbuf ol_flag (RTE_MBUF_F_RX_IPREASSEMBLY_INCOMPLETE) is added to > show that the mbuf received is not reassembled properly. If we use dynfiled for data, why not use dynflag for RTE_MBUF_F_RX_IPREASSE= MBLY_INCOMPLETE? That way we can avoid introduced hardcoded (always defined) flags for that = case.=20 >=20 > Now if this flag is set, application can retreive corresponding chain of > mbufs using mbuf dynfield set by the PMD. Now, it will be upto > application to either drop those fragments or wait for more time. >=20 > Signed-off-by: Akhil Goyal > --- > lib/ethdev/ethdev_driver.h | 8 ++++++ > lib/ethdev/rte_ethdev.c | 16 +++++++++++ > lib/ethdev/rte_ethdev.h | 57 ++++++++++++++++++++++++++++++++++++++ > lib/ethdev/version.map | 2 ++ > lib/mbuf/rte_mbuf_core.h | 3 +- > 5 files changed, 85 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h > index 0ed53c14f3..9a0bab9a61 100644 > --- a/lib/ethdev/ethdev_driver.h > +++ b/lib/ethdev/ethdev_driver.h > @@ -1671,6 +1671,14 @@ int > rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue, > uint32_t direction); >=20 > +/** > + * @internal > + * Register mbuf dynamic field for IP reassembly incomplete case. > + */ > +__rte_internal > +int > +rte_eth_ip_reass_dynfield_register(void); > + >=20 > /* > * Legacy ethdev API used internally by drivers. > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index ecc6c1fe37..d53ce4eaca 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -6503,6 +6503,22 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id, > (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf)); > } >=20 > +#define RTE_ETH_IP_REASS_DYNFIELD_NAME "rte_eth_ip_reass_dynfield" > +int rte_eth_ip_reass_dynfield_offset =3D -1; > + > +int > +rte_eth_ip_reass_dynfield_register(void) > +{ > + static const struct rte_mbuf_dynfield dynfield_desc =3D { > + .name =3D RTE_ETH_IP_REASS_DYNFIELD_NAME, > + .size =3D sizeof(rte_eth_ip_reass_dynfield_t), > + .align =3D __alignof__(rte_eth_ip_reass_dynfield_t), > + }; > + rte_eth_ip_reass_dynfield_offset =3D > + rte_mbuf_dynfield_register(&dynfield_desc); > + return rte_eth_ip_reass_dynfield_offset; > +} > + > RTE_LOG_REGISTER_DEFAULT(rte_eth_dev_logtype, INFO); >=20 > RTE_INIT(ethdev_init_telemetry) > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index 891f9a6e06..c4024d2265 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -5245,6 +5245,63 @@ __rte_experimental > int rte_eth_ip_reassembly_conf_set(uint16_t port_id, > struct rte_eth_ip_reass_params *conf); >=20 > +/** > + * In case of IP reassembly offload failure, ol_flags in mbuf will be se= t > + * with RTE_MBUF_F_RX_IPREASSEMBLY_INCOMPLETE and packets will be return= ed > + * without alteration. The application can retrieve the attached fragmen= ts > + * using mbuf dynamic field. > + */=09 > +typedef struct { > + /** > + * Next fragment packet. Application should fetch dynamic field of > + * each fragment until a NULL is received and nb_frags is 0. > + */ > + struct rte_mbuf *next_frag; > + /** Time spent(in ms) by HW in waiting for further fragments. */ > + uint16_t time_spent; > + /** Number of more fragments attached in mbuf dynamic fields. */ > + uint16_t nb_frags; > +} rte_eth_ip_reass_dynfield_t; Looks like a bit of overkill to me: We do already have 'next' and 'nb_frags' fields inside mbuf, why can't they be used here? Why a separate ones are necessary? =20 > + > +extern int rte_eth_ip_reass_dynfield_offset; > +