All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	michael.chan@broadcom.com, leon@kernel.org,
	ecree.xilinx@gmail.com, habetsm.xilinx@gmail.com,
	f.fainelli@gmail.com, andrew@lunn.ch, mkubecek@suse.cz,
	ariela@nvidia.com, corbet@lwn.net, linux-doc@vger.kernel.org
Subject: Re: [PATCH net-next 3/6] ethtool: add FEC statistics
Date: Thu, 15 Apr 2021 15:33:21 -0700	[thread overview]
Message-ID: <1652e284aea7ff3240d28a22d0dd09c50aed405a.camel@kernel.org> (raw)
In-Reply-To: <20210415082144.260cf3ce@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

On Thu, 2021-04-15 at 08:21 -0700, Jakub Kicinski wrote:
> On Wed, 14 Apr 2021 23:25:43 -0700 Saeed Mahameed wrote:
> > On Tue, 2021-04-13 at 20:44 -0700, Jakub Kicinski wrote:
> > > ethtool_link_ksettings *);
> > > +       void    (*get_fec_stats)(struct net_device *dev,
> > > +                                struct ethtool_fec_stats
> > > *fec_stats);  
> > 
> > why void ? some drivers need to access the FW and it could be an
> > old
> > FW/device where the fec stats are not supported.
> 
> When stats are not supported just returning is fine. Stats are
> initialized to -1, core will not dump them into the netlink message 
> if driver didn't assign anything.
> 
> > and sometimes e.g. in mlx5 case FW can fail for FW related
> > businesses
> > :)..
> 
> Can do. I was wondering if the entity reading the stats (from user
> space) can do anything useful with the error, and didn't really come 
> up with anything other than printing an error. Which the kernel can 
> do as well. OTOH if there are multiple stats to read and one of them
> fails its probably better to return partial results than fail 
> the entire op. Therefore I went for no error - if something fails - 
> the stats will be missing.
> 
> Does that make any sense? Or do you think errors are rare enough that
> it's okay if they are fatal? (with the caveat that -EOPNOTSUPP should
> be ignored).

Agreed, Thanks for the explanation
but you still need to handle the error internally in the driver,
otherwise the command returns garbage or 0 if you didn't check return
status. 


  reply	other threads:[~2021-04-15 22:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  3:44 [PATCH net-next 0/6] ethtool: add standard FEC statistics Jakub Kicinski
2021-04-14  3:44 ` [PATCH net-next 1/6] ethtool: move ethtool_stats_init Jakub Kicinski
2021-04-14  3:44 ` [PATCH net-next 2/6] ethtool: fec_prepare_data() - jump to error handling Jakub Kicinski
2021-04-14  3:44 ` [PATCH net-next 3/6] ethtool: add FEC statistics Jakub Kicinski
2021-04-15  6:25   ` Saeed Mahameed
2021-04-15 15:21     ` Jakub Kicinski
2021-04-15 22:33       ` Saeed Mahameed [this message]
2021-04-14  3:44 ` [PATCH net-next 4/6] bnxt: implement ethtool::get_fec_stats Jakub Kicinski
2021-04-15 20:58   ` Michael Chan
2021-04-14  3:44 ` [PATCH net-next 5/6] sfc: ef10: " Jakub Kicinski
2021-04-19 12:39   ` Edward Cree
2021-04-14  3:44 ` [PATCH net-next 6/6] mlx5: " Jakub Kicinski
2021-04-15  6:37   ` Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1652e284aea7ff3240d28a22d0dd09c50aed405a.camel@kernel.org \
    --to=saeed@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=ariela@nvidia.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.