[dpdk-dev] [PATCH 05/13] pci: introduce PCI lib and bus

Gaëtan Rivet gaetan.rivet at 6wind.com
Fri Aug 25 11:34:17 CEST 2017


On Fri, Aug 25, 2017 at 10:31:05AM +0100, Luca Boccassi wrote:
> On Fri, 2017-08-25 at 11:04 +0200, Gaetan Rivet wrote:
> > The PCI lib defines the types and methods allowing to use PCI
> > elements.
> > 
> > The PCI bus implements a bus driver for PCI devices by constructing
> > rte_bus elements using the PCI lib.
> > 
> > Move the relevant code out of the EAL to their expected place.
> > 
> > Signed-off-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
> > ---
> >  config/common_base                             |  15 +
> >  drivers/bus/Makefile                           |   2 +
> >  drivers/bus/pci/Makefile                       |  60 ++
> >  drivers/bus/pci/bsd/Makefile                   |  32 ++
> >  drivers/bus/pci/bsd/rte_pci.c                  | 670
> > +++++++++++++++++++++++
> >  drivers/bus/pci/include/rte_bus_pci.h          | 387 +++++++++++++
> >  drivers/bus/pci/linux/Makefile                 |  37 ++
> >  drivers/bus/pci/linux/rte_pci.c                | 723
> > +++++++++++++++++++++++++
> >  drivers/bus/pci/linux/rte_pci_init.h           |  97 ++++
> >  drivers/bus/pci/linux/rte_pci_uio.c            | 567
> > +++++++++++++++++++
> >  drivers/bus/pci/linux/rte_pci_vfio.c           | 674
> > +++++++++++++++++++++++
> >  drivers/bus/pci/linux/rte_vfio_mp_sync.c       | 424 +++++++++++++++
> >  drivers/bus/pci/private.h                      | 173 ++++++
> >  drivers/bus/pci/rte_bus_pci_version.map        |  21 +
> >  drivers/bus/pci/rte_pci_common.c               | 542
> > ++++++++++++++++++
> >  drivers/bus/pci/rte_pci_common_uio.c           | 234 ++++++++
> >  lib/Makefile                                   |   2 +
> >  lib/librte_eal/bsdapp/eal/Makefile             |   3 -
> >  lib/librte_eal/bsdapp/eal/eal_pci.c            | 670 -------------
> > ----------
> >  lib/librte_eal/common/Makefile                 |   2 +-
> >  lib/librte_eal/common/eal_common_pci.c         | 580 -------------
> > -------
> >  lib/librte_eal/common/eal_common_pci_uio.c     | 233 --------
> >  lib/librte_eal/common/include/rte_pci.h        | 598 -------------
> > -------
> >  lib/librte_eal/linuxapp/eal/Makefile           |  10 -
> >  lib/librte_eal/linuxapp/eal/eal_pci.c          | 723 -------------
> > ------------
> >  lib/librte_eal/linuxapp/eal/eal_pci_init.h     |  97 ----
> >  lib/librte_eal/linuxapp/eal/eal_pci_uio.c      | 567 -------------
> > ------
> >  lib/librte_eal/linuxapp/eal/eal_pci_vfio.c     | 674 -------------
> > ----------
> >  lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c | 424 ---------------
> >  lib/librte_ether/rte_ethdev.h                  |   2 -
> >  lib/librte_pci/Makefile                        |  49 ++
> >  lib/librte_pci/include/rte_pci.h               | 279 ++++++++++
> >  lib/librte_pci/rte_pci.c                       |  92 ++++
> >  lib/librte_pci/rte_pci_version.map             |   8 +
> >  mk/rte.app.mk                                  |   3 +
> >  35 files changed, 5092 insertions(+), 4582 deletions(-)
> >  create mode 100644 drivers/bus/pci/Makefile
> >  create mode 100644 drivers/bus/pci/bsd/Makefile
> >  create mode 100644 drivers/bus/pci/bsd/rte_pci.c
> >  create mode 100644 drivers/bus/pci/include/rte_bus_pci.h
> >  create mode 100644 drivers/bus/pci/linux/Makefile
> >  create mode 100644 drivers/bus/pci/linux/rte_pci.c
> >  create mode 100644 drivers/bus/pci/linux/rte_pci_init.h
> >  create mode 100644 drivers/bus/pci/linux/rte_pci_uio.c
> >  create mode 100644 drivers/bus/pci/linux/rte_pci_vfio.c
> >  create mode 100644 drivers/bus/pci/linux/rte_vfio_mp_sync.c
> >  create mode 100644 drivers/bus/pci/private.h
> >  create mode 100644 drivers/bus/pci/rte_bus_pci_version.map
> >  create mode 100644 drivers/bus/pci/rte_pci_common.c
> >  create mode 100644 drivers/bus/pci/rte_pci_common_uio.c
> >  delete mode 100644 lib/librte_eal/bsdapp/eal/eal_pci.c
> >  delete mode 100644 lib/librte_eal/common/eal_common_pci.c
> >  delete mode 100644 lib/librte_eal/common/eal_common_pci_uio.c
> >  delete mode 100644 lib/librte_eal/common/include/rte_pci.h
> >  delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci.c
> >  delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_init.h
> >  delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> >  delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
> >  delete mode 100644 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
> >  create mode 100644 lib/librte_pci/Makefile
> >  create mode 100644 lib/librte_pci/include/rte_pci.h
> >  create mode 100644 lib/librte_pci/rte_pci.c
> >  create mode 100644 lib/librte_pci/rte_pci_version.map
> > 
> > diff --git a/lib/librte_pci/Makefile b/lib/librte_pci/Makefile
> > new file mode 100644
> > index 0000000..e3c6ca5
> > --- /dev/null
> > +++ b/lib/librte_pci/Makefile
> > @@ -0,0 +1,49 @@
> > +#   BSD LICENSE
> > +#
> > +#   Copyright(c) 2017 6WIND S.A.
> > +#   All rights reserved.
> > +#
> > +#   Redistribution and use in source and binary forms, with or
> > without
> > +#   modification, are permitted provided that the following
> > conditions
> > +#   are met:
> > +#
> > +#     * Redistributions of source code must retain the above
> > copyright
> > +#       notice, this list of conditions and the following
> > disclaimer.
> > +#     * Redistributions in binary form must reproduce the above
> > copyright
> > +#       notice, this list of conditions and the following disclaimer
> > in
> > +#       the documentation and/or other materials provided with the
> > +#       distribution.
> > +#     * Neither the name of 6WIND nor the names of its
> > +#       contributors may be used to endorse or promote products
> > derived
> > +#       from this software without specific prior written
> > permission.
> > +#
> > +#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> > CONTRIBUTORS
> > +#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
> > NOT
> > +#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
> > FITNESS FOR
> > +#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > COPYRIGHT
> > +#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > INCIDENTAL,
> > +#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> > +#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
> > USE,
> > +#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
> > ON ANY
> > +#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
> > TORT
> > +#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
> > THE USE
> > +#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
> > DAMAGE.
> > +
> > +include $(RTE_SDK)/mk/rte.vars.mk
> > +
> > +# library name
> > +LIB = librte_pci.a
> > +
> > +CFLAGS += -O3
> > +CFLAGS += $(WERROR_FLAGS)
> > +CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/include
> 
> This breaks build reproducibility, please use something like:
> 
> CFLAGS := -I$(SRCDIR)/include -I$(SRCDIR) $(CFLAGS)
> CFLAGS += $(WERROR_FLAGS) -O3
> 
> See http://dpdk.org/dev/patchwork/patch/27639/
> 

Sure, thanks for the heads up.

> -- 
> Kind regards,
> Luca Boccassi

-- 
Gaëtan Rivet
6WIND


More information about the dev mailing list