From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>,
Neil Horman <nhorman@tuxdriver.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
Stephen Hemminger <stephen@networkplumber.org>,
"Singh, Jasvinder" <jasvinder.singh@intel.com>,
"Richardson, Bruce" <bruce.richardson@intel.com>
Subject: Re: [dpdk-dev] [PATCH] table: fix build error with gcc 8
Date: Tue, 10 Apr 2018 12:32:43 +0000 [thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA65E021314@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891267BB3D47F@IRSMSX108.ger.corp.intel.com>
+CC Neil from other reply
> From: Dumitrescu, Cristian
> Sent: Monday, April 9, 2018 6:27 PM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; Van Haaren, Harry
> <harry.van.haaren@intel.com>; Stephen Hemminger <stephen@networkplumber.org>;
> Singh, Jasvinder <jasvinder.singh@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] table: fix build error with gcc 8
>
> > >
> > > 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 type.
> >
> > 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;
> > };
> >
> > ?
> >
>
> 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 signature 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 signature, and that this is being handled by the code, so this looks a better solution.
Neil proposed an alternative solution using a bit to indicate calling params in a separate reply - another possibility.
next prev parent reply other threads:[~2018-04-10 12:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-09 12:49 Jasvinder Singh
2018-04-09 12:59 ` Dumitrescu, Cristian
2018-04-09 13:09 ` Bruce Richardson
2018-04-09 14:51 ` Singh, Jasvinder
2018-04-09 15:28 ` Bruce Richardson
2018-04-09 16:41 ` Stephen Hemminger
2018-04-09 15:09 ` Stephen Hemminger
2018-04-09 15:58 ` Dumitrescu, Cristian
2018-04-09 16:38 ` Van Haaren, Harry
2018-04-09 16:43 ` Ferruh Yigit
2018-04-09 17:05 ` Dumitrescu, Cristian
2018-04-09 17:02 ` Dumitrescu, Cristian
2018-04-09 17:09 ` Ananyev, Konstantin
2018-04-09 17:26 ` Dumitrescu, Cristian
2018-04-10 12:32 ` Van Haaren, Harry [this message]
2018-04-10 11:43 ` Neil Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E923DB57A917B54B9182A2E928D00FA65E021314@IRSMSX101.ger.corp.intel.com \
--to=harry.van.haaren@intel.com \
--cc=bruce.richardson@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=jasvinder.singh@intel.com \
--cc=konstantin.ananyev@intel.com \
--cc=nhorman@tuxdriver.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).