From: roopa <roopa@cumulusnetworks.com>
To: Thomas Graf <tgraf@suug.ch>
Cc: netdev@vger.kernel.org, jhs@mojatatu.com, davem@davemloft.net,
Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Subject: Re: [PATCH net-next v2 1/2] rtnetlink: add new RTM_GETSTATS message to dump link stats
Date: Mon, 11 Apr 2016 20:53:23 -0700 [thread overview]
Message-ID: <570C7133.8070109@cumulusnetworks.com> (raw)
In-Reply-To: <570A9B4D.80104@cumulusnetworks.com>
On 4/10/16, 11:28 AM, roopa wrote:
> On 4/10/16, 1:16 AM, Thomas Graf wrote:
[snip]
>>
>> This currently ties everything to a net_device with a selector to
>> include certain bits of that net_device. How about we take it half a
>> step further and allow for non net_device stats such as IP, TCP,
>> routing or ipsec stats to be retrieved as well?
> yes, absolutely. and that is also the goal.
>> A simple array of nested attributes replacing IFLA_STATS_* would
>> allow for that, e.g.
>>
>> 1. {.type = ST_IPSTATS, value = { ...} }
>>
>> 2. {.type = ST_LINK, .value = {
>> {.type = ST_LINK_NAME, .value = "eth0"},
>> {.type = ST_LINK_Q, .value = 10}
>> }}
>>
>> 3. ...
> One thing though, Its unclear to me if we absolutely need the additional nest.
> Every stats netlink msg has an ifindex in the header (if_stats_msg) if the scope
> of the stats is a netdev. If the msg does not have an ifindex in the if_stats_msg,
> it represents a global stat. ie Cant a dump, include other stats netlink msgs after
> all the netdev msgs are done when the filter has global stat filters ?.
> same will apply to RTM_GETSTATS (without NLM_F_DUMP).
>
> Since the msg may potentially have more nest levels
> in the IFLA_EXT_STATS categories, just trying to see if i can avoid adding another
> top-level nest. We can sure add it if there is no other way to include global
> stats in the same dump.
>
Just wanted to elaborate on what i was trying to say:
Top level stats attributes can be netdev or global attributes: We can include string "LINK" in
the names of all stats belonging to a netdev to make it easier to recognize the netdev stats (example):
IFLA_STATS_LINK64, (netdev)
IFLA_STATS_LINK_INET6, (netdev)
IFLA_STATS_TCP, (non-netdev, global tcp stats)
RTM_GETSTATS (NLM_F_DUMP) with user given filter_mask {
If filter-mask contains any link stats, start with per netdev stats messages:
{ if_stats_msg.ifindex = 1,
if_stats_msg.filter_mask = mask of included link stats,
<stats attributes> }
{ if_stats_msg.ifindex = 2,
if_stats_msg.filter_mask = mask of included link stats,
<stats attributes> }
global stats (if user given filter mask contains global filters.):
{ if_stats_msg.ifindex = 0,
if_stats_msg.filter_mask = mask of included global stats,
<stats attributes> }
}
We will need a field in netlink_callback to indicate global or netdev stats when the stats
crosses skb boundaries. A single nlmsg cannot have both netdev and global stats.
Non-dump RTM_GETSTATS examples:
RTM_GETSTATS with valid ifindex and filter_mask {
filter_mask cannot have global stats (return -EINVAL)
{ if_stats_msg.ifindex = <user_given_ifindex>,
if_stats_msg.filter_mask = mask of included link stats,
<stats attributes> }
}
RTM_GETSTATS with ifindex = 0 and filter_mask {
filter_mask cannot have link stats (return -EINVAL)
{ if_stats_msg.ifindex = 0,
if_stats_msg.filter_mask = mask of included global link stats,
<stats attributes> }
}
Will this not work ?
Thanks,
Roopa
next prev parent reply other threads:[~2016-04-12 3:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-09 6:38 [PATCH net-next v2 1/2] rtnetlink: add new RTM_GETSTATS message to dump link stats Roopa Prabhu
2016-04-09 14:30 ` Jamal Hadi Salim
2016-04-09 18:00 ` roopa
2016-04-10 13:48 ` Jamal Hadi Salim
2016-04-10 19:17 ` roopa
2016-04-10 8:16 ` Thomas Graf
2016-04-10 18:28 ` roopa
2016-04-12 3:53 ` roopa [this message]
2016-04-12 13:21 ` Thomas Graf
2016-04-13 12:11 ` Jamal Hadi Salim
2016-04-14 6:36 ` roopa
2016-04-14 4:19 ` David Miller
2016-04-14 6:35 ` roopa
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=570C7133.8070109@cumulusnetworks.com \
--to=roopa@cumulusnetworks.com \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=tgraf@suug.ch \
/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).