From: Ido Schimmel <idosch@idosch.org>
To: Petr Machata <petrm@nvidia.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net] rtnetlink: Fix handling of disabled L3 stats in RTM_GETSTATS replies
Date: Wed, 13 Apr 2022 09:10:39 +0300 [thread overview]
Message-ID: <YlZpX6YdMzqDeZag@shredder> (raw)
In-Reply-To: <591b58e7623edc3eb66dd1fcfa8c8f133d090974.1649794741.git.petrm@nvidia.com>
On Tue, Apr 12, 2022 at 10:25:06PM +0200, Petr Machata wrote:
> When L3 stats are disabled, rtnl_offload_xstats_get_size_stats() returns
> size of 0, which is supposed to be an indication that the corresponding
> attribute should not be emitted. However, instead, the current code
> reserves a 0-byte attribute.
>
> The reason this does not show up as a citation on a kasan kernel is that
> netdev_offload_xstats_get(), which is supposed to fill in the data, never
> ends up getting called, because rtnl_offload_xstats_get_stats() notices
> that the stats are not actually used and skips the call.
>
> Thus a zero-length IFLA_OFFLOAD_XSTATS_L3_STATS attribute ends up in a
> response, confusing the userspace.
>
> Fix by skipping the L3-stats related block in rtnl_offload_xstats_fill().
>
> Fixes: 0e7788fd7622 ("net: rtnetlink: Add UAPI for obtaining L3 offload xstats")
> Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
next prev parent reply other threads:[~2022-04-13 6:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 20:25 [PATCH net] rtnetlink: Fix handling of disabled L3 stats in RTM_GETSTATS replies Petr Machata
2022-04-13 6:10 ` Ido Schimmel [this message]
2022-04-14 7:20 ` patchwork-bot+netdevbpf
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=YlZpX6YdMzqDeZag@shredder \
--to=idosch@idosch.org \
--cc=davem@davemloft.net \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=petrm@nvidia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox