[ovs-dev] [PATCH] ofproto: Inline trivial functions.

Ben Pfaff blp at nicira.com
Thu Apr 24 16:18:47 UTC 2014


On Thu, Apr 24, 2014 at 09:09:03AM -0700, Jarno Rajahalme wrote:
> rule_dpif_is_internal is among the top ten OVS internal functions in
> recent perf reports.  Inline it and some other equally trivial
> functions.
> 
> This change removes rule_is_internal(), since the fact that a table is
> an internal one is defined within ofproto-dpif, not ofproto.
> 
> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>

I'd prefer to have this assumption that struct rule_dpif begins with
struct rule in just one place, if we can.  In fact, it looks like you
had the same idea, but didn't follow through:

    /* rule_cast() depends on this. */
    BUILD_ASSERT_DECL(offsetof(struct rule_dpif, up) == 0);

Otherwise I'm happy with this, thanks!



More information about the dev mailing list