[dpdk-dev,v3,1/2] drivers: add common folder

Message ID 20180326075344.2209-1-pbhagavatula@caviumnetworks.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

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

Commit Message

Pavan Nikhilesh March 26, 2018, 7:53 a.m. UTC
  Add driver/common folder and skeleton makefile for adding commonly used
functions across mempool, event and net devices.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---

 v3 Changes:
 - Fix common lib naming scheme.

 v2 Changes:
 - Removed dependency on bus.

 Based on discussion on ml
 http://dpdk.org/ml/archives/dev/2018-March/092822.html
 http://dpdk.org/ml/archives/dev/2018-March/093271.html

 drivers/Makefile           | 13 +++++++------
 drivers/common/Makefile    |  7 +++++++
 drivers/common/meson.build |  6 ++++++
 drivers/meson.build        | 11 ++++++-----
 4 files changed, 26 insertions(+), 11 deletions(-)
 create mode 100644 drivers/common/Makefile
 create mode 100644 drivers/common/meson.build

--
2.16.2
  

Comments

Thomas Monjalon March 27, 2018, 4:11 p.m. UTC | #1
26/03/2018 09:53, Pavan Nikhilesh:
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -3,18 +3,19 @@
> 
>  include $(RTE_SDK)/mk/rte.vars.mk
> 
> +DIRS-y += common
>  DIRS-y += bus
>  DIRS-y += mempool
> -DEPDIRS-mempool := bus
> +DEPDIRS-mempool := bus common
>  DIRS-y += net
> -DEPDIRS-net := bus mempool
> +DEPDIRS-net := bus common mempool
>  DIRS-$(CONFIG_RTE_LIBRTE_BBDEV) += bbdev
> -DEPDIRS-bbdev := bus mempool
> +DEPDIRS-bbdev := bus common mempool
>  DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto
> -DEPDIRS-crypto := bus mempool
> +DEPDIRS-crypto := bus common mempool
>  DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event
> -DEPDIRS-event := bus mempool net
> +DEPDIRS-event := bus common mempool net
>  DIRS-$(CONFIG_RTE_LIBRTE_RAWDEV) += raw
> -DEPDIRS-raw := bus mempool net event
> +DEPDIRS-raw := bus common mempool net event

> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -2,11 +2,12 @@
>  # Copyright(c) 2017 Intel Corporation
> 
>  # Defines the order in which the drivers are buit.
> -driver_classes = ['bus',
> -	       'mempool', # depends on bus.
> -	       'net',     # depends on bus and mempool.
> -	       'crypto',  # depenss on bus, mempool (net in future).
> -	       'event']   # depends on bus, mempool and net.
> +driver_classes = ['common',
> +	       'bus',
> +	       'mempool', # depends on bus and common.
> +	       'net',     # depends on bus, common and mempool.
> +	       'crypto',  # depenss on bus, common and mempool (net in future).
> +	       'event']   # depends on bus, common, mempool and net.

It seems you used alphabetical order to list dependencies in the Makefile
and in meson.build. I think it would be more logical to have common
before bus in dependencies.

You can also take the opportunity to fix the typo on "depenss".

Thanks
  

Patch

diff --git a/drivers/Makefile b/drivers/Makefile
index ee65c87b0..d279c4892 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -3,18 +3,19 @@ 

 include $(RTE_SDK)/mk/rte.vars.mk

+DIRS-y += common
 DIRS-y += bus
 DIRS-y += mempool
-DEPDIRS-mempool := bus
+DEPDIRS-mempool := bus common
 DIRS-y += net
-DEPDIRS-net := bus mempool
+DEPDIRS-net := bus common mempool
 DIRS-$(CONFIG_RTE_LIBRTE_BBDEV) += bbdev
-DEPDIRS-bbdev := bus mempool
+DEPDIRS-bbdev := bus common mempool
 DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto
-DEPDIRS-crypto := bus mempool
+DEPDIRS-crypto := bus common mempool
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event
-DEPDIRS-event := bus mempool net
+DEPDIRS-event := bus common mempool net
 DIRS-$(CONFIG_RTE_LIBRTE_RAWDEV) += raw
-DEPDIRS-raw := bus mempool net event
+DEPDIRS-raw := bus common mempool net event

 include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/drivers/common/Makefile b/drivers/common/Makefile
new file mode 100644
index 000000000..192066307
--- /dev/null
+++ b/drivers/common/Makefile
@@ -0,0 +1,7 @@ 
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Cavium, Inc
+#
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/drivers/common/meson.build b/drivers/common/meson.build
new file mode 100644
index 000000000..ab774b8ef
--- /dev/null
+++ b/drivers/common/meson.build
@@ -0,0 +1,6 @@ 
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Cavium, Inc
+
+std_deps = ['eal']
+config_flag_fmt = 'RTE_LIBRTE_@0@_COMMON'
+driver_name_fmt = 'rte_common_@0@'
diff --git a/drivers/meson.build b/drivers/meson.build
index b41a0f18e..5a0b5bc34 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -2,11 +2,12 @@ 
 # Copyright(c) 2017 Intel Corporation

 # Defines the order in which the drivers are buit.
-driver_classes = ['bus',
-	       'mempool', # depends on bus.
-	       'net',     # depends on bus and mempool.
-	       'crypto',  # depenss on bus, mempool (net in future).
-	       'event']   # depends on bus, mempool and net.
+driver_classes = ['common',
+	       'bus',
+	       'mempool', # depends on bus and common.
+	       'net',     # depends on bus, common and mempool.
+	       'crypto',  # depenss on bus, common and mempool (net in future).
+	       'event']   # depends on bus, common, mempool and net.

 foreach class:driver_classes
 	drivers = []