Skip to content

Commit

Permalink
core: support odp-thread counts larger than 256
Browse files Browse the repository at this point in the history
Support ODP implementations with ODP_THREAD_COUNT_MAX > 256.
Values larger than 256 will not fit into an 'uint8_t' so the
relevant code has been changed to use 'uint16_t' instead.
  • Loading branch information
cawallen committed Nov 1, 2022
1 parent b9267ad commit 82b2940
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/em_core_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ typedef struct {

struct {
/** From ODP thread ids to logical EM core ids */
uint8_t logic[ODP_THREAD_COUNT_MAX];
uint16_t logic[ODP_THREAD_COUNT_MAX];
/** From logical EM core ids to ODP thread ids */
uint8_t odp_thr[EM_MAX_CORES];
} thr_vs_logic;
Expand All @@ -75,7 +75,7 @@ COMPILE_TIME_ASSERT((sizeof(core_map_t) % ENV_CACHE_LINE_SIZE) == 0,
CORE_MAP_T__SIZE_ERROR);
COMPILE_TIME_ASSERT(EM_MAX_CORES - 1 <= UINT8_MAX,
CORE_MAP_T__TYPE_ERROR1);
COMPILE_TIME_ASSERT(ODP_THREAD_COUNT_MAX - 1 <= UINT8_MAX,
COMPILE_TIME_ASSERT(ODP_THREAD_COUNT_MAX - 1 <= UINT16_MAX,
CORE_MAP_T__TYPE_ERROR2);

/**
Expand Down

0 comments on commit 82b2940

Please sign in to comment.