* [net-next] IFLA_STATS64, tcp cong modules
@ 2010-03-11 19:57 Jan Engelhardt
2010-03-11 19:57 ` [PATCH 1/3] net: tcp: make hybla selectable as default congestion module Jan Engelhardt
` (2 more replies)
0 siblings, 3 replies; 23+ messages in thread
From: Jan Engelhardt @ 2010-03-11 19:57 UTC (permalink / raw)
To: davem; +Cc: netdev
Hi!
Here are three simple patches for net-next aka to-be-2.6.35.
The following changes since commit 3a5b27bf6f29574d667230c7e76e4b83fe3014e0:
Linus Torvalds (1):
Merge branch 'for-linus' of git://gitorious.org/linux-omap-dss2/linux
are available in the git repository at:
git://dev.medozas.de/linux net
Jan Engelhardt (3):
net: tcp: make hybla selectable as default congestion module
net: tcp: make veno selectable as default congestion module
net: core: add IFLA_STATS64 support
include/linux/if_link.h | 33 +++++++++++++++++++++++++++++++++
net/core/rtnetlink.c | 42 +++++++++++++++++++++++++++++++++++++++++-
net/ipv4/Kconfig | 8 ++++++++
3 files changed, 82 insertions(+), 1 deletions(-)
^ permalink raw reply [flat|nested] 23+ messages in thread* [PATCH 1/3] net: tcp: make hybla selectable as default congestion module 2010-03-11 19:57 [net-next] IFLA_STATS64, tcp cong modules Jan Engelhardt @ 2010-03-11 19:57 ` Jan Engelhardt 2010-03-11 20:10 ` Stephen Hemminger 2010-03-17 4:29 ` David Miller 2010-03-11 19:57 ` [PATCH 2/3] net: tcp: make veno " Jan Engelhardt 2010-03-11 19:57 ` [PATCH 3/3] net: core: add IFLA_STATS64 support Jan Engelhardt 2 siblings, 2 replies; 23+ messages in thread From: Jan Engelhardt @ 2010-03-11 19:57 UTC (permalink / raw) To: davem; +Cc: netdev Signed-off-by: Jan Engelhardt <jengelh@medozas.de> --- net/ipv4/Kconfig | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig index 0c94a1a..731c47b 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig @@ -587,6 +587,9 @@ choice config DEFAULT_HTCP bool "Htcp" if TCP_CONG_HTCP=y + config DEFAULT_HYBLA + bool "Hybla" if TCP_CONG_HYBLA=y + config DEFAULT_VEGAS bool "Vegas" if TCP_CONG_VEGAS=y @@ -610,6 +613,7 @@ config DEFAULT_TCP_CONG default "bic" if DEFAULT_BIC default "cubic" if DEFAULT_CUBIC default "htcp" if DEFAULT_HTCP + default "hybla" if DEFAULT_HYBLA default "vegas" if DEFAULT_VEGAS default "westwood" if DEFAULT_WESTWOOD default "reno" if DEFAULT_RENO -- 1.7.0 ^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 1/3] net: tcp: make hybla selectable as default congestion module 2010-03-11 19:57 ` [PATCH 1/3] net: tcp: make hybla selectable as default congestion module Jan Engelhardt @ 2010-03-11 20:10 ` Stephen Hemminger 2010-03-11 20:19 ` Jan Engelhardt 2010-03-17 4:29 ` David Miller 1 sibling, 1 reply; 23+ messages in thread From: Stephen Hemminger @ 2010-03-11 20:10 UTC (permalink / raw) To: Jan Engelhardt; +Cc: davem, netdev On Thu, 11 Mar 2010 20:57:27 +0100 Jan Engelhardt <jengelh@medozas.de> wrote: > Signed-off-by: Jan Engelhardt <jengelh@medozas.de> > --- > net/ipv4/Kconfig | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig > index 0c94a1a..731c47b 100644 > --- a/net/ipv4/Kconfig > +++ b/net/ipv4/Kconfig > @@ -587,6 +587,9 @@ choice > config DEFAULT_HTCP > bool "Htcp" if TCP_CONG_HTCP=y > > + config DEFAULT_HYBLA > + bool "Hybla" if TCP_CONG_HYBLA=y > + > config DEFAULT_VEGAS > bool "Vegas" if TCP_CONG_VEGAS=y > > @@ -610,6 +613,7 @@ config DEFAULT_TCP_CONG > default "bic" if DEFAULT_BIC > default "cubic" if DEFAULT_CUBIC > default "htcp" if DEFAULT_HTCP > + default "hybla" if DEFAULT_HYBLA > default "vegas" if DEFAULT_VEGAS > default "westwood" if DEFAULT_WESTWOOD > default "reno" if DEFAULT_RENO Hybla seems too experimental to be made default. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 1/3] net: tcp: make hybla selectable as default congestion module 2010-03-11 20:10 ` Stephen Hemminger @ 2010-03-11 20:19 ` Jan Engelhardt 0 siblings, 0 replies; 23+ messages in thread From: Jan Engelhardt @ 2010-03-11 20:19 UTC (permalink / raw) To: Stephen Hemminger; +Cc: davem, netdev On Thursday 2010-03-11 21:10, Stephen Hemminger wrote: >> >> diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig >> index 0c94a1a..731c47b 100644 >> --- a/net/ipv4/Kconfig >> +++ b/net/ipv4/Kconfig >> @@ -587,6 +587,9 @@ choice >> config DEFAULT_HTCP >> bool "Htcp" if TCP_CONG_HTCP=y >> >> + config DEFAULT_HYBLA >> + bool "Hybla" if TCP_CONG_HYBLA=y >> + >> config DEFAULT_VEGAS >> bool "Vegas" if TCP_CONG_VEGAS=y >> >> @@ -610,6 +613,7 @@ config DEFAULT_TCP_CONG >> default "bic" if DEFAULT_BIC >> default "cubic" if DEFAULT_CUBIC >> default "htcp" if DEFAULT_HTCP >> + default "hybla" if DEFAULT_HYBLA >> default "vegas" if DEFAULT_VEGAS >> default "westwood" if DEFAULT_WESTWOOD >> default "reno" if DEFAULT_RENO > >Hybla seems too experimental to be made default. I run Hybla since 2006 on anything that is not connected via wireless and I did not notice any pressing issues. Also, the patch does not make hybla the default default (reno remains), just the default once explicitly selected in a two-step process: 1. CONFIG_TCP_CONG_HYBLA=y *and* 2. choosing Hybla in CONFIG_DEFAULT_TCP_CONG I think that is enough of a "safety measure" against any potential unsuspecting users. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 1/3] net: tcp: make hybla selectable as default congestion module 2010-03-11 19:57 ` [PATCH 1/3] net: tcp: make hybla selectable as default congestion module Jan Engelhardt 2010-03-11 20:10 ` Stephen Hemminger @ 2010-03-17 4:29 ` David Miller 1 sibling, 0 replies; 23+ messages in thread From: David Miller @ 2010-03-17 4:29 UTC (permalink / raw) To: jengelh; +Cc: netdev From: Jan Engelhardt <jengelh@medozas.de> Date: Thu, 11 Mar 2010 20:57:27 +0100 > Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Applied. ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 2/3] net: tcp: make veno selectable as default congestion module 2010-03-11 19:57 [net-next] IFLA_STATS64, tcp cong modules Jan Engelhardt 2010-03-11 19:57 ` [PATCH 1/3] net: tcp: make hybla selectable as default congestion module Jan Engelhardt @ 2010-03-11 19:57 ` Jan Engelhardt 2010-03-17 4:29 ` David Miller 2010-03-11 19:57 ` [PATCH 3/3] net: core: add IFLA_STATS64 support Jan Engelhardt 2 siblings, 1 reply; 23+ messages in thread From: Jan Engelhardt @ 2010-03-11 19:57 UTC (permalink / raw) To: davem; +Cc: netdev Signed-off-by: Jan Engelhardt <jengelh@medozas.de> --- net/ipv4/Kconfig | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig index 731c47b..c9a1c68 100644 --- a/net/ipv4/Kconfig +++ b/net/ipv4/Kconfig @@ -593,6 +593,9 @@ choice config DEFAULT_VEGAS bool "Vegas" if TCP_CONG_VEGAS=y + config DEFAULT_VENO + bool "Veno" if TCP_CONG_VENO=y + config DEFAULT_WESTWOOD bool "Westwood" if TCP_CONG_WESTWOOD=y @@ -616,6 +619,7 @@ config DEFAULT_TCP_CONG default "hybla" if DEFAULT_HYBLA default "vegas" if DEFAULT_VEGAS default "westwood" if DEFAULT_WESTWOOD + default "veno" if DEFAULT_VENO default "reno" if DEFAULT_RENO default "cubic" -- 1.7.0 ^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 2/3] net: tcp: make veno selectable as default congestion module 2010-03-11 19:57 ` [PATCH 2/3] net: tcp: make veno " Jan Engelhardt @ 2010-03-17 4:29 ` David Miller 0 siblings, 0 replies; 23+ messages in thread From: David Miller @ 2010-03-17 4:29 UTC (permalink / raw) To: jengelh; +Cc: netdev From: Jan Engelhardt <jengelh@medozas.de> Date: Thu, 11 Mar 2010 20:57:28 +0100 > Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Applied. ^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 19:57 [net-next] IFLA_STATS64, tcp cong modules Jan Engelhardt 2010-03-11 19:57 ` [PATCH 1/3] net: tcp: make hybla selectable as default congestion module Jan Engelhardt 2010-03-11 19:57 ` [PATCH 2/3] net: tcp: make veno " Jan Engelhardt @ 2010-03-11 19:57 ` Jan Engelhardt 2010-03-11 20:12 ` Stephen Hemminger ` (2 more replies) 2 siblings, 3 replies; 23+ messages in thread From: Jan Engelhardt @ 2010-03-11 19:57 UTC (permalink / raw) To: davem; +Cc: netdev `ip -s link` shows interface counters truncated to 32 bit. This is because interface statistics are transported only in 32-bit quantity to userspace. This commit adds a new IFLA_STATS64 attribute that exports them in full 64 bit. References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html Signed-off-by: Jan Engelhardt <jengelh@medozas.de> --- include/linux/if_link.h | 33 +++++++++++++++++++++++++++++++++ net/core/rtnetlink.c | 42 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 1 deletions(-) diff --git a/include/linux/if_link.h b/include/linux/if_link.h index c9bf92c..cfd420b 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h @@ -37,6 +37,38 @@ struct rtnl_link_stats { __u32 tx_compressed; }; +struct rtnl_link_stats64 { + __u64 rx_packets; /* total packets received */ + __u64 tx_packets; /* total packets transmitted */ + __u64 rx_bytes; /* total bytes received */ + __u64 tx_bytes; /* total bytes transmitted */ + __u64 rx_errors; /* bad packets received */ + __u64 tx_errors; /* packet transmit problems */ + __u64 rx_dropped; /* no space in linux buffers */ + __u64 tx_dropped; /* no space available in linux */ + __u64 multicast; /* multicast packets received */ + __u64 collisions; + + /* detailed rx_errors: */ + __u64 rx_length_errors; + __u64 rx_over_errors; /* receiver ring buff overflow */ + __u64 rx_crc_errors; /* recved pkt with crc error */ + __u64 rx_frame_errors; /* recv'd frame alignment error */ + __u64 rx_fifo_errors; /* recv'r fifo overrun */ + __u64 rx_missed_errors; /* receiver missed packet */ + + /* detailed tx_errors */ + __u64 tx_aborted_errors; + __u64 tx_carrier_errors; + __u64 tx_fifo_errors; + __u64 tx_heartbeat_errors; + __u64 tx_window_errors; + + /* for cslip etc */ + __u64 rx_compressed; + __u64 tx_compressed; +}; + /* The struct should be in sync with struct ifmap */ struct rtnl_link_ifmap { __u64 mem_start; @@ -83,6 +115,7 @@ enum { IFLA_VF_VLAN, IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ IFLA_VFINFO, + IFLA_STATS64, __IFLA_MAX }; diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 4568120..e1121f0 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -600,7 +600,39 @@ static void copy_rtnl_link_stats(struct rtnl_link_stats *a, a->rx_compressed = b->rx_compressed; a->tx_compressed = b->tx_compressed; -}; +} + +static void copy_rtnl_link_stats64(struct rtnl_link_stats64 *a, + const struct net_device_stats *b) +{ + a->rx_packets = b->rx_packets; + a->tx_packets = b->tx_packets; + a->rx_bytes = b->rx_bytes; + a->tx_bytes = b->tx_bytes; + a->rx_errors = b->rx_errors; + a->tx_errors = b->tx_errors; + a->rx_dropped = b->rx_dropped; + a->tx_dropped = b->tx_dropped; + + a->multicast = b->multicast; + a->collisions = b->collisions; + + a->rx_length_errors = b->rx_length_errors; + a->rx_over_errors = b->rx_over_errors; + a->rx_crc_errors = b->rx_crc_errors; + a->rx_frame_errors = b->rx_frame_errors; + a->rx_fifo_errors = b->rx_fifo_errors; + a->rx_missed_errors = b->rx_missed_errors; + + a->tx_aborted_errors = b->tx_aborted_errors; + a->tx_carrier_errors = b->tx_carrier_errors; + a->tx_fifo_errors = b->tx_fifo_errors; + a->tx_heartbeat_errors = b->tx_heartbeat_errors; + a->tx_window_errors = b->tx_window_errors; + + a->rx_compressed = b->rx_compressed; + a->tx_compressed = b->tx_compressed; +} static inline int rtnl_vfinfo_size(const struct net_device *dev) { @@ -698,6 +730,14 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, stats = dev_get_stats(dev); copy_rtnl_link_stats(nla_data(attr), stats); + attr = nla_reserve(skb, IFLA_STATS64, + sizeof(struct rtnl_link_stats64)); + if (attr == NULL) + goto nla_put_failure; + + stats = dev_get_stats(dev); + copy_rtnl_link_stats64(nla_data(attr), stats); + if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) { int i; struct ifla_vf_info ivi; -- 1.7.0 ^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 19:57 ` [PATCH 3/3] net: core: add IFLA_STATS64 support Jan Engelhardt @ 2010-03-11 20:12 ` Stephen Hemminger 2010-03-11 20:26 ` David Miller 2010-03-11 20:19 ` Eric Dumazet 2010-03-17 4:29 ` David Miller 2 siblings, 1 reply; 23+ messages in thread From: Stephen Hemminger @ 2010-03-11 20:12 UTC (permalink / raw) To: Jan Engelhardt; +Cc: davem, netdev On Thu, 11 Mar 2010 20:57:29 +0100 Jan Engelhardt <jengelh@medozas.de> wrote: > `ip -s link` shows interface counters truncated to 32 bit. This is > because interface statistics are transported only in 32-bit quantity > to userspace. This commit adds a new IFLA_STATS64 attribute that > exports them in full 64 bit. > > References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html > Signed-off-by: Jan Engelhardt <jengelh@medozas.de> > What is the point since net_device_stats has only 32 bit counters. The last time this came up the issue was is that is not possible to atomically increment a 64 bit counter on most 32 bit platforms. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 20:12 ` Stephen Hemminger @ 2010-03-11 20:26 ` David Miller 2010-03-11 21:07 ` Jan Engelhardt 2010-03-11 22:04 ` Stephen Hemminger 0 siblings, 2 replies; 23+ messages in thread From: David Miller @ 2010-03-11 20:26 UTC (permalink / raw) To: shemminger; +Cc: jengelh, netdev From: Stephen Hemminger <shemminger@vyatta.com> Date: Thu, 11 Mar 2010 12:12:39 -0800 > On Thu, 11 Mar 2010 20:57:29 +0100 > Jan Engelhardt <jengelh@medozas.de> wrote: > >> `ip -s link` shows interface counters truncated to 32 bit. This is >> because interface statistics are transported only in 32-bit quantity >> to userspace. This commit adds a new IFLA_STATS64 attribute that >> exports them in full 64 bit. >> >> References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html >> Signed-off-by: Jan Engelhardt <jengelh@medozas.de> >> > > What is the point since net_device_stats has only 32 bit counters. > The last time this came up the issue was is that is not possible > to atomically increment a 64 bit counter on most 32 bit platforms. On 64-bit it has 64-bit counters, yet we only report 32-bit counters to userspace via netlink even in that case. That's what Jan is fixing here. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 20:26 ` David Miller @ 2010-03-11 21:07 ` Jan Engelhardt 2010-03-11 21:30 ` David Miller 2010-03-11 22:04 ` Stephen Hemminger 1 sibling, 1 reply; 23+ messages in thread From: Jan Engelhardt @ 2010-03-11 21:07 UTC (permalink / raw) To: David Miller; +Cc: shemminger, netdev On Thursday 2010-03-11 21:26, David Miller wrote: >> On Thu, 11 Mar 2010 20:57:29 +0100 >> Jan Engelhardt <jengelh@medozas.de> wrote: >> >>> `ip -s link` shows interface counters truncated to 32 bit. This is >>> because interface statistics are transported only in 32-bit quantity >>> to userspace. This commit adds a new IFLA_STATS64 attribute that >>> exports them in full 64 bit. >>> >>> References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html >>> Signed-off-by: Jan Engelhardt <jengelh@medozas.de> >>> >> >> What is the point since net_device_stats has only 32 bit counters. >> The last time this came up the issue was is that is not possible >> to atomically increment a 64 bit counter on most 32 bit platforms. > >On 64-bit it has 64-bit counters, yet we only report 32-bit >counters to userspace via netlink even in that case. > >That's what Jan is fixing here. On a side note, is it perhaps possible to use jiffies-like magic to also have 64-bit counters on 32-bit, or is that still too expensive? ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 21:07 ` Jan Engelhardt @ 2010-03-11 21:30 ` David Miller 0 siblings, 0 replies; 23+ messages in thread From: David Miller @ 2010-03-11 21:30 UTC (permalink / raw) To: jengelh; +Cc: shemminger, netdev From: Jan Engelhardt <jengelh@medozas.de> Date: Thu, 11 Mar 2010 22:07:07 +0100 (CET) > On a side note, is it perhaps possible to use jiffies-like magic to > also have 64-bit counters on 32-bit, or is that still too expensive? I think there might still be atomicity issues. We've been telling people to poll periodically in userspace to avoid these problems, but that has limitations as network speeds increase. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 20:26 ` David Miller 2010-03-11 21:07 ` Jan Engelhardt @ 2010-03-11 22:04 ` Stephen Hemminger 2010-03-11 22:13 ` Jan Engelhardt 2010-03-11 22:13 ` David Miller 1 sibling, 2 replies; 23+ messages in thread From: Stephen Hemminger @ 2010-03-11 22:04 UTC (permalink / raw) To: David Miller; +Cc: jengelh, netdev On Thu, 11 Mar 2010 12:26:39 -0800 (PST) David Miller <davem@davemloft.net> wrote: > From: Stephen Hemminger <shemminger@vyatta.com> > Date: Thu, 11 Mar 2010 12:12:39 -0800 > > > On Thu, 11 Mar 2010 20:57:29 +0100 > > Jan Engelhardt <jengelh@medozas.de> wrote: > > > >> `ip -s link` shows interface counters truncated to 32 bit. This is > >> because interface statistics are transported only in 32-bit quantity > >> to userspace. This commit adds a new IFLA_STATS64 attribute that > >> exports them in full 64 bit. > >> > >> References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html > >> Signed-off-by: Jan Engelhardt <jengelh@medozas.de> > >> > > > > What is the point since net_device_stats has only 32 bit counters. > > The last time this came up the issue was is that is not possible > > to atomically increment a 64 bit counter on most 32 bit platforms. > > On 64-bit it has 64-bit counters, yet we only report 32-bit > counters to userspace via netlink even in that case. That make sense, but maybe we shouldn't send IFLA_STATS64 on 32bit platforms. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 22:04 ` Stephen Hemminger @ 2010-03-11 22:13 ` Jan Engelhardt 2010-03-11 22:50 ` Stephen Hemminger 2010-03-11 22:13 ` David Miller 1 sibling, 1 reply; 23+ messages in thread From: Jan Engelhardt @ 2010-03-11 22:13 UTC (permalink / raw) To: Stephen Hemminger; +Cc: David Miller, netdev On Thursday 2010-03-11 23:04, Stephen Hemminger wrote: >> >> `ip -s link` shows interface counters truncated to 32 bit. This is >> >> because interface statistics are transported only in 32-bit quantity >> >> to userspace. This commit adds a new IFLA_STATS64 attribute that >> >> exports them in full 64 bit. >> >> On 64-bit it has 64-bit counters, yet we only report 32-bit >> counters to userspace via netlink even in that case. > >That make sense, but maybe we shouldn't send IFLA_STATS64 on >32bit platforms. Somehow I'd prefer to have consistency. Platform-specific actions and/or payload I think we already were plagued enough by syscalls and iptables. (Just to name two.) ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 22:13 ` Jan Engelhardt @ 2010-03-11 22:50 ` Stephen Hemminger 2010-03-11 22:54 ` David Miller 0 siblings, 1 reply; 23+ messages in thread From: Stephen Hemminger @ 2010-03-11 22:50 UTC (permalink / raw) To: Jan Engelhardt; +Cc: David Miller, netdev On Thu, 11 Mar 2010 23:13:18 +0100 (CET) Jan Engelhardt <jengelh@medozas.de> wrote: > On Thursday 2010-03-11 23:04, Stephen Hemminger wrote: > >> >> `ip -s link` shows interface counters truncated to 32 bit. This is > >> >> because interface statistics are transported only in 32-bit quantity > >> >> to userspace. This commit adds a new IFLA_STATS64 attribute that > >> >> exports them in full 64 bit. > >> > >> On 64-bit it has 64-bit counters, yet we only report 32-bit > >> counters to userspace via netlink even in that case. > > > >That make sense, but maybe we shouldn't send IFLA_STATS64 on > >32bit platforms. > > Somehow I'd prefer to have consistency. Platform-specific > actions and/or payload I think we already were plagued enough by > syscalls and iptables. (Just to name two.) But if you send 32bit truncated values when 64 bit is expected then users are going to complain -- ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 22:50 ` Stephen Hemminger @ 2010-03-11 22:54 ` David Miller 2010-03-11 23:10 ` Stephen Hemminger 0 siblings, 1 reply; 23+ messages in thread From: David Miller @ 2010-03-11 22:54 UTC (permalink / raw) To: shemminger; +Cc: jengelh, netdev From: Stephen Hemminger <shemminger@vyatta.com> Date: Thu, 11 Mar 2010 14:50:59 -0800 > But if you send 32bit truncated values when 64 bit is expected > then users are going to complain They already complain, a lot. This isn't going to change the situation at all, and I agree with Jan that consistency is the trumping factor here. ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 22:54 ` David Miller @ 2010-03-11 23:10 ` Stephen Hemminger 2010-03-11 23:15 ` David Miller 0 siblings, 1 reply; 23+ messages in thread From: Stephen Hemminger @ 2010-03-11 23:10 UTC (permalink / raw) To: David Miller; +Cc: jengelh, netdev On Thu, 11 Mar 2010 14:54:12 -0800 (PST) David Miller <davem@davemloft.net> wrote: > From: Stephen Hemminger <shemminger@vyatta.com> > Date: Thu, 11 Mar 2010 14:50:59 -0800 > > > But if you send 32bit truncated values when 64 bit is expected > > then users are going to complain > > They already complain, a lot. > > This isn't going to change the situation at all, and > I agree with Jan that consistency is the trumping factor > here. But if non utilities will already adapt to new/old kernel, so just don't put out 64 bit values if the platform is 32 bit. When/if 32 bit platforms support it, great add the extra stats. -- ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 23:10 ` Stephen Hemminger @ 2010-03-11 23:15 ` David Miller 2010-03-11 23:44 ` Stephen Hemminger 0 siblings, 1 reply; 23+ messages in thread From: David Miller @ 2010-03-11 23:15 UTC (permalink / raw) To: shemminger; +Cc: jengelh, netdev From: Stephen Hemminger <shemminger@vyatta.com> Date: Thu, 11 Mar 2010 15:10:50 -0800 > But if non utilities will already adapt to new/old kernel, so > just don't put out 64 bit values if the platform is 32 bit. > When/if 32 bit platforms support it, great add the extra stats. How about we just make userland ready for it and: 1) Emitting it now will get it tested even on 32-bit 2) They'll be ready when the drivers can keep track of 64-bit stats too. Stephen I've heard your side of the story, I just don't agree with it :-) ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 23:15 ` David Miller @ 2010-03-11 23:44 ` Stephen Hemminger 0 siblings, 0 replies; 23+ messages in thread From: Stephen Hemminger @ 2010-03-11 23:44 UTC (permalink / raw) To: David Miller; +Cc: jengelh, netdev On Thu, 11 Mar 2010 15:15:29 -0800 (PST) David Miller <davem@davemloft.net> wrote: > From: Stephen Hemminger <shemminger@vyatta.com> > Date: Thu, 11 Mar 2010 15:10:50 -0800 > > > But if non utilities will already adapt to new/old kernel, so > > just don't put out 64 bit values if the platform is 32 bit. > > When/if 32 bit platforms support it, great add the extra stats. > > How about we just make userland ready for it and: > > 1) Emitting it now will get it tested even on 32-bit > > 2) They'll be ready when the drivers can keep track of > 64-bit stats too. > > Stephen I've heard your side of the story, I just don't > agree with it :-) I'm okay with it. just raising the issue. -- ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 22:04 ` Stephen Hemminger 2010-03-11 22:13 ` Jan Engelhardt @ 2010-03-11 22:13 ` David Miller 2010-03-11 22:15 ` Jan Engelhardt 1 sibling, 1 reply; 23+ messages in thread From: David Miller @ 2010-03-11 22:13 UTC (permalink / raw) To: shemminger; +Cc: jengelh, netdev From: Stephen Hemminger <shemminger@vyatta.com> Date: Thu, 11 Mar 2010 14:04:06 -0800 > That make sense, but maybe we shouldn't send IFLA_STATS64 on > 32bit platforms. Let's at least be optimistic that we'll be able to support 64-bit stats on 32-bit at some point :-) ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 22:13 ` David Miller @ 2010-03-11 22:15 ` Jan Engelhardt 0 siblings, 0 replies; 23+ messages in thread From: Jan Engelhardt @ 2010-03-11 22:15 UTC (permalink / raw) To: David Miller; +Cc: shemminger, netdev On Thursday 2010-03-11 23:13, David Miller wrote: > >> That make sense, but maybe we shouldn't send IFLA_STATS64 on >> 32bit platforms. > >Let's at least be optimistic that we'll be able to support 64-bit >stats on 32-bit at some point :-) I was about to say. There is hope: whenever you least expect it, academia comes up with a perfectly foundated theory and plan to solve the problem. (N.B.: But the initial implementation generally sucks ;-) ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 19:57 ` [PATCH 3/3] net: core: add IFLA_STATS64 support Jan Engelhardt 2010-03-11 20:12 ` Stephen Hemminger @ 2010-03-11 20:19 ` Eric Dumazet 2010-03-17 4:29 ` David Miller 2 siblings, 0 replies; 23+ messages in thread From: Eric Dumazet @ 2010-03-11 20:19 UTC (permalink / raw) To: Jan Engelhardt; +Cc: davem, netdev Le jeudi 11 mars 2010 à 20:57 +0100, Jan Engelhardt a écrit : > `ip -s link` shows interface counters truncated to 32 bit. This is > because interface statistics are transported only in 32-bit quantity > to userspace. This commit adds a new IFLA_STATS64 attribute that > exports them in full 64 bit. > > References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html oh oh, back to 2003 :) > Signed-off-by: Jan Engelhardt <jengelh@medozas.de> > --- > > static inline int rtnl_vfinfo_size(const struct net_device *dev) > { > @@ -698,6 +730,14 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, > stats = dev_get_stats(dev); OK, stats is up2date with device stats > copy_rtnl_link_stats(nla_data(attr), stats); > > + attr = nla_reserve(skb, IFLA_STATS64, > + sizeof(struct rtnl_link_stats64)); > + if (attr == NULL) > + goto nla_put_failure; > + > + stats = dev_get_stats(dev); Why calling dev_get_stats(dev) a second time ? Its can be pretty expensive on some devices. > + copy_rtnl_link_stats64(nla_data(attr), stats); > + > if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) { > int i; > struct ifla_vf_info ivi; > -- ^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support 2010-03-11 19:57 ` [PATCH 3/3] net: core: add IFLA_STATS64 support Jan Engelhardt 2010-03-11 20:12 ` Stephen Hemminger 2010-03-11 20:19 ` Eric Dumazet @ 2010-03-17 4:29 ` David Miller 2 siblings, 0 replies; 23+ messages in thread From: David Miller @ 2010-03-17 4:29 UTC (permalink / raw) To: jengelh; +Cc: netdev From: Jan Engelhardt <jengelh@medozas.de> Date: Thu, 11 Mar 2010 20:57:29 +0100 > `ip -s link` shows interface counters truncated to 32 bit. This is > because interface statistics are transported only in 32-bit quantity > to userspace. This commit adds a new IFLA_STATS64 attribute that > exports them in full 64 bit. > > References: http://lkml.indiana.edu/hypermail/linux/kernel/0307.3/0215.html > Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Applied. ^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2010-03-17 4:28 UTC | newest] Thread overview: 23+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-03-11 19:57 [net-next] IFLA_STATS64, tcp cong modules Jan Engelhardt 2010-03-11 19:57 ` [PATCH 1/3] net: tcp: make hybla selectable as default congestion module Jan Engelhardt 2010-03-11 20:10 ` Stephen Hemminger 2010-03-11 20:19 ` Jan Engelhardt 2010-03-17 4:29 ` David Miller 2010-03-11 19:57 ` [PATCH 2/3] net: tcp: make veno " Jan Engelhardt 2010-03-17 4:29 ` David Miller 2010-03-11 19:57 ` [PATCH 3/3] net: core: add IFLA_STATS64 support Jan Engelhardt 2010-03-11 20:12 ` Stephen Hemminger 2010-03-11 20:26 ` David Miller 2010-03-11 21:07 ` Jan Engelhardt 2010-03-11 21:30 ` David Miller 2010-03-11 22:04 ` Stephen Hemminger 2010-03-11 22:13 ` Jan Engelhardt 2010-03-11 22:50 ` Stephen Hemminger 2010-03-11 22:54 ` David Miller 2010-03-11 23:10 ` Stephen Hemminger 2010-03-11 23:15 ` David Miller 2010-03-11 23:44 ` Stephen Hemminger 2010-03-11 22:13 ` David Miller 2010-03-11 22:15 ` Jan Engelhardt 2010-03-11 20:19 ` Eric Dumazet 2010-03-17 4:29 ` David Miller
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).