[dpdk-stable] patch 'examples/kni: fix crash during MTU set' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed May 27 11:24:18 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.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 05/29/20. 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.

Thanks.

Luca Boccassi

---
>From 1b2d70662c00013a0157f8dc809f0ff600b33ceb Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Thu, 21 May 2020 16:10:42 +0100
Subject: [PATCH] examples/kni: fix crash during MTU set

[ upstream commit 36f9eba4710b521b95d72f0e65e85f38c1cff9b5 ]

During MTU set (kni_change_mtu) sample application setup queues, which
can free and re-allocate queues.
Meanwhile sample application keeps continues in Rx/Tx burst calls in
different threads, which may cause crash during queue setup.

Pausing application Rx/Tx calls before MTU set and starts it back
afterwards.

Bugzilla ID: 482
Fixes: a26b116749a3 ("examples/kni: fix MTU change to setup Tx queue")

Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
Acked-by: Rasesh Mody <rmody at marvell.com>
Tested-by: Xi Zhang <xix.zhang at intel.com>
---
 examples/kni/main.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/examples/kni/main.c b/examples/kni/main.c
index b2866238fd..d48a59fcb1 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -764,9 +764,8 @@ monitor_all_ports_link_status(void *arg)
 	return NULL;
 }
 
-/* Callback for request of changing MTU */
 static int
-kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
+kni_change_mtu_(uint16_t port_id, unsigned int new_mtu)
 {
 	int ret;
 	uint16_t nb_rxd = NB_RXD;
@@ -847,6 +846,19 @@ kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
 	return 0;
 }
 
+/* Callback for request of changing MTU */
+static int
+kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
+{
+	int ret;
+
+	rte_atomic32_inc(&kni_pause);
+	ret =  kni_change_mtu_(port_id, new_mtu);
+	rte_atomic32_dec(&kni_pause);
+
+	return ret;
+}
+
 /* Callback for request of configuring network interface up/down */
 static int
 kni_config_network_interface(uint16_t port_id, uint8_t if_up)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-27 10:23:32.152216439 +0100
+++ 0015-examples-kni-fix-crash-during-MTU-set.patch	2020-05-27 10:23:31.647933907 +0100
@@ -1,8 +1,10 @@
-From 36f9eba4710b521b95d72f0e65e85f38c1cff9b5 Mon Sep 17 00:00:00 2001
+From 1b2d70662c00013a0157f8dc809f0ff600b33ceb Mon Sep 17 00:00:00 2001
 From: Ferruh Yigit <ferruh.yigit at intel.com>
 Date: Thu, 21 May 2020 16:10:42 +0100
 Subject: [PATCH] examples/kni: fix crash during MTU set
 
+[ upstream commit 36f9eba4710b521b95d72f0e65e85f38c1cff9b5 ]
+
 During MTU set (kni_change_mtu) sample application setup queues, which
 can free and re-allocate queues.
 Meanwhile sample application keeps continues in Rx/Tx burst calls in
@@ -13,7 +15,6 @@
 
 Bugzilla ID: 482
 Fixes: a26b116749a3 ("examples/kni: fix MTU change to setup Tx queue")
-Cc: stable at dpdk.org
 
 Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
 Acked-by: Rasesh Mody <rmody at marvell.com>
@@ -23,10 +24,10 @@
  1 file changed, 14 insertions(+), 2 deletions(-)
 
 diff --git a/examples/kni/main.c b/examples/kni/main.c
-index 7a927a50c0..80dd0353e7 100644
+index b2866238fd..d48a59fcb1 100644
 --- a/examples/kni/main.c
 +++ b/examples/kni/main.c
-@@ -768,9 +768,8 @@ monitor_all_ports_link_status(void *arg)
+@@ -764,9 +764,8 @@ monitor_all_ports_link_status(void *arg)
  	return NULL;
  }
  
@@ -37,7 +38,7 @@
  {
  	int ret;
  	uint16_t nb_rxd = NB_RXD;
-@@ -851,6 +850,19 @@ kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
+@@ -847,6 +846,19 @@ kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
  	return 0;
  }
  


More information about the stable mailing list