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

Message ID 20180319092726.10153-1-pbhagavatula@caviumnetworks.com (mailing list archive)
State Superseded, archived
Headers

Checks

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

Commit Message

Pavan Nikhilesh March 19, 2018, 9:27 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>
---
 drivers/Makefile           | 14 ++++++++------
 drivers/common/Makefile    |  7 +++++++
 drivers/common/meson.build |  6 ++++++
 drivers/meson.build        |  9 +++++----
 4 files changed, 26 insertions(+), 10 deletions(-)
 create mode 100644 drivers/common/Makefile
 create mode 100644 drivers/common/meson.build
  

Comments

Shreyansh Jain March 19, 2018, 10:35 a.m. UTC | #1
Hi Pavan,

On Mon, Mar 19, 2018 at 2:57 PM, Pavan Nikhilesh
<pbhagavatula@caviumnetworks.com> wrote:
> 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>
> ---
>  drivers/Makefile           | 14 ++++++++------
>  drivers/common/Makefile    |  7 +++++++
>  drivers/common/meson.build |  6 ++++++
>  drivers/meson.build        |  9 +++++----
>  4 files changed, 26 insertions(+), 10 deletions(-)
>  create mode 100644 drivers/common/Makefile
>  create mode 100644 drivers/common/meson.build
>
> diff --git a/drivers/Makefile b/drivers/Makefile
> index ee65c87b0..bd83ad9f3 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -4,17 +4,19 @@
>  include $(RTE_SDK)/mk/rte.vars.mk
>
>  DIRS-y += bus
> +DIRS-y += common
> +DEPDIRS-common := bus

Why should common be dependent on bus? Shouldn't common be independent
in itself?

>  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

[...]

-
Shreyansh
  
Pavan Nikhilesh March 20, 2018, 2:38 p.m. UTC | #2
Hi Shreyansh,

On Mon, Mar 19, 2018 at 04:05:13PM +0530, Shreyansh Jain wrote:
> Hi Pavan,
>
> On Mon, Mar 19, 2018 at 2:57 PM, Pavan Nikhilesh
> <pbhagavatula@caviumnetworks.com> wrote:
> > 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>
> > ---
> >  drivers/Makefile           | 14 ++++++++------
> >  drivers/common/Makefile    |  7 +++++++
> >  drivers/common/meson.build |  6 ++++++
> >  drivers/meson.build        |  9 +++++----
> >  4 files changed, 26 insertions(+), 10 deletions(-)
> >  create mode 100644 drivers/common/Makefile
> >  create mode 100644 drivers/common/meson.build
> >
> > diff --git a/drivers/Makefile b/drivers/Makefile
> > index ee65c87b0..bd83ad9f3 100644
> > --- a/drivers/Makefile
> > +++ b/drivers/Makefile
> > @@ -4,17 +4,19 @@
> >  include $(RTE_SDK)/mk/rte.vars.mk
> >
> >  DIRS-y += bus
> > +DIRS-y += common
> > +DEPDIRS-common := bus
>
> Why should common be dependent on bus? Shouldn't common be independent
> in itself?

Yup will send out v2 soon.

>
> >  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
>
> [...]
>
> -
> Shreyansh

Thanks,
Pavan.
  

Patch

diff --git a/drivers/Makefile b/drivers/Makefile
index ee65c87b0..bd83ad9f3 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -4,17 +4,19 @@ 
 include $(RTE_SDK)/mk/rte.vars.mk
 
 DIRS-y += bus
+DIRS-y += common
+DEPDIRS-common := 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..20d4a30ba
--- /dev/null
+++ b/drivers/common/meson.build
@@ -0,0 +1,6 @@ 
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Cavium, Inc
+
+std_deps = ['bus_pci']
+config_flag_fmt = 'RTE_LIBRTE_@0@_COMMON'
+driver_name_fmt = 'rte_@0@_common'
diff --git a/drivers/meson.build b/drivers/meson.build
index b41a0f18e..9494e5d76 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -3,10 +3,11 @@ 
 
 # 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.
+	       'common',  # depends on 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 = []