Commit bb63daf9 authored by Jarod Wilson's avatar Jarod Wilson Committed by David S. Miller

team: track sum of rx_nohandler for all slaves

CC: Jiri Pirko <jiri@resnulli.us>
CC: netdev@vger.kernel.org
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6e7333d3
...@@ -758,6 +758,8 @@ static rx_handler_result_t team_handle_frame(struct sk_buff **pskb) ...@@ -758,6 +758,8 @@ static rx_handler_result_t team_handle_frame(struct sk_buff **pskb)
u64_stats_update_end(&pcpu_stats->syncp); u64_stats_update_end(&pcpu_stats->syncp);
skb->dev = team->dev; skb->dev = team->dev;
} else if (res == RX_HANDLER_EXACT) {
this_cpu_inc(team->pcpu_stats->rx_nohandler);
} else { } else {
this_cpu_inc(team->pcpu_stats->rx_dropped); this_cpu_inc(team->pcpu_stats->rx_dropped);
} }
...@@ -1807,7 +1809,7 @@ team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) ...@@ -1807,7 +1809,7 @@ team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
struct team *team = netdev_priv(dev); struct team *team = netdev_priv(dev);
struct team_pcpu_stats *p; struct team_pcpu_stats *p;
u64 rx_packets, rx_bytes, rx_multicast, tx_packets, tx_bytes; u64 rx_packets, rx_bytes, rx_multicast, tx_packets, tx_bytes;
u32 rx_dropped = 0, tx_dropped = 0; u32 rx_dropped = 0, tx_dropped = 0, rx_nohandler = 0;
unsigned int start; unsigned int start;
int i; int i;
...@@ -1828,14 +1830,16 @@ team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) ...@@ -1828,14 +1830,16 @@ team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
stats->tx_packets += tx_packets; stats->tx_packets += tx_packets;
stats->tx_bytes += tx_bytes; stats->tx_bytes += tx_bytes;
/* /*
* rx_dropped & tx_dropped are u32, updated * rx_dropped, tx_dropped & rx_nohandler are u32,
* without syncp protection. * updated without syncp protection.
*/ */
rx_dropped += p->rx_dropped; rx_dropped += p->rx_dropped;
tx_dropped += p->tx_dropped; tx_dropped += p->tx_dropped;
rx_nohandler += p->rx_nohandler;
} }
stats->rx_dropped = rx_dropped; stats->rx_dropped = rx_dropped;
stats->tx_dropped = tx_dropped; stats->tx_dropped = tx_dropped;
stats->rx_nohandler = rx_nohandler;
return stats; return stats;
} }
......
...@@ -24,6 +24,7 @@ struct team_pcpu_stats { ...@@ -24,6 +24,7 @@ struct team_pcpu_stats {
struct u64_stats_sync syncp; struct u64_stats_sync syncp;
u32 rx_dropped; u32 rx_dropped;
u32 tx_dropped; u32 tx_dropped;
u32 rx_nohandler;
}; };
struct team; struct team;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment