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 06ACC46082; Tue, 14 Jan 2025 09:22:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E909D402E8; Tue, 14 Jan 2025 09:22:49 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2063.outbound.protection.outlook.com [40.107.102.63]) by mails.dpdk.org (Postfix) with ESMTP id E4816400EF for ; Tue, 14 Jan 2025 09:22:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Yk59CcNSFy2dWrj2oMDS8Xowt8863BtqoihY8zg8mgk5HoF2xwqZk+wFUYt4+UA/rMiJ7O+m8ygMkT7P2BSnwEhvEuIPt88pHHKBuUnOdnrw/+RP479HqbYcSQLvbdmZ4llFYmHmTKkehYgTgV4E5pHrzA0jK0x5rUiqY0NBWriGRTX6wYRasuPexYbxvpJ/cDq07Obdel7UrUjzmtJ2vZkpK96LAuw5oubJuLSc0nX9QrvU+wjeWJifxb9flnR7lUWi8zIt+MSzrmDRE8FlZQNYwvRYq8aOXZQ2zBTSNUXgCvBd4wiyiBCM5FRFXPJEeLa8MbofYi4qsXk98kCfUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nLpZHiXI6GeT7uKb35Wdi0Q31+9j648sME8fgiQVmd4=; b=s1zN0EKQZ7BB/0bTTIyR1brEG+drFlWSpLIYQRLRS2+e9rSHXwmbMGwxFZLtGvKQCIIKxj35M4MQvuuV4/gXv+au/OntTbUP7XHcbiX9Qqj6W6defhJtqZohvU2TKK11Hov65t3ksmXjFIwxXxNLKfzFmqyop3Xpj6smotm6rGcnUUvQ6iAtjP2PHKur3/d6HDuNWl8lTKryayYw1q+dWZMC/kyBCd+7+lbJBNZlliIpjDTKo5sQDj6iGdj1BBsFYB+gzupDrhLuHsY17MKk3SoIUflIAV5Ed8KFhBmI9Q/tFB0vdrakyt+IC5jm/tv10mf1uL5W5UiFOIxlHqJEHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nLpZHiXI6GeT7uKb35Wdi0Q31+9j648sME8fgiQVmd4=; b=phZn8j2lx5kzCTDV4+gdLbPNZx9RkX9quuEI7uECtLfNgfy3NIQrxf5g0irCJ7eEcc/ZlMIHpDH8Kh7INUFg7aFoFTcWyvedcyj5AkEscNtN9o+9TgsgF/UKgV4j1PcTejgbo2Z/qVNPKQzmWGEQoKLzQvROH5oAp0ytqR4RdVP1PCMRH8k0pvvqTnkRjjnUSGeB/ibPtA9sFvsKKhsDnhG3+pFc5/xluRqZVZ3TFDvyeMHNZy3y2yUAaFSY8/EEtm18Ey21rgbLm1CJ6LZzLiD1uaFw5iQqZPMsd8XY8JoupwnY/Vopp6ghY7Oitzl5vwJAk9hp0X/3IKZDwsHBgw== Received: from MN6PR12MB8567.namprd12.prod.outlook.com (2603:10b6:208:478::12) by BY5PR12MB4290.namprd12.prod.outlook.com (2603:10b6:a03:20e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.19; Tue, 14 Jan 2025 08:22:46 +0000 Received: from MN6PR12MB8567.namprd12.prod.outlook.com ([fe80::9bde:b697:6d6d:ee04]) by MN6PR12MB8567.namprd12.prod.outlook.com ([fe80::9bde:b697:6d6d:ee04%6]) with mapi id 15.20.8335.017; Tue, 14 Jan 2025 08:22:46 +0000 From: Slava Ovsiienko To: =?iso-8859-1?Q?Morten_Br=F8rup?= , Shahaf Shuler , "dev@dpdk.org" CC: Olivier Matz , "NBU-Contact-Thomas Monjalon (EXTERNAL)" Subject: RE: questions about pinned external buffers Thread-Topic: questions about pinned external buffers Thread-Index: Adtij6SnfyLI8A1BTh26CsCUpTAgKgDzCUHg Date: Tue, 14 Jan 2025 08:22:46 +0000 Message-ID: References: <98CBD80474FA8B44BF855DF32C47DC35E9F99F@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F99F@smartserver.smartshare.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR12MB8567:EE_|BY5PR12MB4290:EE_ x-ms-office365-filtering-correlation-id: 0d9e6986-8a24-4caa-8053-08dd34749ffb x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?ka7HutRyjisj85SSguqivIg4vdu+UWRRg66t6dlx9l8TIfFoQLVARKQdVd?= =?iso-8859-1?Q?s8z1CXOXR1NY5cdvhQCr3Vr8UEAnTP5iD7MzT4Kgch/UEWYRw6OsZA2oON?= =?iso-8859-1?Q?RTiZSHvvSj20gIPot62lBGmZ0XDjRAUSut1IjfFk8uKSbRxvgz0LCa3d5x?= =?iso-8859-1?Q?nUHR88RBc2zCqhTDyCd1XL0jylSXrSdblT+OJJ93Dq5t401PDKXuoIH2su?= =?iso-8859-1?Q?SxjdD8O0pnvkT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so-8859-1?Q?sTdiqZNsRvDRvUeEWzb1Vfh7+NVNj2bcPJOahZqdEe94866AGDYVAyoCLD?= =?iso-8859-1?Q?tvr9i8mIQQBqLx7FCwD2LUnx4c9MRK8EeWuu58TcjLtoIkJTiWL1FhWM9y?= =?iso-8859-1?Q?4ScutJNC152bziEMUI/SRYuLcVCArwZqC7B+fhPPnM5BBihdhuLpljdd5+?= =?iso-8859-1?Q?nDUDiIiI86U1koenRLK8TusenJiczowbYQOm0WNJIAu91oDvFWzryahYp3?= =?iso-8859-1?Q?XLhxFwQ871D7op2SN/KtSqdCbqJKkPp6mJ3r5jCYyb2sgOkH2sz6VPnsUm?= =?iso-8859-1?Q?N3deHt1w4dCW7S5Cu5J2GUQZlP//4sPtOusY63s53ncgAKDSLRBjYD+sO0?= =?iso-8859-1?Q?79/5Ei8nAf83AmIMH4NyKL?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN6PR12MB8567.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?bnzNKkcL7nQ4pgUiyloIdeF1qrzmaiItE4h5svAF78Lzj2s3qxXt7Kj7GM?= =?iso-8859-1?Q?QyTDXK5C6Xls5wWgoOEQ8CU+7NsOGfxKx86AzDxAQ4Q3wwX+2Avje7tJGt?= =?iso-8859-1?Q?UuTqyRJ+r5ofkqLZ33s5m/vQz7jecb6HOawCTwhNBfppbcIEYznMuXUQgp?= =?iso-8859-1?Q?onqNExluuWyHZiszd2l3+OyDufHcmPneC/W6W2pw8qjUuiEB+dm52xhHnq?= =?iso-8859-1?Q?1Efsj4WuaIOc/7lEEGfRvRMnZj/9rlysLc9SPPJ6cbGeE77L+2CfDeupNk?= =?iso-8859-1?Q?YgFHC1WlVeKZ124VC8w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AxpaqVmMdpRrpvibq6i6hSaN51KurHKf1lvartO9lEfypfnbZ3jiN?= =?iso-8859-1?Q?cUGQbGFnimunkqwrGHGQ2Fa25oaSIqmwM5JBvc2CEhAlHYh8mvfBmN63IS?= =?iso-8859-1?Q?EzuYgjji7sPPK2U1rJPKUXquDERBrCwILjPOk57FEncxyMaU6FJ5dsEs7q?= =?iso-8859-1?Q?6eFf8Clic4tg77tOQJWbOWbK0arUjt5efJzBuKVY9eY32ana2OAQ3GGa0x?= =?iso-8859-1?Q?oP4TfOMYP9f8ZPFrN8bFCZbDSOK3PpPZYCywh40wob61KOSZGFRnj8d7L/?= =?iso-8859-1?Q?MWSKCAg6EQkVn03ylvCAAuEo6CkD6ihEaIKEkAO7D+UfDlCvJvDwNyHe2Y?= =?iso-8859-1?Q?WxtaiWsc0TBmL9nV/SETpseO91bEZi8ep/TPVozVDw8wZDK8mMVnqDCZDP?= =?iso-8859-1?Q?1LMgOsrmi5FXeP5XxJtaDOLd/4eRJf31sW?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR12MB8567.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d9e6986-8a24-4caa-8053-08dd34749ffb X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2025 08:22:46.0841 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 20GqifyUZF14vuiJmNwyeNnsYPCkIQxieoapRH12xtS7SjKospyBQUYPMFNLDfTN2TS5DNUnEsZlCEajEN9x+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4290 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, Morten > Question 1: > Please confirm that the mbuf's pinned external buffer's refcnt is suppose= d to > be 1 when an mbuf is returned to the mempool? ... > + rte_mbuf_ext_refcnt_read(m->shinfo) =3D=3D 1))); I think we can add this extra check and neglect the light performance impac= t in debug version. > Question 2: > Could this assertion be moved to __rte_mbuf_raw_sanity_check()? Looks like it could, but we should be careful about side effects in=20 __rte_mbuf_raw_sanity_check(), it is exposed in rte_mbuf.h to users (also as legacy MBUF_RAW_ALLOC_CHECK). But I have no strong objections. With best regards, Slava > -----Original Message----- > From: Morten Br=F8rup > Sent: Thursday, January 9, 2025 2:12 PM > To: Shahaf Shuler ; Slava Ovsiienko > ; dev@dpdk.org > Cc: Olivier Matz ; NBU-Contact-Thomas Monjalon > (EXTERNAL) > Subject: questions about pinned external buffers >=20 > Pinned external buffers were introduced with this patch: > https://git.dpdk.org/dpdk/commit/lib/librte_mbuf/rte_mbuf.h?id=3D6ef1107a= d4 > c6d4fcb6be627367ee0b97bb13e822 >=20 > Question 1: > Please confirm that the mbuf's pinned external buffer's refcnt is suppose= d to > be 1 when an mbuf is returned to the mempool? >=20 > If so, the below assertion should be updated for completion: >=20 > rte_mbuf_raw_free(struct rte_mbuf *m) > { > RTE_ASSERT(!RTE_MBUF_CLONED(m) && > - (!RTE_MBUF_HAS_EXTBUF(m) || > RTE_MBUF_HAS_PINNED_EXTBUF(m))); > + (!RTE_MBUF_HAS_EXTBUF(m) || > + (RTE_MBUF_HAS_PINNED_EXTBUF(m) && > + rte_mbuf_ext_refcnt_read(m->shinfo) =3D=3D 1))); > __rte_mbuf_raw_sanity_check(m); > rte_mempool_put(m->pool, m); > } >=20 > The increased performance cost should be acceptable for debug builds (i.e= . > with assertions enabled). >=20 > Question 2: > Could this assertion be moved to __rte_mbuf_raw_sanity_check()? >=20 > I'm working on a new rte_mbuf_raw_free_bulk() function, for use with > RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; and if the assertion is not moved > to __rte_mbuf_raw_sanity_check(), it needs to be copy-pasted into the new > raw_free_bulk() function too.