[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20161015.111814.1130714147077640809.davem@davemloft.net>
Date: Sat, 15 Oct 2016 11:18:14 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: vlad@...rklevich.net
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] ethtool: Zero memory allocated for statistics
From: Vlad Tsyrklevich <vlad@...rklevich.net>
Date: Sat, 15 Oct 2016 15:11:08 +0000
> I agree that we should propagate those errors and I'll prepare a new change
> to do so for phy_driver.get_stats(), ethtool_ops.self_test(), and
> ethtool_ops.get_ethtool_stats(). However, I still think this change should
> be adopted. 3/5 of the cases here are reachable without any special
> capabilities and programming defensively at the ethtool interface can
> eliminate an entire class of potential driver bugs instead of fixing them
> one by one. For example, get_eeprom() propagates errors but with a brief
> grep I found that qlcnic_get_eeprom() will return 0 incorrectly even though
> it read nothing for some NICs. Deeper bugs are undoubtedly laying around.
I'm all for defensive program when practical.
But statistics gathering is highly performance sensitive for many
important use cases, so I'm not ready to add a whole bzero() here
unless absolutely, positively, necessary.
Thanks.
Powered by blists - more mailing lists