From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luca Boccassi Subject: Re: [PATCH v2] net/mlx: add meson build support Date: Wed, 29 Aug 2018 11:00:54 +0100 Message-ID: <1535536854.1113.33.camel@debian.org> References: <7812af2267017898332783e934bef9478814ae96.1535361299.git.nelio.laranjeiro@6wind.com> <85a2b398fecdf917dc22810ea0974a91ccca1d13.1535373640.git.nelio.laranjeiro@6wind.com> <20180828154500.GA4208@bricha3-MOBL.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, Yongseok Koh , Shahaf Shuler , Matan Azrad To: Bruce Richardson , Nelio Laranjeiro Return-path: Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 11EDF3772 for ; Wed, 29 Aug 2018 12:00:57 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id v16-v6so4207505wro.11 for ; Wed, 29 Aug 2018 03:00:57 -0700 (PDT) In-Reply-To: <20180828154500.GA4208@bricha3-MOBL.ger.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 2018-08-28 at 16:45 +0100, Bruce Richardson wrote: > Thanks for this, comments inline below. >=20 > /Bruce >=20 > On Mon, Aug 27, 2018 at 02:42:25PM +0200, Nelio Laranjeiro wrote: > > Mellanox drivers remains un-compiled by default due to third party > > libraries dependencies.=C2=A0=C2=A0They can be enabled through: > > - enable_driver_mlx{4,5}=3Dtrue or > > - enable_driver_mlx{4,5}_glue=3Dtrue > > depending on the needs. >=20 > The big reason why we wanted a new build system was to move away from > this > sort of static configuration. Instead, detect if the requirements as > present and build the driver if you can. >=20 > >=20 > > To avoid modifying the whole sources and keep the compatibility > > with > > current build systems (e.g. make), the mlx{4,5}_autoconf.h is still > > generated by invoking DPDK scripts though meson's run_command() > > instead > > of using has_types, has_members, ... commands. > >=20 > > Meson will try to find the required external libraries.=C2=A0=C2=A0When= they > > are > > not installed system wide, they can be provided though CFLAGS, > > LDFLAGS > > and LD_LIBRARY_PATH environment variables, example (considering > > RDMA-Core is installed in /tmp/rdma-core): > >=20 > > =C2=A0# CLFAGS=3D-I/tmp/rdma-core/build/include \ > > =C2=A0=C2=A0=C2=A0LDFLAGS=3D-L/tmp/rdma-core/build/lib \ > > =C2=A0=C2=A0=C2=A0LD_LIBRARY_PATH=3D/tmp/rdma-core/build/lib \ > > =C2=A0=C2=A0=C2=A0meson -Denable_driver_mlx4=3Dtrue output > >=20 > > =C2=A0# CLFAGS=3D-I/tmp/rdma-core/build/include \ > > =C2=A0=C2=A0=C2=A0LDFLAGS=3D-L/tmp/rdma-core/build/lib \ > > =C2=A0=C2=A0=C2=A0LD_LIBRARY_PATH=3D/tmp/rdma-core/build/lib \ > > =C2=A0=C2=A0=C2=A0ninja -C output install >=20 > Once the CFLAGS/LDFLAGS are passed to meson, they should not be > needed for > ninja. The LD_LIBRARY_PATH might be - I'm not sure about that one! :- > ) >=20 > >=20 > > Signed-off-by: Nelio Laranjeiro > >=20 > > --- > >=20 > > Changes in v2: > >=20 > > - dropped patch https://patches.dpdk.org/patch/43897/ > > - remove extra_{cflags,ldflags} as already honored by meson through > > environment variables. > > --- > > =C2=A0drivers/net/meson.build=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0|=C2= =A0=C2=A0=C2=A02 + > > =C2=A0drivers/net/mlx4/meson.build |=C2=A0=C2=A094 ++++++ > > =C2=A0drivers/net/mlx5/meson.build | 545 > > +++++++++++++++++++++++++++++++++++ > > =C2=A0meson_options.txt=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0|=C2=A0=C2=A0=C2=A08 + > > =C2=A04 files changed, 649 insertions(+) > > =C2=A0create mode 100644 drivers/net/mlx4/meson.build > > =C2=A0create mode 100644 drivers/net/mlx5/meson.build > >=20 > > diff --git a/drivers/net/meson.build b/drivers/net/meson.build > > index 9c28ed4da..c7a2d0e7d 100644 > > --- a/drivers/net/meson.build > > +++ b/drivers/net/meson.build > > @@ -18,6 +18,8 @@ drivers =3D ['af_packet', > > =C2=A0 'ixgbe', > > =C2=A0 'kni', > > =C2=A0 'liquidio', > > + 'mlx4', > > + 'mlx5', > > =C2=A0 'mvpp2', > > =C2=A0 'netvsc', > > =C2=A0 'nfp', > > diff --git a/drivers/net/mlx4/meson.build > > b/drivers/net/mlx4/meson.build > > new file mode 100644 > > index 000000000..debaca5b6 > > --- /dev/null > > +++ b/drivers/net/mlx4/meson.build > > @@ -0,0 +1,94 @@ > > +# SPDX-License-Identifier: BSD-3-Clause > > +# Copyright 2018 6WIND S.A. > > +# Copyright 2018 Mellanox Technologies, Ltd > > + > > +# As there is no more configuration file to activate/configure the > > PMD it will > > +# use some variables here to configure it. > > +pmd_dlopen =3D get_option('enable_driver_mlx4_glue') > > +build =3D get_option('enable_driver_mlx4') or pmd_dlopen >=20 > As stated above, I believe this should be based upon whether you find > the > "mnl", "mlx4" and "ibverbs" libraries. If we start adding back in > static > options for every driver, then we'll be back to having a mass of > config > options like we had before. BTW, slightly related to that: ibverbs doesn't ship pkg-config files at the moment which makes the detection slightly more awkward that it could be, so I've sent a PR upstream to add that: https://github.com/linux-rdma/rdma-core/pull/373 Hope this can be useful! --=20 Kind regards, Luca Boccassi