service: use id in probe and get name
authorHarry van Haaren <harry.van.haaren@intel.com>
Mon, 21 Aug 2017 12:58:02 +0000 (13:58 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 15 Sep 2017 11:44:47 +0000 (13:44 +0200)
commit6f62f3cf3ae147efdd2a05dc387f574aa3427d85
tree635fd1ffa0ebe822dde698e191e1f6f552221b99
parent9cdbd44ea94020f1b28b1407b73f2a34bc424a4f
service: use id in probe and get name

This commit adds a macro to easily validate a service ID, and then
lookup the service pointer, or return a user-specified error code.
This macro will be heavily used in the following patches as it will
be ID based instead of pointer-based.

The probe_capability function is reworked to use an integer ID instead
of a pointer. Rework the service_get_name() function is updated to use
IDs. Unit tests are updated to keep things compiling after each commit.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
lib/librte_eal/common/include/rte_service.h
lib/librte_eal/common/rte_service.c
test/test/test_service_cores.c