DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Gowrishankar <gowrishankar.m@linux.vnet.ibm.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Chao Zhu <chaozhu@linux.vnet.ibm.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>,
	Pradeep <pradeep@us.ibm.com>
Subject: Re: [dpdk-dev] [PATCH v2] eal: sPAPR IOMMU support in pci probing for vfio-pci in ppc64le
Date: Fri, 3 Mar 2017 09:08:43 +0000	[thread overview]
Message-ID: <C6ECDF3AB251BE4894318F4E45123697821EC0D7@IRSMSX109.ger.corp.intel.com> (raw)
In-Reply-To: <89825b7a9e0758dea19a01eb347c0753bf2c4134.1488480000.git.gowrishankar.m@linux.vnet.ibm.com>

Hi Muthurkrishnan,

> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
> 
> Below changes adds pci probing support for vfio-pci devices in power8.
> 
> Changes:
> v2 - kernel version checked and doc updated
> 
> Signed-off-by: Gowrishankar Muthukrishnan
> <gowrishankar.m@linux.vnet.ibm.com>
> ---
>  doc/guides/rel_notes/release_17_05.rst |  4 ++
>  lib/librte_eal/linuxapp/eal/eal_vfio.c | 90
> ++++++++++++++++++++++++++++++++++
>  lib/librte_eal/linuxapp/eal/eal_vfio.h |  6 +++
>  3 files changed, 100 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_17_05.rst
> b/doc/guides/rel_notes/release_17_05.rst
> index e25ea9f..4b90036 100644
> --- a/doc/guides/rel_notes/release_17_05.rst
> +++ b/doc/guides/rel_notes/release_17_05.rst
> @@ -42,6 +42,10 @@ New Features
> 
> =========================================================
> 
> 
> +* **Added powerpc support in pci probing for vfio-pci devices.**
> +
> +  sPAPR IOMMU based pci probing enabled for vfio-pci devices.
> +
>  Resolved Issues
>  ---------------
> 
> diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c
> b/lib/librte_eal/linuxapp/eal/eal_vfio.c
> index 702f7a2..9377a66 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c
> @@ -50,12 +50,15 @@
>  static struct vfio_config vfio_cfg;
> 
>  static int vfio_type1_dma_map(int);
> +static int vfio_spapr_dma_map(int);
>  static int vfio_noiommu_dma_map(int);
> 
>  /* IOMMU types we support */
>  static const struct vfio_iommu_type iommu_types[] = {
>  	/* x86 IOMMU, otherwise known as type 1 */
>  	{ RTE_VFIO_TYPE1, "Type 1", &vfio_type1_dma_map},
> +	/* ppc64 IOMMU, otherwise known as spapr */
> +	{ RTE_VFIO_SPAPR, "sPAPR", &vfio_spapr_dma_map},
>  	/* IOMMU-less mode */
>  	{ RTE_VFIO_NOIOMMU, "No-IOMMU",
> &vfio_noiommu_dma_map},
>  };
> @@ -540,6 +543,93 @@ int vfio_setup_device(const char *sysfs_base, const
> char *dev_addr,
>  }
> 
>  static int
> +vfio_spapr_dma_map(int vfio_container_fd)
> +{
> +	const struct rte_memseg *ms = rte_eal_get_physmem_layout();
> +	int i, ret;
> +
> +	struct vfio_iommu_spapr_register_memory reg = {
> +		.argsz = sizeof(reg),
> +		.flags = 0
> +	};
> +	struct vfio_iommu_spapr_tce_info info = {
> +		.argsz = sizeof(info),
> +	};
> +	struct vfio_iommu_spapr_tce_create create = {
> +		.argsz = sizeof(create),
> +	};
> +	struct vfio_iommu_spapr_tce_remove remove = {
> +		.argsz = sizeof(remove),
> +	};
> +
> +	/* query spapr iommu info */
> +	ret = ioctl(vfio_container_fd, VFIO_IOMMU_SPAPR_TCE_GET_INFO,

Please correct me if I'm wrong here, but wouldn't all of these SPAPR-specific defines
and structures not be available for pre-4.2? So the kernel check should also
contain all the definitions and structs as well. Maybe it's better to just not compile
SPAPR support on older kernels, rather than duplicating all the VFIO code.

Any opinions?

  reply	other threads:[~2017-03-03  9:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10  6:18 [dpdk-dev] [PATCH] " Gowrishankar
2017-02-11  3:26 ` gowrishankar muthukrishnan
2017-02-11  8:18   ` Thomas Monjalon
2017-02-23  5:27 ` gowrishankar muthukrishnan
2017-03-02 15:18 ` Burakov, Anatoly
2017-03-03  3:45 ` [dpdk-dev] [PATCH v2] " Gowrishankar
2017-03-03  9:08   ` Burakov, Anatoly [this message]
2017-03-03 12:31     ` gowrishankar muthukrishnan
2017-03-03 12:55       ` Burakov, Anatoly
2017-03-06 15:04 ` [dpdk-dev] [PATCH v3] " Gowrishankar
2017-03-06 16:46   ` Burakov, Anatoly
2017-03-07 12:03   ` Chao Zhu
2017-03-07 13:07     ` Thomas Monjalon
2017-03-09  1:39       ` Chao Zhu
2017-03-09  1:38   ` Chao Zhu
2017-03-09 17:50     ` 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=C6ECDF3AB251BE4894318F4E45123697821EC0D7@IRSMSX109.ger.corp.intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=chaozhu@linux.vnet.ibm.com \
    --cc=dev@dpdk.org \
    --cc=gowrishankar.m@linux.vnet.ibm.com \
    --cc=pradeep@us.ibm.com \
    --cc=thomas.monjalon@6wind.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).