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:
Tomasz Zawadzki 2021-07-15 06:14:51 -04:00
parent d6c4f8cf6b
commit 4c5246c97f
2 changed files with 3 additions and 3 deletions

View File

@ -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); \
} \
/**

View File

@ -187,4 +187,4 @@ static struct spdk_governor dpdk_governor = {
.deinit = _deinit,
};
SPDK_GOVERNOR_REGISTER(&dpdk_governor);
SPDK_GOVERNOR_REGISTER(dpdk_governor);