Skip to contentSkip to conversation

build: add drivers_install_subdir meson option

PATCH In review Luca Boccassi 5 participants 28 messages Sep 28, 2018 – Oct 27, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: add drivers_install_subdir meson option

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---
 meson.build       | 3 ++-
 meson_options.txt | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
meson.build +2 -1
index c9af33532d..123e3e81d6 100644
@@ -15,7 +15,8 @@ dpdk_libraries = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
 
-driver_install_path = join_paths(get_option('libdir'), 'dpdk/drivers')
+driver_install_path = join_paths(get_option('libdir'),
+	get_option('drivers_install_subdir'))
 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 
 # configure the build, and make sure configs here and in config folder are
meson_options.txt +2 -0
index cb58b1b607..0834ae364e 100644
@@ -1,5 +1,7 @@
 option('allow_invalid_socket_id', type: 'boolean', value: false,
 	description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly')
+option('drivers_install_subdir', type: 'string', value: 'dpdk/drivers',
+	description: 'subdirectory of libdir where to install PMDs')
 option('enable_driver_mlx_glue', type: 'boolean', value: false,
 	description: 'Enable glue library for Mellanox ConnectX-3/4/5 NIC PMD')
 option('enable_kmods', type: 'boolean', value: true,
Signature · 1 line
2.19.0
#1 lore raw
Quoted 5 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---

I'm ok with this change, but what is the current location used by distro's right now? I mistakenly never checked what was done before I used dpdk/drivers as a default value, and I'd like the default to match the common option if possible.

/Bruce

#2 lore raw
Quoted 7 lines · Bruce Richardson
Quoted 5 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---

Quoted 7 lines

I'm ok with this change, but what is the current location used by distro's right now? I mistakenly never checked what was done before I used dpdk/drivers as a default value, and I'd like the default to match the common option if possible.

/Bruce

Replying to my own question, I've just checked on CentOS and Debian, and it appears both are using directory "dpdk-pmds" as the subdir name. Therefore, let's just make that the default. [Does it need to be configurable in that case?]

/Bruce

#3 lore raw
Quoted 26 lines · Bruce Richardson
Quoted 7 lines · Bruce Richardson
Quoted 5 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---

Quoted 9 lines

I'm ok with this change, but what is the current location used by distro's
right now? I mistakenly never checked what was done before I used dpdk/drivers as a default value, and I'd like the default to match the
common option if possible.

/Bruce

Replying to my own question, I've just checked on CentOS and Debian, and it
appears both are using directory "dpdk-pmds" as the subdir name. Therefore,
let's just make that the default. [Does it need to be configurable in that
case?]

Quoted 1 line

/Bruce

If the default is the one I expect then I'm fine without having an option (actually happier - less things to configure).

But in Debian/Ubuntu it's dpdk-MAJORVER-drivers since last January :-) We changed because using a single directory creates problems when multiple different ABI versions are installed, due to the EAL autoload from that directory. So we need a different subdirectory per ABI revision.

We were actually talking with Timothy a while ago to make this consistent across our distros, and perhaps Marco can chip in as well.

Timothy, Marco, is using dpdk-MAJORVER-$something ok for you? I'm not too fussy on $something, it can be drivers or pmds or something else.

Signature · 2 lines
Kind regards,
Luca Boccassi
#4 lore raw
Quoted 38 lines · Luca Boccassi
Quoted 26 lines · Bruce Richardson
Quoted 7 lines · Bruce Richardson
Quoted 5 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---

Quoted 9 lines

I'm ok with this change, but what is the current location used by distro's
right now? I mistakenly never checked what was done before I used dpdk/drivers as a default value, and I'd like the default to match the
common option if possible.

/Bruce

Replying to my own question, I've just checked on CentOS and Debian, and it
appears both are using directory "dpdk-pmds" as the subdir name. Therefore,
let's just make that the default. [Does it need to be configurable in that
case?]

Quoted 1 line

/Bruce

If the default is the one I expect then I'm fine without having an option (actually happier - less things to configure).

But in Debian/Ubuntu it's dpdk-MAJORVER-drivers since last January :-) We changed because using a single directory creates problems when multiple different ABI versions are installed, due to the EAL autoload from that directory. So we need a different subdirectory per ABI revision.

Quoted 6 lines

We were actually talking with Timothy a while ago to make this consistent across our distros, and perhaps Marco can chip in as well.

Timothy, Marco, is using dpdk-MAJORVER-$something ok for you? I'm not too fussy on $something, it can be drivers or pmds or something else.

Sounds like it needs to be configurable, just in case.

#5 lore raw
In reply to Luca Boccassi
Quoted 38 lines · On Mon, 01 Oct 2018 10:46:02 +0100 Luca Boccassi <[email protected]> wrote:
Quoted 26 lines · Bruce Richardson
Quoted 7 lines · Bruce Richardson
Quoted 5 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---

Quoted 9 lines

I'm ok with this change, but what is the current location used by distro's
right now? I mistakenly never checked what was done before I used dpdk/drivers as a default value, and I'd like the default to match the
common option if possible.

/Bruce

Replying to my own question, I've just checked on CentOS and Debian, and it
appears both are using directory "dpdk-pmds" as the subdir name. Therefore,
let's just make that the default. [Does it need to be configurable in that
case?]

Quoted 1 line

/Bruce

If the default is the one I expect then I'm fine without having an option (actually happier - less things to configure).

