DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] drivers/raw: fix incorrect device start
@ 2018-02-05 11:16 Shreyansh Jain
  2018-02-05 11:24 ` [dpdk-dev] [PATCH v2] raw/skeleton_rawdev: " Shreyansh Jain
  0 siblings, 1 reply; 7+ messages in thread
From: Shreyansh Jain @ 2018-02-05 11:16 UTC (permalink / raw)
  To: thomas; +Cc: dev, Shreyansh Jain

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

Device can only be started if firmware is loaded, as per Skeleton
rawdev driver semantics. This patch fixes original implementation
which attempted to start the device without loading firmware.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
index c7931d869..4095e0652 100644
--- a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
@@ -297,10 +297,25 @@ test_rawdev_start_stop(void)
 	int ret;
 	struct rte_rawdev_info rdev_info = {0};
 	struct skeleton_rawdev_conf rdev_conf_get = {0};
+	char *dummy_firmware = NULL;
 
 	/* Get the current configuration */
 	rdev_info.dev_private = &rdev_conf_get;
 
+	/* Load a firmware using a dummy address area */
+	dummy_firmware = rte_zmalloc("RAWDEV SKELETON", sizeof(int) * 10, 0);
+	RTE_TEST_ASSERT(dummy_firmware != NULL,
+			"Failed to create firmware memory backing");
+
+	ret = rte_rawdev_firmware_load(TEST_DEV_ID, dummy_firmware);
+	RTE_TEST_ASSERT_SUCCESS(ret, "Firmware loading failed (%d)", ret);
+
+	/* Skeleton doesn't do anything with the firmware area - that is dummy
+	 * and can be removed.
+	 */
+	rte_free(dummy_firmware);
+	dummy_firmware = NULL;
+
 	rte_rawdev_start(TEST_DEV_ID);
 	ret = rte_rawdev_info_get(TEST_DEV_ID, (rte_rawdev_obj_t)&rdev_info);
 	RTE_TEST_ASSERT_SUCCESS(ret,
@@ -319,6 +334,10 @@ test_rawdev_start_stop(void)
 			      "Device stop failed. State is (%d)",
 			      rdev_conf_get.device_state);
 
+	/* Unloading the firmware once device is stopped */
+	ret = rte_rawdev_firmware_unload(TEST_DEV_ID);
+	RTE_TEST_ASSERT_SUCCESS(ret, "Failed to unload fimware (%d)", ret);
+
 	return TEST_SUCCESS;
 }
 
-- 
2.14.1

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

* [dpdk-dev] [PATCH v2] raw/skeleton_rawdev: fix incorrect device start
  2018-02-05 11:16 [dpdk-dev] [PATCH] drivers/raw: fix incorrect device start Shreyansh Jain
@ 2018-02-05 11:24 ` Shreyansh Jain
  2018-02-05 11:31   ` [dpdk-dev] [PATCH v3] raw/skeleton_rawdev: fix device start test Shreyansh Jain
  0 siblings, 1 reply; 7+ messages in thread
From: Shreyansh Jain @ 2018-02-05 11:24 UTC (permalink / raw)
  To: thomas; +Cc: dev, Shreyansh Jain

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

Device can only be started if firmware is loaded, as per Skeleton
rawdev driver semantics. This patch fixes original implementation
which attempted to start the device without loading firmware.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
v2:
 - Fixed headline from drivers/raw to raw/skeleton_rawdev
 - checkpatch for spelling mistake

 drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
index c7931d869..795f24bcb 100644
--- a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
@@ -297,10 +297,25 @@ test_rawdev_start_stop(void)
 	int ret;
 	struct rte_rawdev_info rdev_info = {0};
 	struct skeleton_rawdev_conf rdev_conf_get = {0};
+	char *dummy_firmware = NULL;
 
 	/* Get the current configuration */
 	rdev_info.dev_private = &rdev_conf_get;
 
+	/* Load a firmware using a dummy address area */
+	dummy_firmware = rte_zmalloc("RAWDEV SKELETON", sizeof(int) * 10, 0);
+	RTE_TEST_ASSERT(dummy_firmware != NULL,
+			"Failed to create firmware memory backing");
+
+	ret = rte_rawdev_firmware_load(TEST_DEV_ID, dummy_firmware);
+	RTE_TEST_ASSERT_SUCCESS(ret, "Firmware loading failed (%d)", ret);
+
+	/* Skeleton doesn't do anything with the firmware area - that is dummy
+	 * and can be removed.
+	 */
+	rte_free(dummy_firmware);
+	dummy_firmware = NULL;
+
 	rte_rawdev_start(TEST_DEV_ID);
 	ret = rte_rawdev_info_get(TEST_DEV_ID, (rte_rawdev_obj_t)&rdev_info);
 	RTE_TEST_ASSERT_SUCCESS(ret,
@@ -319,6 +334,10 @@ test_rawdev_start_stop(void)
 			      "Device stop failed. State is (%d)",
 			      rdev_conf_get.device_state);
 
+	/* Unloading the firmware once device is stopped */
+	ret = rte_rawdev_firmware_unload(TEST_DEV_ID);
+	RTE_TEST_ASSERT_SUCCESS(ret, "Failed to unload firmware (%d)", ret);
+
 	return TEST_SUCCESS;
 }
 
-- 
2.14.1

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

* [dpdk-dev] [PATCH v3] raw/skeleton_rawdev: fix device start test
  2018-02-05 11:24 ` [dpdk-dev] [PATCH v2] raw/skeleton_rawdev: " Shreyansh Jain
