char pool_name[25];
int rc;
+ cache_sz /= rte_lcore_count();
/* Create chunk pool. */
if (rcfg->flags & RTE_EVENT_TIMER_ADAPTER_F_SP_PUT) {
mp_flags = MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET;
cache_sz = RTE_MEMPOOL_CACHE_MAX_SIZE;
if (!tim_ring->disable_npa) {
- /* NPA need not have cache as free is not visible to SW */
tim_ring->chunk_pool = rte_mempool_create_empty(pool_name,
tim_ring->nb_chunks, tim_ring->chunk_sz,
- 0, 0, rte_socket_id(), mp_flags);
+ cache_sz, 0, rte_socket_id(), mp_flags);
if (tim_ring->chunk_pool == NULL) {
otx2_err("Unable to create chunkpool.");
struct otx2_tim_evdev *dev = opaque;
struct otx2_tim_ctl ring_ctl = {0};
char *tok = strtok(value, "-");
+ struct otx2_tim_ctl *old_ptr;
uint16_t *val;
val = (uint16_t *)&ring_ctl;
}
dev->ring_ctl_cnt++;
+ old_ptr = dev->ring_ctl_data;
dev->ring_ctl_data = rte_realloc(dev->ring_ctl_data,
- sizeof(struct otx2_tim_ctl), 0);
+ sizeof(struct otx2_tim_ctl) *
+ dev->ring_ctl_cnt, 0);
+ if (dev->ring_ctl_data == NULL) {
+ dev->ring_ctl_data = old_ptr;
+ dev->ring_ctl_cnt--;
+ return;
+ }
+
dev->ring_ctl_data[dev->ring_ctl_cnt - 1] = ring_ctl;
}
else if (*s == ']')
end = s;
- if (start < end && *start) {
+ if (start && start < end) {
*end = 0;
tim_parse_ring_param(start + 1, opaque);
start = end;
&dev->min_ring_cnt);
rte_kvargs_process(kvlist, OTX2_TIM_RING_CTL,
&tim_parse_kvargs_dict, &dev);
+
+ rte_kvargs_free(kvlist);
}
void