From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AFD55A04C1; Wed, 20 Nov 2019 08:01:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 148AA2C6D; Wed, 20 Nov 2019 08:01:29 +0100 (CET) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00056.outbound.protection.outlook.com [40.107.0.56]) by dpdk.org (Postfix) with ESMTP id 96ACF2C36 for ; Wed, 20 Nov 2019 08:01:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XbNAzYqXgFkli5pDP2cBttin7rZ9fJT52JntFnaZwehLVgEyL8xrvjzJymP6/RvGLUxBY1nTN/QofnlEzv4Qjok1/eKVjiCIu8uV+Vjq6F/TS0mk503SnCcEvieeTKJ9C1LWDoU4VNQc292lTx6UgVgqHevOBhAWKQVXF4f2M8/0aCxsda1DaI0b3r7kFImImJR+e8sLucBEuaxuCR1Q0m/IPqQsFCafDvkB0DA6dNCG22T+p1lFoM1O06S/p5gvqh2sZYTet8v+IWH2BoBOhJDP3PD32HFw70fJWv8XQwo6Wf6REfwim5gL4RnRO+TjTCUXDNki+CcI8I9lQNzJ/g== 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-SenderADCheck; bh=wJ0XIy8xcZA3ymBtChEdh37mI3ssOe5FFVQxgfrvVA0=; b=iaRe7pj63j+nEGAyD5fC4BLUGMhDF2m6DuWI0698fU2Z6+MGBDH0wQW5/+RxKeRoUHoPgDHCPKL6WEYZ3ETuu1z0j9sER0U+iNNfvbGtx6/1tGWIomCjRffsGmiDGlFvYmS8IbTTUPnoAjDm2sXc7xtUBGiJ7lfm82vwdHBIbV9YSshKAXUSmnj0vkKCINq4bTRX87kTh7Dt9T9DzljJdoIGKWdlItWN4rUnSkr4e2bXxWji/YC4m7vmPy6CuTr/DTAbRxx6Ui1+y146h3P//m4HZTAzVxZk5/tMy1ExAk8pldybFbMms939WIlCcVz2qmKkvI3iMGFJC7P7IBQ38w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wJ0XIy8xcZA3ymBtChEdh37mI3ssOe5FFVQxgfrvVA0=; b=qH5nnraaC+HXqHZvCU0nmjL7FrOqcIW9lEhoyEQj8Bl2AqmTnKa6mpb4k2MFx6Dys5inegN1DGNhagMXACNaSf9a0hEC64evPHPv6yqD0lxHRRVc1iXKgiqRqwNncAVHHpi0gdVhSppiwaaDaTSvb6jRN6PQhzk2KknTUiPZw+Y= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3953.eurprd05.prod.outlook.com (52.133.33.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.30; Wed, 20 Nov 2019 07:01:26 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::c9c0:7e1c:6dae:7e4d]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::c9c0:7e1c:6dae:7e4d%4]) with mapi id 15.20.2451.031; Wed, 20 Nov 2019 07:01:26 +0000 From: Shahaf Shuler To: Stephen Hemminger , Thomas Monjalon CC: "olivier.matz@6wind.com" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] mbuf: extend pktmbuf pool private structure Thread-Index: AQHVnfdZ9XvmbPQFAU6tWakRtJ1/dKeSPKYAgABh4fCAABFjgIAAZfuAgAAWbgCAAHeYYA== Date: Wed, 20 Nov 2019 07:01:26 +0000 Message-ID: References: <20191118100247.74241-1-shahafs@mellanox.com> <20191119082515.41848e4e@hermes.lan> <2817003.Afhorg6P4o@xps> <20191119155032.78a0180c@hermes.lan> In-Reply-To: <20191119155032.78a0180c@hermes.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b37410b0-d878-46a3-7f9f-08d76d87763e x-ms-traffictypediagnostic: AM0PR0502MB3953: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 02272225C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(376002)(346002)(136003)(366004)(39860400002)(189003)(199004)(86362001)(76116006)(6246003)(186003)(74316002)(102836004)(4326008)(25786009)(229853002)(14444005)(256004)(66066001)(55016002)(14454004)(26005)(316002)(54906003)(110136005)(6506007)(478600001)(486006)(6436002)(9686003)(66946007)(476003)(33656002)(8936002)(66446008)(66476007)(66556008)(64756008)(2906002)(99286004)(11346002)(6116002)(446003)(71190400001)(305945005)(81156014)(81166006)(7696005)(7736002)(71200400001)(76176011)(8676002)(3846002)(52536014)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3953; H:AM0PR0502MB3795.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: v8KwO6Xmo8b0r84gm2TzMhHO2uI6ZsJ9eMMEqR6QBgcKRinbDaCdEFKwq1w05D1CyRTKsxEhGCppXEuS7je7S9N63VMwjZ/DR1mVLmJpqwOkPY16YDU8X5j5J4XaZsIsGa7RaNXi4/X1BIH8Bu7E9zWwFdBs8MGg6SO7QPr10o1G/b5sldi7fjK8IB4WgfUcM/krzDVmA/koVL4kyZVXu5xwkibrvXxtATEjOIw0BXD0rEJxQwmUAuUTluhymhvyfC3KjSYaVItbYKnaIf2UL1psVZbF3LYMpg6CSjNS9xB/RT7gPIest0Gwjgn+HY/7pfO+Hn44QMP0uy6pcjxx6vafvaLioBF95YcbR14uaRPpC60/SwJoikqK1rt2zOjXWg/DCvTwZgKnOiPrdW4kY0fHwLklMjDxbDX0ho/woLT4P0CkEMpy8CRwWleVdBlR x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b37410b0-d878-46a3-7f9f-08d76d87763e X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Nov 2019 07:01:26.7684 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dIdUao4Jx+araruP/v2pG+bgrFd84xEjFV9x7Va4JABTWlyXpX1xxoR9+IaCAit/AyoujTcLrPxFFKT+wX80gQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3953 Subject: Re: [dpdk-dev] [PATCH] mbuf: extend pktmbuf pool private structure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Wednesday, November 20, 2019 1:51 AM, Stephen Hemminger: > Subject: Re: [dpdk-dev] [PATCH] mbuf: extend pktmbuf pool private > structure >=20 > On Tue, 19 Nov 2019 23:30:15 +0100 > Thomas Monjalon wrote: >=20 > > 19/11/2019 17:25, Stephen Hemminger: > > > On Tue, 19 Nov 2019 15:23:50 +0000 > > > Shahaf Shuler wrote: > > > > > > > Tuesday, November 19, 2019 11:33 AM, Thomas Monjalon: > > > > > Subject: Re: [PATCH] mbuf: extend pktmbuf pool private structure > > > > > > > > > > 18/11/2019 11:02, Shahaf Shuler: > > > > > > struct rte_pktmbuf_pool_private { > > > > > > uint16_t mbuf_data_room_size; /**< Size of data space in > each > > > > > mbuf. */ > > > > > > uint16_t mbuf_priv_size; /**< Size of private area in ea= ch > mbuf. > > > > > */ > > > > > > + uint32_t reserved; /**< reserved for future use. */ > > > > > > > > > > Maybe simpler to give the future name "flags" and keep the > comment > > > > > "reserved for future use". > > > > > > > > I'm am OK w/ changing to flags. > > > > If Olivier accepts maybe you can change while applying? > > > > > > After the Linux openat experience if you want to add flags. > > > Then all usage of API needs to validate that flags is 0. > > > > Sorry Stephen, I don't understand what you mean. > > Please could you explain? > > > > >=20 > Any time a new field is added that maybe used later you can not guarantee > that existing code correctly initializes the value to zero. What happened= with > openat() was that there was a flag value that was originally unused, but = since > kernel did not enforce that it was zero; it could not later be used for > extensions. >=20 > You need to make sure that all reserved fields are initialized. > That means when a private pool is created it is zeroed. And if a flag is = new > argument to an API, check for zero at create time. I guess we can hard code the value for 0 on the rte_pktmbuf_pool_create fun= ction and have some assert on the rte_pktmbuf_pool_init callback (we cannot= fail as this function returns void). Any other places you find problematic?=20 >=20 > An example of how DPDK failed at this is the filter field in rte_pdump. S= ince it > is not checked for NULL, it can't safely be used now (and still claim API= /ABI > compatiablity).