[ovs-dev] [PATCH v5 6/6] meta-flow: Avoid unnecessary large memset.

Ben Pfaff blp at nicira.com
Wed Aug 26 20:08:40 UTC 2015


On Fri, Aug 21, 2015 at 03:25:23PM -0700, Jarno Rajahalme wrote:
> mf_mask_field_and_prereqs() used to memset a static variable again and
> again.  Now that mf_value is larger (due to tun_metadata field), this
> is more expensive.  Avoid this by using static initialization.
> 
> mf_mask_field_and_prereqs() is used only for set field and reg move,
> which never deal with the tun_metadata field as a whole.
> 
> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>

The critical change here is a few lines buried in refactoring.  I guess
that's OK in this case but it would be even better if these changes were
separated.

Acked-by: Ben Pfaff <blp at nicira.com>



More information about the dev mailing list