[dpdk-dev] [PATCH v8] ethdev: add sanity checks in control APIs

Ferruh Yigit ferruh.yigit at intel.com
Tue Apr 20 15:59:21 CEST 2021


On 4/20/2021 11:04 AM, Thomas Monjalon wrote:
> Thanks for the work.
> Few last comments below.
> 
> 17/04/2021 09:39, Min Hu (Connor):
>> @@ -293,6 +303,11 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str)
>>   uint16_t
>>   rte_eth_iterator_next(struct rte_dev_iterator *iter)
>>   {
>> +	if (iter == NULL) {
>> +		RTE_ETHDEV_LOG(ERR, "Cannot iterate next NULL iter\n");
> 
> I would remove "next".
> Cannot iterate NULL iter
> 
>> @@ -2629,6 +2707,13 @@ rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *eth_link)
>>   	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>>   	dev = &rte_eth_devices[port_id];
>>   
>> +	if (eth_link == NULL) {
>> +		RTE_ETHDEV_LOG(ERR,
>> +			"Cannot get nowait ethdev port %u for NULL link\n",
>> +			port_id);
> 
> "nowait ethdev" is not correct.
> I think you can just remove "nowait".
> 
>> +	if (fw_version == NULL) {
>> +		RTE_ETHDEV_LOG(ERR,
>> +			"Cannot get ethdev port %u fw version for NULL param\n",
> [...]
>> +	if (fw_size == 0) {
>> +		RTE_ETHDEV_LOG(ERR,
>> +			"Cannot get ethdev port %u fw version with zero size\n",
>> +			port_id);
> 
> s/fw/FW/
> 
>> +		RTE_ETHDEV_LOG(ERR,
>> +			"Cannot update ethdev port %u rss reta to NULL\n",
>> +		RTE_ETHDEV_LOG(ERR,
>> +			"Cannot update ethdev port %u rss reta with zero size\n",
> 
> s/rss reta/RSS RETA/
> 
>> +		RTE_ETHDEV_LOG(ERR,
>> +			"Cannot update ethdev port %u rss hash to NULL\n",
> 
> s/rss/RSS/
> 
> 
> 

Hi Thomas, Connor,

The issues seems only syntax issues, I can fix them so that we can get the patch 
for -rc1, I will send a new version soon.


More information about the dev mailing list