[ovs-dev] [v4 11/12] dpif-netdev/mfex: add more AVX512 traffic profiles

Van Haaren, Harry harry.van.haaren at intel.com
Wed Jun 30 17:01:04 UTC 2021

> -----Original Message-----
> From: Amber, Kumar <kumar.amber at intel.com>
> Sent: Wednesday, June 30, 2021 4:10 PM
> To: Eelco Chaudron <echaudro at redhat.com>; Van Haaren, Harry
> <harry.van.haaren at intel.com>
> Cc: dev at openvswitch.org; i.maximets at ovn.org; Flavio Leitner <fbl at sysclose.org>;
> Stokes, Ian <ian.stokes at intel.com>
> Subject: RE: [ovs-dev] [v4 11/12] dpif-netdev/mfex: add more AVX512 traffic profiles
> Hi Eelco,
> Pls find my comments inline.

Snip away all except the "callbacks" topic.

> > NIT: As we might continue to add variants, would a callback in the profile be
> > cleaner? Not sure what arguments to pass? Just a thought…
> Nice thought we have patch for IPv6 coming up we can surely explore the idea 😊

Callbacks can be more difficult for the compiler to inline.
A direct function call is always taken, and compilers know this.

A function pointer requires a little more "compiler knowledge"
to successfully inline the actual function. (GCC can do it, its been
tested before).

I'm not seeing a better solution overall however, as that function pointer
will still need to be set based on each profile... so we still have a switch()
with all profiles inside it.

We could abstract each specific profile away to a profile-specific helper function,
however that would cause an explosion of functions, instead of some code inside
a switch statement.

For now, lets leave as is, no need for churn at this point. If the list really gets
unmanageable, we can review again in future when adding more impls.

Thanks for feedback, -Harry

More information about the dev mailing list