[ovs-dev] [PATCH] ofproto: Inline trivial functions.
Jarno Rajahalme
jrajahalme at nicira.com
Tue Apr 29 22:53:38 UTC 2014
Pushed, thanks for the review!
Jarno
On Apr 29, 2014, at 3:11 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Tue, Apr 29, 2014 at 03:01:47PM -0700, Jarno Rajahalme wrote:
>>
>> On Apr 29, 2014, at 2:55 PM, Jarno Rajahalme <jrajahalme at nicira.com> wrote:
>>
>>>
>>> On Apr 24, 2014, at 9:18 AM, Ben Pfaff <blp at nicira.com> wrote:
>>>
>>>> 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);
>>>>
>>>
>>> You are right, I went back and forth with this. I?ll check this a rule_cast__() inline used for all the casting.
>>>
>>
>> I changed my mind a bit. I?d like to use a macro (RULE_CAST(RULE)) instead, so that I can undef it right after the inlines. This way the rest of the code can?t start depending on the offset of struct rule within the struct rule_dpif by accident.
>>
>> Jarno
>
> That will also minimize the dependency, so it's fine with me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140429/1f8ca999/attachment-0005.html>
More information about the dev
mailing list