From: Eric Dumazet <eric.dumazet@gmail.com>
To: Michael Spang <mspang@csclub.uwaterloo.ca>
Cc: "David S. Miller" <davem@davemloft.net>,
LKML <linux-kernel@vger.kernel.org>,
Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH] Revert netlink ABI change to gnet_stats_basic
Date: Sun, 16 Aug 2009 14:33:48 +0200 [thread overview]
Message-ID: <4A87FCAC.5070705@gmail.com> (raw)
In-Reply-To: <1250002683-28554-1-git-send-email-mspang@csclub.uwaterloo.ca>
Michael Spang a écrit :
> In 5e140dfc1fe87eae27846f193086724806b33c7d "net: reorder struct Qdisc
> for better SMP performance" the definition of struct gnet_stats_basic
> changed incompatibly, and as copies of this struct may be shipped to
> userland via netlink. This reverts back to the old ABI.
So userland expects to get exactly 16 bytes instead of 12 ?
iproute2 has no problem :
void print_tcstats2_attr(FILE *fp, struct rtattr *rta, char *prefix, struct rtattr **xstats)
{
SPRINT_BUF(b1);
struct rtattr *tbs[TCA_STATS_MAX + 1];
parse_rtattr_nested(tbs, TCA_STATS_MAX, rta);
if (tbs[TCA_STATS_BASIC]) {
struct gnet_stats_basic bs = {0};
memcpy(&bs, RTA_DATA(tbs[TCA_STATS_BASIC]), MIN(RTA_PAYLOAD(tbs[TCA_STATS_BASIC]), sizeof(bs)));
fprintf(fp, "%sSent %llu bytes %u pkt",
prefix, (unsigned long long) bs.bytes, bs.packets);
}
What exactly broke after patch was pushed ?
It would be better to fix gnet_stats_copy_basic() if necessary...
>
> Signed-off-by: Michael Spang <mspang@csclub.uwaterloo.ca>
> ---
> include/linux/gen_stats.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/gen_stats.h b/include/linux/gen_stats.h
> index 0ffa41d..13f4e74 100644
> --- a/include/linux/gen_stats.h
> +++ b/include/linux/gen_stats.h
> @@ -22,7 +22,7 @@ struct gnet_stats_basic
> {
> __u64 bytes;
> __u32 packets;
> -} __attribute__ ((packed));
> +};
>
> /**
> * struct gnet_stats_rate_est - rate estimator
next parent reply other threads:[~2009-08-16 12:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1250002683-28554-1-git-send-email-mspang@csclub.uwaterloo.ca>
2009-08-16 12:33 ` Eric Dumazet [this message]
2009-08-16 13:42 ` [PATCH] Revert netlink ABI change to gnet_stats_basic Michael Spang
2009-08-16 19:36 ` Eric Dumazet
2009-08-16 20:10 ` Michael Spang
2009-08-18 4:34 ` David Miller
2009-08-18 21:21 ` Arnd Bergmann
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=4A87FCAC.5070705@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mspang@csclub.uwaterloo.ca \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).