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 E3178A052E; Tue, 21 Jan 2020 09:23:56 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A2F21252; Tue, 21 Jan 2020 09:23:56 +0100 (CET) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40066.outbound.protection.outlook.com [40.107.4.66]) by dpdk.org (Postfix) with ESMTP id 34D2811A2 for ; Tue, 21 Jan 2020 09:23:54 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jSNzYeCWMZcLI8FEI3pV0kjEoeBTvwfbG2Kfb21ETf5gO3phk2Q6SuDY5zPhdQOzqm4K/Ancv44mOTVnbuezHpNzbaSNFFMeNjh+k61L6eipp+uPTcxL7HwArnIKCdREDaGQZtqXGaPB8cSWHnTJE5KAnC36BCybiFMi8yYIGIG+oJPfjAUqJlo2Z9KxhBjhvo4eX8PIX1qbYGNzW2NQfUE6ql7du5+5ir01Y3oXmKD9iB1z/jqu9xIC+Fvpx1ZEU2uXM+YBX2kl4lV2CPJboaKbmCvUwG1f78S0ntbc1a018lOgx36BffAAddukXxK6lHVm7zwA27wITYrvjAGGIg== 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=1QM/zEErCo6D2IVS0ksYPqVTkFZR3+bWG74/c6Br1qw=; b=P1vQuvELqOAQxFafw560Y+DwEJt6KuXQlAg7liJLBZ0L1q0azDaaEu3zAYAkjUzOfCPzf8vmkdz93ExDjo/RgdjrtcRZemMsIUVmQxAgxGn8jP+LIUwwxVNyCoDkQGzLHv1BiFymQBrz5vegg+ZM77E8cyKqRh0e7T9xf4OUq5xZn8ctDxedzyga6566/t05KCllU7uXLOlzuMUdoQtTNi/OFK7ymLacJ2ly3OVRX8ccqOgohExc1g3hfEN1WA0fgIGapkX8NchtksMEu/boZ/TehllEYm5/r5S8tHedxE0CkHMSw8aO7elympFoYJLSukpnIVrPDRuR/gl+ng27JQ== 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=1QM/zEErCo6D2IVS0ksYPqVTkFZR3+bWG74/c6Br1qw=; b=hO8Ihgz7SXvg5K8r9kkBZTYOn+eMpSa2L4IjcB64ZP8S1lCBUefQKf3VxTXBMatiwkrqDOtNv/RAQSfWc7rqrf5NxZhFZzixmYO0Y3Ck9M2PsJkHJ0rt8G9kTpIpA9koQXsJLJEk8raZzDUzOdL3es1zAG246jQR3EnU9UaCGsg= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3458.eurprd05.prod.outlook.com (10.170.125.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Tue, 21 Jan 2020 08:23:52 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::68eb:ad79:71f4:110f]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::68eb:ad79:71f4:110f%3]) with mapi id 15.20.2644.024; Tue, 21 Jan 2020 08:23:52 +0000 From: Slava Ovsiienko To: Olivier Matz CC: Stephen Hemminger , "dev@dpdk.org" , Matan Azrad , Raslan Darawsheh , Ori Kam , Shahaf Shuler , "thomas@mellanox.net" Thread-Topic: [PATCH v5 1/5] mbuf: introduce routine to get private mbuf pool flags Thread-Index: AQHVz9JUQbzanLz0f0WVDugMHenrNaf0wCKggAAFxYCAAAJjwA== Date: Tue, 21 Jan 2020 08:23:52 +0000 Message-ID: References: <20191118094938.192850-1-shahafs@mellanox.com> <1579541003-2399-1-git-send-email-viacheslavo@mellanox.com> <1579541003-2399-2-git-send-email-viacheslavo@mellanox.com> <20200120124342.6b308e18@hermes.lan> <20200121081417.GO14387@glumotte.dev.6wind.com> In-Reply-To: <20200121081417.GO14387@glumotte.dev.6wind.com> 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=viacheslavo@mellanox.com; x-originating-ip: [77.75.144.194] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: cb618103-8a6b-4bae-df6a-08d79e4b3faf x-ms-traffictypediagnostic: AM4PR05MB3458:|AM4PR05MB3458: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(376002)(346002)(39860400002)(366004)(136003)(199004)(189003)(76116006)(71200400001)(5660300002)(4326008)(66946007)(33656002)(55016002)(81156014)(316002)(52536014)(54906003)(7696005)(26005)(81166006)(2906002)(6506007)(8936002)(8676002)(53546011)(6916009)(64756008)(66556008)(66476007)(66446008)(86362001)(186003)(9686003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3458; H:AM4PR05MB3265.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: rIpWt/yd3q6QeGP7aNF8nKL+X6Xdws7Trl9FZe//R7UXjDzV1Xh+GkqyQ4U0tNvn2L0yEkkyyoXo2DdP5zFzl9uz/x7pE3nVX7t4sBwGFblXSLZ0bvsCIXTAPdUyBcF8dcE/3gbTogkdjqHY21cJLZygTZIY/o6h8LxOiHo8dirhY160BrYgQ/6BHYYs8PTs3aeBzlyESZQYIVb1BosW7AWkb6MeXCL8DclRyswEhjC7r4npQENUkzpy4A+S8MR59MxJMObJH73YaNKlg9FRCRvMjmg02VYztKncTQiFhd6nnZkfici3UxxxRIKS+2v4plELNMgKtP7N5wwTJxvl1MH/zuHyqdaaEtJLcPR3CPKwyE5mds1dRCynxdOPDGId7qf8fYuRX/tOOPjHd4eSA1Lzy9gORIxE3jdVKxEB14rrJivIkGIawUm+J4oXL1Dv 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: cb618103-8a6b-4bae-df6a-08d79e4b3faf X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 08:23:52.3221 (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: zgbU83Jgkc81AGfEVCw550YtxtGS9zGuXLY6EMrx+p0agcTtZqf91BkwI3gb9IDHp5sBxs+ylbXzAbVhEOqZ3M+yTeEMknZ/I1G0KaRnufU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3458 Subject: Re: [dpdk-dev] [PATCH v5 1/5] mbuf: introduce routine to get private mbuf pool flags 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" > -----Original Message----- > From: Olivier Matz > Sent: Tuesday, January 21, 2020 10:14 > To: Slava Ovsiienko > Cc: Stephen Hemminger ; dev@dpdk.org; > Matan Azrad ; Raslan Darawsheh > ; Ori Kam ; Shahaf Shuler > ; thomas@mellanox.net > Subject: Re: [PATCH v5 1/5] mbuf: introduce routine to get private mbuf p= ool > flags >=20 > On Tue, Jan 21, 2020 at 08:00:17AM +0000, Slava Ovsiienko wrote: > > > -----Original Message----- > > > From: Stephen Hemminger > > > Sent: Monday, January 20, 2020 22:44 > > > To: Slava Ovsiienko > > > Cc: dev@dpdk.org; Matan Azrad ; Raslan > Darawsheh > > > ; Ori Kam ; Shahaf Shuler > > > ; olivier.matz@6wind.com; > thomas@mellanox.net > > > Subject: Re: [PATCH v5 1/5] mbuf: introduce routine to get private > > > mbuf pool flags > > > > > > On Mon, 20 Jan 2020 17:23:19 +0000 > > > Viacheslav Ovsiienko wrote: > > > > > > > The routine rte_pktmbuf_priv_flags is introduced to fetch the > > > > flags from the mbuf memory pool private structure in unified fashio= n. > > > > > > > > Signed-off-by: Viacheslav Ovsiienko > > > > Acked-by: Olivier Matz > > > > --- > > > > lib/librte_mbuf/rte_mbuf.h | 17 +++++++++++++++++ > > > > 1 file changed, 17 insertions(+) > > > > > > > > diff --git a/lib/librte_mbuf/rte_mbuf.h > > > > b/lib/librte_mbuf/rte_mbuf.h index 2d4bda2..9b0691d 100644 > > > > --- a/lib/librte_mbuf/rte_mbuf.h > > > > +++ b/lib/librte_mbuf/rte_mbuf.h > > > > @@ -306,6 +306,23 @@ struct rte_pktmbuf_pool_private { > > > > uint32_t flags; /**< reserved for future use. */ }; > > > > > > > > +/** > > > > + * Return the flags from private data in an mempool structure. > > > > + * > > > > + * @param mp > > > > + * A pointer to the mempool structure. > > > > + * @return > > > > + * The flags from the private data structure. > > > > + */ > > > > +static inline uint32_t > > > > +rte_pktmbuf_priv_flags(struct rte_mempool *mp) { > > > > + struct rte_pktmbuf_pool_private *mbp_priv; > > > > + > > > > + mbp_priv =3D (struct rte_pktmbuf_pool_private > > > *)rte_mempool_get_priv(mp); > > > > + return mbp_priv->flags; > > > > +} > > > > + > > > > #ifdef RTE_LIBRTE_MBUF_DEBUG > > > > > > > > /** check mbuf type in debug mode */ > > > > > > Looks fine, but a couple of minor suggestions. > > > > > > > > > Since this doesn't modify the mbuf, the arguments should be const. > > > Since rte_mempool_get_priv returns void *, the cast is unnecessary. > > > > rte_mempool_get_priv() does not expect "const", so adding "const" is a > > bit problematic, and we should not change the rte_mempool_get_priv() > prototype. > > Do you think we should take private structure pointer directly from > > the pool structure instead of calling rte_mempool_get_priv() ? >=20 > I'm not sure it would work. The problem is that to get the priv, we do > pool_ptr + offset. So if we want to remove the const, we'll have to do a = cast to > "unconst". Not sure it is worth doing it. >=20 > Thanks > Olivier OK, I'll just remove not necessary (struct rte_pktmbuf_pool_private*) cast = and will not introduce const qualifier for the parameter. With best regards, Slava