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 4AF73A052E; Tue, 21 Jan 2020 09:00:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0FA12493D; Tue, 21 Jan 2020 09:00:20 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2042.outbound.protection.outlook.com [40.107.22.42]) by dpdk.org (Postfix) with ESMTP id 7C16644C7 for ; Tue, 21 Jan 2020 09:00:18 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DTnOlEOexnQ5psUa8zQjN5UmW/MkipC8mZ97PSo9qTCanvTe152XuQ+1vJOylBD8wk686ts+yFfeFQU5vEWfkdQxnd+U2RlJiTQR2NnpLY1toEb+1ACCXNRWfglhjZ+X5PKJa+bp3jKQCUv+YU52o+RPNcL0MNZW4hrntmitIwoWFjDoouPsZQbH/mHzWc1rVmn0X8oECHbt8wGyziuRIxtrYdWBRbcDgSs7hwnuK2jLBuZ6Kb7ptdeC9FcFg85ZF4x9VjbFyA5xyn+rhwCc1rZXSpnDEts7SolOUIlNAvCBBmHkQtXrR/1WCHMxTyFq1drg1hTkObBqzMP9Rc7DdA== 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=cTdLWu/gHxFouE+f67jRojESzH0DUKgDAZDOUvXmR9I=; b=TmDFaBP7KStjBv2SQtutv9IP7a3zdYzvIjkwE+oQn8XhyhORvMP/0vxjNIuZaRcxqTtme0YpQbFhn2XJIAqZFge3K7eQyi94EzG5EHzwPVZEomOsWX26tKVktR9cJZHshJmmi5oDcnfR+Bos0XQCco/i9FLpgD+azx8jbu82TtzFjJ2YYRSlEe76goplhcyT/QRYid92N1vPsJ049OU6Onyld6vCEgRmetXnlW6amSTY9qFWgwqkhyArGGtWhMSI0qDb2kXb3FKZ1CbxnGyzpDi172U6zXr+kSibb+FYe9/UL8hG8V9uh1bixbyJ5viaMaumWxrp/9t3z68ZPgfbMA== 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=cTdLWu/gHxFouE+f67jRojESzH0DUKgDAZDOUvXmR9I=; b=TZisTrstsNALm/srIzYPdbVDmJj+/4XuhBsDnyMgdz5QM0+MdhqsUiwSMtoH4eaZ0kUYOam8Lwgc4lxKDCaYKpflWzrwTbnS11FWCd7Qz0qM/2ROodBSbsxSSXTf26jSRBZnej78RDiwqGC+7ihiUItBj4u4R4hKqjS0O3M7TW4= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3460.eurprd05.prod.outlook.com (10.171.187.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Tue, 21 Jan 2020 08:00:17 +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:00:17 +0000 From: Slava Ovsiienko To: Stephen Hemminger CC: "dev@dpdk.org" , Matan Azrad , Raslan Darawsheh , Ori Kam , Shahaf Shuler , "olivier.matz@6wind.com" , "thomas@mellanox.net" Thread-Topic: [PATCH v5 1/5] mbuf: introduce routine to get private mbuf pool flags Thread-Index: AQHVz9JUQbzanLz0f0WVDugMHenrNaf0wCKg Date: Tue, 21 Jan 2020 08:00:17 +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> In-Reply-To: <20200120124342.6b308e18@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=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: c9be161c-fc8a-4982-bd9a-08d79e47f42a x-ms-traffictypediagnostic: AM4PR05MB3460:|AM4PR05MB3460: 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:8273; x-forefront-prvs: 0289B6431E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(396003)(376002)(366004)(136003)(346002)(199004)(189003)(316002)(5660300002)(81156014)(81166006)(8936002)(6916009)(8676002)(54906003)(26005)(33656002)(86362001)(186003)(52536014)(2906002)(7696005)(71200400001)(4326008)(53546011)(478600001)(55016002)(66476007)(64756008)(9686003)(66446008)(66556008)(6506007)(76116006)(66946007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3460; 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: f4jtrp5zQ1yyHzdAdbfAJQGCo8GZJMUrn5yX4OA0A1ZvTn1d/9Gsmz/kVph/fH8dk3+X3s+neIsP6WKZdPE+wCtRRpQAQXCVylQlTgnqmVASKSge9O/Q2PyAn1n75i1ogILKMNIhZHd7RyHsrPRJGoLUppIMrF2XTbpnT6gJctXl7Ldi21GxbQIPAtC/d79am5V42zOHDPqDrnbA/8pUfFGK2Wc6PeDyZyATc5tk2K740Co4iBwG3doxWKLYZscQAuEAPErRv0MAOMzc0tjpCsOkpvvkNn0EIAZbFSAoRxk8+leDaTzvXrI9jCHDQXQf4+Q1NlXx7spx9OEJujIzVq05duQIDVBr+c64c5nRtGY5vpoddOntGdXJvaqK3Vj+d4pzzubB/G+roz3iRL63utbayruDh2BMDHjilQMD8chSxEuOytjjkmaRJEWjzETA 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: c9be161c-fc8a-4982-bd9a-08d79e47f42a X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2020 08:00:17.1533 (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: LOnyNbNRQ9oOtKJBzq2Uner9w+ax8Se+j5NVQTmU+dJpBgvj9xeyOUgXb3gBRFLXBQKMeC2Lw/TvSefZ64IjcqfB5S3jbYxPyDNzZgoVS+0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3460 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: 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 p= ool > flags >=20 > On Mon, 20 Jan 2020 17:23:19 +0000 > Viacheslav Ovsiienko wrote: >=20 > > The routine rte_pktmbuf_priv_flags is introduced to fetch the flags > > from the mbuf memory pool private structure in unified fashion. > > > > 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 */ >=20 > Looks fine, but a couple of minor suggestions. >=20 >=20 > 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 poo= l structure instead of calling rte_mempool_get_priv() ? With best regards, Slava