DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: Ian Stokes <ian.stokes@intel.com>, <dev@dpdk.org>,
	Robin Jarry <rjarry@redhat.com>
Subject: Re: [PATCH 0/4] fix issues with using AVX-512 drivers on 32-bit
Date: Tue, 1 Oct 2024 08:42:25 +0100	[thread overview]
Message-ID: <Zvun4bpkRgmyagem@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <CAJFAV8xsdktEXuwa65GKbnmV1wAyep6PCjrm+16_W3Y_n-CYUg@mail.gmail.com>

On Tue, Oct 01, 2024 at 09:14:53AM +0200, David Marchand wrote:
> On Mon, Sep 30, 2024 at 5:57 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Mon, Sep 30, 2024 at 05:38:44PM +0200, David Marchand wrote:
> > > On Fri, Sep 6, 2024 at 4:11 PM Bruce Richardson
> > > <bruce.richardson@intel.com> wrote:
> > > >
> > > > The AVX-512 copy code in multiple drivers was incorrect for 32-bit as it
> > > > assumed that each pointer was always 8B in size.
> > > >
> > > > Bruce Richardson (4):
> > > >   net/i40e: fix AVX-512 pointer copy on 32-bit
> > > >   net/ice: fix AVX-512 pointer copy on 32-bit
> > > >   net/iavf: fix AVX-512 pointer copy on 32-bit
> > > >   common/idpf: fix AVX-512 pointer copy on 32-bit
> > > >
> > > >  drivers/common/idpf/idpf_common_rxtx_avx512.c | 7 +++++++
> > > >  drivers/net/i40e/i40e_rxtx_vec_avx512.c       | 7 +++++++
> > > >  drivers/net/iavf/iavf_rxtx_vec_avx512.c       | 7 +++++++
> > > >  drivers/net/ice/ice_rxtx_vec_avx512.c         | 7 +++++++
> > > >  4 files changed, 28 insertions(+)
> > >
> > > Sorry, not directly related to this series, but as I was checking some
> > > AVX512 patch, I suspect some drivers are missing runtime checks for
> > > availability of some AVX512 instructions:
> > >
> > > $ for meson in $(git grep -l __AVX512[^_]*__
> > > 'drivers/**/meson.build'); do dir=$(dirname $meson); for flag in $(git
> > > grep -ho __AVX512[^_]*__ $dir | sort -u); do flag=${flag%%__};
> > > flag=${flag##__}; git grep -ql
> > > rte_cpu_get_flag_enabled.RTE_CPUFLAG_$flag $dir || echo
> > > RTE_CPUFLAG_$flag check missing in $dir; done; done
> > >
> > > RTE_CPUFLAG_AVX512BW check missing in drivers/common/idpf
> > > RTE_CPUFLAG_AVX512DQ check missing in drivers/common/idpf
> > > RTE_CPUFLAG_AVX512F check missing in drivers/common/idpf
> > > RTE_CPUFLAG_AVX512VL check missing in drivers/net/i40e
> > > RTE_CPUFLAG_AVX512VL check missing in drivers/net/ice
> > >
> > > Maybe some flags are implictly available... worth a confirmation from
> > > Intel in any case from my pov.
> > >
> >
> > I think it would be good practice to explicitly check for all the AVX-512
> > extensions actually used. Ideally, as a cleanup, we should probably check
> > for those listed (f, bw, dq and vl) once early in the config and reuse that
> > value throughout the build, rather than having each and every PMD
> > continually check them.
> 
> This simplification on the build side looks good.
> 
> On the other hand, vectorized handlers in libraries and drivers are
> selected based on some AVX512 instructions availability at runtime.
> Don't we need to validate *runtime* availability of each of those
> instructions in each library/driver?
> 
Yes, each lib and driver should be also checking these at runtime.
Simplification of such checks may be possible, and may be something I look
at in future, time permitting. For now, an example of the checks done can
be seen in [1].

/Bruce

[1] https://git.dpdk.org/dpdk/tree/drivers/net/ice/ice_rxtx.c#n3486

      reply	other threads:[~2024-10-01  7:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06 14:11 Bruce Richardson
2024-09-06 14:11 ` [PATCH 1/4] net/i40e: fix AVX-512 pointer copy " Bruce Richardson
2024-09-30 13:27   ` Stokes, Ian
2024-09-06 14:11 ` [PATCH 2/4] net/ice: " Bruce Richardson
2024-09-30 13:29   ` Stokes, Ian
2024-09-06 14:11 ` [PATCH 3/4] net/iavf: " Bruce Richardson
2024-09-06 14:11 ` [PATCH 4/4] common/idpf: " Bruce Richardson
2024-09-30 13:31 ` [PATCH 0/4] fix issues with using AVX-512 drivers " Stokes, Ian
2024-09-30 15:38 ` David Marchand
2024-09-30 15:57   ` Bruce Richardson
2024-09-30 17:52     ` Bruce Richardson
2024-10-01  7:14     ` David Marchand
2024-10-01  7:42       ` Bruce Richardson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zvun4bpkRgmyagem@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ian.stokes@intel.com \
    --cc=rjarry@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).