> -----Original Message----- > From: Wei Fang <wei.fang@xxxxxxx> > Sent: Friday, February 21, 2025 3:42 AM > To: Vladimir Oltean <vladimir.oltean@xxxxxxx> > Cc: Claudiu Manoil <claudiu.manoil@xxxxxxx>; Clark Wang > <xiaoning.wang@xxxxxxx>; andrew+netdev@xxxxxxx; > davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx; > pabeni@xxxxxxxxxx; Ioana Ciornei <ioana.ciornei@xxxxxxx>; Y.B. Lu > <yangbo.lu@xxxxxxx>; michal.swiatkowski@xxxxxxxxxxxxxxx; > netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; imx@xxxxxxxxxxxxxxx; > stable@xxxxxxxxxxxxxxx > Subject: RE: [PATCH v2 net 2/9] net: enetc: correct the tx_swbd statistics > > > I'm not sure "correct the statistics" is the best way to describe this > > change. Maybe "keep track of correct TXBD count in > > enetc_map_tx_tso_buffs()"? > > Hi Vladimir, > > Inspired by Michal, I think we don't need to keep the count variable, because > we already have index "i", we just need to record the value of the initial i at the > beginning. So I plan to do this optimization on the net-next tree in the future. > So I don't think it is necessary to modify enetc_map_tx_tso_hdr(). > And what if 'i' wraps around at least one time and becomes greater than the initial 'i'? Instead of 'count' you would have to record the number of wraps. Even if not possible now in specific cases, there should be no limitation on whether 'i' can wrap around in the loop or not (i.e. maybe some users want to try very small Tx rings etc.)