[dpdk-dev] [PATCH] lib/cryptodev: fix driver name comparison

Akhil Goyal akhil.goyal at nxp.com
Thu Feb 28 11:20:16 CET 2019



On 2/28/2019 2:57 PM, Anoob Joseph wrote:
> Hi Akhil,
>
> Please see inline.
>
> Thanks,
> Anoob
>
>> -----Original Message-----
>> From: Akhil Goyal <akhil.goyal at nxp.com>
>> Sent: Thursday, February 28, 2019 2:22 PM
>> To: Anoob Joseph <anoobj at marvell.com>; Trahe, Fiona
>> <fiona.trahe at intel.com>; Doherty, Declan <declan.doherty at intel.com>; De
>> Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>; Yigit, Ferruh
>> <ferruh.yigit at intel.com>; Thomas Monjalon <thomas at monjalon.net>
>> Cc: Jerin Jacob Kollanukkaran <jerinj at marvell.com>; Narayana Prasad Raju
>> Athreya <pathreya at marvell.com>; dev at dpdk.org; Ankur Dwivedi
>> <adwivedi at marvell.com>
>> Subject: Re: [dpdk-dev] [PATCH] lib/cryptodev: fix driver name comparison
>>
>> Hi Anoob,
>>
>> On 2/28/2019 12:18 PM, Anoob Joseph wrote:
>>> Hi Akhil, Declan, Pablo,
>>>
>>> Can you review this patch and share your thoughts?
>>>
>>> Thanks,
>>> Anoob
>>>
>>>> -----Original Message-----
>>>> From: Trahe, Fiona <fiona.trahe at intel.com>
>>>> Sent: Monday, February 25, 2019 5:22 PM
>>>> To: Anoob Joseph <anoobj at marvell.com>; Akhil Goyal
>>>> <akhil.goyal at nxp.com>; Doherty, Declan <declan.doherty at intel.com>;
>> De
>>>> Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>; Yigit, Ferruh
>>>> <ferruh.yigit at intel.com>; Thomas Monjalon <thomas at monjalon.net>
>>>> Cc: Jerin Jacob Kollanukkaran <jerinj at marvell.com>; Narayana Prasad
>>>> Raju Athreya <pathreya at marvell.com>; dev at dpdk.org; Ankur Dwivedi
>>>> <adwivedi at marvell.com>
>>>> Subject: RE: [PATCH] lib/cryptodev: fix driver name comparison
>>>>
>>>> Hi Anoob
>>>>
>>>>> -----Original Message-----
>>>>> From: Anoob Joseph [mailto:anoobj at marvell.com]
>>>>> Sent: Saturday, February 23, 2019 6:12 AM
>>>>> To: Trahe, Fiona <fiona.trahe at intel.com>; Akhil Goyal
>>>>> <akhil.goyal at nxp.com>; Doherty, Declan <declan.doherty at intel.com>;
>>>>> De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>; Yigit,
>>>>> Ferruh <ferruh.yigit at intel.com>; Thomas Monjalon
>>>>> <thomas at monjalon.net>
>>>>> Cc: Jerin Jacob Kollanukkaran <jerinj at marvell.com>; Narayana Prasad
>>>>> Raju Athreya <pathreya at marvell.com>; dev at dpdk.org; Ankur Dwivedi
>>>>> <adwivedi at marvell.com>
>>>>> Subject: RE: [PATCH] lib/cryptodev: fix driver name comparison
>>>>>
>>>>> Hi Fiona,
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Trahe, Fiona <fiona.trahe at intel.com>
>>>>>> Sent: Friday, February 22, 2019 9:09 PM
>>>>>> To: Anoob Joseph <anoobj at marvell.com>; Akhil Goyal
>>>>>> <akhil.goyal at nxp.com>; Doherty, Declan
>> <declan.doherty at intel.com>;
>>>>>> De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>
>>>>>> Cc: Jerin Jacob Kollanukkaran <jerinj at marvell.com>; Narayana Prasad
>>>>>> Raju Athreya <pathreya at marvell.com>; dev at dpdk.org; Ankur Dwivedi
>>>>>> <adwivedi at marvell.com>; Trahe, Fiona <fiona.trahe at intel.com>
>>>>>> Subject: RE: [PATCH] lib/cryptodev: fix driver name comparison
>>>>>>
>>>>>> Hi Anoob,
>>>>>>
>>>>>>>>>> @@ -542,8 +543,8 @@ rte_cryptodev_get_dev_id(const char
>>>> *name)
>>>>>>>>>>    		return -1;
>>>>>>>>>>
>>>>>>>>>>    	for (i = 0; i < cryptodev_globals.nb_devs; i++)
>>>>>>>>>> -		if ((strcmp(cryptodev_globals.devs[i].data->name,
>>>> name)
>>>>>>>>>> -				== 0) &&
>>>>>>>>>> +		if ((strncmp(cryptodev_globals.devs[i].data->name,
>>>>>> name,
>>>>>>>>>> +				RTE_CRYPTODEV_NAME_MAX_LEN)
>> consider using "strlen(name) + 1" instead of
>> RTE_CRYPTODEV_NAME_MAX_LEN.
>> This will not cause any ABI breakage in my opinion and and will check till we
>> get a null terminated string in both the strings.
>> What say?
> [Anoob] In that  case, I'll restrict the patch to two places. Wherever strlen(name) is used, I'll make it strlen(name)+1. I won't touch strcmp ones as that would work as is. Shall I prepare a v2?
I think it should be fine.

Fiona,
Any comments?

-Akhil


More information about the dev mailing list