Re: [PATCH v4 net-next 08/18] net: make dev_get_stats return void
From: Eric Dumazet <edumazet@google.com>
Date: 2021-01-08 10:15:45
On Fri, Jan 8, 2021 at 1:20 AM Vladimir Oltean [off-list ref] wrote:
From: Vladimir Oltean <vladimir.oltean@nxp.com>
After commit 28172739f0a2 ("net: fix 64 bit counters on 32 bit arches"),
dev_get_stats got an additional argument for storage of statistics. At
this point, dev_get_stats could return either the passed "storage"
argument, or the output of .ndo_get_stats64.
Then commit caf586e5f23c ("net: add a core netdev->rx_dropped counter")
came, and the output of .ndo_get_stats64 (still returning a pointer to
struct rtnl_link_stats64) started being ignored.
Then came commit bc1f44709cf2 ("net: make ndo_get_stats64 a void
function") which made .ndo_get_stats64 stop returning anything.
So now, dev_get_stats always reports the "storage" pointer received as
argument. This is useless. Some drivers are dealing with unnecessary
complexity due to this, so refactor them to ignore the return value
completely.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---This seems like a lot of code churn. Ultimately we need this function to return an error code, so why keep this patch with a void return ? Please squash your patches a bit, to avoid having 18 patches to review. Additionally I would suggest a __must_check attribute on dev_get_stats() to make sure we converted all callers. I can not convince myself that after your patches, bonding does the right thing...