@ 2018-02-05 11:31   ` Shreyansh Jain
  2018-02-05 14:10     ` Thomas Monjalon
  2018-02-06  6:43     ` [dpdk-dev] [PATCH v4] raw/skeleton: " Shreyansh Jain
  0 siblings, 2 replies; 7+ messages in thread
From: Shreyansh Jain @ 2018-02-05 11:31 UTC (permalink / raw)
  To: thomas; +Cc: dev, Shreyansh Jain

Device can only be started if firmware is loaded, as per Skeleton
rawdev driver semantics. This patch fixes original implementation
which attempted to start the device without loading firmware.

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

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
v3:
 - Moving 'Fixes' below commit message
 - patch headline made specific

v2:
 - Fixed headline from drivers/raw to raw/skeleton_rawdev
 - checkpatch for spelling mistake

 drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
index c7931d869..795f24bcb 100644
--- a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
@@ -297,10 +297,25 @@ test_rawdev_start_stop(void)
 	int ret;
 	struct rte_rawdev_info rdev_info = {0};
 	struct skeleton_rawdev_conf rdev_conf_get = {0};
+	char *dummy_firmware = NULL;
 
 	/* Get the current configuration */
 	rdev_info.dev_private = &rdev_conf_get;
 
+	/* Load a firmware using a dummy address area */
+	dummy_firmware = rte_zmalloc("RAWDEV SKELETON", sizeof(int) * 10, 0);
+	RTE_TEST_ASSERT(dummy_firmware != NULL,
+			"Failed to create firmware memory backing");
+
+	ret = rte_rawdev_firmware_load(TEST_DEV_ID, dummy_firmware);
+	RTE_TEST_ASSERT_SUCCESS(ret, "Firmware loading failed (%d)", ret);
+
+	/* Skeleton doesn't do anything with the firmware area - that is dummy
+	 * and can be removed.
+	 */
+	rte_free(dummy_firmware);
+	dummy_firmware = NULL;
+
 	rte_rawdev_start(TEST_DEV_ID);
 	ret = rte_rawdev_info_get(TEST_DEV_ID, (rte_rawdev_obj_t)&rdev_info);
 	RTE_TEST_ASSERT_SUCCESS(ret,
@@ -319,6 +334,10 @@ test_rawdev_start_stop(void)
 			      "Device stop failed. State is (%d)",
 			      rdev_conf_get.device_state);
 
+	/* Unloading the firmware once device is stopped */
+	ret = rte_rawdev_firmware_unload(TEST_DEV_ID);
+	RTE_TEST_ASSERT_SUCCESS(ret, "Failed to unload firmware (%d)", ret);
+
 	return TEST_SUCCESS;
 }
 
-- 
2.14.1

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

* Re: [dpdk-dev] [PATCH v3] raw/skeleton_rawdev: fix device start test
  2018-02-05 11:31   ` [dpdk-dev] [PATCH v3] raw/skeleton_rawdev: fix device start test Shreyansh Jain
@ 2018-02-05 14:10     ` Thomas Monjalon
  2018-02-05 16:25       ` Shreyansh Jain
  2018-02-06  6:43     ` [dpdk-dev] [PATCH v4] raw/skeleton: " Shreyansh Jain
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2018-02-05 14:10 UTC (permalink / raw)
  To: Shreyansh Jain; +Cc: dev

05/02/2018 12:31, Shreyansh Jain:
> Device can only be started if firmware is loaded, as per Skeleton
> rawdev driver semantics. This patch fixes original implementation
> which attempted to start the device without loading firmware.
> 
> Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")
> Cc: shreyansh.jain@nxp.com
> 
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> ---
> v3:
>  - Moving 'Fixes' below commit message
>  - patch headline made specific
> 
> v2:
>  - Fixed headline from drivers/raw to raw/skeleton_rawdev

Actually, it should be raw/skeleton because it is shorter
and it is what was chosen for previous commits :)

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

* Re: [dpdk-dev] [PATCH v3] raw/skeleton_rawdev: fix device start test
  2018-02-05 14:10     ` Thomas Monjalon