But in Debian/Ubuntu it's dpdk-MAJORVER-drivers since last January :-) We changed because using a single directory creates problems when multiple different ABI versions are installed, due to the EAL autoload from that directory. So we need a different subdirectory per ABI revision.

Quoted 6 lines

We were actually talking with Timothy a while ago to make this consistent across our distros, and perhaps Marco can chip in as well.

Timothy, Marco, is using dpdk-MAJORVER-$something ok for you? I'm not too fussy on $something, it can be drivers or pmds or something else.

LGTM.
If needed, we can just do a compatibility symlink using the current dpdk-pmds path

#6 lore raw
Quoted 44 lines · Timothy Redaelli
Quoted 41 lines · On Mon, 01 Oct 2018 10:46:02 +0100 Luca Boccassi <[email protected]> wrote:
Quoted 26 lines · Bruce Richardson
Quoted 7 lines · Bruce Richardson
Quoted 5 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---

Quoted 9 lines

I'm ok with this change, but what is the current location used by distro's
right now? I mistakenly never checked what was done before I used dpdk/drivers as a default value, and I'd like the default to match the
common option if possible.

/Bruce

Replying to my own question, I've just checked on CentOS and Debian, and it
appears both are using directory "dpdk-pmds" as the subdir name. Therefore,
let's just make that the default. [Does it need to be configurable in that
case?]

Quoted 1 line

/Bruce

If the default is the one I expect then I'm fine without having an option (actually happier - less things to configure).

But in Debian/Ubuntu it's dpdk-MAJORVER-drivers since last January :-) We changed because using a single directory creates problems when multiple different ABI versions are installed, due to the EAL autoload from that directory. So we need a different subdirectory per ABI revision.

We were actually talking with Timothy a while ago to make this consistent across our distros, and perhaps Marco can chip in as well.

Quoted 8 lines
Quoted 3 lines

Timothy, Marco, is using dpdk-MAJORVER-$something ok for you? I'm not too fussy on $something, it can be drivers or pmds or something else.

LGTM.
If needed, we can just do a compatibility symlink using the current dpdk-pmds path

One suggestion/comment. Would using a unique directory per release not lead to clobbering up the lib directory unnecessarily? How about having a single "dpdk" or "dpdk-pmds" directory in lib, and having $MAJORVER as a subdir under that?

E.g. dpdk/pmds-18.08/, dpdk/pmds-18.11/, or dpdk-pmds/18.08/ dpdk-pmds/18.11

[The former of the above would be my preference, since I don't like having hypenated names, and like having "dpdk" alone as a folder name :-)]

/Bruce

#7 lore raw
Quoted 77 lines · Bruce Richardson
Quoted 63 lines · Timothy Redaelli
Quoted 50 lines · On Mon, 01 Oct 2018 10:46:02 +0100 Luca Boccassi <[email protected]> wrote:
Quoted 35 lines · Bruce Richardson
Quoted 19 lines · Bruce Richardson
Quoted 6 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers
subdirectory where the PMDs get installed under $lib.

---

I'm ok with this change, but what is the current location used by
distro's
right now? I mistakenly never checked what was done before I used
dpdk/drivers as a default value, and I'd like the default to match
the
common option if possible.

Quoted 2 lines

/Bruce

Replying to my own question, I've just checked on CentOS and Debian,
and it
appears both are using directory "dpdk-pmds" as the subdir name.
Therefore,
let's just make that the default. [Does it need to be configurable in
that
case?]

Quoted 1 line

/Bruce

If the default is the one I expect then I'm fine without having an
option (actually happier - less things to configure).

But in Debian/Ubuntu it's dpdk-MAJORVER-drivers since last January :-)
We changed because using a single directory creates problems when multiple different ABI versions are installed, due to the EAL autoload
from that directory. So we need a different subdirectory per ABI revision.

Quoted 9 lines

We were actually talking with Timothy a while ago to make this consistent across our distros, and perhaps Marco can chip in as well.

Timothy, Marco, is using dpdk-MAJORVER-$something ok for you? I'm not
too fussy on $something, it can be drivers or pmds or something else.

Quoted 4 lines

LGTM.
If needed, we can just do a compatibility symlink using the current dpdk-pmds path

One suggestion/comment. Would using a unique directory per release not lead
to clobbering up the lib directory unnecessarily? How about having a single
"dpdk" or "dpdk-pmds" directory in lib, and having $MAJORVER as a subdir
under that?

Quoted 8 lines

E.g. dpdk/pmds-18.08/, dpdk/pmds-18.11/, or dpdk-pmds/18.08/ dpdk-pmds/18.11

[The former of the above would be my preference, since I don't like having
hypenated names, and like having "dpdk" alone as a folder name :-)]

/Bruce

dpdk/pmds-XX.YY/ would work for me. Timothy and Marco?

Signature · 2 lines
Kind regards,
Luca Boccassi
#8 lore raw
Quoted 81 lines · Luca Boccassi
Quoted 80 lines · Bruce Richardson
Quoted 63 lines · Timothy Redaelli
Quoted 50 lines · On Mon, 01 Oct 2018 10:46:02 +0100 Luca Boccassi <[email protected]> wrote:
Quoted 35 lines · Bruce Richardson
Quoted 19 lines · Bruce Richardson
Quoted 6 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers
subdirectory where the PMDs get installed under $lib.

---

