[dpdk-dev] [PATCH 2/2] dpaa2: register dpaa2 mempool ops as active mempool

Hemant Agrawal hemant.agrawal at nxp.com
Mon Dec 18 10:25:57 CET 2017


On 12/18/2017 2:27 PM, Jerin Jacob wrote:

...<snip>

>> diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
>> index 334e1f5..5a6f292 100644
>> --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
>> +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
>> @@ -64,6 +64,7 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused,
>>  {
>>  	struct dpaa2_dpbp_dev *dpbp_node;
>>  	int ret;
>> +	static int active_pool;
>>
>>  	/* Allocate DPAA2 dpbp handle */
>>  	dpbp_node = rte_malloc(NULL, sizeof(struct dpaa2_dpbp_dev), 0);
>> @@ -100,6 +101,11 @@ dpaa2_create_dpbp_device(int vdev_fd __rte_unused,
>>
>>  	RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpbp.%d]\n", dpbp_id);
>>
>> +	if (!active_pool) {
>
> I think, this global variable can be avoided. Why it needs to be under
> active_pool?
>
This code register the active pool when it physically detect a instance 
of hw mempool on bus. There can be more than one objects of dpaa2 
mempool. Yes! we can do avoid it as the current registration code 
proposal will not allow re-registration.


More information about the dev mailing list