[dpdk-dev] [PATCH] net/tap: set queue started and stopped

Wiles, Keith keith.wiles at intel.com
Tue Jul 10 00:00:12 CEST 2018



> On Jul 9, 2018, at 4:51 PM, Eads, Gage <gage.eads at intel.com> wrote:
> 
> <snip>
> 
>>> 
>>> +static int
>>> +tap_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
>>> +{
>>> +	dev->data->rx_queue_state[rx_queue_id] =
>> RTE_ETH_QUEUE_STATE_STARTED;
>> 
>> We need to verify the rx_queue_id is valid before setting the state.
>> 
>> if (rx_queue_id < dev->data>nb_rx_queues)
>> 	dev->data->rx_queue_state[rx_queue_id] =
>> RTE_ETH_QUEUE_STATE_STARTED;
>> else
>> 	return -1;
>> 
>> This needs to be done for each of these routines.
>> 
> 
> The ethdev layer function (rte_eth_dev_{rx, tx}_queue_{start, stop}) already does the queue ID bounds check -- do you prefer to duplicate it here?

I looked in ixgb driver and it was checking I then assumed needed it. I should check in the ethdev layer. We do not need to duplicate more checks.

Thanks for spotting that one.

> 
> Thanks,
> Gage

Regards,
Keith



More information about the dev mailing list