aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-04-13 09:02:17 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-04-13 09:02:17 +0000
commit70e542788103a8578f6eef3840e51e2e2d3586a8 (patch)
treed8a577ff3b8cac20abfb0002b4b720b37ad3607c
parent644d59c8aec1887fccbe79682c2526f9effbbc9c (diff)
downloadsrc-70e542788103a8578f6eef3840e51e2e2d3586a8.tar.gz
src-70e542788103a8578f6eef3840e51e2e2d3586a8.zip
MFC r359653:
Count number of times transmit ring is out of buffers in mlx5en(4). Differential Revision: https://reviews.freebsd.org/D24273 Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/stable/10/; revision=359855
-rw-r--r--sys/dev/mlx5/mlx5_en/en.h1
-rw-r--r--sys/dev/mlx5/mlx5_en/mlx5_en_tx.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h
index d9e0d98d3693..9c437bdabaff 100644
--- a/sys/dev/mlx5/mlx5_en/en.h
+++ b/sys/dev/mlx5/mlx5_en/en.h
@@ -355,6 +355,7 @@ struct mlx5e_rq_stats {
m(+1, u64 csum_offload_none, "csum_offload_none", "Transmitted packets") \
m(+1, u64 defragged, "defragged", "Transmitted packets") \
m(+1, u64 dropped, "dropped", "Transmitted packets") \
+ m(+1, u64 enobuf, "enobuf", "Transmitted packets") \
m(+1, u64 nop, "nop", "Transmitted packets")
#define MLX5E_SQ_STATS_NUM (0 MLX5E_SQ_STATS(MLX5E_STATS_COUNT))
diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
index 3dcf399fc683..6e32455b8285 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
@@ -255,6 +255,7 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struct mbuf **mbp)
* of the mbuf into the drbr (see mlx5e_xmit_locked)
*/
if (unlikely(!mlx5e_sq_has_room_for(sq, 2 * MLX5_SEND_WQE_MAX_WQEBBS))) {
+ sq->stats.enobuf++;
return (ENOBUFS);
}
@@ -264,8 +265,10 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struct mbuf **mbp)
/* Send one multi NOP message instead of many */
mlx5e_send_nop(sq, (pi + 1) * MLX5_SEND_WQEBB_NUM_DS);
pi = ((~sq->pc) & sq->wq.sz_m1);
- if (pi < (MLX5_SEND_WQE_MAX_WQEBBS - 1))
+ if (pi < (MLX5_SEND_WQE_MAX_WQEBBS - 1)) {
+ sq->stats.enobuf++;
return (ENOMEM);
+ }
}
/* Setup local variables */