[dpdk-stable] patch 'raw/skeleton: allow closing already closed device' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:44:30 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/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 8a53e82ec4504863795134649ac80ad2f230bcd8 Mon Sep 17 00:00:00 2001
From: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
Date: Mon, 21 Sep 2020 23:44:20 +0200
Subject: [PATCH] raw/skeleton: allow closing already closed device

[ upstream commit e640362b34e868b82bfb047761e05056ba77e58e ]

This patch return OK code (0) from skeleton_rawdev_close function
if firmware is in SKELETON_FW_READY state. Formerly it returned
-EINVAL error code.

Returning an error here is troublesome as it disallows proper release
of the rawdev. The rte_rawdev_pmd_release function from librte_rawdev
library calls drivers' rawdev_close handler and continues execution
only in case of errorless call.
(see lib/librte_rawdev/rte_rawdev.c:540)

The SKELETON_FW_READY state is reached after creation, reset, unload
or close of the device. The device should be ok to be released in
such situations.

To reproduce issue fixed by this patch, call rawdev_autotest
from dpdk-test app for few times. As the device is not properly
released, the next calls will fail.

Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver")

Signed-off-by: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
---
 drivers/raw/skeleton/skeleton_rawdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index 586183a5b8..1daf0fecd2 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -189,9 +189,11 @@ static int skeleton_rawdev_close(struct rte_rawdev *dev)
 		}
 		break;
 	case SKELETON_FW_READY:
+		SKELETON_PMD_DEBUG("Device already in stopped state");
+		break;
 	case SKELETON_FW_ERROR:
 	default:
-		SKELETON_PMD_DEBUG("Device already in stopped state");
+		SKELETON_PMD_DEBUG("Device in impossible state");
 		ret = -EINVAL;
 		break;
 	}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:15.210176241 +0000
+++ 0111-raw-skeleton-allow-closing-already-closed-device.patch	2020-10-28 10:35:11.664832379 +0000
@@ -1,8 +1,10 @@
-From e640362b34e868b82bfb047761e05056ba77e58e Mon Sep 17 00:00:00 2001
+From 8a53e82ec4504863795134649ac80ad2f230bcd8 Mon Sep 17 00:00:00 2001
 From: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
 Date: Mon, 21 Sep 2020 23:44:20 +0200
 Subject: [PATCH] raw/skeleton: allow closing already closed device
 
+[ upstream commit e640362b34e868b82bfb047761e05056ba77e58e ]
+
 This patch return OK code (0) from skeleton_rawdev_close function
 if firmware is in SKELETON_FW_READY state. Formerly it returned
 -EINVAL error code.
@@ -22,7 +24,6 @@
 released, the next calls will fail.
 
 Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver")
-Cc: stable at dpdk.org
 
 Signed-off-by: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
 ---
@@ -30,10 +31,10 @@
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
-index f8b47a391a..aa3beaad18 100644
+index 586183a5b8..1daf0fecd2 100644
 --- a/drivers/raw/skeleton/skeleton_rawdev.c
 +++ b/drivers/raw/skeleton/skeleton_rawdev.c
-@@ -190,9 +190,11 @@ static int skeleton_rawdev_close(struct rte_rawdev *dev)
+@@ -189,9 +189,11 @@ static int skeleton_rawdev_close(struct rte_rawdev *dev)
  		}
  		break;
  	case SKELETON_FW_READY:


More information about the stable mailing list