I'm ok with this change, but what is the current location used by
distro's
right now? I mistakenly never checked what was done before I used
dpdk/drivers as a default value, and I'd like the default to match
the
common option if possible.

Quoted 2 lines

/Bruce

Replying to my own question, I've just checked on CentOS and Debian,
and it
appears both are using directory "dpdk-pmds" as the subdir name.
Therefore,
let's just make that the default. [Does it need to be configurable in
that
case?]

Quoted 1 line

/Bruce

If the default is the one I expect then I'm fine without having an
option (actually happier - less things to configure).

But in Debian/Ubuntu it's dpdk-MAJORVER-drivers since last January :-)
We changed because using a single directory creates problems when multiple different ABI versions are installed, due to the EAL autoload
from that directory. So we need a different subdirectory per ABI revision.

Quoted 9 lines

We were actually talking with Timothy a while ago to make this consistent across our distros, and perhaps Marco can chip in as well.

Timothy, Marco, is using dpdk-MAJORVER-$something ok for you? I'm not
too fussy on $something, it can be drivers or pmds or something else.

Quoted 4 lines

LGTM.
If needed, we can just do a compatibility symlink using the current dpdk-pmds path

One suggestion/comment. Would using a unique directory per release not lead
to clobbering up the lib directory unnecessarily? How about having a single
"dpdk" or "dpdk-pmds" directory in lib, and having $MAJORVER as a subdir
under that?

E.g. dpdk/pmds-18.08/, dpdk/pmds-18.11/, or dpdk-pmds/18.08/ dpdk-pmds/18.11

Quoted 7 lines
Quoted 5 lines

[The former of the above would be my preference, since I don't like having
hypenated names, and like having "dpdk" alone as a folder name :-)]

/Bruce

dpdk/pmds-XX.YY/ would work for me. Timothy and Marco?

That would work for us.
However, I would suggest to have the path to be configurable (feature to be dropped in maybe next release). Just to make sure the transition can happen without pain in the remote circumstance that something goes wrong with packaging...

Quoted 1 line
Signature · 4 lines
Marco V

SUSE LINUX GmbH | GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg) Maxfeldstr. 5, D-90409, Nürnberg
#9 lore raw
Quoted 88 lines · Marco Varlese
Quoted 87 lines · Luca Boccassi
Quoted 85 lines · Bruce Richardson
Quoted 63 lines · Timothy Redaelli
Quoted 50 lines · On Mon, 01 Oct 2018 10:46:02 +0100 Luca Boccassi <[email protected]> wrote:
Quoted 35 lines · Bruce Richardson
Quoted 19 lines · Bruce Richardson
Quoted 6 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers
subdirectory where the PMDs get installed under $lib.

---

I'm ok with this change, but what is the current location used by
distro's
right now? I mistakenly never checked what was done before I used
dpdk/drivers as a default value, and I'd like the default to match
the
common option if possible.

Quoted 2 lines

/Bruce

Replying to my own question, I've just checked on CentOS and Debian,
and it
appears both are using directory "dpdk-pmds" as the subdir name.
Therefore,
let's just make that the default. [Does it need to be configurable in
that
case?]

Quoted 1 line

/Bruce

If the default is the one I expect then I'm fine without having an
option (actually happier - less things to configure).

But in Debian/Ubuntu it's dpdk-MAJORVER-drivers since last January :-)
We changed because using a single directory creates problems when multiple different ABI versions are installed, due to the EAL autoload
from that directory. So we need a different subdirectory per ABI revision.

Quoted 9 lines

We were actually talking with Timothy a while ago to make this consistent across our distros, and perhaps Marco can chip in as well.

Timothy, Marco, is using dpdk-MAJORVER-$something ok for you? I'm not
too fussy on $something, it can be drivers or pmds or something else.

Quoted 4 lines

LGTM.
If needed, we can just do a compatibility symlink using the current dpdk-pmds path

One suggestion/comment. Would using a unique directory per release not lead
to clobbering up the lib directory unnecessarily? How about having a single
"dpdk" or "dpdk-pmds" directory in lib, and having $MAJORVER as a subdir
under that?

E.g. dpdk/pmds-18.08/, dpdk/pmds-18.11/, or dpdk-pmds/18.08/ dpdk-pmds/18.11

[The former of the above would be my preference, since I don't like having
hypenated names, and like having "dpdk" alone as a folder name :-)]

/Bruce

Quoted 10 lines
Quoted 1 line

dpdk/pmds-XX.YY/ would work for me. Timothy and Marco?

That would work for us.
However, I would suggest to have the path to be configurable (feature to be dropped in maybe next release). Just to make sure the transition can happen without pain in the remote circumstance that something goes wrong with packaging...

Quoted 1 line
Signature · 1 line
Marco V

Yes, I think it needs to be configurable for the forseeable future. If the DPDK version is to be put in the path then we either need to always use a configurable version, since we can't hardcode a version number in the default, or else we need to put logic in the meson.build file to always insert a version number.

/Bruce

#10 lore raw
Quoted 135 lines · Bruce Richardson
Quoted 121 lines · Marco Varlese
Quoted 106 lines · Luca Boccassi
Quoted 105 lines · Bruce Richardson
Quoted 77 lines · Timothy Redaelli
Quoted 66 lines · On Mon, 01 Oct 2018 10:46:02 +0100 Luca Boccassi <[email protected]> wrote:
Quoted 41 lines · Bruce Richardson
Quoted 22 lines · Bruce Richardson
Quoted 6 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers
subdirectory where the PMDs get installed under $lib.

