DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: "Wang, Xiao W" <xiao.w.wang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH v4 2/2] eal/vfio: export internal vfio functions
Date: Wed, 4 Apr 2018 06:47:36 +0000	[thread overview]
Message-ID: <AM2PR04MB0753B0104B0A1E399071048889A40@AM2PR04MB0753.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <B7F2E978279D1D49A3034B7786DACF406F85CF1E@SHSMSX101.ccr.corp.intel.com>

> Hi Hemant,
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Hemant Agrawal
> > Sent: Tuesday, April 3, 2018 7:10 PM
> > To: dev@dpdk.org
> > Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; thomas@monjalon.net
> > Subject: [dpdk-dev] [PATCH v4 2/2] eal/vfio: export internal vfio
> > functions
> >
> > This patch moves some of the internal vfio functions from eal_vfio.h
> > to rte_vfio.h for common uses with "rte_" prefix.
> >
> > This patch also change the FSLMC bus usages from the internal VFIO
> > functions to external ones with "rte_" prefix
> >
> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> > Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
> > ---
> >  drivers/bus/fslmc/Makefile                     |  1 -
> >  drivers/bus/fslmc/fslmc_vfio.c                 |  7 +--
> >  drivers/bus/fslmc/fslmc_vfio.h                 |  2 -
> >  drivers/bus/fslmc/meson.build                  |  1 -
> >  lib/librte_eal/bsdapp/eal/eal.c                | 20 +++++++
> >  lib/librte_eal/common/include/rte_vfio.h       | 75
> > +++++++++++++++++++++++++-
> >  lib/librte_eal/linuxapp/eal/eal_vfio.c         | 38 ++++++-------
> >  lib/librte_eal/linuxapp/eal/eal_vfio.h         | 21 --------
> >  lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c |  4 +-
> >  lib/librte_eal/rte_eal_version.map             |  3 ++
> >  10 files changed, 122 insertions(+), 50 deletions(-)
> >
> > diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile
> > index 93870ba..3aa34e2 100644
> > --- a/drivers/bus/fslmc/Makefile
> > +++ b/drivers/bus/fslmc/Makefile
> > @@ -16,7 +16,6 @@ CFLAGS += $(WERROR_FLAGS)  CFLAGS +=
> > -I$(RTE_SDK)/drivers/bus/fslmc  CFLAGS +=
> > -I$(RTE_SDK)/drivers/bus/fslmc/mc  CFLAGS +=
> > -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include
> > -CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal
> >  CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common
> >  LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring  LDLIBS +=
> > -lrte_ethdev diff --git a/drivers/bus/fslmc/fslmc_vfio.c
> > b/drivers/bus/fslmc/fslmc_vfio.c index 62499de..f3b2960 100644
> > --- a/drivers/bus/fslmc/fslmc_vfio.c
> > +++ b/drivers/bus/fslmc/fslmc_vfio.c
> > @@ -91,7 +91,8 @@ fslmc_get_container_group(int *groupid)
> >  	}
> >
> >  	/* get group number */
> > -	ret = vfio_get_group_no(SYSFS_FSL_MC_DEVICES, g_container,
> > groupid);
> > +	ret = rte_vfio_get_group_num(SYSFS_FSL_MC_DEVICES,
> > +				     g_container, groupid);
> >  	if (ret <= 0) {
> >  		DPAA2_BUS_ERR("Unable to find %s IOMMU group",
> g_container);
> >  		return -1;
> > @@ -124,7 +125,7 @@ vfio_connect_container(void)
> >  	}
> >
> >  	/* Opens main vfio file descriptor which represents the "container" */
> > -	fd = vfio_get_container_fd();
> > +	fd = rte_vfio_get_container_fd();
> >  	if (fd < 0) {
> >  		DPAA2_BUS_ERR("Failed to open VFIO container");
> >  		return -errno;
> > @@ -620,7 +621,7 @@ fslmc_vfio_setup_group(void)
> >  	}
> >
> >  	/* Get the actual group fd */
> > -	ret = vfio_get_group_fd(groupid);
> > +	ret = rte_vfio_get_group_fd(groupid);
> >  	if (ret < 0)
> >  		return ret;
> >  	vfio_group.fd = ret;
> > diff --git a/drivers/bus/fslmc/fslmc_vfio.h
> > b/drivers/bus/fslmc/fslmc_vfio.h index e8fb344..9e2c4fe 100644
> > --- a/drivers/bus/fslmc/fslmc_vfio.h
> > +++ b/drivers/bus/fslmc/fslmc_vfio.h
> > @@ -10,8 +10,6 @@
> >
> >  #include <rte_vfio.h>
> >
> > -#include "eal_vfio.h"
> > -
> >  #define DPAA2_MC_DPNI_DEVID	7
> >  #define DPAA2_MC_DPSECI_DEVID	3
> >  #define DPAA2_MC_DPCON_DEVID	5
> > diff --git a/drivers/bus/fslmc/meson.build
> > b/drivers/bus/fslmc/meson.build index e94340e..78f9d92 100644
> > --- a/drivers/bus/fslmc/meson.build
> > +++ b/drivers/bus/fslmc/meson.build
> > @@ -22,6 +22,5 @@ sources = files('fslmc_bus.c',
> >
> >  allow_experimental_apis = true
> >
> > -includes +=
> > include_directories('../../../lib/librte_eal/linuxapp/eal')
> >  includes += include_directories('mc', 'qbman/include', 'portal')
> > cflags += ['-D_GNU_SOURCE'] diff --git
> > a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
> > index 4eafcb5..ac23db5 100644
> > --- a/lib/librte_eal/bsdapp/eal/eal.c
> > +++ b/lib/librte_eal/bsdapp/eal/eal.c
> > @@ -781,3 +781,23 @@ int rte_vfio_clear_group(__rte_unused int
> > vfio_group_fd)
> >  {
> >  	return 0;
> >  }
> > +
> > +int __rte_experimental
> > +rte_vfio_get_group_num(__rte_unused const char *sysfs_base,
> > +		       __rte_unused const char *dev_addr,
> > +		       __rte_unused int *iommu_group_num) {
> > +	return -1;
> > +}
> > +
> > +int  __rte_experimental
> > +rte_vfio_get_container_fd(void)
> > +{
> > +	return -1;
> > +}
> > +
> > +int  __rte_experimental
> > +rte_vfio_get_group_fd(__rte_unused int iommu_group_num) {
> > +	return -1;
> > +}
> 
> No function declarations for the above 3 global API. I guess compile will fail in
> BSD.
> You may include the rte_vfio.h in this file, and remove the dummy prototype.
> My previous patch "eal/vfio: add support for multiple container" does this too.
> 
[Hemant]  Just saw it. Fixing it.

> BRs,
> Xiao

  reply	other threads:[~2018-04-04  6:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14  8:00 [dpdk-dev] [PATCH] " Hemant Agrawal
2018-03-14 10:19 ` Burakov, Anatoly
2018-03-27 15:53 ` Thomas Monjalon
2018-04-03  6:27   ` Hemant Agrawal
2018-04-03  7:34     ` Thomas Monjalon
2018-04-03  8:34       ` Hemant Agrawal
2018-04-02  8:36 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
2018-04-02 16:41   ` Thomas Monjalon
2018-04-03  8:28   ` [dpdk-dev] [PATCH v3 1/2] doc: add vfio api support Hemant Agrawal
2018-04-03  8:28     ` [dpdk-dev] [PATCH v3 2/2] eal/vfio: export internal vfio functions Hemant Agrawal
2018-04-03 10:16     ` [dpdk-dev] [PATCH v3 1/2] doc: add vfio api support Thomas Monjalon
2018-04-03 11:10     ` [dpdk-dev] [PATCH v4 " Hemant Agrawal
2018-04-03 11:10       ` [dpdk-dev] [PATCH v4 2/2] eal/vfio: export internal vfio functions Hemant Agrawal
2018-04-03 12:24         ` Thomas Monjalon
2018-04-03 12:59           ` Hemant Agrawal
2018-04-03 15:23         ` Wang, Xiao W
2018-04-04  6:47           ` Hemant Agrawal [this message]
2018-04-04  7:48       ` [dpdk-dev] [PATCH v5 1/2] doc: add vfio api support Hemant Agrawal
2018-04-04  7:48         ` [dpdk-dev] [PATCH v5 2/2] eal/vfio: export internal vfio functions Hemant Agrawal
2018-04-05  9:03           ` Wang, Xiao W
2018-04-05 10:22             ` Thomas Monjalon
2018-04-05 10:35               ` Wang, Xiao W
2018-04-11 21:25           ` Thomas Monjalon
2018-04-12  6:26             ` Hemant Agrawal
2018-04-12  6:23         ` [dpdk-dev] [PATCH v6 1/2] doc: add vfio api support Hemant Agrawal
2018-04-12  6:23           ` [dpdk-dev] [PATCH v6 2/2] eal/vfio: export internal vfio functions Hemant Agrawal
2018-04-12 23:09             ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM2PR04MB0753B0104B0A1E399071048889A40@AM2PR04MB0753.eurprd04.prod.outlook.com \
    --to=hemant.agrawal@nxp.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=xiao.w.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).