diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2019-09-19 20:38:44 +0000 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2019-10-03 08:38:29 +0000 |
commit | 4ce47210e9f6c2186bb96bf5761168906b94d39a (patch) | |
tree | 363aa5228665a838092ca6b8b510cec0f6be97b2 /src/plugins/hs_apps/sapi/vpp_echo_common.c | |
parent | 4767cf24f4b2d206de61f10ef46cf88356557bc5 (diff) |
hsa: refactor vpp_echo failure handling
- Return unique value for each failure condition
- Last failure value returned
- All failures included in description
- Output failure value and description
Type: test
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Change-Id: I72d5e7f660ad4765c468874421622607af6ae3d1
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
(cherry picked from commit 0e402a98b20fbb7c5b715abd038c244c539bad36)
Diffstat (limited to 'src/plugins/hs_apps/sapi/vpp_echo_common.c')
-rw-r--r-- | src/plugins/hs_apps/sapi/vpp_echo_common.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.c b/src/plugins/hs_apps/sapi/vpp_echo_common.c index deeb3b14d93..d6ee644ea6b 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_common.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_common.c @@ -18,6 +18,12 @@ #include <hs_apps/sapi/vpp_echo_common.h> +char *echo_fail_code_str[] = { +#define _(sym, str) str, + foreach_echo_fail_code +#undef _ +}; + /* * * Format functions @@ -481,7 +487,8 @@ echo_get_session_from_handle (echo_main_t * em, u64 handle) clib_spinlock_unlock (&em->sid_vpp_handles_lock); if (!p) { - ECHO_FAIL ("unknown handle 0x%lx", handle); + ECHO_FAIL (ECHO_FAIL_GET_SESSION_FROM_HANDLE, + "unknown handle 0x%lx", handle); return 0; } return pool_elt_at_index (em->sessions, p[0]); |