DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: <dev@dpdk.org>, Jie Hai <haijie1@huawei.com>
Subject: Re: [RFC PATCH] drivers: add generic build of SVE files
Date: Mon, 7 Apr 2025 17:10:04 +0100	[thread overview]
Message-ID: <Z_P43JHA4H4Mm4w0@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <CAJFAV8zKFof8+_mDc7_Nmf=QkTdVDgBVYY2rc+DVZKXDoR8s8A@mail.gmail.com>

On Mon, Apr 07, 2025 at 05:49:34PM +0200, David Marchand wrote:
> On Mon, Apr 7, 2025 at 5:29 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > For SVE, as for AVX2 and AVX-512, support building files for these ISAs
> > from the top-level drivers/meson.build file, rather than having each
> > driver re-implement it.
> >
> > This removes the remaining build task for drivers in DPDK which is
> > being done by a driver itself, rather than in the generic drivers'
> > build rules.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Thanks for working on this additional cleanup.
> 
> 
> > ---
> >  drivers/meson.build          | 27 +++++++++++++++++++++++++++
> >  drivers/net/hns3/meson.build | 22 +---------------------
> >  2 files changed, 28 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/meson.build b/drivers/meson.build
> > index b2d2537dc8..a6f0670a2f 100644
> > --- a/drivers/meson.build
> > +++ b/drivers/meson.build
> > @@ -128,6 +128,7 @@ foreach subpath:subdirs
> >          sources = []
> >          sources_avx2 = []
> >          sources_avx512 = []
> > +        sources_sve = []
> >          headers = []
> >          driver_sdk_headers = [] # public headers included by drivers
> >          objs = []
> > @@ -285,6 +286,32 @@ foreach subpath:subdirs
> >              endif
> >          endif
> >
> > +        if (arch_subdir == 'arm' and sources_sve.length() > 0
> > +                and cc.has_argument('-march=armv8.2-a+sve')
> > +                and cc.check_header('arm_sve.h'))
> > +
> > +            if dpdk_conf.has('RTE_HAS_SVE_ACLE')
> > +                sources += sources_sve
> 
> Do we need this special case?
> 

I put it there because it was in the original code. The handling of the
march/mcpu flags below are also different to what is done on x86, and being
unfamiliar with SVE compilation, I was very conservative in changing
things. Again, hopefully an SVE expert (or hns3 driver expert), can rework
this as necessary.

> 
> > +            else
> > +                cflags += ['-DRTE_HAS_SVE_ACLE=1']
> > +                sve_cflags = ['-march=armv8.2-a+sve']
> > +                foreach flag: cflags
> > +                    if (flag.startswith('-march=')
> > +                            or flag.startswith('-mcpu=')
> > +                            or flag.startswith('-mtune='))
> > +                        continue
> > +                    endif
> > +                    sve_cflags += flag
> > +                endforeach
> > +                sve_lib = static_library(libname + '_sve_lib',
> > +                        sources_sve,
> > +                        dependencies: static_deps,
> > +                        include_directories: includes,
> > +                        c_args: sve_cflags)
> > +                objs += sve_lib.extract_objects(sources_sve)
> > +            endif
> > +        endif
> > +
> >          # generate pmdinfo sources by building a temporary
> >          # lib and then running pmdinfogen on the contents of
> >          # that lib. The final lib reuses the object files and
> 
> On the principle, sources_sve must be passed to gen_version_map like
> other sources_XXX.
> 
Yep, missed that as I neglected to update from main the branch I was working
on. :(

      reply	other threads:[~2025-04-07 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 15:28 Bruce Richardson
2025-04-07 15:35 ` Bruce Richardson
2025-04-07 15:49 ` David Marchand
2025-04-07 16:10   ` 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=Z_P43JHA4H4Mm4w0@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=haijie1@huawei.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).