[v2,1/9] build: add Meson file for TAP PMD

Message ID 20180911160903.27226-1-bluca@debian.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series [v2,1/9] build: add Meson file for TAP PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Luca Boccassi Sept. 11, 2018, 4:08 p.m. UTC
  Use same autoconf generation mechanism as the MLX4/5 PMDs

Signed-off-by: Luca Boccassi <bluca@debian.org>
---
 drivers/net/meson.build     |  1 +
 drivers/net/tap/meson.build | 41 +++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 drivers/net/tap/meson.build
  

Comments

Bruce Richardson Sept. 13, 2018, 1:11 p.m. UTC | #1
On Tue, Sep 11, 2018 at 05:08:55PM +0100, Luca Boccassi wrote:
> Use same autoconf generation mechanism as the MLX4/5 PMDs
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---
>  drivers/net/meson.build     |  1 +
>  drivers/net/tap/meson.build | 41 +++++++++++++++++++++++++++++++++++++
>  2 files changed, 42 insertions(+)
>  create mode 100644 drivers/net/tap/meson.build
> 
> diff --git a/drivers/net/meson.build b/drivers/net/meson.build
> index c7a2d0e7db..b7b4870eb8 100644
> --- a/drivers/net/meson.build
> +++ b/drivers/net/meson.build
> @@ -27,6 +27,7 @@ drivers = ['af_packet',
>  	'sfc',
>  	'softnic',
>  	'szedata2',
> +	'tap',
>  	'thunderx',
>  	'vhost',
>  	'virtio']
> diff --git a/drivers/net/tap/meson.build b/drivers/net/tap/meson.build
> new file mode 100644
> index 0000000000..ef3c6e1fee
> --- /dev/null
> +++ b/drivers/net/tap/meson.build
> @@ -0,0 +1,41 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright 2018 Luca Boccassi <bluca@debian.org>
> +
> +sources = files(
> +	'rte_eth_tap.c',
> +	'tap_bpf_api.c',
> +	'tap_flow.c',
> +	'tap_intr.c',
> +	'tap_netlink.c',
> +	'tap_tcmsgs.c',
> +)
> +
> +deps = ['bus_vdev', 'gso', 'hash']
> +
> +cflags += '-DTAP_MAX_QUEUES=16'
> +
> +# To maintain the compatibility with the make build system
> +# tap_autoconf.h file is still generated.
> +# input array for meson symbol search:
> +# [ "MACRO to define if found", "header for the search",
> +#   "enum/define", "symbol to search" ]
> +#
> +args = [
> +	[ 'HAVE_TC_FLOWER', 'linux/pkt_cls.h',
> +	  'enum', 'TCA_FLOWER_UNSPEC' ],
> +	[ 'HAVE_TC_VLAN_ID', 'linux/pkt_cls.h',
> +	  'enum', 'TCA_FLOWER_KEY_VLAN_PRIO' ],
> +	[ 'HAVE_TC_BPF', 'linux/pkt_cls.h',
> +	  'enum', 'TCA_BPF_UNSPEC' ],
> +	[ 'HAVE_TC_BPF_FD', 'linux/pkt_cls.h',
> +	  'enum', 'TCA_BPF_FD' ],
> +	[ 'HAVE_TC_ACT_BPF', 'linux/tc_act/tc_bpf.h',
> +	  'enum', 'TCA_ACT_BPF_UNSPEC' ],
> +	[ 'HAVE_TC_ACT_BPF_FD', 'linux/tc_act/tc_bpf.h',
> +	  'enum', 'TCA_ACT_BPF_FD' ],
> +]
> +config = configuration_data()
> +foreach arg:args
> +	config.set(arg[0], cc.has_header_symbol(arg[1], arg[3]))
> +endforeach
> +configure_file(output : 'tap_autoconf.h', configuration : config)
> -- 

Minor nit, arg 2 is unused, and this could be dropped, as is done in the
latest version of the mlnx meson build files.

/Bruce
  
