[ovs-dev] [PATCH] packets: Prefetch the packet metadata in cacheline1.

Aaron Conole aconole at redhat.com
Mon Nov 20 15:48:27 UTC 2017


Bhanuprakash Bodireddy <bhanuprakash.bodireddy at intel.com> writes:

> pkt_metadata_prefetch_init() is used to prefetch the packet metadata
> before initializing the metadata in pkt_metadata_init(). This is done
> for every packet in userspace datapath and is performance critical.
>
> Commit 99fc16c0 prefetches only cachline0 and cacheline2 as the metadata
> part of respective cachelines will be initialized by pkt_metadata_init().
>
> However in VXLAN case when popping the vxlan header, netdev_vxlan_pop_header()
> invokes pkt_metadata_init_tnl() which zeroes out metadata part of
> cacheline1 that wasn't prefetched earlier and causes performance
> degradation.
>
> By prefetching cacheline1, 9% performance improvement is observed.

Do we see a degredation in the non-vxlan case?  If not, then I don't see
any reason not to apply this patch.

> CC: Ben Pfaff <blp at ovn.org>
> Fixes: 99fc16c0 ("Reorganize the pkt_metadata structure.")
> Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy at intel.com>
> ---


More information about the dev mailing list