DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 1/2] raw/skeleton: reset rawdev test statistics
       [not found] <CGME20200921214426eucas1p1780728815bcc17e96102cb1f43df0195@eucas1p1.samsung.com>
@ 2020-09-21 21:44 ` Lukasz Wojciechowski
       [not found]   ` <CGME20200921214427eucas1p1f55e4da85bf76c8f73a840b47e01b04d@eucas1p1.samsung.com>
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lukasz Wojciechowski @ 2020-09-21 21:44 UTC (permalink / raw)
  To: Nipun Gupta, Hemant Agrawal, Shreyansh Jain; +Cc: dev, l.wojciechow, stable

Statistics: passed, failed, unsupported and total are kept
in global static variables. As global variables they are initiated
with zeroes. However running test multiple times cumulates results
from previous calls.

This patch resets statistics with zeroes in testsuite_setup().

To reproduce issue fixed by this patch, run rawdev_autotest command
in dpdk-test app multiple times.

Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")
Cc: shreyansh.jain@nxp.com

Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
---
 drivers/raw/skeleton/skeleton_rawdev_test.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/raw/skeleton/skeleton_rawdev_test.c b/drivers/raw/skeleton/skeleton_rawdev_test.c
index bb4b6efe4..1405df080 100644
--- a/drivers/raw/skeleton/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton/skeleton_rawdev_test.c
@@ -42,6 +42,12 @@ static int
 testsuite_setup(void)
 {
 	uint8_t count;
+
+	total = 0;
+	passed = 0;
+	failed = 0;
+	unsupported = 0;
+
 	count = rte_rawdev_count();
 	if (!count) {
 		SKELDEV_TEST_INFO("\tNo existing rawdev; "
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH v1 2/2] raw/skeleton: allow closing already closed rawdev
       [not found]   ` <CGME20200921214427eucas1p1f55e4da85bf76c8f73a840b47e01b04d@eucas1p1.samsung.com>
@ 2020-09-21 21:44     ` Lukasz Wojciechowski
  0 siblings, 0 replies; 4+ messages in thread
From: Lukasz Wojciechowski @ 2020-09-21 21:44 UTC (permalink / raw)
  To: Nipun Gupta, Hemant Agrawal, Shreyansh Jain; +Cc: dev, l.wojciechow, stable

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")
Cc: shreyansh.jain@nxp.com

Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@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 f8b47a391..aa3beaad1 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)
 		}
 		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.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/2] raw/skeleton: reset rawdev test statistics
  2020-09-21 21:44 ` [dpdk-dev] [PATCH v1 1/2] raw/skeleton: reset rawdev test statistics Lukasz Wojciechowski
       [not found]   ` <CGME20200921214427eucas1p1f55e4da85bf76c8f73a840b47e01b04d@eucas1p1.samsung.com>
@ 2020-09-22  4:15   ` Hemant Agrawal
  2020-10-06 21:31   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Hemant Agrawal @ 2020-09-22  4:15 UTC (permalink / raw)
  To: Lukasz Wojciechowski, Nipun Gupta, Shreyansh Jain; +Cc: dev, stable

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [dpdk-stable] [PATCH v1 1/2] raw/skeleton: reset rawdev test statistics
  2020-09-21 21:44 ` [dpdk-dev] [PATCH v1 1/2] raw/skeleton: reset rawdev test statistics Lukasz Wojciechowski
       [not found]   ` <CGME20200921214427eucas1p1f55e4da85bf76c8f73a840b47e01b04d@eucas1p1.samsung.com>
  2020-09-22  4:15   ` [dpdk-dev] [PATCH v1 1/2] raw/skeleton: reset rawdev test statistics Hemant Agrawal
@ 2020-10-06 21:31   ` Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2020-10-06 21:31 UTC (permalink / raw)
  To: Lukasz Wojciechowski
  Cc: Nipun Gupta, Hemant Agrawal, Shreyansh Jain, dev, stable

21/09/2020 23:44, Lukasz Wojciechowski:
> Statistics: passed, failed, unsupported and total are kept
> in global static variables. As global variables they are initiated
> with zeroes. However running test multiple times cumulates results
> from previous calls.
> 
> This patch resets statistics with zeroes in testsuite_setup().
> 
> To reproduce issue fixed by this patch, run rawdev_autotest command
> in dpdk-test app multiple times.
> 
> Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")
> Cc: shreyansh.jain@nxp.com
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Applied, thanks





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-06 21:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200921214426eucas1p1780728815bcc17e96102cb1f43df0195@eucas1p1.samsung.com>
2020-09-21 21:44 ` [dpdk-dev] [PATCH v1 1/2] raw/skeleton: reset rawdev test statistics Lukasz Wojciechowski
     [not found]   ` <CGME20200921214427eucas1p1f55e4da85bf76c8f73a840b47e01b04d@eucas1p1.samsung.com>
2020-09-21 21:44     ` [dpdk-dev] [PATCH v1 2/2] raw/skeleton: allow closing already closed rawdev Lukasz Wojciechowski
2020-09-22  4:15   ` [dpdk-dev] [PATCH v1 1/2] raw/skeleton: reset rawdev test statistics Hemant Agrawal
2020-10-06 21:31   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).