Luca Boccassi Sept. 13, 2018, 1:28 p.m. UTC | #2
On Thu, 2018-09-13 at 14:11 +0100, Bruce Richardson wrote:
> On Tue, Sep 11, 2018 at 05:08:55PM +0100, Luca Boccassi wrote:
> > Use same autoconf generation mechanism as the MLX4/5 PMDs
> > 
> > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > ---
> >  drivers/net/meson.build     |  1 +
> >  drivers/net/tap/meson.build | 41
> > +++++++++++++++++++++++++++++++++++++
> >  2 files changed, 42 insertions(+)
> >  create mode 100644 drivers/net/tap/meson.build
> > 
> > diff --git a/drivers/net/meson.build b/drivers/net/meson.build
> > index c7a2d0e7db..b7b4870eb8 100644
> > --- a/drivers/net/meson.build
> > +++ b/drivers/net/meson.build
> > @@ -27,6 +27,7 @@ drivers = ['af_packet',
> >  	'sfc',
> >  	'softnic',
> >  	'szedata2',
> > +	'tap',
> >  	'thunderx',
> >  	'vhost',
> >  	'virtio']
> > diff --git a/drivers/net/tap/meson.build
> > b/drivers/net/tap/meson.build
> > new file mode 100644
> > index 0000000000..ef3c6e1fee
> > --- /dev/null
> > +++ b/drivers/net/tap/meson.build
> > @@ -0,0 +1,41 @@
> > +# SPDX-License-Identifier: BSD-3-Clause
> > +# Copyright 2018 Luca Boccassi <bluca@debian.org>
> > +
> > +sources = files(
> > +	'rte_eth_tap.c',
> > +	'tap_bpf_api.c',
> > +	'tap_flow.c',
> > +	'tap_intr.c',
> > +	'tap_netlink.c',
> > +	'tap_tcmsgs.c',
> > +)
> > +
> > +deps = ['bus_vdev', 'gso', 'hash']
> > +
> > +cflags += '-DTAP_MAX_QUEUES=16'
> > +
> > +# To maintain the compatibility with the make build system
> > +# tap_autoconf.h file is still generated.
> > +# input array for meson symbol search:
> > +# [ "MACRO to define if found", "header for the search",
> > +#   "enum/define", "symbol to search" ]
> > +#
> > +args = [
> > +	[ 'HAVE_TC_FLOWER', 'linux/pkt_cls.h',
> > +	  'enum', 'TCA_FLOWER_UNSPEC' ],
> > +	[ 'HAVE_TC_VLAN_ID', 'linux/pkt_cls.h',
> > +	  'enum', 'TCA_FLOWER_KEY_VLAN_PRIO' ],
> > +	[ 'HAVE_TC_BPF', 'linux/pkt_cls.h',
> > +	  'enum', 'TCA_BPF_UNSPEC' ],
> > +	[ 'HAVE_TC_BPF_FD', 'linux/pkt_cls.h',
> > +	  'enum', 'TCA_BPF_FD' ],
> > +	[ 'HAVE_TC_ACT_BPF', 'linux/tc_act/tc_bpf.h',
> > +	  'enum', 'TCA_ACT_BPF_UNSPEC' ],
> > +	[ 'HAVE_TC_ACT_BPF_FD', 'linux/tc_act/tc_bpf.h',
> > +	  'enum', 'TCA_ACT_BPF_FD' ],
> > +]
> > +config = configuration_data()
> > +foreach arg:args
> > +	config.set(arg[0], cc.has_header_symbol(arg[1], arg[3]))
> > +endforeach
> > +configure_file(output : 'tap_autoconf.h', configuration : config)
> > -- 
> 
> Minor nit, arg 2 is unused, and this could be dropped, as is done in
> the
> latest version of the mlnx meson build files.
> 
> /Bruce

Ok, will fix in v3
  

Patch

diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index c7a2d0e7db..b7b4870eb8 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -27,6 +27,7 @@  drivers = ['af_packet',
 	'sfc',
 	'softnic',
 	'szedata2',
+	'tap',
 	'thunderx',
 	'vhost',
 	'virtio']
diff --git a/drivers/net/tap/meson.build b/drivers/net/tap/meson.build
new file mode 100644
index 0000000000..ef3c6e1fee
--- /dev/null
+++ b/drivers/net/tap/meson.build
@@ -0,0 +1,41 @@ 
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018 Luca Boccassi <bluca@debian.org>
+
+sources = files(
+	'rte_eth_tap.c',
+	'tap_bpf_api.c',
+	'tap_flow.c',
+	'tap_intr.c',
+	'tap_netlink.c',
+	'tap_tcmsgs.c',
+)
+
+deps = ['bus_vdev', 'gso', 'hash']
+
+cflags += '-DTAP_MAX_QUEUES=16'
+
+# To maintain the compatibility with the make build system
+# tap_autoconf.h file is still generated.
+# input array for meson symbol search:
+# [ "MACRO to define if found", "header for the search",
+#   "enum/define", "symbol to search" ]
+#
+args = [
+	[ 'HAVE_TC_FLOWER', 'linux/pkt_cls.h',
+	  'enum', 'TCA_FLOWER_UNSPEC' ],
+	[ 'HAVE_TC_VLAN_ID', 'linux/pkt_cls.h',
+	  'enum', 'TCA_FLOWER_KEY_VLAN_PRIO' ],
+	[ 'HAVE_TC_BPF', 'linux/pkt_cls.h',
+	  'enum', 'TCA_BPF_UNSPEC' ],
+	[ 'HAVE_TC_BPF_FD', 'linux/pkt_cls.h',
+	  'enum', 'TCA_BPF_FD' ],
+	[ 'HAVE_TC_ACT_BPF', 'linux/tc_act/tc_bpf.h',
+	  'enum', 'TCA_ACT_BPF_UNSPEC' ],
+	[ 'HAVE_TC_ACT_BPF_FD', 'linux/tc_act/tc_bpf.h',
+	  'enum', 'TCA_ACT_BPF_FD' ],
+]
+config = configuration_data()
+foreach arg:args
+	config.set(arg[0], cc.has_header_symbol(arg[1], arg[3]))
+endforeach
+configure_file(output : 'tap_autoconf.h', configuration : config)