---

I'm ok with this change, but what is the current location
used by
distro's
right now? I mistakenly never checked what was done before I
used
dpdk/drivers as a default value, and I'd like the default to
match
the
common option if possible.

Quoted 2 lines

/Bruce

Replying to my own question, I've just checked on CentOS and
Debian,
and it
appears both are using directory "dpdk-pmds" as the subdir
name.
Therefore,
let's just make that the default. [Does it need to be configurable in
that
case?]

Quoted 1 line

/Bruce

If the default is the one I expect then I'm fine without having
an
option (actually happier - less things to configure).

But in Debian/Ubuntu it's dpdk-MAJORVER-drivers since last January :-)
We changed because using a single directory creates problems when
multiple different ABI versions are installed, due to the EAL
autoload
from that directory. So we need a different subdirectory per ABI
revision.

We were actually talking with Timothy a while ago to make this
consistent across our distros, and perhaps Marco can chip in as
well.

Quoted 7 lines

Timothy, Marco, is using dpdk-MAJORVER-$something ok for you? I'm
not
too fussy on $something, it can be drivers or pmds or something
else.

Quoted 5 lines

LGTM.
If needed, we can just do a compatibility symlink using the current
dpdk-pmds path

One suggestion/comment. Would using a unique directory per release
not lead
to clobbering up the lib directory unnecessarily? How about having a
single
"dpdk" or "dpdk-pmds" directory in lib, and having $MAJORVER as a
subdir
under that?

E.g. dpdk/pmds-18.08/, dpdk/pmds-18.11/, or dpdk-pmds/18.08/ dpdk-pmds/18.11

[The former of the above would be my preference, since I don't like
having
hypenated names, and like having "dpdk" alone as a folder name :-)]

Quoted 3 lines
Quoted 1 line

/Bruce

dpdk/pmds-XX.YY/ would work for me. Timothy and Marco?

That would work for us.
However, I would suggest to have the path to be configurable (feature to be
dropped in maybe next release). Just to make sure the transition can happen
without pain in the remote circumstance that something goes wrong with
packaging...

Quoted 1 line
Quoted 3 lines

--
Marco V

Yes, I think it needs to be configurable for the forseeable future. If the
DPDK version is to be put in the path then we either need to always use a
configurable version, since we can't hardcode a version number in the default, or else we need to put logic in the meson.build file to always
insert a version number.

Quoted 1 line

/Bruce

Ok, in v2 I added a small bit of logic to set the default to the major version number (and also the override option).

Signature · 2 lines
Kind regards,
Luca Boccassi
#11 lore raw

PATCH v2 1/2 build: change default PMD installation subdir to dpdk/pmds-XX.YY

In reply to Luca Boccassi

As part of the effort of consolidating the DPDK installation bits and pieces across distros, set the default directory of lib/ where PMDs get installed to dpdk/pmds-XX.YY. It's necessary to have a versioned subdirectory as multiple ABI revisions might be installed at the same time, so having a fixed name will cause trouble with the autoload feature.
Small refactor with parsing and saving the major version to a variable, since it's now used in 3 different places.

---
 drivers/meson.build | 6 ++----
 lib/meson.build     | 6 ++----
 meson.build         | 8 +++++++-
 3 files changed, 11 insertions(+), 9 deletions(-)
drivers/meson.build +2 -4
index 47b4215a30..3a6c4bf656 100644
@@ -98,10 +98,8 @@ foreach class:driver_classes
 				lib_version = '@[email protected]'.format(version)
 				so_version = '@0@'.format(version)
 			else
-				pver = meson.project_version().split('.')
-				lib_version = '@0@.@1@'.format(pver.get(0),
-						pver.get(1))
-				so_version = lib_version
+				lib_version = major_version
+				so_version = major_version
 			endif
 
 			# now build the static driver
lib/meson.build +2 -4
index 3acc67e6ed..bed492a4ec 100644
@@ -88,10 +88,8 @@ foreach l:libraries
 				lib_version = '@[email protected]'.format(version)
 				so_version = '@0@'.format(version)
 			else
-				prj_ver = meson.project_version().split('.')
-				lib_version = '@0@.@1@'.format(
-						prj_ver.get(0), prj_ver.get(1))
-				so_version = lib_version
+				lib_version = major_version
+				so_version = major_version
 			endif
 
 			# first build static lib
meson.build +7 -1
index c9af33532d..4bd04b9de3 100644
@@ -15,7 +15,13 @@ dpdk_libraries = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
 
-driver_install_path = join_paths(get_option('libdir'), 'dpdk/drivers')
+# set the major version, which might be used by drivers and libraries
+# depending on the configuration options
+pver = meson.project_version().split('.')
+major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
+
+driver_install_path = join_paths(get_option('libdir'), 'dpdk',
+	'pmds-' + major_version)
 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 
 # configure the build, and make sure configs here and in config folder are
Signature · 1 line
2.19.0
#12 lore raw

PATCH v2 2/2 build: add drivers_install_subdir meson option

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---
 meson.build       | 10 ++++++++--
 meson_options.txt |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)
meson.build +8 -2
index 4bd04b9de3..9f7f17f7fe 100644
@@ -20,8 +20,14 @@ dpdk_extra_ldflags = []
 pver = meson.project_version().split('.')
 major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
 
