Commit 8501841a authored by Amir Vadai's avatar Amir Vadai Committed by David S. Miller

net/mlx4_en: Low Latency recv statistics

Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9e77a2b8
...@@ -222,7 +222,12 @@ static int mlx4_en_get_sset_count(struct net_device *dev, int sset) ...@@ -222,7 +222,12 @@ static int mlx4_en_get_sset_count(struct net_device *dev, int sset)
switch (sset) { switch (sset) {
case ETH_SS_STATS: case ETH_SS_STATS:
return (priv->stats_bitmap ? bit_count : NUM_ALL_STATS) + return (priv->stats_bitmap ? bit_count : NUM_ALL_STATS) +
(priv->tx_ring_num + priv->rx_ring_num) * 2; (priv->tx_ring_num * 2) +
#ifdef CONFIG_NET_LL_RX_POLL
(priv->rx_ring_num * 5);
#else
(priv->rx_ring_num * 2);
#endif
case ETH_SS_TEST: case ETH_SS_TEST:
return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.flags return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.flags
& MLX4_DEV_CAP_FLAG_UC_LOOPBACK) * 2; & MLX4_DEV_CAP_FLAG_UC_LOOPBACK) * 2;
...@@ -271,6 +276,11 @@ static void mlx4_en_get_ethtool_stats(struct net_device *dev, ...@@ -271,6 +276,11 @@ static void mlx4_en_get_ethtool_stats(struct net_device *dev,
for (i = 0; i < priv->rx_ring_num; i++) { for (i = 0; i < priv->rx_ring_num; i++) {
data[index++] = priv->rx_ring[i].packets; data[index++] = priv->rx_ring[i].packets;
data[index++] = priv->rx_ring[i].bytes; data[index++] = priv->rx_ring[i].bytes;
#ifdef CONFIG_NET_LL_RX_POLL
data[index++] = priv->rx_ring[i].yields;
data[index++] = priv->rx_ring[i].misses;
data[index++] = priv->rx_ring[i].cleaned;
#endif
} }
spin_unlock_bh(&priv->stats_lock); spin_unlock_bh(&priv->stats_lock);
...@@ -334,6 +344,14 @@ static void mlx4_en_get_strings(struct net_device *dev, ...@@ -334,6 +344,14 @@ static void mlx4_en_get_strings(struct net_device *dev,
"rx%d_packets", i); "rx%d_packets", i);
sprintf(data + (index++) * ETH_GSTRING_LEN, sprintf(data + (index++) * ETH_GSTRING_LEN,
"rx%d_bytes", i); "rx%d_bytes", i);
#ifdef CONFIG_NET_LL_RX_POLL
sprintf(data + (index++) * ETH_GSTRING_LEN,
"rx%d_napi_yield", i);
sprintf(data + (index++) * ETH_GSTRING_LEN,
"rx%d_misses", i);
sprintf(data + (index++) * ETH_GSTRING_LEN,
"rx%d_cleaned", i);
#endif
} }
break; break;
} }
......
...@@ -85,6 +85,10 @@ static int mlx4_en_low_latency_recv(struct napi_struct *napi) ...@@ -85,6 +85,10 @@ static int mlx4_en_low_latency_recv(struct napi_struct *napi)
return LL_FLUSH_BUSY; return LL_FLUSH_BUSY;
done = mlx4_en_process_rx_cq(dev, cq, 4); done = mlx4_en_process_rx_cq(dev, cq, 4);
if (likely(done))
rx_ring->cleaned += done;
else
rx_ring->misses++;
mlx4_en_cq_unlock_poll(cq); mlx4_en_cq_unlock_poll(cq);
......
...@@ -290,6 +290,11 @@ struct mlx4_en_rx_ring { ...@@ -290,6 +290,11 @@ struct mlx4_en_rx_ring {
void *rx_info; void *rx_info;
unsigned long bytes; unsigned long bytes;
unsigned long packets; unsigned long packets;
#ifdef CONFIG_NET_LL_RX_POLL
unsigned long yields;
unsigned long misses;
unsigned long cleaned;
#endif
unsigned long csum_ok; unsigned long csum_ok;
unsigned long csum_none; unsigned long csum_none;
int hwtstamp_rx_filter; int hwtstamp_rx_filter;
...@@ -625,6 +630,7 @@ static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq) ...@@ -625,6 +630,7 @@ static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq)
cq->state |= MLX4_EN_CQ_STATE_POLL_YIELD; cq->state |= MLX4_EN_CQ_STATE_POLL_YIELD;
rc = false; rc = false;
rx_ring->yields++;
} else } else
/* preserve yield marks */ /* preserve yield marks */
cq->state |= MLX4_EN_CQ_STATE_POLL; cq->state |= MLX4_EN_CQ_STATE_POLL;
......
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