Date: Mon, 13 Apr 2020 08:56:20 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r359851 - stable/12/sys/dev/mlx5/mlx5_en Message-ID: <202004130856.03D8uKKP095856@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon Apr 13 08:56:19 2020 New Revision: 359851 URL: https://svnweb.freebsd.org/changeset/base/359851 Log: 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 Modified: stable/12/sys/dev/mlx5/mlx5_en/en.h stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/en.h Mon Apr 13 08:45:05 2020 (r359850) +++ stable/12/sys/dev/mlx5/mlx5_en/en.h Mon Apr 13 08:56:19 2020 (r359851) @@ -624,6 +624,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)) Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Apr 13 08:45:05 2020 (r359850) +++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Apr 13 08:56:19 2020 (r359851) @@ -306,8 +306,10 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struct mbuf **mbp) u8 opcode; /* Return ENOBUFS if the queue is full */ - if (unlikely(!mlx5e_sq_has_room_for(sq, 2 * MLX5_SEND_WQE_MAX_WQEBBS))) + if (unlikely(!mlx5e_sq_has_room_for(sq, 2 * MLX5_SEND_WQE_MAX_WQEBBS))) { + sq->stats.enobuf++; return (ENOBUFS); + } /* Align SQ edge with NOPs to avoid WQE wrap around */ pi = ((~sq->pc) & sq->wq.sz_m1); @@ -315,8 +317,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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004130856.03D8uKKP095856>