-driver_install_path = join_paths(get_option('libdir'), 'dpdk',
-	'pmds-' + major_version)
+pmd_subdir_opt = get_option('drivers_install_subdir')
+if pmd_subdir_opt == 'dpdk/pmds-XX.YY'
+	driver_install_path = join_paths(get_option('libdir'),
+		'dpdk', 'pmds-' + major_version)
+else
+	driver_install_path = join_paths(get_option('libdir'),
+		pmd_subdir_opt)
+endif
 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 
 # configure the build, and make sure configs here and in config folder are
meson_options.txt +2 -0
index d14bde892d..d0f5675eb7 100644
@@ -1,5 +1,7 @@
 option('allow_invalid_socket_id', type: 'boolean', value: false,
 	description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly')
+option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-XX.YY',
+	description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_driver_mlx_glue', type: 'boolean', value: false,
 	description: 'Enable glue library for Mellanox PMDs')
 option('enable_kmods', type: 'boolean', value: true,
Signature · 1 line
2.19.0
#13 lore raw
Quoted 17 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---
 meson.build       | 10 ++++++++--
 meson_options.txt |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)
meson.build +0 -0
index 4bd04b9de3..9f7f17f7fe 100644
@@ -20,8 +20,14 @@ dpdk_extra_ldflags = []
 pver = meson.project_version().split('.')
 major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
 

meson.build dpdk_extra_ldflags = [] · line 30

Quoted 10 lines
meson.build +8 -2
-driver_install_path = join_paths(get_option('libdir'), 'dpdk',
-	'pmds-' + major_version)
+pmd_subdir_opt = get_option('drivers_install_subdir')
+if pmd_subdir_opt == 'dpdk/pmds-XX.YY'
+	driver_install_path = join_paths(get_option('libdir'),
+		'dpdk', 'pmds-' + major_version)
+else
+	driver_install_path = join_paths(get_option('libdir'),
+		pmd_subdir_opt)
+endif

Not sure I like this degree of hard-coding of paths. While meson doesn't have a string replace function, we can still use "sed" via run_command to perform some substitution, or else get a little creative using split if it can be made work. That would allow us to put in e.g "<VERSION>" as a generic placeholder in the text.

/Bruce

#14 lore raw
Quoted 38 lines · Bruce Richardson
Quoted 17 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---
 meson.build       | 10 ++++++++--
 meson_options.txt |  2 ++

 2 files changed, 10 insertions(+), 2 deletions(-)
meson.build +0 -0
index 4bd04b9de3..9f7f17f7fe 100644
@@ -20,8 +20,14 @@ dpdk_extra_ldflags = []
  pver = meson.project_version().split('.')
  major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))

meson.build dpdk_extra_ldflags = [] · line 30

Quoted 10 lines
meson.build +8 -2
-driver_install_path = join_paths(get_option('libdir'), 'dpdk',
-	'pmds-' + major_version)
+pmd_subdir_opt = get_option('drivers_install_subdir')
+if pmd_subdir_opt == 'dpdk/pmds-XX.YY'
+	driver_install_path = join_paths(get_option('libdir'),
+		'dpdk', 'pmds-' + major_version)
+else
+	driver_install_path = join_paths(get_option('libdir'),
+		pmd_subdir_opt)
+endif

Not sure I like this degree of hard-coding of paths. While meson doesn't
have a string replace function, we can still use "sed" via run_command to
perform some substitution, or else get a little creative using split if it
can be made work. That would allow us to put in e.g "<VERSION>" as a generic placeholder in the text.

Quoted 1 line

/Bruce

Do you mean for the "if pmd_subdir_opt == 'dpdk/pmds-XX.YY'" bit? I can change that to "== 'dpdk/pmds-<VERSION>'" if you prefer?

Signature · 2 lines
Kind regards,
Luca Boccassi
#15 lore raw
Quoted 39 lines · Luca Boccassi
Quoted 38 lines · Bruce Richardson
Quoted 17 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---
 meson.build       | 10 ++++++++--
 meson_options.txt |  2 ++

 2 files changed, 10 insertions(+), 2 deletions(-)
meson.build +0 -0
index 4bd04b9de3..9f7f17f7fe 100644
@@ -20,8 +20,14 @@ dpdk_extra_ldflags = []
  pver = meson.project_version().split('.')
  major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))

meson.build dpdk_extra_ldflags = [] · line 30

Quoted 10 lines
meson.build +8 -2
-driver_install_path = join_paths(get_option('libdir'), 'dpdk',
-	'pmds-' + major_version)
+pmd_subdir_opt = get_option('drivers_install_subdir')
+if pmd_subdir_opt == 'dpdk/pmds-XX.YY'
+	driver_install_path = join_paths(get_option('libdir'),
+		'dpdk', 'pmds-' + major_version)
+else
+	driver_install_path = join_paths(get_option('libdir'),
+		pmd_subdir_opt)
+endif

Not sure I like this degree of hard-coding of paths. While meson doesn't
have a string replace function, we can still use "sed" via run_command to
perform some substitution, or else get a little creative using split if it
can be made work. That would allow us to put in e.g "<VERSION>" as a generic placeholder in the text.

Quoted 5 lines
Quoted 1 line

/Bruce

