net/bnxt: fix to reset Rx next consumer index

Message ID 20210810060731.30127-1-somnath.kotur@broadcom.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ajit Khaparde
Headers
Series net/bnxt: fix to reset Rx next consumer index |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Somnath Kotur Aug. 10, 2021, 6:07 a.m. UTC
  In bnxt_init_one_rx_ring(), reset this variable internal to the driver
ring to 0, so that there is no mismatch with actual value in HW on
traffic resumption.

Fixes: 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion")
Cc: stable@dpdk.org

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

Comments

Ajit Khaparde Aug. 19, 2021, 4:48 a.m. UTC | #1
On Mon, Aug 9, 2021 at 11:11 PM Somnath Kotur <somnath.kotur@broadcom.com>
wrote:

> In bnxt_init_one_rx_ring(), reset this variable internal to the driver
> ring to 0, so that there is no mismatch with actual value in HW on
> traffic resumption.
>
> Fixes: 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion")
> Cc: stable@dpdk.org
>
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>
Patch applied to dpdk-next-net-brcm for-next-net branch.

---
>  drivers/net/bnxt/bnxt_rxr.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
> index aea71703d1..73fbdd17d1 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -1379,6 +1379,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
>         }
>         PMD_DRV_LOG(DEBUG, "TPA alloc Done!\n");
>
> +       /* Explicitly reset this driver internal tracker on a ring init */
> +       rxr->rx_next_cons = 0;
> +
>         return 0;
>  }
>
> --
> 2.28.0.497.g54e85e7
>
>
  
Ferruh Yigit Aug. 20, 2021, 12:46 p.m. UTC | #2
On 8/10/2021 7:07 AM, Somnath Kotur wrote:
> In bnxt_init_one_rx_ring(), reset this variable internal to the driver
> ring to 0, so that there is no mismatch with actual value in HW on
> traffic resumption.
> 

Hi Somnath,

What is the impact of the patch, what are you fixing?

If the 'rx_next_cons' (next consumer index) is not matching with HW value, what
happens, does the Rx fails completely and unrecoverable? Or does miss one or
more packet?

And when/how this happens, since driver is not new I assume this doesn't happen
in first ring init. Does this happen after uninit and init again? Providing this
information helps clarifying scope of the fix.

Can you please send a new version with updated commit log?

Thanks,
ferruh

> Fixes: 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_rxr.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
> index aea71703d1..73fbdd17d1 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -1379,6 +1379,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
>  	}
>  	PMD_DRV_LOG(DEBUG, "TPA alloc Done!\n");
>  
> +	/* Explicitly reset this driver internal tracker on a ring init */
> +	rxr->rx_next_cons = 0;
> +
>  	return 0;
>  }
>  
>
  
Somnath Kotur Aug. 23, 2021, 6:38 a.m. UTC | #3
Thank you Ferruh, have sent V2 with updated commit log, please see if it
sounds good now?

-Som

On Fri, Aug 20, 2021 at 6:17 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 8/10/2021 7:07 AM, Somnath Kotur wrote:
> > In bnxt_init_one_rx_ring(), reset this variable internal to the driver
> > ring to 0, so that there is no mismatch with actual value in HW on
> > traffic resumption.
> >
>
> Hi Somnath,
>
> What is the impact of the patch, what are you fixing?
>
> If the 'rx_next_cons' (next consumer index) is not matching with HW value,
> what
> happens, does the Rx fails completely and unrecoverable? Or does miss one
> or
> more packet?
>
> And when/how this happens, since driver is not new I assume this doesn't
> happen
> in first ring init. Does this happen after uninit and init again?
> Providing this
> information helps clarifying scope of the fix.
>
> Can you please send a new version with updated commit log?
>
> Thanks,
> ferruh
>
> > Fixes: 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> > Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> > Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> > ---
> >  drivers/net/bnxt/bnxt_rxr.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
> > index aea71703d1..73fbdd17d1 100644
> > --- a/drivers/net/bnxt/bnxt_rxr.c
> > +++ b/drivers/net/bnxt/bnxt_rxr.c
> > @@ -1379,6 +1379,9 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue
> *rxq)
> >       }
> >       PMD_DRV_LOG(DEBUG, "TPA alloc Done!\n");
> >
> > +     /* Explicitly reset this driver internal tracker on a ring init */
> > +     rxr->rx_next_cons = 0;
> > +
> >       return 0;
> >  }
> >
> >
>
>
  

Patch

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index aea71703d1..73fbdd17d1 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -1379,6 +1379,9 @@  int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
 	}
 	PMD_DRV_LOG(DEBUG, "TPA alloc Done!\n");
 
+	/* Explicitly reset this driver internal tracker on a ring init */
+	rxr->rx_next_cons = 0;
+
 	return 0;
 }