This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 70a21e1b3c797f96ed0768f045be7f1f624a415b (commit) via ad1d7b43fd5ed6c94984c4d0279be5ea35ecf420 (commit) via aca1d07eb4ca40ef057e0a8c0738ee2bd45820f7 (commit) from e5dcd6f21ed52d068336a662976fd0e893f639f1 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 70a21e1b3c797f96ed0768f045be7f1f624a415b Author: Petri Savolainen petri.savolainen@nokia.com Date: Fri Jul 5 10:55:30 2019 +0300
linux-gen: sched: use prio_q prefix for prio queue variables
Improve code readability by using prio_q prefix for prio queue related variables.
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index b60ba7368..b814c09cc 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -82,10 +82,10 @@ ODP_STATIC_ASSERT(ODP_THREAD_COUNT_MAX < (64 * 1024), "Max_64k_threads_supported");
/* Mask of queues per priority */ -typedef uint8_t pri_mask_t; +typedef uint8_t prio_q_mask_t;
-ODP_STATIC_ASSERT((8 * sizeof(pri_mask_t)) >= MAX_SPREAD, - "pri_mask_t_is_too_small"); +ODP_STATIC_ASSERT((8 * sizeof(prio_q_mask_t)) >= MAX_SPREAD, + "prio_q_mask_t_is_too_small");
/* Start of named groups in group mask arrays */ #define SCHED_GROUP_NAMED (ODP_SCHED_GROUP_CONTROL + 1) @@ -182,7 +182,7 @@ typedef struct {
uint16_t max_spread; uint32_t ring_mask; - pri_mask_t pri_mask[NUM_PRIO]; + prio_q_mask_t prio_q_mask[NUM_PRIO]; odp_spinlock_t mask_lock; odp_atomic_u32_t grp_epoch; odp_shm_t shm; @@ -202,7 +202,7 @@ typedef struct { /* Scheduler priority queues */ prio_queue_t prio_q[NUM_SCHED_GRPS][NUM_PRIO][MAX_SPREAD];
- uint32_t pri_count[NUM_PRIO][MAX_SPREAD]; + uint32_t prio_q_count[NUM_PRIO][MAX_SPREAD];
odp_thrmask_t mask_all; odp_spinlock_t grp_lock; @@ -576,8 +576,8 @@ static int schedule_create_queue(uint32_t queue_index, odp_spinlock_lock(&sched->mask_lock);
/* update scheduler prio queue usage status */ - sched->pri_mask[prio] |= 1 << spread; - sched->pri_count[prio][spread]++; + sched->prio_q_mask[prio] |= 1 << spread; + sched->prio_q_count[prio][spread]++;
odp_spinlock_unlock(&sched->mask_lock);
@@ -617,10 +617,10 @@ static void schedule_destroy_queue(uint32_t queue_index) odp_spinlock_lock(&sched->mask_lock);
/* Clear mask bit when last queue is removed*/ - sched->pri_count[prio][spread]--; + sched->prio_q_count[prio][spread]--;
- if (sched->pri_count[prio][spread] == 0) - sched->pri_mask[prio] &= (uint8_t)(~(1 << spread)); + if (sched->prio_q_count[prio][spread] == 0) + sched->prio_q_mask[prio] &= (uint8_t)(~(1 << spread));
odp_spinlock_unlock(&sched->mask_lock);
@@ -956,7 +956,7 @@ static inline int do_schedule_grp(odp_queue_t *out_queue, odp_event_t out_ev[], /* Schedule events */ for (prio = 0; prio < NUM_PRIO; prio++) {
- if (sched->pri_mask[prio] == 0) + if (sched->prio_q_mask[prio] == 0) continue;
burst_def = sched->config.burst_default[prio]; @@ -978,7 +978,7 @@ static inline int do_schedule_grp(odp_queue_t *out_queue, odp_event_t out_ev[], id = 0;
/* No queues created for this priority queue */ - if (odp_unlikely((sched->pri_mask[prio] & (1 << id)) + if (odp_unlikely((sched->prio_q_mask[prio] & (1 << id)) == 0)) { i++; id++;
commit ad1d7b43fd5ed6c94984c4d0279be5ea35ecf420 Author: Petri Savolainen petri.savolainen@nokia.com Date: Fri Jul 5 10:41:52 2019 +0300
linux-gen: sched: remove pri_set and pri_clr functions
Improve code readability by removing four small functions that are called only once (merge code into the call site).
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 28d70030c..b60ba7368 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -352,8 +352,9 @@ static int read_config_file(sched_global_t *sched) return 0; }
-static inline uint8_t prio_spread_index(uint32_t index) +static inline uint8_t spread_index(uint32_t index) { + /* thread/queue index to spread index */ return index % sched->config.num_spread; }
@@ -370,15 +371,15 @@ static void sched_local_init(void) sched_local.sync_ctx = NO_SYNC_CONTEXT; sched_local.stash.queue = ODP_QUEUE_INVALID;
- spread = prio_spread_index(sched_local.thr); + spread = spread_index(sched_local.thr); prefer_ratio = sched->config.prefer_ratio;
for (i = 0; i < SPREAD_TBL_SIZE; i++) { sched_local.spread_tbl[i] = spread;
if (num_spread > 1 && (i % prefer_ratio) == 0) { - sched_local.spread_tbl[i] = prio_spread_index(spread + - offset); + sched_local.spread_tbl[i] = spread_index(spread + + offset); offset++; if (offset == num_spread) offset = 1; @@ -559,56 +560,30 @@ static inline int prio_level_from_api(int api_prio) return schedule_max_prio() - api_prio; }
-static void pri_set(int id, int prio) -{ - odp_spinlock_lock(&sched->mask_lock); - sched->pri_mask[prio] |= 1 << id; - sched->pri_count[prio][id]++; - odp_spinlock_unlock(&sched->mask_lock); -} - -static void pri_clr(int id, int prio) -{ - odp_spinlock_lock(&sched->mask_lock); - - /* Clear mask bit when last queue is removed*/ - sched->pri_count[prio][id]--; - - if (sched->pri_count[prio][id] == 0) - sched->pri_mask[prio] &= (uint8_t)(~(1 << id)); - - odp_spinlock_unlock(&sched->mask_lock); -} - -static void pri_set_queue(uint32_t queue_index, int prio) -{ - uint8_t id = prio_spread_index(queue_index); - - return pri_set(id, prio); -} - -static void pri_clr_queue(uint32_t queue_index, int prio) -{ - uint8_t id = prio_spread_index(queue_index); - pri_clr(id, prio); -} - static int schedule_create_queue(uint32_t queue_index, const odp_schedule_param_t *sched_param) { uint32_t ring_size; int i; int prio = prio_level_from_api(sched_param->prio); + uint8_t spread = spread_index(queue_index);
if (_odp_schedule_configured == 0) { ODP_ERR("Scheduler has not been configured\n"); return -1; }
- pri_set_queue(queue_index, prio); + odp_spinlock_lock(&sched->mask_lock); + + /* update scheduler prio queue usage status */ + sched->pri_mask[prio] |= 1 << spread; + sched->pri_count[prio][spread]++; + + odp_spinlock_unlock(&sched->mask_lock); + sched->queue[queue_index].grp = sched_param->group; sched->queue[queue_index].prio = prio; - sched->queue[queue_index].spread = prio_spread_index(queue_index); + sched->queue[queue_index].spread = spread; sched->queue[queue_index].sync = sched_param->sync; sched->queue[queue_index].order_lock_count = sched_param->lock_count; sched->queue[queue_index].poll_pktin = 0; @@ -637,8 +612,18 @@ static inline uint8_t sched_sync_type(uint32_t queue_index) static void schedule_destroy_queue(uint32_t queue_index) { int prio = sched->queue[queue_index].prio; + uint8_t spread = spread_index(queue_index); + + odp_spinlock_lock(&sched->mask_lock); + + /* Clear mask bit when last queue is removed*/ + sched->pri_count[prio][spread]--; + + if (sched->pri_count[prio][spread] == 0) + sched->pri_mask[prio] &= (uint8_t)(~(1 << spread)); + + odp_spinlock_unlock(&sched->mask_lock);
- pri_clr_queue(queue_index, prio); sched->queue[queue_index].grp = 0; sched->queue[queue_index].prio = 0; sched->queue[queue_index].spread = 0;
commit aca1d07eb4ca40ef057e0a8c0738ee2bd45820f7 Author: Petri Savolainen petri.savolainen@nokia.com Date: Fri Jul 5 09:46:56 2019 +0300
linux-gen: sched: rename queue create callback
Rename init_queue to create_queue as this function is called from odp_queue_create().
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index 831afdfa8..88f1ea022 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -35,9 +35,8 @@ typedef void (*schedule_pktio_start_fn_t)(int pktio_index, typedef int (*schedule_thr_add_fn_t)(odp_schedule_group_t group, int thr); typedef int (*schedule_thr_rem_fn_t)(odp_schedule_group_t group, int thr); typedef int (*schedule_num_grps_fn_t)(void); -typedef int (*schedule_init_queue_fn_t)(uint32_t queue_index, - const odp_schedule_param_t *sched_param - ); +typedef int (*schedule_create_queue_fn_t)(uint32_t queue_index, + const odp_schedule_param_t *param); typedef void (*schedule_destroy_queue_fn_t)(uint32_t queue_index); typedef int (*schedule_sched_queue_fn_t)(uint32_t queue_index); typedef int (*schedule_unsched_queue_fn_t)(uint32_t queue_index); @@ -60,7 +59,7 @@ typedef struct schedule_fn_t { schedule_thr_add_fn_t thr_add; schedule_thr_rem_fn_t thr_rem; schedule_num_grps_fn_t num_grps; - schedule_init_queue_fn_t init_queue; + schedule_create_queue_fn_t create_queue; schedule_destroy_queue_fn_t destroy_queue; schedule_sched_queue_fn_t sched_queue; schedule_ord_enq_multi_fn_t ord_enq_multi; diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index 1a3f0a5bc..4ec564d69 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -365,8 +365,8 @@ static odp_queue_t queue_create(const char *name, return ODP_QUEUE_INVALID;
if (type == ODP_QUEUE_TYPE_SCHED) { - if (sched_fn->init_queue(queue->s.index, - &queue->s.param.sched)) { + if (sched_fn->create_queue(queue->s.index, + &queue->s.param.sched)) { queue->s.status = QUEUE_STATUS_FREE; ODP_ERR("schedule queue init failed\n"); return ODP_QUEUE_INVALID; diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index d70258475..28d70030c 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -593,8 +593,8 @@ static void pri_clr_queue(uint32_t queue_index, int prio) pri_clr(id, prio); }
-static int schedule_init_queue(uint32_t queue_index, - const odp_schedule_param_t *sched_param) +static int schedule_create_queue(uint32_t queue_index, + const odp_schedule_param_t *sched_param) { uint32_t ring_size; int i; @@ -1598,7 +1598,7 @@ const schedule_fn_t schedule_basic_fn = { .thr_add = schedule_thr_add, .thr_rem = schedule_thr_rem, .num_grps = schedule_num_grps, - .init_queue = schedule_init_queue, + .create_queue = schedule_create_queue, .destroy_queue = schedule_destroy_queue, .sched_queue = schedule_sched_queue, .ord_enq_multi = schedule_ord_enq_multi, diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index a9e86cc56..df8fee552 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -2033,8 +2033,8 @@ static int thr_rem(odp_schedule_group_t group, int thr) return 0; }
-static int init_queue(uint32_t queue_index, - const odp_schedule_param_t *sched_param) +static int create_queue(uint32_t queue_index, + const odp_schedule_param_t *sched_param) { /* Not used in scalable scheduler. */ (void)queue_index; @@ -2139,7 +2139,7 @@ const schedule_fn_t schedule_scalable_fn = { .thr_add = thr_add, .thr_rem = thr_rem, .num_grps = num_grps, - .init_queue = init_queue, + .create_queue = create_queue, .destroy_queue = destroy_queue, .sched_queue = sched_queue, .ord_enq_multi = ord_enq_multi, diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index 106874552..a47899208 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -376,7 +376,7 @@ static int num_grps(void) return NUM_GROUP - NUM_STATIC_GROUP; }
-static int init_queue(uint32_t qi, const odp_schedule_param_t *sched_param) +static int create_queue(uint32_t qi, const odp_schedule_param_t *sched_param) { sched_group_t *sched_group = &sched_global->sched_group; odp_schedule_group_t group = sched_param->group; @@ -969,7 +969,7 @@ const schedule_fn_t schedule_sp_fn = { .thr_add = thr_add, .thr_rem = thr_rem, .num_grps = num_grps, - .init_queue = init_queue, + .create_queue = create_queue, .destroy_queue = destroy_queue, .sched_queue = sched_queue, .ord_enq_multi = ord_enq_multi,
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/include/odp_schedule_if.h | 7 +- platform/linux-generic/odp_queue_basic.c | 4 +- platform/linux-generic/odp_schedule_basic.c | 87 ++++++++++-------------- platform/linux-generic/odp_schedule_scalable.c | 6 +- platform/linux-generic/odp_schedule_sp.c | 4 +- 5 files changed, 46 insertions(+), 62 deletions(-)
hooks/post-receive