Do you mean for the "if pmd_subdir_opt == 'dpdk/pmds-XX.YY'" bit? I can change that to "== 'dpdk/pmds-<VERSION>'" if you prefer?

Yes, though I was more thinking of:

	 "if pmd_subdir_opt.contains('<VERSION>')" ...

rather than matching on the whole string.

/Bruce

#16 lore raw
Quoted 49 lines · Bruce Richardson
Quoted 41 lines · Luca Boccassi
Quoted 40 lines · Bruce Richardson
Quoted 17 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---
 meson.build       | 10 ++++++++--
 meson_options.txt |  2 ++

 2 files changed, 10 insertions(+), 2 deletions(-)
meson.build +0 -0
index 4bd04b9de3..9f7f17f7fe 100644
@@ -20,8 +20,14 @@ dpdk_extra_ldflags = []
  pver = meson.project_version().split('.')
  major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))

meson.build dpdk_extra_ldflags = [] · line 30

Quoted 10 lines
meson.build +8 -2
-driver_install_path = join_paths(get_option('libdir'), 'dpdk',
-	'pmds-' + major_version)
+pmd_subdir_opt = get_option('drivers_install_subdir')
+if pmd_subdir_opt == 'dpdk/pmds-XX.YY'
+	driver_install_path = join_paths(get_option('libdir'),
+		'dpdk', 'pmds-' + major_version)
+else
+	driver_install_path = join_paths(get_option('libdir'),
+		pmd_subdir_opt)
+endif

Not sure I like this degree of hard-coding of paths. While meson doesn't
have a string replace function, we can still use "sed" via run_command to
perform some substitution, or else get a little creative using split
if it
can be made work. That would allow us to put in e.g "<VERSION>" as a
generic placeholder in the text.

Quoted 6 lines
Quoted 1 line

/Bruce

Do you mean for the "if pmd_subdir_opt == 'dpdk/pmds-XX.YY'" bit? I can
change that to "== 'dpdk/pmds-<VERSION>'" if you prefer?

Quoted 5 lines

Yes, though I was more thinking of:

	 "if pmd_subdir_opt.contains('<VERSION>')" ...

rather than matching on the whole string.

/Bruce

Ok, fixed in v3

Signature · 2 lines
Kind regards,
Luca Boccassi
#17 lore raw

PATCH v3 1/2 build: change default PMD installation subdir to dpdk/pmds-XX.YY

In reply to Luca Boccassi

As part of the effort of consolidating the DPDK installation bits and pieces across distros, set the default directory of lib/ where PMDs get installed to dpdk/pmds-XX.YY. It's necessary to have a versioned subdirectory as multiple ABI revisions might be installed at the same time, so having a fixed name will cause trouble with the autoload feature.
Small refactor with parsing and saving the major version to a variable, since it's now used in 3 different places.

---
 drivers/meson.build | 6 ++----
 lib/meson.build     | 6 ++----
 meson.build         | 8 +++++++-
 3 files changed, 11 insertions(+), 9 deletions(-)
drivers/meson.build +2 -4
index 47b4215a30..3a6c4bf656 100644
@@ -98,10 +98,8 @@ foreach class:driver_classes
 				lib_version = '@[email protected]'.format(version)
 				so_version = '@0@'.format(version)
 			else
-				pver = meson.project_version().split('.')
-				lib_version = '@0@.@1@'.format(pver.get(0),
-						pver.get(1))
-				so_version = lib_version
+				lib_version = major_version
+				so_version = major_version
 			endif
 
 			# now build the static driver
lib/meson.build +2 -4
index 3acc67e6ed..bed492a4ec 100644
@@ -88,10 +88,8 @@ foreach l:libraries
 				lib_version = '@[email protected]'.format(version)
 				so_version = '@0@'.format(version)
 			else
-				prj_ver = meson.project_version().split('.')
-				lib_version = '@0@.@1@'.format(
-						prj_ver.get(0), prj_ver.get(1))
-				so_version = lib_version
+				lib_version = major_version
+				so_version = major_version
 			endif
 
 			# first build static lib
meson.build +7 -1
index c9af33532d..4bd04b9de3 100644
@@ -15,7 +15,13 @@ dpdk_libraries = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
 
-driver_install_path = join_paths(get_option('libdir'), 'dpdk/drivers')
+# set the major version, which might be used by drivers and libraries
+# depending on the configuration options
+pver = meson.project_version().split('.')
+major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
+
+driver_install_path = join_paths(get_option('libdir'), 'dpdk',
+	'pmds-' + major_version)
 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 
 # configure the build, and make sure configs here and in config folder are
Signature · 1 line
2.19.0
#18 lore raw

PATCH v3 2/2 build: add drivers_install_subdir meson option

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---
v3: changed default value to <VERSION> and use string.contains rather
than exact equivalence

 meson.build       | 10 ++++++++--
 meson_options.txt |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)
meson.build +8 -2
index 4bd04b9de3..2e3cbac587 100644
@@ -20,8 +20,14 @@ dpdk_extra_ldflags = []
 pver = meson.project_version().split('.')
 major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
 
-driver_install_path = join_paths(get_option('libdir'), 'dpdk',
-	'pmds-' + major_version)
+pmd_subdir_opt = get_option('drivers_install_subdir')
+if pmd_subdir_opt.contains('<VERSION>')
+	driver_install_path = join_paths(get_option('libdir'),
+		'dpdk', 'pmds-' + major_version)
+else
+	driver_install_path = join_paths(get_option('libdir'),
+		pmd_subdir_opt)
+endif
 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 
 # configure the build, and make sure configs here and in config folder are
