On Aug 22 01:59, Francois Romieu wrote:
> Corinna Vinschen <vinsc...@redhat.com> :
> > On Aug 21 21:39, Francois Romieu wrote:
> [...]
> > > The code should propagate failure when both rtl8169_reset_counters and
> > > rtl8169_update_counters fail.
> > 
> > This one I don't understand.  Neither failing to reset the counters nor
> > failing to update the counters is fatal for the driver.  So far the
> > (unchanged) rtl8169_update_counters doesn't even print a log message,
> 
> I wouldn't overestimate the value of log messages vs real status return.
> Users can be quite unhappy with default settings that spam their logs
> (it isn't a problem in open(), it's marginaly murphy plausible from
> a periodic get_stats context).

That won't happen with the current patch because only
rtl8169_reset_counters would print a log message, it's only called from
open, and open occurs rather seldom.  Atop of that the code only tries
to reset counters on HW supporting it, and only if resetting on the HW
fails, there will be a log message at all.  There's no reasonable chance
that failing to reset the counters will lead to log flooding.

> The driver can't propagate errors from the current get_stats context
> where rtl8169_update_counters is used. However it can be done in
> open().
> 
> > while a failing reset in rtl8169_reset_counters now does.
> > 
> > Why is that not sufficent?
> 
> Because of the same reason(s) why this patch wants to improve things.
> 
> It isn't a showstopper.

I'm not trying to avoid work, I'm trying to understand.

As far as I see it failing to reset the counters has no impact on the
viability of the code.  It's still working with offsets and if the
offset is 0 or non-0, the user space won't see the difference in the
values returned by @get_stats64.  Successful resetting the counters is
just a bonus.

Considering that failing rtl8169_reset_counters or failing
rtl8169_update_counters has no negative impact on open at all, the
problem I have here is:

What do you do with a return value from either one of these functions?

rtl_open () {
  [...]

  if (!rtl8169_reset_counters (dev)) {
    /* ??? */
  }

  if (!rtl8169_update_counters (dev)) {
    /* ??? */
  }

  [...]
}


Thanks,
Corinna

Attachment: pgpV15gksNm_k.pgp
Description: PGP signature

Reply via email to