From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id F3AB01B867 for ; Tue, 10 Apr 2018 14:33:01 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2018 05:32:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,432,1517904000"; d="scan'208";a="35998204" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga002.fm.intel.com with ESMTP; 10 Apr 2018 05:32:46 -0700 Received: from irsmsx156.ger.corp.intel.com (10.108.20.68) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 10 Apr 2018 13:32:44 +0100 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.176]) by IRSMSX156.ger.corp.intel.com ([169.254.3.229]) with mapi id 14.03.0319.002; Tue, 10 Apr 2018 13:32:45 +0100 From: "Van Haaren, Harry" To: "Dumitrescu, Cristian" , Neil Horman CC: "dev@dpdk.org" , "Ananyev, Konstantin" , Stephen Hemminger , "Singh, Jasvinder" , "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH] table: fix build error with gcc 8 Thread-Index: AQHT0AFSoFIUIDcUxUmbURS24rQGhKP4eMUAgAANtICAABoPMP//97wAgAACEQCAAATQgIABNyJw Date: Tue, 10 Apr 2018 12:32:43 +0000 Message-ID: References: <20180409124948.130974-1-jasvinder.singh@intel.com> <20180409080936.58ecb66c@xeon-e3> <3EB4FA525960D640B5BDFFD6A3D891267BB3D389@IRSMSX108.ger.corp.intel.com> <3EB4FA525960D640B5BDFFD6A3D891267BB3D42E@IRSMSX108.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258AE912640@IRSMSX102.ger.corp.intel.com> <3EB4FA525960D640B5BDFFD6A3D891267BB3D47F@IRSMSX108.ger.corp.intel.com> In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891267BB3D47F@IRSMSX108.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWI2OWFkNTMtOTlhMS00MjVlLWE4OGUtMzIyNzhmNWUzOTcyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJCMkdqN3NadVwvcGR6cUo0THprVHU0RmRQRmFZU1ZOMW5pRG0rQk1zOGhGUDI3MVhybDcrVUIweVVoU3I4YU5ZNSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] table: fix build error with gcc 8 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: , X-List-Received-Date: Tue, 10 Apr 2018 12:33:02 -0000 +CC Neil from other reply > From: Dumitrescu, Cristian > Sent: Monday, April 9, 2018 6:27 PM > To: Ananyev, Konstantin ; Van Haaren, Harry > ; Stephen Hemminger ; > Singh, Jasvinder ; Richardson, Bruce > > Cc: dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] table: fix build error with gcc 8 >=20 > > > > > > If people think that this function conversion is not nice, it can be > reworked > > in multiple ways at the expense of API (but not ABI) change: > > > 1. Define the hash function field in the table parameter structure as > > opaque void * rather than 4-parameter version. > > > 2. Create a separate parameter structure just for this hash table typ= e. > > > > Why just not define your f_hash member as a union: > > > > struct rte_table_hash_params { > > ... > > union { > > rte_table_hash_op_hash f_hash_4params; > > rte_hash_function f_hash_3_params; > > }; > > > > ? > > >=20 > Yes, agreed, this is yet another way to handle this, thanks Konstantin. Agree that this solution is a lot better than raw casting. The issue I have with casting is that it doesn't explicitly show that the s= ignature is different, and that the code must be aware of that fact. With a= union, at least the code explicitly states that there is a difference in s= ignature, and that this is being handled by the code, so this looks a bette= r solution. Neil proposed an alternative solution using a bit to indicate calling param= s in a separate reply - another possibility.