* Re: [PATCH v2 1/3] net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats [not found] ` <20221129103801.498149-2-d-tatianin@yandex-team.ru> @ 2022-11-30 0:20 ` Andrew Lunn 0 siblings, 0 replies; 5+ messages in thread From: Andrew Lunn @ 2022-11-30 0:20 UTC (permalink / raw) To: Daniil Tatianin; +Cc: netdev, Michal Kubecek, yc-core, lvc-project On Tue, Nov 29, 2022 at 01:37:59PM +0300, Daniil Tatianin wrote: > It's not very useful to copy back an empty ethtool_stats struct and > return 0 if we didn't actually have any stats. This also allows for > further simplification of this function in the future commits. > > Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20221129103801.498149-3-d-tatianin@yandex-team.ru>]
* Re: [PATCH v2 2/3] net/ethtool/ioctl: remove if n_stats checks from ethtool_get_phy_stats [not found] ` <20221129103801.498149-3-d-tatianin@yandex-team.ru> @ 2022-11-30 0:21 ` Andrew Lunn 0 siblings, 0 replies; 5+ messages in thread From: Andrew Lunn @ 2022-11-30 0:21 UTC (permalink / raw) To: Daniil Tatianin; +Cc: netdev, Michal Kubecek, yc-core, lvc-project On Tue, Nov 29, 2022 at 01:38:00PM +0300, Daniil Tatianin wrote: > Now that we always early return if we don't have any stats we can remove > these checks as they're no longer necessary. > > Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20221129103801.498149-4-d-tatianin@yandex-team.ru>]
* Re: [PATCH v2 3/3] net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers [not found] ` <20221129103801.498149-4-d-tatianin@yandex-team.ru> @ 2022-11-30 0:25 ` Andrew Lunn 2022-11-30 2:39 ` Jakub Kicinski 0 siblings, 1 reply; 5+ messages in thread From: Andrew Lunn @ 2022-11-30 0:25 UTC (permalink / raw) To: Daniil Tatianin; +Cc: netdev, Michal Kubecek, yc-core, lvc-project On Tue, Nov 29, 2022 at 01:38:01PM +0300, Daniil Tatianin wrote: > So that it's easier to follow and make sense of the branching and > various conditions. > > Stats retrieval has been split into two separate functions > ethtool_get_phy_stats_phydev & ethtool_get_phy_stats_ethtool. > The former attempts to retrieve the stats using phydev & phy_ops, while > the latter uses ethtool_ops. > > Actual n_stats validation & array allocation has been moved into a new > ethtool_vzalloc_stats_array helper. > > This also fixes a potential NULL dereference of > ops->get_ethtool_phy_stats where it was getting called in an else branch > unconditionally without making sure it was actually present. > > Found by Linux Verification Center (linuxtesting.org) with the SVACE > static analysis tool. > > Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 3/3] net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers 2022-11-30 0:25 ` [PATCH v2 3/3] net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers Andrew Lunn @ 2022-11-30 2:39 ` Jakub Kicinski 2022-11-30 13:51 ` Andrew Lunn 0 siblings, 1 reply; 5+ messages in thread From: Jakub Kicinski @ 2022-11-30 2:39 UTC (permalink / raw) To: Andrew Lunn; +Cc: Daniil Tatianin, netdev, Michal Kubecek, yc-core, lvc-project On Wed, 30 Nov 2022 01:25:06 +0100 Andrew Lunn wrote: > On Tue, Nov 29, 2022 at 01:38:01PM +0300, Daniil Tatianin wrote: > > So that it's easier to follow and make sense of the branching and > > various conditions. > > > > Stats retrieval has been split into two separate functions > > ethtool_get_phy_stats_phydev & ethtool_get_phy_stats_ethtool. > > The former attempts to retrieve the stats using phydev & phy_ops, while > > the latter uses ethtool_ops. > > > > Actual n_stats validation & array allocation has been moved into a new > > ethtool_vzalloc_stats_array helper. > > > > This also fixes a potential NULL dereference of > > ops->get_ethtool_phy_stats where it was getting called in an else branch > > unconditionally without making sure it was actually present. > > > > Found by Linux Verification Center (linuxtesting.org) with the SVACE > > static analysis tool. > > > > Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru> > > Reviewed-by: Andrew Lunn <andrew@lunn.ch> FWIW the patches did not hit the list, once again :/ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 3/3] net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers 2022-11-30 2:39 ` Jakub Kicinski @ 2022-11-30 13:51 ` Andrew Lunn 0 siblings, 0 replies; 5+ messages in thread From: Andrew Lunn @ 2022-11-30 13:51 UTC (permalink / raw) To: Jakub Kicinski Cc: Daniil Tatianin, netdev, Michal Kubecek, yc-core, lvc-project On Tue, Nov 29, 2022 at 06:39:41PM -0800, Jakub Kicinski wrote: > On Wed, 30 Nov 2022 01:25:06 +0100 Andrew Lunn wrote: > > On Tue, Nov 29, 2022 at 01:38:01PM +0300, Daniil Tatianin wrote: > > > So that it's easier to follow and make sense of the branching and > > > various conditions. > > > > > > Stats retrieval has been split into two separate functions > > > ethtool_get_phy_stats_phydev & ethtool_get_phy_stats_ethtool. > > > The former attempts to retrieve the stats using phydev & phy_ops, while > > > the latter uses ethtool_ops. > > > > > > Actual n_stats validation & array allocation has been moved into a new > > > ethtool_vzalloc_stats_array helper. > > > > > > This also fixes a potential NULL dereference of > > > ops->get_ethtool_phy_stats where it was getting called in an else branch > > > unconditionally without making sure it was actually present. > > > > > > Found by Linux Verification Center (linuxtesting.org) with the SVACE > > > static analysis tool. > > > > > > Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru> > > > > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > > FWIW the patches did not hit the list, once again :/ Daniil, how are you sending the patches? git send-email? You might need to contact postmaster@vger.kernel.org and ask if they have logs records of why it is discarding your emails. Andrew ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-11-30 14:36 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20221129103801.498149-1-d-tatianin@yandex-team.ru> [not found] ` <20221129103801.498149-2-d-tatianin@yandex-team.ru> 2022-11-30 0:20 ` [PATCH v2 1/3] net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats Andrew Lunn [not found] ` <20221129103801.498149-3-d-tatianin@yandex-team.ru> 2022-11-30 0:21 ` [PATCH v2 2/3] net/ethtool/ioctl: remove if n_stats checks from ethtool_get_phy_stats Andrew Lunn [not found] ` <20221129103801.498149-4-d-tatianin@yandex-team.ru> 2022-11-30 0:25 ` [PATCH v2 3/3] net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers Andrew Lunn 2022-11-30 2:39 ` Jakub Kicinski 2022-11-30 13:51 ` Andrew Lunn
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.