On Thu, Jun 22, 2017 at 10:10:49PM +0100, Bhanuprakash Bodireddy wrote:
> pkt_metadata_init() is called for every packet in userspace datapath and
> initializes few members in pkt_metadata. Before this the members that
> needs to be initialized are prefetched using pkt_metadata_prefetch_init().
> 
> The above functions are critical to the userspace datapath performance and
> should be in sync. Any changes to the pkt_metadata should also include
> changes to metadata_init() and prefetch_init() if necessary.
> 
> This commit slightly refactors the pkt_metadata structure and introduces
> cache line markers to catch any violations to the structure. Also only
> prefetch the cachelines having the members that needs to be zeroed out.
> 
> Signed-off-by: Bhanuprakash Bodireddy <[email protected]>

OVS has a PADDED_MEMBERS macro that makes this easier.  Unfortunately it
isn't currently adequate for use more than once per struct.  But it's
fixable, so I sent a patch to fix it:
        https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/335204.html
and a fixed-up version of the original patch:
        https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/335205.html

However, even with the fix, this is going to cause problems with MSVC,
because it does not allow 0-length arrays.  Maybe you can find another
way to mark the beginning of a cache line.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to