[dpdk-dev] [PATCH v2] eal: sPAPR IOMMU support in pci probing for vfio-pci in ppc64le

Burakov, Anatoly anatoly.burakov at intel.com
Fri Mar 3 13:55:06 CET 2017


Hi Gowrishankar,

> Hi Anatoly,
> 
> 
> On Friday 03 March 2017 02:38 PM, Burakov, Anatoly wrote:
> >
> > 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?
> >
> >
> Thanks for this check.
> 
> As far as its trace in linux main stream, I see it was merged in 4.2.
> But, it depends on distro when we go back in older kernels.
> Some distros may have back-ported it too - eg. linux-3.10.0-514.6.2.el7 in
> RHEL 7.2 supports it. So, we might realise whether not supported, only in run
> time (atleast without autoconf sort of stuff in dpdk) IMO.
> any thoughts ?.
> 
> Regards,
> Gowrishankar

I guess the best way to go would be something like:

#ifndef SPAPR_IOMMU_TYPE
#define RTE_SPAPR_IOMMU 6
#define SPAPR_MAP_FOO bar
struct spapr_foo {};
struct spapr_bar {};
#else
#define RTE_SPAPR_IOMMU SPAPR_IOMMU_TYPE
#endif

Even though it's a bit messy, this way we won't be dependent on kernel version or if any distro has backported SPAPR support. Does that sound reasonable?

Thanks,
Anatoly


More information about the dev mailing list