DPDK patches and discussions
 help / color / mirror / Atom feed
From: Luca Boccassi <bluca@debian.org>
To: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	dev@dpdk.org, Yongseok Koh <yskoh@mellanox.com>,
	Shahaf Shuler <shahafs@mellanox.com>,
	Matan Azrad <matan@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH v2] net/mlx: add meson build support
Date: Fri, 31 Aug 2018 17:24:51 +0100	[thread overview]
Message-ID: <1535732691.11823.34.camel@debian.org> (raw)
In-Reply-To: <20180829115942.iog3bk4xkmi3newe@laranjeiro-vm.dev.6wind.com>

On Wed, 2018-08-29 at 13:59 +0200, Nélio Laranjeiro wrote:
> On Wed, Aug 29, 2018 at 11:00:54AM +0100, Luca Boccassi wrote:
> > On Tue, 2018-08-28 at 16:45 +0100, Bruce Richardson wrote:
> > > Thanks for this, comments inline below.
> > > 
> > > /Bruce
> > > 
> > > 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.  They can be enabled through:
> > > > - enable_driver_mlx{4,5}=true or
> > > > - enable_driver_mlx{4,5}_glue=true
> > > > depending on the needs.
> > > 
> > > 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.
> > > 
> > > > 
> > > > 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.
> > > > 
> > > > Meson will try to find the required external libraries.  When
> > > > 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):
> > > > 
> > > >  # CLFAGS=-I/tmp/rdma-core/build/include \
> > > >    LDFLAGS=-L/tmp/rdma-core/build/lib \
> > > >    LD_LIBRARY_PATH=/tmp/rdma-core/build/lib \
> > > >    meson -Denable_driver_mlx4=true output
> > > > 
> > > >  # CLFAGS=-I/tmp/rdma-core/build/include \
> > > >    LDFLAGS=-L/tmp/rdma-core/build/lib \
> > > >    LD_LIBRARY_PATH=/tmp/rdma-core/build/lib \
> > > >    ninja -C output install
> > > 
> > > 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! :-
> > > )
> > > 
> > > > 
> > > > Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> > > > 
> > > > ---
> > > > 
> > > > Changes in v2:
> > > > 
> > > > - dropped patch https://patches.dpdk.org/patch/43897/
> > > > - remove extra_{cflags,ldflags} as already honored by meson
> > > > through
> > > > environment variables.
> > > > ---
> > > >  drivers/net/meson.build      |   2 +
> > > >  drivers/net/mlx4/meson.build |  94 ++++++
> > > >  drivers/net/mlx5/meson.build | 545
> > > > +++++++++++++++++++++++++++++++++++
> > > >  meson_options.txt            |   8 +
> > > >  4 files changed, 649 insertions(+)
> > > >  create mode 100644 drivers/net/mlx4/meson.build
> > > >  create mode 100644 drivers/net/mlx5/meson.build
> > > > 
> > > > 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 = ['af_packet',
> > > >  	'ixgbe',
> > > >  	'kni',
> > > >  	'liquidio',
> > > > +	'mlx4',
> > > > +	'mlx5',
> > > >  	'mvpp2',
> > > >  	'netvsc',
> > > >  	'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 = get_option('enable_driver_mlx4_glue')
> > > > +build = get_option('enable_driver_mlx4') or pmd_dlopen
> > > 
> > > 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!
> 
> Thanks Luca, I was also searching for it, you save me some time, I
> hope
> this can be backported down to RDMA-Core's stable version v15 of
> RDMA-Core it would fully help.

This was merged now, so if you want it backported you can ask the
maintainers if it would be fine to do so.

-- 
Kind regards,
Luca Boccassi

  parent reply	other threads:[~2018-08-31 16:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Message-Id: <7812af2267017898332783e934bef9478814ae96.1535361299.git.nelio.laranjeiro@6wind.com>
2018-08-27 12:42 ` Nelio Laranjeiro
2018-08-28 15:45   ` Bruce Richardson
2018-08-29  9:34     ` Nélio Laranjeiro
2018-08-29 10:01       ` Bruce Richardson
2018-08-29 12:44         ` Nélio Laranjeiro
2018-08-29 10:00     ` Luca Boccassi
2018-08-29 11:59       ` Nélio Laranjeiro
2018-08-29 12:28         ` Luca Boccassi
2018-08-31 16:24         ` Luca Boccassi [this message]
2018-08-29 13:48   ` [dpdk-dev] [PATCH v3] " Nelio Laranjeiro
2018-08-30 14:46     ` Bruce Richardson
2018-08-31  7:05       ` Nélio Laranjeiro
2018-08-31  7:16     ` [dpdk-dev] [PATCH v4] " Nelio Laranjeiro
2018-09-05 11:47       ` [dpdk-dev] [PATCH v5] " Shahaf Shuler
2018-09-07 10:34         ` Bruce Richardson
2018-09-13  9:22           ` Bruce Richardson
2018-09-13 10:12             ` Shahaf Shuler
2018-09-13 10:51               ` Bruce Richardson
2018-09-13 12:11         ` [dpdk-dev] [PATCH v6 1/2] net/mlx5: support meson build Shahaf Shuler
2018-09-13 12:41           ` Bruce Richardson
2018-09-16  9:01             ` Shahaf Shuler
2018-09-13 12:11         ` [dpdk-dev] [PATCH v6 2/2] net/mlx4: " Shahaf Shuler
2018-08-27 11:10 [dpdk-dev] [PATCH 1/2] build: add extra cflags ldflags to meson option Nelio Laranjeiro
2018-08-27 11:10 ` [dpdk-dev] [PATCH 2/2] net/mlx: add meson build support Nelio Laranjeiro
2018-08-27 11:24 ` [dpdk-dev] [PATCH 1/2] build: add extra cflags ldflags to meson option Bruce Richardson
2018-08-27 12:20   ` Nélio Laranjeiro

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=1535732691.11823.34.camel@debian.org \
    --to=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=shahafs@mellanox.com \
    --cc=yskoh@mellanox.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).