[2/6] net/bnxt: fix to check for NULL completion ring doorbell in int_handler

Message ID 20190608192208.77607-3-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [1/6] net/bnxt: add code to redirect tunnel packets |

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Ajit Khaparde June 8, 2019, 7:22 p.m. UTC
  From: Somnath Kotur <somnath.kotur@broadcom.com>

It is observed that sometimes during init, the bnxt_int_handler() gets
invoked while the cpr->cp_db.doorbell is not yet initialized. Check for
the same and return.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit June 12, 2019, 2:44 p.m. UTC | #1
On 6/8/2019 8:22 PM, Ajit Khaparde wrote:
> From: Somnath Kotur <somnath.kotur@broadcom.com>
> 
> It is observed that sometimes during init, the bnxt_int_handler() gets
> invoked while the cpr->cp_db.doorbell is not yet initialized. Check for
> the same and return.
> 
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_irq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
> index 918f3dcf4..e1b9a2b04 100644
> --- a/drivers/net/bnxt/bnxt_irq.c
> +++ b/drivers/net/bnxt/bnxt_irq.c
> @@ -31,7 +31,7 @@ static void bnxt_int_handler(void *param)
>  
>  	raw_cons = cpr->cp_raw_cons;
>  	while (1) {
> -		if (!cpr || !cpr->cp_ring_struct)
> +		if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.cp_doorbell)

This conflicts with patch from Lance Richardson, which is already merged to
next-net, and renames 'cp_doorbell' to 'doorbell'

Can you please send new version of the patchset rebasing latest next-net?
  
Ferruh Yigit June 12, 2019, 2:49 p.m. UTC | #2
On 6/12/2019 3:44 PM, Ferruh Yigit wrote:
> On 6/8/2019 8:22 PM, Ajit Khaparde wrote:
>> From: Somnath Kotur <somnath.kotur@broadcom.com>
>>
>> It is observed that sometimes during init, the bnxt_int_handler() gets
>> invoked while the cpr->cp_db.doorbell is not yet initialized. Check for
>> the same and return.
>>
>> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
>> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>> ---
>>  drivers/net/bnxt/bnxt_irq.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
>> index 918f3dcf4..e1b9a2b04 100644
>> --- a/drivers/net/bnxt/bnxt_irq.c
>> +++ b/drivers/net/bnxt/bnxt_irq.c
>> @@ -31,7 +31,7 @@ static void bnxt_int_handler(void *param)
>>  
>>  	raw_cons = cpr->cp_raw_cons;
>>  	while (1) {
>> -		if (!cpr || !cpr->cp_ring_struct)
>> +		if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.cp_doorbell)
> 
> This conflicts with patch from Lance Richardson, which is already merged to
> next-net, and renames 'cp_doorbell' to 'doorbell'
> 
> Can you please send new version of the patchset rebasing latest next-net?
> 

This looks simple enough to resolve,
another issue is s/ETHER_MIN_MTU/RTE_ETHER_MIN_MTU, also straightforward
Let me resolve myself instead of sending new version
  

Patch

diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 918f3dcf4..e1b9a2b04 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -31,7 +31,7 @@  static void bnxt_int_handler(void *param)
 
 	raw_cons = cpr->cp_raw_cons;
 	while (1) {
-		if (!cpr || !cpr->cp_ring_struct)
+		if (!cpr || !cpr->cp_ring_struct || !cpr->cp_db.cp_doorbell)
 			return;
 
 		cons = RING_CMP(cpr->cp_ring_struct, raw_cons);