meson_options.txt +2 -0
index d14bde892d..10b5416151 100644
@@ -1,5 +1,7 @@
 option('allow_invalid_socket_id', type: 'boolean', value: false,
 	description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly')
+option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
+	description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_driver_mlx_glue', type: 'boolean', value: false,
 	description: 'Enable glue library for Mellanox PMDs')
 option('enable_kmods', type: 'boolean', value: true,
Signature · 1 line
2.19.0
#19 lore raw
Quoted 22 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---
v3: changed default value to <VERSION> and use string.contains rather
than exact equivalence

 meson.build       | 10 ++++++++--
 meson_options.txt |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)
meson.build +0 -2
index 4bd04b9de3..2e3cbac587 100644
@@ -20,8 +20,14 @@ dpdk_extra_ldflags = []
 pver = meson.project_version().split('.')
 major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
 
-driver_install_path = join_paths(get_option('libdir'), 'dpdk',
-	'pmds-' + major_version)

meson.build dpdk_extra_ldflags = [] · line 32

Quoted 10 lines
meson.build +8 -0
+pmd_subdir_opt = get_option('drivers_install_subdir')
+if pmd_subdir_opt.contains('<VERSION>')
+	driver_install_path = join_paths(get_option('libdir'),
+		'dpdk', 'pmds-' + major_version)
+else
+	driver_install_path = join_paths(get_option('libdir'),
+		pmd_subdir_opt)
+endif
 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 

The diff (to your patch) below demonstrates more of what I had in mind :-) Basically do a replace of '<VERSION>' with the version number, leaving the remaining string unchanged.

/Bruce

meson.build +2 -5
index 2e3cbac58..11697861c 100644
@@ -22,12 +22,9 @@ major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
 
 pmd_subdir_opt = get_option('drivers_install_subdir')
 if pmd_subdir_opt.contains('<VERSION>')
-	driver_install_path = join_paths(get_option('libdir'),
-		'dpdk', 'pmds-' + major_version)
-else
-	driver_install_path = join_paths(get_option('libdir'),
-		pmd_subdir_opt)
+	pmd_subdir_opt = major_version.join(pmd_subdir_opt.split('<VERSION>'))
 endif
+driver_install_path = join_paths(get_option('libdir'), pmd_subdir_opt)
 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 
 # configure the build, and make sure configs here and in config folder are
#20 lore raw
Quoted 65 lines · Bruce Richardson
Quoted 31 lines · Luca Boccassi

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---
v3: changed default value to <VERSION> and use string.contains rather
    than exact equivalence

 meson.build       | 10 ++++++++--
 meson_options.txt |  2 ++

 2 files changed, 10 insertions(+), 2 deletions(-)
meson.build +0 -0
index 4bd04b9de3..2e3cbac587 100644
@@ -20,8 +20,14 @@ dpdk_extra_ldflags = []
  pver = meson.project_version().split('.')
  major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))

meson.build +8 -2
-driver_install_path = join_paths(get_option('libdir'), 'dpdk',
-	'pmds-' + major_version)
+pmd_subdir_opt = get_option('drivers_install_subdir')
+if pmd_subdir_opt.contains('<VERSION>')
+	driver_install_path = join_paths(get_option('libdir'),
+		'dpdk', 'pmds-' + major_version)
+else
+	driver_install_path = join_paths(get_option('libdir'),
+		pmd_subdir_opt)
+endif
Quoted 3 lines

 eal_pmd_path = join_paths(get_option('prefix'),
driver_install_path)

The diff (to your patch) below demonstrates more of what I had in mind :-)
Basically do a replace of '<VERSION>' with the version number, leaving the
remaining string unchanged.

/Bruce

meson.build +0 -0
index 2e3cbac58..11697861c 100644
@@ -22,12 +22,9 @@ major_version = '@0@.@1@'.format(pver.get(0),
 pver.get(1))


 pmd_subdir_opt = get_option('drivers_install_subdir') if pmd_subdir_opt.contains('<VERSION>')

meson.build +1 -5
-	driver_install_path = join_paths(get_option('libdir'),
-		'dpdk', 'pmds-' + major_version)
-else
-	driver_install_path = join_paths(get_option('libdir'),
-		pmd_subdir_opt)
+	pmd_subdir_opt =

major_version.join(pmd_subdir_opt.split('<VERSION>')) endif
+driver_install_path = join_paths(get_option('libdir'), pmd_subdir_opt)
 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)

Quoted 2 lines
 # configure the build, and make sure configs here and in config
folder are

Ok, pushed in v4

Signature · 2 lines
Kind regards,
Luca Boccassi
#21 lore raw

PATCH v4 1/2 build: change default PMD installation subdir to dpdk/pmds-XX.YY

In reply to Luca Boccassi

As part of the effort of consolidating the DPDK installation bits and pieces across distros, set the default directory of lib/ where PMDs get installed to dpdk/pmds-XX.YY. It's necessary to have a versioned subdirectory as multiple ABI revisions might be installed at the same time, so having a fixed name will cause trouble with the autoload feature.
Small refactor with parsing and saving the major version to a variable, since it's now used in 3 different places.

---
 drivers/meson.build | 6 ++----
 lib/meson.build     | 6 ++----
 meson.build         | 8 +++++++-
 3 files changed, 11 insertions(+), 9 deletions(-)
