patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] kni: fix crash on userspace VA for segmented packets
@ 2021-06-22 12:29 Ferruh Yigit
  2021-06-24  1:57 ` [dpdk-stable] [dpdk-dev] " Ajit Khaparde
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2021-06-22 12:29 UTC (permalink / raw)
  To: Jerin Jacob, Kiran Kumar K, Vamsi Attunuru; +Cc: Ferruh Yigit, dev, stable

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>
---
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] kni: fix crash on userspace VA for segmented packets
  2021-06-22 12:29 [dpdk-stable] [PATCH] kni: fix crash on userspace VA for segmented packets Ferruh Yigit
@ 2021-06-24  1:57 ` Ajit Khaparde
  2021-06-24  7:48   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Ajit Khaparde @ 2021-06-24  1:57 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Jerin Jacob, Kiran Kumar K, Vamsi Attunuru, dpdk-dev, dpdk stable

[-- 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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] kni: fix crash on userspace VA for segmented packets
  2021-06-24  1:57 ` [dpdk-stable] [dpdk-dev] " Ajit Khaparde
@ 2021-06-24  7:48   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2021-06-24  7:48 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: stable, Jerin Jacob, Kiran Kumar K, Vamsi Attunuru, dpdk-dev,
	dpdk stable, Ajit Khaparde

24/06/2021 03:57, Ajit Khaparde:
> 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>

Applied, thanks




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-24  7:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 12:29 [dpdk-stable] [PATCH] kni: fix crash on userspace VA for segmented packets Ferruh Yigit
2021-06-24  1:57 ` [dpdk-stable] [dpdk-dev] " Ajit Khaparde
2021-06-24  7:48   ` Thomas Monjalon

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git