* [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function
@ 2017-09-05 14:10 Guduri Prathyusha
2017-09-05 14:10 ` [dpdk-dev] [PATCH 2/2] service: fix service lcore start stop unit test Guduri Prathyusha
2017-09-05 14:34 ` [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function Van Haaren, Harry
0 siblings, 2 replies; 4+ messages in thread
From: Guduri Prathyusha @ 2017-09-05 14:10 UTC (permalink / raw)
To: harry.van.haaren; +Cc: dev, Guduri Prathyusha
lcore_states store the state of the lcore. Fixing the invalid
dereference of lcore_states with service number
Fixes: 21698354c832 ("service: introduce service cores concept")
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
---
lib/librte_eal/common/rte_service.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 7efb76dc8..2ac77cc2a 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -609,7 +609,7 @@ rte_service_lcore_stop(uint32_t lcore)
uint32_t i;
for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) {
int32_t enabled =
- lcore_states[i].service_mask & (UINT64_C(1) << i);
+ lcore_states[lcore].service_mask & (UINT64_C(1) << i);
int32_t service_running = rte_services[i].runstate !=
RUNSTATE_STOPPED;
int32_t only_core = rte_services[i].num_mapped_cores == 1;
--
2.14.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/2] service: fix service lcore start stop unit test
2017-09-05 14:10 [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function Guduri Prathyusha
@ 2017-09-05 14:10 ` Guduri Prathyusha
2017-09-05 14:34 ` [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function Van Haaren, Harry
1 sibling, 0 replies; 4+ messages in thread
From: Guduri Prathyusha @ 2017-09-05 14:10 UTC (permalink / raw)
To: harry.van.haaren; +Cc: dev, Guduri Prathyusha
Unit test case service_lcore_start_stop fails since the service core was
stopped without stopping the service.
This commit fixes the test by adding negative and positive cases of
stopping the service lcore before and after stopping the service
respectively.
Fixes: f038a81e1c56 ("service: add unit tests")
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
---
test/test/test_service_cores.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/test/test/test_service_cores.c b/test/test/test_service_cores.c
index 88fac8f44..b043397ef 100644
--- a/test/test/test_service_cores.c
+++ b/test/test/test_service_cores.c
@@ -553,6 +553,10 @@ service_lcore_start_stop(void)
"Service core expected to poll service but it didn't");
/* core stop */
+ TEST_ASSERT_EQUAL(-EBUSY, rte_service_lcore_stop(slcore_id),
+ "Service core running a service should return -EBUSY");
+ TEST_ASSERT_EQUAL(0, rte_service_stop(s),
+ "Stopping valid service failed");
TEST_ASSERT_EQUAL(-EINVAL, rte_service_lcore_stop(100000),
"Invalid Service core stop should return -EINVAL");
TEST_ASSERT_EQUAL(0, rte_service_lcore_stop(slcore_id),
--
2.14.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function
2017-09-05 14:10 [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function Guduri Prathyusha
2017-09-05 14:10 ` [dpdk-dev] [PATCH 2/2] service: fix service lcore start stop unit test Guduri Prathyusha
@ 2017-09-05 14:34 ` Van Haaren, Harry
2017-09-05 16:02 ` Guduri Prathyusha
1 sibling, 1 reply; 4+ messages in thread
From: Van Haaren, Harry @ 2017-09-05 14:34 UTC (permalink / raw)
To: Guduri Prathyusha; +Cc: dev
> From: Guduri Prathyusha [mailto:gprathyusha@caviumnetworks.com]
> Sent: Tuesday, September 5, 2017 3:11 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org; Guduri Prathyusha <gprathyusha@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function
>
> lcore_states store the state of the lcore. Fixing the invalid
> dereference of lcore_states with service number
>
> Fixes: 21698354c832 ("service: introduce service cores concept")
>
> Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Hi Guduri,
This looks like a genuine bug-fix - thanks for looking into it and providing a patch. Typically, DPDK tries to fix the unit-tests and a bug at the same time - this ensures that the unit tests continue to pass at every test. So, patch 2/2 of this series can be merged into this patch, and include both Fixes: lines.
Secondly, does this patchset apply to the current dpdk (17.08), or to the future service-cores patches? If it doesn't apply cleanly on the future patches, it is probably better to A) include it in that patchset, or B) rebase this fix patch onto the service cores patches.
Hope that makes sense, and let me know if you'd prefer A) or B) above. Thanks, -Harry
> ---
> lib/librte_eal/common/rte_service.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
> index 7efb76dc8..2ac77cc2a 100644
> --- a/lib/librte_eal/common/rte_service.c
> +++ b/lib/librte_eal/common/rte_service.c
> @@ -609,7 +609,7 @@ rte_service_lcore_stop(uint32_t lcore)
> uint32_t i;
> for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) {
> int32_t enabled =
> - lcore_states[i].service_mask & (UINT64_C(1) << i);
> + lcore_states[lcore].service_mask & (UINT64_C(1) << i);
> int32_t service_running = rte_services[i].runstate !=
> RUNSTATE_STOPPED;
> int32_t only_core = rte_services[i].num_mapped_cores == 1;
> --
> 2.14.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function
2017-09-05 14:34 ` [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function Van Haaren, Harry
@ 2017-09-05 16:02 ` Guduri Prathyusha
0 siblings, 0 replies; 4+ messages in thread
From: Guduri Prathyusha @ 2017-09-05 16:02 UTC (permalink / raw)
To: Van Haaren, Harry; +Cc: dev
On Tue, Sep 05, 2017 at 02:34:44PM +0000, Van Haaren, Harry wrote:
> > From: Guduri Prathyusha [mailto:gprathyusha@caviumnetworks.com]
> > Sent: Tuesday, September 5, 2017 3:11 PM
> > To: Van Haaren, Harry <harry.van.haaren@intel.com>
> > Cc: dev@dpdk.org; Guduri Prathyusha <gprathyusha@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function
> >
> > lcore_states store the state of the lcore. Fixing the invalid
> > dereference of lcore_states with service number
> >
> > Fixes: 21698354c832 ("service: introduce service cores concept")
> >
> > Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
>
> Hi Guduri,
Hi Harry
>
> This looks like a genuine bug-fix - thanks for looking into it and providing a patch. Typically, DPDK tries to fix the unit-tests and a bug at the same time - this ensures that the unit tests continue to pass at every test. So, patch 2/2 of this series can be merged into this patch, and include both Fixes: lines.
Sure, thanks for a quick review
>
> Secondly, does this patchset apply to the current dpdk (17.08), or to the future service-cores patches? If it doesn't apply cleanly on the future patches, it is probably better to A) include it in that patchset, or B) rebase this fix patch onto the service cores patches.
>
> Hope that makes sense, and let me know if you'd prefer A) or B) above. Thanks, -Harry
>
>
This series is based on the current 17.08 dpdk master branch. I will rebase the patches to the future service core patches and send a v2 mentioning the patch is dependent on the future service core patches. Is that fine?
Thanks,
Prathyusha
> > ---
> > lib/librte_eal/common/rte_service.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
> > index 7efb76dc8..2ac77cc2a 100644
> > --- a/lib/librte_eal/common/rte_service.c
> > +++ b/lib/librte_eal/common/rte_service.c
> > @@ -609,7 +609,7 @@ rte_service_lcore_stop(uint32_t lcore)
> > uint32_t i;
> > for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) {
> > int32_t enabled =
> > - lcore_states[i].service_mask & (UINT64_C(1) << i);
> > + lcore_states[lcore].service_mask & (UINT64_C(1) << i);
> > int32_t service_running = rte_services[i].runstate !=
> > RUNSTATE_STOPPED;
> > int32_t only_core = rte_services[i].num_mapped_cores == 1;
> > --
> > 2.14.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-05 16:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 14:10 [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function Guduri Prathyusha
2017-09-05 14:10 ` [dpdk-dev] [PATCH 2/2] service: fix service lcore start stop unit test Guduri Prathyusha
2017-09-05 14:34 ` [dpdk-dev] [PATCH 1/2] service: fix service lcore stop function Van Haaren, Harry
2017-09-05 16:02 ` Guduri Prathyusha
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).