Skip to content

Commit

Permalink
test: check thread creation
Browse files Browse the repository at this point in the history
[ upstream commit a20cb9d ]

There was a call for thread create function without result check.
Add result check and message print out after failure.

Fixes: 086eb64 ("test/pdump: add unit test for pdump library")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
  • Loading branch information
fengchengwen authored and cpaelzer committed May 17, 2021
1 parent 20d9298 commit 8cf97af
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/test/process.h
Expand Up @@ -48,6 +48,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
#ifdef RTE_LIBRTE_PDUMP
#ifdef RTE_LIBRTE_RING_PMD
pthread_t thread;
int rc;
#endif
#endif

Expand Down Expand Up @@ -126,8 +127,13 @@ process_dup(const char *const argv[], int numargs, const char *env_value)
/* parent process does a wait */
#ifdef RTE_LIBRTE_PDUMP
#ifdef RTE_LIBRTE_RING_PMD
if ((strcmp(env_value, "run_pdump_server_tests") == 0))
pthread_create(&thread, NULL, &send_pkts, NULL);
if ((strcmp(env_value, "run_pdump_server_tests") == 0)) {
rc = pthread_create(&thread, NULL, &send_pkts, NULL);
if (rc != 0) {
rte_panic("Cannot start send pkts thread: %s\n",
strerror(rc));
}
}
#endif
#endif

Expand Down

0 comments on commit 8cf97af

Please sign in to comment.