> -----Original Message-----
> From: ovs-dev-boun...@openvswitch.org [mailto:ovs-dev-
> boun...@openvswitch.org] On Behalf Of Bhanuprakash Bodireddy
> Sent: Friday, January 12, 2018 5:41 PM
> To: d...@openvswitch.org
> Subject: [ovs-dev] [PATCH 2/4] util: Extend ovs_prefetch_range to include
> prefetch type.
> 
> With ovs_prefetch_range(), large amounts of data can be prefetched in to
> caches. Prefetch type gives better control over data caching strategy;
> Meaning where the data should be prefetched(L1/L2/L3) and if the data
> reference is temporal or non-temporal.
> 
> Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodire...@intel.com>
> ---
>  lib/pvector.h | 6 ++++--
>  lib/util.h    | 4 ++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/pvector.h b/lib/pvector.h index b175b21..d5655f0 100644
> --- a/lib/pvector.h
> +++ b/lib/pvector.h
> @@ -177,7 +177,8 @@ pvector_cursor_init(const struct pvector *pvec,
> 
>      impl = ovsrcu_get(struct pvector_impl *, &pvec->impl);
> 
> -    ovs_prefetch_range(impl->vector, impl->size * sizeof impl-
> >vector[0]);
> +    ovs_prefetch_range(impl->vector, impl->size * sizeof impl->vector[0],
> +                       OPCH_HTR);

Overall I think this look ok,

Again my only comment would be if people agree with the classification of 
OPCH_HTR for these calls. Could the hint OPCH_HTR have a different meaning on a 
different platform or is it expected to be the same across platforms?

> 
>      cursor.size = impl->size;
>      cursor.vector = impl->vector;
> @@ -208,7 +209,8 @@ static inline void pvector_cursor_lookahead(const
> struct pvector_cursor *cursor,
>                                              int n, size_t size)  {
>      if (cursor->entry_idx + n < cursor->size) {
> -        ovs_prefetch_range(cursor->vector[cursor->entry_idx + n].ptr,
> size);
> +        ovs_prefetch_range(cursor->vector[cursor->entry_idx + n].ptr,
> size,
> +                           OPCH_HTR);
>      }
>  }
> 
> diff --git a/lib/util.h b/lib/util.h
> index b6639b8..0a8ae23 100644
> --- a/lib/util.h
> +++ b/lib/util.h
> @@ -73,13 +73,13 @@ BUILD_ASSERT_DECL(IS_POW2(CACHE_LINE_SIZE));
>  typedef uint8_t OVS_CACHE_LINE_MARKER[1];
> 
>  static inline void
> -ovs_prefetch_range(const void *start, size_t size)
> +ovs_prefetch_range(const void *start, size_t size, enum
> +ovs_prefetch_type type)
>  {
>      const char *addr = (const char *)start;
>      size_t ofs;
> 
>      for (ofs = 0; ofs < size; ofs += CACHE_LINE_SIZE) {
> -        OVS_PREFETCH(addr + ofs);
> +        OVS_PREFETCH_CACHE(addr + ofs, type);
>      }
>  }
> 
> --
> 2.4.11
> 
> _______________________________________________
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to