lib/event: add governor structure name in SPDK_GOVERNOR_REGISTER macro
Registering multiple governors would fail due to them having the same name. Only saved by the fact that right now, there is only one governor registered in this fashion. Fix it by adding name of the governor structure passed to the function name. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: Ic7a206da2c8f5dc1e72e41629bccf989c030f182 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8792 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@gmail.com>
This commit is contained in:
parent
d6c4f8cf6b
commit
4c5246c97f
@ -220,9 +220,9 @@ struct spdk_governor *_spdk_governor_get(void);
|
||||
* Macro used to register new cores governor.
|
||||
*/
|
||||
#define SPDK_GOVERNOR_REGISTER(governor) \
|
||||
static void __attribute__((constructor)) _spdk_governor_register_##name(void) \
|
||||
static void __attribute__((constructor)) _spdk_governor_register_ ## governor(void) \
|
||||
{ \
|
||||
_spdk_governor_list_add(governor); \
|
||||
_spdk_governor_list_add(&governor); \
|
||||
} \
|
||||
|
||||
/**
|
||||
|
@ -187,4 +187,4 @@ static struct spdk_governor dpdk_governor = {
|
||||
.deinit = _deinit,
|
||||
};
|
||||
|
||||
SPDK_GOVERNOR_REGISTER(&dpdk_governor);
|
||||
SPDK_GOVERNOR_REGISTER(dpdk_governor);
|
||||
|
Loading…
Reference in New Issue
Block a user