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

Jesse Gross jesse at nicira.com
Wed Aug 26 23:57:59 UTC 2015

On Fri, Aug 21, 2015 at 3:25 PM, Jarno Rajahalme <jrajahalme at nicira.com> 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.

I'm not sure that it's really true that this is never called for
tunnel metadata. This wouldn't be called on the whole 256 byte
tun_metadata field but an individual option can be up to 124 bytes, so
still larger than an IPv6 address. The size of mf_value actually
should represent the size of an individual element.

More information about the dev mailing list