[dpdk-stable] patch 'net/failsafe: fix probe cleanup' has been queued to LTS release 17.11.3

Yuanhan Liu yliu at fridaylinux.org
Sun May 20 15:02:38 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 17.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/27/18. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 85865d936ac500e585bc9e1c2225a736dd1fbb85 Mon Sep 17 00:00:00 2001
From: Raslan Darawsheh <rasland at mellanox.com>
Date: Wed, 9 May 2018 18:57:39 +0300
Subject: [PATCH] net/failsafe: fix probe cleanup

[ upstream commit 95e7a72f9decd1db38dfb754b485dd4ac6859def ]

The hot-plug alarm mechanism is responsible to practically execute both
plug in and out operations. It periodically tries to detect missed
sub-devices to be reconfigured and clean the resources of the removed
sub-devices.

The hot-plug alarm is started by the failsafe probe function, and it's
wrongly not stopped if failsafe instance got an error. for example
when starting failsafe with a MAC option, and giving it an invalid MAC
address this will lead to a NULL pointer for the dev private field. Then
when the hotplug alarm is called it will try to access this pointer,
which will lead to a segmentation fault.

Uninstall the hot-plug alarm in case of error in probe function.

Fixes: ebea83f8 ("net/failsafe: add plug-in support")

Signed-off-by: Raslan Darawsheh <rasland at mellanox.com>
Acked-by: Matan Azrad <matan at mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
---
 drivers/net/failsafe/failsafe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 8336510f0..41b4cb0b0 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -210,7 +210,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
 							       mac);
 			if (ret) {
 				ERROR("Failed to set default MAC address");
-				goto free_args;
+				goto cancel_alarm;
 			}
 		}
 	} else {
@@ -240,6 +240,8 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
 		mac->addr_bytes[4], mac->addr_bytes[5]);
 	dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
 	return 0;
+cancel_alarm:
+	failsafe_hotplug_alarm_cancel(dev);
 free_args:
 	failsafe_args_free(dev);
 free_subs:
-- 
2.11.0



More information about the stable mailing list