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 70668A0471 for ; Mon, 9 Sep 2019 11:01:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C4EC1EB4A; Mon, 9 Sep 2019 11:01:32 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id E1F7A1EAC1 for ; Mon, 9 Sep 2019 11:01:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 02:01:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,484,1559545200"; d="scan'208";a="188961094" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga006.jf.intel.com with ESMTP; 09 Sep 2019 02:01:28 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 9 Sep 2019 02:01:28 -0700 Received: from hasmsx114.ger.corp.intel.com (10.184.198.65) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 9 Sep 2019 02:01:28 -0700 Received: from hasmsx113.ger.corp.intel.com ([169.254.13.177]) by HASMSX114.ger.corp.intel.com ([169.254.14.116]) with mapi id 14.03.0439.000; Mon, 9 Sep 2019 12:01:26 +0300 From: "Zapolski, MarcinX A" To: Stephen Hemminger CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide key ethdev structures from public API Thread-Index: AQHVZLYTzdmBMJkf+0y1UM2/wAYG6KcetBmAgARXdbA= Date: Mon, 9 Sep 2019 09:01:25 +0000 Message-ID: <51FEE37A1339864DB0A4E34597F561E30D5D622C@HASMSX113.ger.corp.intel.com> References: <20190730124950.1293-1-marcinx.a.zapolski@intel.com> <20190906131813.1343-2-marcinx.a.zapolski@intel.com> <20190906122415.3a9ee4a4@xps13> In-Reply-To: <20190906122415.3a9ee4a4@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTRiMDQxOGUtNDczZC00YmZmLTkyMmYtODBiYjBjZWJiNDM4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMDNkY2U4MmluMW5Bb2lGOHR3ZStMRmtkMEYzR1ZZZ0JMUndWeE1lZW1UdTBKek4ycG9aOVRGYnUwY1E1UnRFXC8ifQ== x-ctpclassification: CTP_NT x-originating-ip: [10.184.70.11] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide key ethdev structures from public API 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 [mailto:stephen@networkplumber.org] > Sent: Friday, September 6, 2019 7:24 PM > To: Zapolski, MarcinX A > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide key ethdev > structures from public API >=20 > On Fri, 6 Sep 2019 15:18:11 +0200 > Marcin Zapolski wrote: >=20 > > +RTE_INIT(rte_eth_dev_init) > > +{ > > + int i; > > + > > + for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) > > + rte_eth_dev_functions[i] =3D > > + (struct rte_eth_dev_fcns *)(&rte_eth_devices[i]); >=20 > Casts are error prone. Is it possible to use container_of instead of dire= ct cast. I could if I had a pointer to struct rte_eth_dev_functions and needed to ge= t struct rte_eth_dev which is a container structure in this case. But I cou= ld use offsetof instead.