On Thu, Nov 14, 2019 at 11:57 AM David Marchand
<david.march...@redhat.com> wrote:
> On Tue, Nov 5, 2019 at 12:05 PM <vattun...@marvell.com> wrote:
> > diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
> > index 9e2d50c..a1c5bf6 100644
> > --- a/lib/librte_eal/linux/eal/eal.c
> > +++ b/lib/librte_eal/linux/eal/eal.c
> > @@ -922,6 +922,19 @@ static int rte_eal_vfio_setup(void)
> >  }
> >  #endif
> >
> > +static enum rte_iova_mode
> > +rte_eal_kni_get_iova_mode(enum rte_iova_mode iova_mode)
> > +{
> > +       if (iova_mode == RTE_IOVA_VA) {
> > +#if KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE
>
> I understood that IOVA as VA is possible with kernel >= 4.6.
> Should it be < ?

I had read it backwards.
So, the check is ok.

[snip]

> In the end, can't we just change the check on the workaround?
> Something like:
>
> @@ -1085,7 +1085,7 @@ rte_eal_init(int argc, char **argv)
>                                 RTE_LOG(DEBUG, EAL, "IOMMU is not
> available, selecting IOVA as PA mode.\n");
>                         }
>                 }
> -#ifdef RTE_LIBRTE_KNI
> +#if defined(RTE_LIBRTE_KNI) && KERNEL_VERSION(4, 6, 0) < LINUX_VERSION_CODE

Then it becomes:

+#if defined(RTE_LIBRTE_KNI) && KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE

>                 /* Workaround for KNI which requires physical address to work 
> */
>                 if (iova_mode == RTE_IOVA_VA &&
>                                 rte_eal_check_module("rte_kni") == 1) {
>
>
> It would be the only change in the whole file lib/librte_eal/linux/eal/eal.c


-- 
David Marchand

Reply via email to