DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: kirankumark@marvell.com, vattunuru@marvell.com
Cc: David Marchand <david.marchand@redhat.com>,
	dev@dpdk.org, thomas@monjalon.net, olivier.matz@6wind.com,
	anatoly.burakov@intel.com, arybchenko@solarflare.com,
	stephen@networkplumber.org,
	Jerin Jacob <jerin.jacob@caviumnetworks.com>
Subject: Re: [dpdk-dev] [PATCH v15 1/2] kni: support userspace VA
Date: Wed, 20 Nov 2019 10:47:36 +0000	[thread overview]
Message-ID: <7332eede-e33f-9a30-5b59-288363b9ee5f@intel.com> (raw)
In-Reply-To: <20191117151244.3854-2-david.marchand@redhat.com>

On 11/17/2019 3:12 PM, David Marchand wrote:
> From: Vamsi Attunuru <vattunuru@marvell.com>
> 
> Patch adds support for kernel module to work in IOVA = VA mode by
> providing address translation routines to convert userspace VA to
> kernel VA.
> 
> KNI performance using PA is not changed by this patch.
> But comparing KNI using PA to KNI using VA, the latter will have lower
> performance due to the cost of the added translation.
> 
> This translation is implemented only with kernel versions starting 4.6.0.
> 
> Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
> Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
> ---
> Changelog since v14:
> - reworded commitlog,
> 
> ---
>  kernel/linux/kni/compat.h                     | 14 +++++
>  kernel/linux/kni/kni_dev.h                    | 42 +++++++++++++
>  kernel/linux/kni/kni_misc.c                   | 39 +++++++++---
>  kernel/linux/kni/kni_net.c                    | 62 +++++++++++++++----
>  .../linux/eal/include/rte_kni_common.h        |  1 +
>  5 files changed, 136 insertions(+), 22 deletions(-)
> 
> diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
> index 562d8bf94..062b170ef 100644
> --- a/kernel/linux/kni/compat.h
> +++ b/kernel/linux/kni/compat.h
> @@ -121,3 +121,17 @@
>  #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
>  #define HAVE_SIGNAL_FUNCTIONS_OWN_HEADER
>  #endif
> +
> +#if KERNEL_VERSION(4, 6, 0) <= LINUX_VERSION_CODE
> +
> +#define HAVE_IOVA_TO_KVA_MAPPING_SUPPORT
> +
> +#if KERNEL_VERSION(4, 9, 0) > LINUX_VERSION_CODE
> +#define GET_USER_PAGES_REMOTE_API_V1
> +#elif KERNEL_VERSION(4, 9, 0) == LINUX_VERSION_CODE
> +#define GET_USER_PAGES_REMOTE_API_V2
> +#else
> +#define GET_USER_PAGES_REMOTE_API_V3
> +#endif

A build error has been reported [1], it looks like only version check is not
enough for the distro kernel version that may be backported some related commits.

I am also checking if we can find another way to check which version of the
function to use, but can you also please check?

Thanks,
ferruh


[1]
In file included from
/tmp/dpdk/i686-native-linuxapp-gcc/build/kernel/linux/kni/kni_net.c:25:0:
/tmp/dpdk/kernel/linux/kni/kni_dev.h: In function ‘iova_to_phys’:
/tmp/dpdk/kernel/linux/kni/kni_dev.h:114:9: error: expected ‘)’ before numeric
constant
         0, 0, &page, NULL);
         ^
/tmp/dpdk/kernel/linux/kni/kni_dev.h:113:8: error: too few arguments to function
‘get_user_pages_remote’
  ret = get_user_pages_remote(tsk, tsk->mm, iova, 1
        ^~~~~~~~~~~~~~~~~~~~~
In file included from
/usr/src/linux-headers-4.8.0-22-generic/include/linux/scatterlist.h:7:0,
                 from
/usr/src/linux-headers-4.8.0-22-generic/include/linux/dmaengine.h:24,
                 from
/usr/src/linux-headers-4.8.0-22-generic/include/linux/netdevice.h:38,
                 from
/tmp/dpdk/i686-native-linuxapp-gcc/build/kernel/linux/kni/kni_net.c:14:
/usr/src/linux-headers-4.8.0-22-generic/include/linux/mm.h:1311:6: note:
declared here
 long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm,
      ^~~~~~~~~~~~~~~~~~~~~
In file included from
/tmp/dpdk/i686-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.c:22:0:
/tmp/dpdk/kernel/linux/kni/kni_dev.h: In function ‘iova_to_phys’:
/tmp/dpdk/kernel/linux/kni/kni_dev.h:114:9: error: expected ‘)’ before numeric
constant
         0, 0, &page, NULL);
         ^
/tmp/dpdk/kernel/linux/kni/kni_dev.h:113:8: error: too few arguments to function
‘get_user_pages_remote’
  ret = get_user_pages_remote(tsk, tsk->mm, iova, 1
        ^~~~~~~~~~~~~~~~~~~~~
In file included from
/usr/src/linux-headers-4.8.0-22-generic/include/linux/scatterlist.h:7:0,
                 from
/usr/src/linux-headers-4.8.0-22-generic/include/linux/dmaengine.h:24,
                 from
/usr/src/linux-headers-4.8.0-22-generic/include/linux/netdevice.h:38,
                 from
/tmp/dpdk/i686-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.c:9:
/usr/src/linux-headers-4.8.0-22-generic/include/linux/mm.h:1311:6: note:
declared here
 long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm,
      ^~~~~~~~~~~~~~~~~~~~~



  parent reply	other threads:[~2019-11-20 10:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-17 15:12 [dpdk-dev] [PATCH v15 0/2] kni: support IOVA mode David Marchand
2019-11-17 15:12 ` [dpdk-dev] [PATCH v15 1/2] kni: support userspace VA David Marchand
2019-11-18 14:04   ` Jerin Jacob
2019-11-20 10:47   ` Ferruh Yigit [this message]
2019-11-17 15:12 ` [dpdk-dev] [PATCH v15 2/2] eal/linux: remove KNI restriction on IOVA David Marchand
2019-11-18 14:04   ` Jerin Jacob
2019-11-18 15:03 ` [dpdk-dev] [PATCH v15 0/2] kni: support IOVA mode David Marchand

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=7332eede-e33f-9a30-5b59-288363b9ee5f@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=kirankumark@marvell.com \
    --cc=olivier.matz@6wind.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=vattunuru@marvell.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).