> -----Original Message-----
> From: Ferruh Yigit <ferruh.yi...@amd.com>
> Sent: Friday, November 1, 2024 10:46 AM
> To: Jiawen Wu <jiawe...@trustnetic.com>; dev@dpdk.org
> Subject: Re: [PATCH v2 07/13] net/txgbe: add Tx descriptor error statistics
>
> On 11/1/2024 2:06 AM, Jiawen Wu wrote:
> >>> @@ -4980,6 +4982,7 @@ txgbe_tx_queue_clear_error(void *param)
> >>> if (!txq->resetting)
> >>> continue;
> >>>
> >>> + txq->desc_error++;
> >>>
> >>
> >> Why error value is increased in this function, which resets the Tx queue?
> >> Is the intention to reset the error value here?
> >
> > When there is a desc error to cause Tx ring hang, the interrupt directs to
> > reset of the queue. So we increase the error count in the specific queue
> > reset function. The queue is reset, but the error that led to the resetting
> > is recorded. The error count is only reset at the setup function.
> >
>
> Got it. But this variable counts number of bad packets. Increasing it
> when Tx ring hang too may be confusing as there are two different
> reasons to increase the counter.
I think I should add a comment here:
/* Increase the count of Tx desc error since it causes the queue reset. */
> Btw, .stats_reset() needs to reset this error stat.
I'll add it into .stats_reset() in patch set v3.