@ 2018-02-05 16:25       ` Shreyansh Jain
  0 siblings, 0 replies; 7+ messages in thread
From: Shreyansh Jain @ 2018-02-05 16:25 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Monday, February 5, 2018 7:41 PM
> To: Shreyansh Jain <shreyansh.jain@nxp.com>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH v3] raw/skeleton_rawdev: fix device start test
> 
> 05/02/2018 12:31, Shreyansh Jain:
> > Device can only be started if firmware is loaded, as per Skeleton
> > rawdev driver semantics. This patch fixes original implementation
> > which attempted to start the device without loading firmware.
> >
> > Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")
> > Cc: shreyansh.jain@nxp.com
> >
> > Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
> > ---
> > v3:
> >  - Moving 'Fixes' below commit message
> >  - patch headline made specific
> >
> > v2:
> >  - Fixed headline from drivers/raw to raw/skeleton_rawdev
> 
> Actually, it should be raw/skeleton because it is shorter
> and it is what was chosen for previous commits :)

Yes, that is shorter but not correct as per directory name. And, I thought I had made a mistake in previous commit.

In hindsight, my choice for driver name itself was not correct - I had thought of type_subtype but it doesn't sound right now that it is directory. I will change that in next release, I guess.

I will send v4 with 'raw/skeleton'.

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

* [dpdk-dev] [PATCH v4] raw/skeleton: fix device start test
  2018-02-05 11:31   ` [dpdk-dev] [PATCH v3] raw/skeleton_rawdev: fix device start test Shreyansh Jain
  2018-02-05 14:10     ` Thomas Monjalon
@ 2018-02-06  6:43     ` Shreyansh Jain
  2018-02-06 16:32       ` Thomas Monjalon
  1 sibling, 1 reply; 7+ messages in thread
From: Shreyansh Jain @ 2018-02-06  6:43 UTC (permalink / raw)
  To: thomas; +Cc: dev, Shreyansh Jain

Device can only be started if firmware is loaded, as per Skeleton
rawdev driver semantics. This patch fixes original implementation
which attempted to start the device without loading firmware.

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

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
v4:
 - change patch headline to raw/skeleton from raw/skeleton_rawdev

v3:
 - Moving 'Fixes' below commit message
 - patch headline made specific

v2:
 - Fixed headline from drivers/raw to raw/skeleton_rawdev
 - checkpatch for spelling mistake

 drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
index c7931d869..795f24bcb 100644
--- a/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c
@@ -297,10 +297,25 @@ test_rawdev_start_stop(void)
 	int ret;
 	struct rte_rawdev_info rdev_info = {0};
 	struct skeleton_rawdev_conf rdev_conf_get = {0};
+	char *dummy_firmware = NULL;
 
 	/* Get the current configuration */
 	rdev_info.dev_private = &rdev_conf_get;
 
+	/* Load a firmware using a dummy address area */
+	dummy_firmware = rte_zmalloc("RAWDEV SKELETON", sizeof(int) * 10, 0);
+	RTE_TEST_ASSERT(dummy_firmware != NULL,
+			"Failed to create firmware memory backing");
+
+	ret = rte_rawdev_firmware_load(TEST_DEV_ID, dummy_firmware);
+	RTE_TEST_ASSERT_SUCCESS(ret, "Firmware loading failed (%d)", ret);
+
+	/* Skeleton doesn't do anything with the firmware area - that is dummy
+	 * and can be removed.
+	 */
+	rte_free(dummy_firmware);
+	dummy_firmware = NULL;
+
 	rte_rawdev_start(TEST_DEV_ID);
 	ret = rte_rawdev_info_get(TEST_DEV_ID, (rte_rawdev_obj_t)&rdev_info);
 	RTE_TEST_ASSERT_SUCCESS(ret,
@@ -319,6 +334,10 @@ test_rawdev_start_stop(void)
 			      "Device stop failed. State is (%d)",
 			      rdev_conf_get.device_state);
 
+	/* Unloading the firmware once device is stopped */
+	ret = rte_rawdev_firmware_unload(TEST_DEV_ID);
+	RTE_TEST_ASSERT_SUCCESS(ret, "Failed to unload firmware (%d)", ret);
+
 	return TEST_SUCCESS;
 }
 
-- 
2.14.1

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

* Re: [dpdk-dev] [PATCH v4] raw/skeleton: fix device start test
  2018-02-06  6:43     ` [dpdk-dev] [PATCH v4] raw/skeleton: " Shreyansh Jain
@ 2018-02-06 16:32       ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2018-02-06 16:32 UTC (permalink / raw)
  To: Shreyansh Jain; +Cc: dev

06/02/2018 07:43, Shreyansh Jain:
> Device can only be started if firmware is loaded, as per Skeleton
> rawdev driver semantics. This patch fixes original implementation
> which attempted to start the device without loading firmware.
> 
> Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")
> Cc: shreyansh.jain@nxp.com
> 
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>

Applied, thanks

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

end of thread, other threads:[~2018-02-06 16:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-05 11:16 [dpdk-dev] [PATCH] drivers/raw: fix incorrect device start Shreyansh Jain
2018-02-05 11:24 ` [dpdk-dev] [PATCH v2] raw/skeleton_rawdev: " Shreyansh Jain
2018-02-05 11:31   ` [dpdk-dev] [PATCH v3] raw/skeleton_rawdev: fix device start test Shreyansh Jain
2018-02-05 14:10     ` Thomas Monjalon
2018-02-05 16:25       ` Shreyansh Jain
2018-02-06  6:43     ` [dpdk-dev] [PATCH v4] raw/skeleton: " Shreyansh Jain
2018-02-06 16:32       ` 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).