lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 Nov 2023 10:18:09 -0800
From:   Alex Pakhunov <alexey.pakhunov@...cex.com>
To:     <michael.chan@...adcom.com>
CC:     <alexey.pakhunov@...cex.com>, <linux-kernel@...r.kernel.org>,
        <mchan@...adcom.com>, <netdev@...r.kernel.org>,
        <prashant@...adcom.com>, <siva.kallam@...adcom.com>,
        <vincent.wong2@...cex.com>
Subject: Re: [PATCH 1/2] tg3: Move the [rt]x_dropped counters to tg3_napi

Hi,

> I think here we need to keep these counters accumulate across a reset:
> 
> stats->rx_dropped = old_stats->rx_dropped + rx_dropped;
> stats->tx_dropped = old_stats->tx_dropped + tx_dropped;

Hm, tg3_halt() explicitly resets the HW counters:

```
	if (tp->hw_stats) {
		/* Save the stats across chip resets... */
		tg3_get_nstats(tp, &tp->net_stats_prev);
		tg3_get_estats(tp, &tp->estats_prev);

		/* And make sure the next sample is new data */
		memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats));
	}
```

We sort of doing the same thing with clearing [tr]x_dropped in
tg3_init_rings() but it seems more confusing than helpful. First, why do we
handle different counters differently? Second, tg3_halt() is not always
followed by tg3_init_rings(), so the logic is not consistent.

Instead I think we should just not touch [tr]x_dropped in tg3_init_rings().
The counters will be set to zero when tg3 is allocated in tg3_init_one().
Hardware resets will not change tg3_napi::[tr]x_dropped since they are
purely software counters.

Alex.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