[dpdk-stable] patch 'kni: fix crash on userspace VA for segmented packets' has been queued to stable release 19.11.10

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Aug 10 17:38:56 CEST 2021


Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/d4cd1ffd337c746eecca578abb93dfcde5dcada0

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From d4cd1ffd337c746eecca578abb93dfcde5dcada0 Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Tue, 22 Jun 2021 13:29:56 +0100
Subject: [PATCH] kni: fix crash on userspace VA for segmented packets

[ upstream commit 9b83a7ed2ac160aca64eed4d45102aadf26bc053 ]

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

Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde at broadcom.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 c82c881a2c..c8bad5f197 100644
--- a/kernel/linux/kni/kni_net.c
+++ b/kernel/linux/kni/kni_net.c
@@ -223,7 +223,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);
 			}
@@ -400,7 +400,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);
@@ -479,7 +479,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.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.710515565 +0200
+++ 0016-kni-fix-crash-on-userspace-VA-for-segmented-packets.patch	2021-08-10 15:11:12.918637378 +0200
@@ -1 +1 @@
-From 9b83a7ed2ac160aca64eed4d45102aadf26bc053 Mon Sep 17 00:00:00 2001
+From d4cd1ffd337c746eecca578abb93dfcde5dcada0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9b83a7ed2ac160aca64eed4d45102aadf26bc053 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index f259327954..611719b5ee 100644
+index c82c881a2c..c8bad5f197 100644
@@ -25 +26 @@
-@@ -245,7 +245,7 @@ kni_fifo_trans_pa2va(struct kni_dev *kni,
+@@ -223,7 +223,7 @@ kni_fifo_trans_pa2va(struct kni_dev *kni,
@@ -34 +35 @@
-@@ -422,7 +422,7 @@ kni_net_rx_normal(struct kni_dev *kni)
+@@ -400,7 +400,7 @@ kni_net_rx_normal(struct kni_dev *kni)
@@ -43 +44 @@
-@@ -501,7 +501,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)
+@@ -479,7 +479,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)


More information about the stable mailing list