Commit eca09be8 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: report FW vNIC stats in interface stats

Report in standard netdev stats drops and errors as well as
RX multicast from the FW vNIC counters.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0041195d
...@@ -3167,6 +3167,7 @@ static void nfp_net_stat64(struct net_device *netdev, ...@@ -3167,6 +3167,7 @@ static void nfp_net_stat64(struct net_device *netdev,
struct nfp_net *nn = netdev_priv(netdev); struct nfp_net *nn = netdev_priv(netdev);
int r; int r;
/* Collect software stats */
for (r = 0; r < nn->max_r_vecs; r++) { for (r = 0; r < nn->max_r_vecs; r++) {
struct nfp_net_r_vector *r_vec = &nn->r_vecs[r]; struct nfp_net_r_vector *r_vec = &nn->r_vecs[r];
u64 data[3]; u64 data[3];
...@@ -3192,6 +3193,14 @@ static void nfp_net_stat64(struct net_device *netdev, ...@@ -3192,6 +3193,14 @@ static void nfp_net_stat64(struct net_device *netdev,
stats->tx_bytes += data[1]; stats->tx_bytes += data[1];
stats->tx_errors += data[2]; stats->tx_errors += data[2];
} }
/* Add in device stats */
stats->multicast += nn_readq(nn, NFP_NET_CFG_STATS_RX_MC_FRAMES);
stats->rx_dropped += nn_readq(nn, NFP_NET_CFG_STATS_RX_DISCARDS);
stats->rx_errors += nn_readq(nn, NFP_NET_CFG_STATS_RX_ERRORS);
stats->tx_dropped += nn_readq(nn, NFP_NET_CFG_STATS_TX_DISCARDS);
stats->tx_errors += nn_readq(nn, NFP_NET_CFG_STATS_TX_ERRORS);
} }
static int nfp_net_set_features(struct net_device *netdev, static int nfp_net_set_features(struct net_device *netdev,
......
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