net/i40e/base: skip further adminq init for VF
diff mbox series

Message ID 20200122035810.154767-1-xiaolong.ye@intel.com
State Accepted, archived
Delegated to: xiaolong ye
Headers show
Series
  • net/i40e/base: skip further adminq init for VF
Related show

Checks

Context Check Description
ci/travis-robot success Travis build: passed
ci/iol-testing success Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Xiaolong Ye Jan. 22, 2020, 3:58 a.m. UTC
Since VF has no need of firmware, we can skip further adminq init which
involves firmware operation, this patch fixes the testpmd segfault issue
when starting with i40e VF.

Fixes: d5e1a149362e ("net/i40e/base: check MAC type")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
---
 drivers/net/i40e/base/i40e_adminq.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Xing, Beilei Jan. 22, 2020, 4:48 a.m. UTC | #1
> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Wednesday, January 22, 2020 11:58 AM
> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>
> Subject: [PATCH] net/i40e/base: skip further adminq init for VF
> 
> Since VF has no need of firmware, we can skip further adminq init which
> involves firmware operation, this patch fixes the testpmd segfault issue when
> starting with i40e VF.
> 
> Fixes: d5e1a149362e ("net/i40e/base: check MAC type")
> 
> Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
> ---
>  drivers/net/i40e/base/i40e_adminq.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/i40e/base/i40e_adminq.c
> b/drivers/net/i40e/base/i40e_adminq.c
> index 221c327d1..bc9ef3c87 100644
> --- a/drivers/net/i40e/base/i40e_adminq.c
> +++ b/drivers/net/i40e/base/i40e_adminq.c
> @@ -673,6 +673,9 @@ enum i40e_status_code i40e_init_adminq(struct
> i40e_hw *hw)
>  	if (ret_code != I40E_SUCCESS)
>  		goto init_adminq_free_asq;
> 
> +	if (i40e_is_vf(hw))
> +		goto init_adminq_exit;
> +
>  	/* There are some cases where the firmware may not be quite ready
>  	 * for AdminQ operations, so we retry the AdminQ setup a few times
>  	 * if we see timeouts in this first AQ call.
> --
> 2.17.1

Acked-by: Beilei Xing <beilei.xing@intel.com>
Xiaolong Ye Jan. 22, 2020, 7:49 a.m. UTC | #2
On 01/22, Xing, Beilei wrote:
>
>
>> -----Original Message-----
>> From: Ye, Xiaolong
>> Sent: Wednesday, January 22, 2020 11:58 AM
>> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
>> Cc: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>
>> Subject: [PATCH] net/i40e/base: skip further adminq init for VF
>> 
>> Since VF has no need of firmware, we can skip further adminq init which
>> involves firmware operation, this patch fixes the testpmd segfault issue when
>> starting with i40e VF.
>> 
>> Fixes: d5e1a149362e ("net/i40e/base: check MAC type")
>> 
>> Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
>> ---
>>  drivers/net/i40e/base/i40e_adminq.c | 3 +++
>>  1 file changed, 3 insertions(+)
>> 
>> diff --git a/drivers/net/i40e/base/i40e_adminq.c
>> b/drivers/net/i40e/base/i40e_adminq.c
>> index 221c327d1..bc9ef3c87 100644
>> --- a/drivers/net/i40e/base/i40e_adminq.c
>> +++ b/drivers/net/i40e/base/i40e_adminq.c
>> @@ -673,6 +673,9 @@ enum i40e_status_code i40e_init_adminq(struct
>> i40e_hw *hw)
>>  	if (ret_code != I40E_SUCCESS)
>>  		goto init_adminq_free_asq;
>> 
>> +	if (i40e_is_vf(hw))
>> +		goto init_adminq_exit;
>> +
>>  	/* There are some cases where the firmware may not be quite ready
>>  	 * for AdminQ operations, so we retry the AdminQ setup a few times
>>  	 * if we see timeouts in this first AQ call.
>> --
>> 2.17.1
>
>Acked-by: Beilei Xing <beilei.xing@intel.com>

Applied to dpdk-next-net-intel, Thanks.
Ferruh Yigit Jan. 23, 2020, 9:07 a.m. UTC | #3
On 1/22/2020 7:49 AM, Ye Xiaolong wrote:
> On 01/22, Xing, Beilei wrote:
>>
>>
>>> -----Original Message-----
>>> From: Ye, Xiaolong
>>> Sent: Wednesday, January 22, 2020 11:58 AM
>>> To: Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
>>> Cc: dev@dpdk.org; Ye, Xiaolong <xiaolong.ye@intel.com>
>>> Subject: [PATCH] net/i40e/base: skip further adminq init for VF
>>>
>>> Since VF has no need of firmware, we can skip further adminq init which
>>> involves firmware operation, this patch fixes the testpmd segfault issue when
>>> starting with i40e VF.
>>>
>>> Fixes: d5e1a149362e ("net/i40e/base: check MAC type")
>>>
>>> Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
>>> ---
>>>  drivers/net/i40e/base/i40e_adminq.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/net/i40e/base/i40e_adminq.c
>>> b/drivers/net/i40e/base/i40e_adminq.c
>>> index 221c327d1..bc9ef3c87 100644
>>> --- a/drivers/net/i40e/base/i40e_adminq.c
>>> +++ b/drivers/net/i40e/base/i40e_adminq.c
>>> @@ -673,6 +673,9 @@ enum i40e_status_code i40e_init_adminq(struct
>>> i40e_hw *hw)
>>>  	if (ret_code != I40E_SUCCESS)
>>>  		goto init_adminq_free_asq;
>>>
>>> +	if (i40e_is_vf(hw))
>>> +		goto init_adminq_exit;
>>> +
>>>  	/* There are some cases where the firmware may not be quite ready
>>>  	 * for AdminQ operations, so we retry the AdminQ setup a few times
>>>  	 * if we see timeouts in this first AQ call.
>>> --
>>> 2.17.1
>>
>> Acked-by: Beilei Xing <beilei.xing@intel.com>
> 
> Applied to dpdk-next-net-intel, Thanks.
> 

Commented new block while merging to next-net, change become:

 +       /* VF has no need of firmware */
 +       if (i40e_is_vf(hw))
 +               goto init_adminq_exit;

Patch
diff mbox series

diff --git a/drivers/net/i40e/base/i40e_adminq.c b/drivers/net/i40e/base/i40e_adminq.c
index 221c327d1..bc9ef3c87 100644
--- a/drivers/net/i40e/base/i40e_adminq.c
+++ b/drivers/net/i40e/base/i40e_adminq.c
@@ -673,6 +673,9 @@  enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
 	if (ret_code != I40E_SUCCESS)
 		goto init_adminq_free_asq;
 
+	if (i40e_is_vf(hw))
+		goto init_adminq_exit;
+
 	/* There are some cases where the firmware may not be quite ready
 	 * for AdminQ operations, so we retry the AdminQ setup a few times
 	 * if we see timeouts in this first AQ call.