build: enable packet data prefetch
Checks
Commit Message
Data prefetch instruction can preload data into cpu’s hierarchical
cache before data access. Virtualized data paths like virtio utilized
this feature for acceleration. Since most modern cpus have support
prefetch function, we can enable packet data prefetch as default.
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Comments
On Tue, 22 Sep 2020 16:21:35 +0800
Marvin Liu <yong.liu@intel.com> wrote:
> Data prefetch instruction can preload data into cpu’s hierarchical
> cache before data access. Virtualized data paths like virtio utilized
> this feature for acceleration. Since most modern cpus have support
> prefetch function, we can enable packet data prefetch as default.
>
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
>
> diff --git a/config/meson.build b/config/meson.build
> index 69f2aeb605..a0c828a437 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -109,6 +109,9 @@ if not is_windows
> add_project_link_arguments('-Wl,--no-as-needed', language: 'c')
> endif
>
> +# do prefetch of packet data
> +dpdk_conf.set('RTE_PMD_PACKET_PREFETCH', 1)
> +
> # use pthreads if available for the platform
> if not is_windows
> add_project_link_arguments('-pthread', language: 'c')
With meson, the project has been using rte_config.h for this.
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Tuesday, September 22, 2020 10:12 PM
> To: Liu, Yong <yong.liu@intel.com>
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] build: enable packet data prefetch
>
> On Tue, 22 Sep 2020 16:21:35 +0800
> Marvin Liu <yong.liu@intel.com> wrote:
>
> > Data prefetch instruction can preload data into cpu’s hierarchical
> > cache before data access. Virtualized data paths like virtio utilized
> > this feature for acceleration. Since most modern cpus have support
> > prefetch function, we can enable packet data prefetch as default.
> >
> > Signed-off-by: Marvin Liu <yong.liu@intel.com>
> >
>
> With meson, the project has been using rte_config.h for this.
Thanks a lot, will send v2 for the change.
Regards,
Marvin
@@ -109,6 +109,9 @@ if not is_windows
add_project_link_arguments('-Wl,--no-as-needed', language: 'c')
endif
+# do prefetch of packet data
+dpdk_conf.set('RTE_PMD_PACKET_PREFETCH', 1)
+
# use pthreads if available for the platform
if not is_windows
add_project_link_arguments('-pthread', language: 'c')