On 2/22/2019 6:42 PM, Ben Pfaff wrote:
> On Sun, Feb 17, 2019 at 09:18:46AM +0000, Eli Britstein wrote:
>> This patch set avoids unnecessary rewrite actions to fields with the
>> same values as matched on.
>>
>> Patch 1 is a pre-step of generating ovs key fields macros
>> Patch 2 avoids the unnecessary rewrites and adapts the tests accordingly
> Thanks for the revision.
>
> Do you foresee other uses of OVS_KEY_FIELD in the future?  As is,
> there's a lot of duplication here from the numerous declarations like
>
>      struct ovs_key_field_properties ovs_key_nd_extensions_properties[] = {
> #define OVS_KEY_FIELD(type, name) {offsetof(struct ovs_key_nd_extensions, 
> name), sizeof(type)},
>          OVS_KEY_ND_EXTENSIONS_FIELDS
>          {0, 0}
> #undef OVS_KEY_FIELD
>      };
>
> If this is the only currently foreseen use, it would be better to have
> the code generator just generate the declarations directly instead of
> forcing these later duplications.

Please note the definitions are not exactly duplicated - each define 
refers to a different struct. Currently I don't know what other uses 
will be needed/done in the future. However, I think we should remain 
with more generic and flexible code, that will allow easier use of those 
macros in the future rather than specific macros.

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to