aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sun/sunvnet_common.c
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@oracle.com>2017-03-14 10:24:40 -0700
committerDavid S. Miller <davem@davemloft.net>2017-03-16 20:29:54 -0700
commit0f512c84544b9a8f8de53b6f4bc0c372c45d8693 (patch)
tree848642bf531b53e4700e226796c091468dcd7f50 /drivers/net/ethernet/sun/sunvnet_common.c
parentldmvsw: better use of link up and down on ldom vswitch (diff)
downloadlinux-dev-0f512c84544b9a8f8de53b6f4bc0c372c45d8693.tar.xz
linux-dev-0f512c84544b9a8f8de53b6f4bc0c372c45d8693.zip
sunvnet: add stats to track ldom to ldom packets and bytes
In this driver, there is a "port" created for the connection to each of the other ldoms; a netdev queue is mapped to each port, and they are collected under a single netdev. The generic netdev statistics show us all the traffic in and out of our network device, but don't show individual queue/port stats. This patch breaks out the traffic counts for the individual ports and gives us a little view into the state of those connections. Orabug: 25190537 Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sun/sunvnet_common.c')
-rw-r--r--drivers/net/ethernet/sun/sunvnet_common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sun/sunvnet_common.c b/drivers/net/ethernet/sun/sunvnet_common.c
index fbd0f1e5210e..7e95808f8227 100644
--- a/drivers/net/ethernet/sun/sunvnet_common.c
+++ b/drivers/net/ethernet/sun/sunvnet_common.c
@@ -411,6 +411,8 @@ static int vnet_rx_one(struct vnet_port *port, struct vio_net_desc *desc)
dev->stats.rx_packets++;
dev->stats.rx_bytes += len;
+ port->stats.rx_packets++;
+ port->stats.rx_bytes += len;
napi_gro_receive(&port->napi, skb);
return 0;
@@ -768,6 +770,7 @@ static int vnet_event_napi(struct vnet_port *port, int budget)
maybe_tx_wakeup(port);
port->rx_event = 0;
+ port->stats.event_reset++;
return 0;
}
@@ -781,6 +784,7 @@ static int vnet_event_napi(struct vnet_port *port, int budget)
vio_link_state_change(vio, LDC_EVENT_UP);
port->rx_event = 0;
+ port->stats.event_up++;
return 0;
}
@@ -1430,6 +1434,8 @@ ldc_start_done:
dev->stats.tx_packets++;
dev->stats.tx_bytes += port->tx_bufs[txi].skb->len;
+ port->stats.tx_packets++;
+ port->stats.tx_bytes += port->tx_bufs[txi].skb->len;
dr->prod = (dr->prod + 1) & (VNET_TX_RING_SIZE - 1);
if (unlikely(vnet_tx_dring_avail(dr) < 1)) {