OpenDataPlane / odp

The ODP project is an open-source, cross-platform set of application programming interfaces (APIs) for the networking data plane

Home Page:https://opendataplane.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Traffic Manager - Queue management

jmmontenot opened this issue · comments

commented

Hello,

context : I use Traffic manager to create and destroy dynamically queue (on demand), each queue is different and specific for one flow (ip src / ip dst / ... ). rules are defined by sdn controler

Creation queue with TM (odp_tm_queue_create) has been designed to be use statically or by addition :
each queue created is recorded into the TM queue pool (tm_system->queue_num_tbl) at the position defined by an incremented number (tm_system->next_queue_num++)
in my case, depending of the network activity, queues are created and freed dynamically, but in the case of release, the queue position in tm queue pool is non-reusable for a futur creation.
in the end, after multiple creation / release, i have consumed all position of tm queue pool.

Global queue pool (tm_glb->queue_obj.obj) is dynamically managed and do not have this problem : the first queue found with status FREE is used.
Why in this case not reuse the position from global queue pool to create this queue into tm queue pool ? (it's not a best solution, but it will fix this problem)

extract of the code.
odp_traffic_mgnr_internal.h

tm_queue_obj_t     *queue_num_tbl[ODP_TM_MAX_TM_QUEUES];

odp_traffic_mgnr.c

odp_tm_queue_t odp_tm_queue_create(odp_tm_t odp_tm, const odp_tm_queue_params_t *params) {
	...
	for (i = 0; i < ODP_TM_MAX_TM_QUEUES; i++) {
		_odp_int_queue_pool_t  int_queue_pool;

		queue_obj = tm_qobj_from_index(i);

		if (queue_obj->status != TM_STATUS_FREE)
			continue;
			
		...
		
		odp_tm_queue = MAKE_ODP_TM_QUEUE(queue_obj);
		memset(queue_obj, 0, sizeof(tm_queue_obj_t));
		
		...
		
		queue_obj->queue_num = tm_system->next_queue_num++;
		
		...
		
		tm_system->queue_num_tbl[queue_obj->queue_num - 1] = queue_obj;
		
		...
		
		queue_obj->status = TM_STATUS_RESERVED;
		
		...
	}
}```

best regards

This looks like clear bug to me.

Hi @jmmontenot, could you please test if the two latest commits here fix the problem you are seeing?

Hi @jmmontenot, can you check if this branch fixes the problem?

commented

Hi @MatiasElo , ok its now working, num queue not longer exceed MAKE_ODP_TM_QUEUE.

Hi @MatiasElo , ok its now working, num queue not longer exceed MAKE_ODP_TM_QUEUE.

Thanks! If you like, I can tag you in the commit messages. I would need your name and email address.

commented

This doesn't matter, and many thanks for your support 😃