drivers/meson.build +2 -4
index 47b4215a30..3a6c4bf656 100644
@@ -98,10 +98,8 @@ foreach class:driver_classes
 				lib_version = '@[email protected]'.format(version)
 				so_version = '@0@'.format(version)
 			else
-				pver = meson.project_version().split('.')
-				lib_version = '@0@.@1@'.format(pver.get(0),
-						pver.get(1))
-				so_version = lib_version
+				lib_version = major_version
+				so_version = major_version
 			endif
 
 			# now build the static driver
lib/meson.build +2 -4
index 3acc67e6ed..bed492a4ec 100644
@@ -88,10 +88,8 @@ foreach l:libraries
 				lib_version = '@[email protected]'.format(version)
 				so_version = '@0@'.format(version)
 			else
-				prj_ver = meson.project_version().split('.')
-				lib_version = '@0@.@1@'.format(
-						prj_ver.get(0), prj_ver.get(1))
-				so_version = lib_version
+				lib_version = major_version
+				so_version = major_version
 			endif
 
 			# first build static lib
meson.build +7 -1
index c9af33532d..4bd04b9de3 100644
@@ -15,7 +15,13 @@ dpdk_libraries = []
 dpdk_drivers = []
 dpdk_extra_ldflags = []
 
-driver_install_path = join_paths(get_option('libdir'), 'dpdk/drivers')
+# set the major version, which might be used by drivers and libraries
+# depending on the configuration options
+pver = meson.project_version().split('.')
+major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
+
+driver_install_path = join_paths(get_option('libdir'), 'dpdk',
+	'pmds-' + major_version)
 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 
 # configure the build, and make sure configs here and in config folder are
Signature · 1 line
2.19.0
#22 lore raw

PATCH v4 2/2 build: add drivers_install_subdir meson option

Allow users and packagers to override the default dpdk/drivers subdirectory where the PMDs get installed under $lib.

---
v3: changed default value to <VERSION> and use string.contains rather
than exact equivalence
v4: further optimisations suggested by review

 meson.build       | 7 +++++--
 meson_options.txt | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)
meson.build +5 -2
index 4bd04b9de3..11697861c4 100644
@@ -20,8 +20,11 @@ dpdk_extra_ldflags = []
 pver = meson.project_version().split('.')
 major_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
 
-driver_install_path = join_paths(get_option('libdir'), 'dpdk',
-	'pmds-' + major_version)
+pmd_subdir_opt = get_option('drivers_install_subdir')
+if pmd_subdir_opt.contains('<VERSION>')
+	pmd_subdir_opt = major_version.join(pmd_subdir_opt.split('<VERSION>'))
+endif
+driver_install_path = join_paths(get_option('libdir'), pmd_subdir_opt)
 eal_pmd_path = join_paths(get_option('prefix'), driver_install_path)
 
 # configure the build, and make sure configs here and in config folder are
meson_options.txt +2 -0
index d14bde892d..10b5416151 100644
@@ -1,5 +1,7 @@
 option('allow_invalid_socket_id', type: 'boolean', value: false,
 	description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly')
+option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
+	description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_driver_mlx_glue', type: 'boolean', value: false,
 	description: 'Enable glue library for Mellanox PMDs')
 option('enable_kmods', type: 'boolean', value: true,
Signature · 1 line
2.19.0
Acked-by on v4 1/2
#25 lore raw

Re: [PATCH v4 1/2] build: change default PMD installation subdir to dpdk/pmds-XX.YY

In reply to Luca Boccassi
Quoted 11 lines · Luca Boccassi

As part of the effort of consolidating the DPDK installation bits and pieces across distros, set the default directory of lib/ where PMDs get installed to dpdk/pmds-XX.YY. It's necessary to have a versioned subdirectory as multiple ABI revisions might be installed at the same time, so having a fixed name will cause trouble with the autoload feature.
Small refactor with parsing and saving the major version to a variable, since it's now used in 3 different places.

---

Acked-by on v4 1/2
#26 lore raw

Re: [PATCH v4 1/2] build: change default PMD installation subdir to dpdk/pmds-XX.YY

In reply to Luca Boccassi
Quoted 11 lines · On Tue, 2 Oct 2018 17:20:45 +0100 Luca Boccassi <[email protected]> wrote:

As part of the effort of consolidating the DPDK installation bits and pieces across distros, set the default directory of lib/ where PMDs get installed to dpdk/pmds-XX.YY. It's necessary to have a versioned subdirectory as multiple ABI revisions might be installed at the same time, so having a fixed name will cause trouble with the autoload feature.
Small refactor with parsing and saving the major version to a variable, since it's now used in 3 different places.

---

#27 lore raw

Re: [PATCH v4 1/2] build: change default PMD installation subdir to dpdk/pmds-XX.YY

In reply to Luca Boccassi

02/10/2018 18:20, Luca Boccassi:

Quoted 10 lines

As part of the effort of consolidating the DPDK installation bits and pieces across distros, set the default directory of lib/ where PMDs get installed to dpdk/pmds-XX.YY. It's necessary to have a versioned subdirectory as multiple ABI revisions might be installed at the same time, so having a fixed name will cause trouble with the autoload feature.
Small refactor with parsing and saving the major version to a variable, since it's now used in 3 different places.

Series applied, thanks