DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Jerin Jacob <jerinj@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	 Vamsi Attunuru <vattunuru@marvell.com>, dpdk-dev <dev@dpdk.org>,
	dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] kni: fix crash on userspace VA for segmented packets
Date: Wed, 23 Jun 2021 18:57:15 -0700	[thread overview]
Message-ID: <CACZ4nhsgnk=tYs41S8WvJugYjqK_dDs0uPyczmkUcux4w2uDbA@mail.gmail.com> (raw)
In-Reply-To: <20210622122956.3130231-1-ferruh.yigit@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2319 bytes --]

On Tue, Jun 22, 2021 at 5:39 AM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> When IOVA=VA, address translation for segmented packets is wrong, it
> assumes the address in the mbuf->next is physical address, not VA
> address.
>
> Fixing the address translation to work both PA & VA mode.
>
> Fixes: e73831dc6c26 ("kni: support userspace VA")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

> ---
> Cc: vattunuru@marvell.com
> ---
>  kernel/linux/kni/kni_net.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c
> index f259327954b2..611719b5ee27 100644
> --- a/kernel/linux/kni/kni_net.c
> +++ b/kernel/linux/kni/kni_net.c
> @@ -245,7 +245,7 @@ kni_fifo_trans_pa2va(struct kni_dev *kni,
>                                         break;
>
>                                 prev_kva = kva;
> -                               kva = pa2kva(kva->next);
> +                               kva = get_kva(kni, kva->next);
>                                 /* Convert physical address to virtual address */
>                                 prev_kva->next = pa2va(prev_kva->next, kva);
>                         }
> @@ -422,7 +422,7 @@ kni_net_rx_normal(struct kni_dev *kni)
>                                         break;
>
>                                 prev_kva = kva;
> -                               kva = pa2kva(kva->next);
> +                               kva = get_kva(kni, kva->next);
>                                 data_kva = kva2data_kva(kva);
>                                 /* Convert physical address to virtual address */
>                                 prev_kva->next = pa2va(prev_kva->next, kva);
> @@ -501,7 +501,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)
>                         kni->va[i] = pa2va(kni->pa[i], kva);
>
>                         while (kva->next) {
> -                               next_kva = pa2kva(kva->next);
> +                               next_kva = get_kva(kni, kva->next);
>                                 /* Convert physical address to virtual address */
>                                 kva->next = pa2va(kva->next, next_kva);
>                                 kva = next_kva;
> --
> 2.31.1
>

  reply	other threads:[~2021-06-24  1:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 12:29 Ferruh Yigit
2021-06-24  1:57 ` Ajit Khaparde [this message]
2021-06-24  7:48   ` [dpdk-dev] [dpdk-stable] " 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='CACZ4nhsgnk=tYs41S8WvJugYjqK_dDs0uPyczmkUcux4w2uDbA@mail.gmail.com' \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=stable@dpdk.org \
    --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).