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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 12 15:04:27 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/75be3a8eb3f877fcdeb1a5be63b7d66c5f91c20e

Thanks.

Luca Boccassi

---
>From 75be3a8eb3f877fcdeb1a5be63b7d66c5f91c20e 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 f259327954..611719b5ee 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.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-07-12 13:41:38.394922019 +0100
+++ 0032-kni-fix-crash-on-userspace-VA-for-segmented-packets.patch	2021-07-12 13:41:36.294118528 +0100
@@ -1 +1 @@
-From 9b83a7ed2ac160aca64eed4d45102aadf26bc053 Mon Sep 17 00:00:00 2001
+From 75be3a8eb3f877fcdeb1a5be63b7d66c5f91c20e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9b83a7ed2ac160aca64eed4d45102aadf26bc053 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list