DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] service: reintroduce test dummy service delay
@ 2024-10-02 19:31 Mattias Rönnblom
  2024-10-03  6:42 ` David Marchand
  0 siblings, 1 reply; 2+ messages in thread
From: Mattias Rönnblom @ 2024-10-02 19:31 UTC (permalink / raw)
  To: dev, Harry van Haaren; +Cc: hofors, david.marchand, Mattias Rönnblom

Eliminate unreachable code and have dummy service function perform a
short delay again, mimicking previous service core test behavior.

Fixes: a37e053b2364 ("service: extend service function call statistics")

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
---
 app/test/test_service_cores.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
index 7ae6bbb179..46ed9a1868 100644
--- a/app/test/test_service_cores.c
+++ b/app/test/test_service_cores.c
@@ -49,21 +49,27 @@ testsuite_teardown(void)
 static int32_t dummy_cb(void *args)
 {
 	RTE_SET_USED(args);
+	int32_t rc;
 
 	service_calls++;
 
 	switch (rte_rand_max(3)) {
 	case 0:
-		return 0;
+		rc = 0;
+		break;
 	case 1:
 		service_idle_calls++;
-		return -EAGAIN;
+		rc = -EAGAIN;
+		break;
 	default:
 		service_error_calls++;
-		return -ENOENT;
+		rc = -ENOENT;
+		break;
 	}
 
 	rte_delay_ms(SERVICE_DELAY);
+
+	return rc;
 }
 
 static int32_t dummy_mt_unsafe_cb(void *args)
-- 
2.43.0


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

* Re: [PATCH] service: reintroduce test dummy service delay
  2024-10-02 19:31 [PATCH] service: reintroduce test dummy service delay Mattias Rönnblom
@ 2024-10-03  6:42 ` David Marchand
  0 siblings, 0 replies; 2+ messages in thread
From: David Marchand @ 2024-10-03  6:42 UTC (permalink / raw)
  To: Mattias Rönnblom; +Cc: dev, Harry van Haaren, hofors

On Wed, Oct 2, 2024 at 9:40 PM Mattias Rönnblom
<mattias.ronnblom@ericsson.com> wrote:
>
> Eliminate unreachable code and have dummy service function perform a
> short delay again, mimicking previous service core test behavior.
>
Coverity issue: 445158
> Fixes: a37e053b2364 ("service: extend service function call statistics")
>
> Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2024-10-03  6:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-02 19:31 [PATCH] service: reintroduce test dummy service delay Mattias Rönnblom
2024-10-03  6:42 ` David Marchand

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).