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 92294A04C1; Thu, 21 Nov 2019 13:28:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 372702BA8; Thu, 21 Nov 2019 13:28:21 +0100 (CET) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00047.outbound.protection.outlook.com [40.107.0.47]) by dpdk.org (Postfix) with ESMTP id 2918E2BA2 for ; Thu, 21 Nov 2019 13:28:20 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kt7xiaogIPcy4bAAG77Ufw7jMk3UVvB1bUZw9Z3zzceHV7Rk8RmmLgfeaS1HZBdzJw3IKw34fQfk/wHUcENlfH2YaPVYEM4S5XVm8BSl+P7i1XMtfBlw4ulD6V2cTKRlOUYSMWVcqf8TcXqaLwY50WzOLZqkEDve5ubOZEPXebDVj5YpYyeLWPJlo++3Shu+JJ9vGS4ZN4dKEleKL4PnXCXBIuuJIHnr4OukRwEIu7GWjaRKv+CePsjmern6Bz2UZ2prrsrJP6L2+Q5ZqwVdi+OGLeMtwFNQYhTdXguLFNqlI81x7Q21iw7ML25lqrqMtgjroOTr2Nmg+b79JiVI2g== 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=6ak3UtnFHJmjzek3HzpWRdJaOpVCDDCrh0zpPHohrfM=; b=bQOWSoVAO1ScCftj/5tP9NIucEjiTOrB9B2FEweuYiId4W4gaZJfglexMycmd/OLIYvD+ka203WDsZPKbzh1AI91BtZXdMA3tFWjyWGfLRroG5/YpFtVR0dn4tvcsVr0YdB7n5BPwOLuMezXkULnOnJ/e+ClO/u38BJ8r9mimPL3kUCXN5SFCcu7Tu58DuH1YDCsMgzmy1TuBBGF6gmmc/rU2CeeDFLnDtvmR8e+kxxJ+rOIl2H9fHj1q5lKhE627CcF7gHIeJToUgTlQC4h1Qlk8qZJnt7/4+Jjha/zM/DefXup+wRjM+bSIp+XwrNC4TF2U1i+fKHriYNQGl+SjQ== 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=6ak3UtnFHJmjzek3HzpWRdJaOpVCDDCrh0zpPHohrfM=; b=QbH8ahqOis5SCyO1O3cI9+VaaOWnzoDkgc7HukSJNzc/zsmvrbLw67jSCtLVmRJMHmRXAyyiEErhKX8qa70w72bVHmXZlVbtQFOaof8w/HqpbXNVvqrk1CI5+6/uKUNmo/lgsM+u6G/e5KOjd6ew1DqkA8hJKWN8ytJx7PlVNuM= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3987.eurprd05.prod.outlook.com (52.133.33.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17; Thu, 21 Nov 2019 12:28:19 +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; Thu, 21 Nov 2019 12:28:19 +0000 From: Shahaf Shuler To: "olivier.matz@6wind.com" , Thomas Monjalon , "dev@dpdk.org" Thread-Topic: [PATCH v2] mbuf: extend pktmbuf pool private structure Thread-Index: AQHVoGcn08o9i3LW30aQ4M+mHEpQ4w== Date: Thu, 21 Nov 2019 12:28:18 +0000 Message-ID: <20191121122810.147351-1-shahafs@mellanox.com> References: <20191118100247.74241-1-shahafs@mellanox.com> In-Reply-To: <20191118100247.74241-1-shahafs@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.12.0 x-clientproxiedby: AM0PR01CA0144.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::49) To AM0PR0502MB3795.eurprd05.prod.outlook.com (2603:10a6:208:1b::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [94.188.199.18] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8b5ed063-7611-48a3-eaad-08d76e7e4a48 x-ms-traffictypediagnostic: AM0PR0502MB3987: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0228DDDDD7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(366004)(396003)(39850400004)(346002)(376002)(189003)(199004)(64756008)(52116002)(478600001)(86362001)(316002)(14454004)(2616005)(71190400001)(71200400001)(6512007)(1076003)(6116002)(50226002)(6306002)(110136005)(186003)(66446008)(66946007)(8676002)(966005)(99286004)(446003)(11346002)(66476007)(66556008)(36756003)(102836004)(26005)(6436002)(5660300002)(2906002)(25786009)(2501003)(256004)(7736002)(8936002)(305945005)(386003)(6506007)(3846002)(66066001)(76176011)(81166006)(81156014)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3987; 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: dDIbZVoOFJGAyi/dLNHLSJCRFeZ1oV5E3yFZL3UEUQdhtXyk9T/2v67Kd2lrg/dvE06B80MGE2TNFsqJPf/yrCKL1jSba3AHYMkLjjb7pRrDRi0yXj7TndQwFPV6fg03NINWIYQLBVNuDYejEgNKysa/MfYVS6Ors5zGxK/WtnmxmsBDaVl5WtqlPhnFBbRFN3cO3EZ9HgMSVHToqIfwE8rHPKLwNZPNhOdhNmWbQbDG9wziRDhfnNYOS6s6CPKclXIgVmL+VoK6nG+mEpFDv27lG+2yioWWuVr8aYdarXDSY+4xsUjzTDtFepB5tfvqIgNQQQ5RBYFPicPGcr7dx5vGUVJjIHutJYR5Y6ghmNlv8KdZyuIBocdmNhacQhB1l8iPDuDx99hBHgB0f0ExIVcAR9PpHwBiGeqarvKGmLYR4RKo+8NWc9HUhsWSwqUyexTCO68qZK/jX1388qcOJHuH7i6RlY6JajDGmoxmE2c= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b5ed063-7611-48a3-eaad-08d76e7e4a48 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2019 12:28:19.0210 (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: 7hswdJyq0pAXmuhmdJh9r7MQN7UWZLiBIkE/PrHz370dkk8r5iQojtIMzJ05ssOO+kjjsCyWXq8drPFI1gwQLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3987 Subject: [dpdk-dev] [PATCH v2] 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" With the API and ABI freeze ahead, it will be good to reserve some bits on the private structure for future use. Otherwise we will potentially need to maintain two different private structure during 2020 period. There is already one use case for those reserved bits[1] The reserved field should be set to 0 by the user. [1] https://patches.dpdk.org/patch/63077/ Signed-off-by: Shahaf Shuler --- On v2: - rename new field to flags - add extra validation in code that flags =3D 0 --- lib/librte_mbuf/rte_mbuf.c | 10 +++++++--- lib/librte_mbuf/rte_mbuf.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 35df1c4c38..bd64c55fe6 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -50,6 +50,7 @@ rte_pktmbuf_pool_init(struct rte_mempool *mp, void *opaqu= e_arg) user_mbp_priv =3D opaque_arg; if (user_mbp_priv =3D=3D NULL) { default_mbp_priv.mbuf_priv_size =3D 0; + default_mbp_priv.flags =3D 0; if (mp->elt_size > sizeof(struct rte_mbuf)) roomsz =3D mp->elt_size - sizeof(struct rte_mbuf); else @@ -61,6 +62,7 @@ rte_pktmbuf_pool_init(struct rte_mempool *mp, void *opaqu= e_arg) RTE_ASSERT(mp->elt_size >=3D sizeof(struct rte_mbuf) + user_mbp_priv->mbuf_data_room_size + user_mbp_priv->mbuf_priv_size); + RTE_ASSERT(user_mbp_priv->flags =3D=3D 0); =20 mbp_priv =3D rte_mempool_get_priv(mp); memcpy(mbp_priv, user_mbp_priv, sizeof(*mbp_priv)); @@ -113,7 +115,11 @@ rte_pktmbuf_pool_create_by_ops(const char *name, unsig= ned int n, int socket_id, const char *ops_name) { struct rte_mempool *mp; - struct rte_pktmbuf_pool_private mbp_priv; + struct rte_pktmbuf_pool_private mbp_priv =3D { + .mbuf_data_room_size =3D data_room_size, + .mbuf_priv_size =3D priv_size, + .flags =3D 0, + }; const char *mp_ops_name =3D ops_name; unsigned elt_size; int ret; @@ -126,8 +132,6 @@ rte_pktmbuf_pool_create_by_ops(const char *name, unsign= ed int n, } elt_size =3D sizeof(struct rte_mbuf) + (unsigned)priv_size + (unsigned)data_room_size; - mbp_priv.mbuf_data_room_size =3D data_room_size; - mbp_priv.mbuf_priv_size =3D priv_size; =20 mp =3D rte_mempool_create_empty(name, n, elt_size, cache_size, sizeof(struct rte_pktmbuf_pool_private), socket_id, 0); diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 92d81972ab..219b110b76 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -303,6 +303,7 @@ rte_mbuf_to_priv(struct rte_mbuf *m) 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 each mbuf. */ + uint32_t flags; /**< reserved for future use. */ }; =20 #ifdef RTE_LIBRTE_MBUF_DEBUG --=20 2.12.0