diff options
Diffstat (limited to 'net/ipv4/ipvs/ip_vs_ctl.c')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_ctl.c | 53 |
1 files changed, 21 insertions, 32 deletions
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index e53efe41f01d..993a83fb0d56 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c | |||
@@ -744,18 +744,7 @@ ip_vs_zero_stats(struct ip_vs_stats *stats) | |||
744 | { | 744 | { |
745 | spin_lock_bh(&stats->lock); | 745 | spin_lock_bh(&stats->lock); |
746 | 746 | ||
747 | stats->conns = 0; | 747 | memset(&stats->ustats, 0, sizeof(stats->ustats)); |
748 | stats->inpkts = 0; | ||
749 | stats->outpkts = 0; | ||
750 | stats->inbytes = 0; | ||
751 | stats->outbytes = 0; | ||
752 | |||
753 | stats->cps = 0; | ||
754 | stats->inpps = 0; | ||
755 | stats->outpps = 0; | ||
756 | stats->inbps = 0; | ||
757 | stats->outbps = 0; | ||
758 | |||
759 | ip_vs_zero_estimator(stats); | 748 | ip_vs_zero_estimator(stats); |
760 | 749 | ||
761 | spin_unlock_bh(&stats->lock); | 750 | spin_unlock_bh(&stats->lock); |
@@ -1964,20 +1953,20 @@ static int ip_vs_stats_show(struct seq_file *seq, void *v) | |||
1964 | " Conns Packets Packets Bytes Bytes\n"); | 1953 | " Conns Packets Packets Bytes Bytes\n"); |
1965 | 1954 | ||
1966 | spin_lock_bh(&ip_vs_stats.lock); | 1955 | spin_lock_bh(&ip_vs_stats.lock); |
1967 | seq_printf(seq, "%8X %8X %8X %16LX %16LX\n\n", ip_vs_stats.conns, | 1956 | seq_printf(seq, "%8X %8X %8X %16LX %16LX\n\n", ip_vs_stats.ustats.conns, |
1968 | ip_vs_stats.inpkts, ip_vs_stats.outpkts, | 1957 | ip_vs_stats.ustats.inpkts, ip_vs_stats.ustats.outpkts, |
1969 | (unsigned long long) ip_vs_stats.inbytes, | 1958 | (unsigned long long) ip_vs_stats.ustats.inbytes, |
1970 | (unsigned long long) ip_vs_stats.outbytes); | 1959 | (unsigned long long) ip_vs_stats.ustats.outbytes); |
1971 | 1960 | ||
1972 | /* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ | 1961 | /* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ |
1973 | seq_puts(seq, | 1962 | seq_puts(seq, |
1974 | " Conns/s Pkts/s Pkts/s Bytes/s Bytes/s\n"); | 1963 | " Conns/s Pkts/s Pkts/s Bytes/s Bytes/s\n"); |
1975 | seq_printf(seq,"%8X %8X %8X %16X %16X\n", | 1964 | seq_printf(seq,"%8X %8X %8X %16X %16X\n", |
1976 | ip_vs_stats.cps, | 1965 | ip_vs_stats.ustats.cps, |
1977 | ip_vs_stats.inpps, | 1966 | ip_vs_stats.ustats.inpps, |
1978 | ip_vs_stats.outpps, | 1967 | ip_vs_stats.ustats.outpps, |
1979 | ip_vs_stats.inbps, | 1968 | ip_vs_stats.ustats.inbps, |
1980 | ip_vs_stats.outbps); | 1969 | ip_vs_stats.ustats.outbps); |
1981 | spin_unlock_bh(&ip_vs_stats.lock); | 1970 | spin_unlock_bh(&ip_vs_stats.lock); |
1982 | 1971 | ||
1983 | return 0; | 1972 | return 0; |
@@ -2215,7 +2204,7 @@ static void | |||
2215 | ip_vs_copy_stats(struct ip_vs_stats_user *dst, struct ip_vs_stats *src) | 2204 | ip_vs_copy_stats(struct ip_vs_stats_user *dst, struct ip_vs_stats *src) |
2216 | { | 2205 | { |
2217 | spin_lock_bh(&src->lock); | 2206 | spin_lock_bh(&src->lock); |
2218 | memcpy(dst, src, (char*)&src->lock - (char*)src); | 2207 | memcpy(dst, &src->ustats, sizeof(*dst)); |
2219 | spin_unlock_bh(&src->lock); | 2208 | spin_unlock_bh(&src->lock); |
2220 | } | 2209 | } |
2221 | 2210 | ||
@@ -2591,16 +2580,16 @@ static int ip_vs_genl_fill_stats(struct sk_buff *skb, int container_type, | |||
2591 | 2580 | ||
2592 | spin_lock_bh(&stats->lock); | 2581 | spin_lock_bh(&stats->lock); |
2593 | 2582 | ||
2594 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_CONNS, stats->conns); | 2583 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_CONNS, stats->ustats.conns); |
2595 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_INPKTS, stats->inpkts); | 2584 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_INPKTS, stats->ustats.inpkts); |
2596 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_OUTPKTS, stats->outpkts); | 2585 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_OUTPKTS, stats->ustats.outpkts); |
2597 | NLA_PUT_U64(skb, IPVS_STATS_ATTR_INBYTES, stats->inbytes); | 2586 | NLA_PUT_U64(skb, IPVS_STATS_ATTR_INBYTES, stats->ustats.inbytes); |
2598 | NLA_PUT_U64(skb, IPVS_STATS_ATTR_OUTBYTES, stats->outbytes); | 2587 | NLA_PUT_U64(skb, IPVS_STATS_ATTR_OUTBYTES, stats->ustats.outbytes); |
2599 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_CPS, stats->cps); | 2588 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_CPS, stats->ustats.cps); |
2600 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_INPPS, stats->inpps); | 2589 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_INPPS, stats->ustats.inpps); |
2601 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_OUTPPS, stats->outpps); | 2590 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_OUTPPS, stats->ustats.outpps); |
2602 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_INBPS, stats->inbps); | 2591 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_INBPS, stats->ustats.inbps); |
2603 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_OUTBPS, stats->outbps); | 2592 | NLA_PUT_U32(skb, IPVS_STATS_ATTR_OUTBPS, stats->ustats.outbps); |
2604 | 2593 | ||
2605 | spin_unlock_bh(&stats->lock); | 2594 | spin_unlock_bh(&stats->lock); |
2606 | 2595 | ||