svn commit: r347827 - stable/11/sys/dev/mlx5/mlx5_en
Hans Petter Selasky
hselasky at FreeBSD.org
Thu May 16 17:34:10 UTC 2019
Author: hselasky
Date: Thu May 16 17:34:09 2019
New Revision: 347827
URL: https://svnweb.freebsd.org/changeset/base/347827
Log:
MFC r347277:
Avoid leaking send queue mbufs during error recovery in mlx5en(4).
Sponsored by: Mellanox Technologies
Modified:
stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu May 16 17:33:24 2019 (r347826)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu May 16 17:34:09 2019 (r347827)
@@ -1044,8 +1044,13 @@ mlx5e_free_sq_db(struct mlx5e_sq *sq)
int wq_sz = mlx5_wq_cyc_get_size(&sq->wq);
int x;
- for (x = 0; x != wq_sz; x++)
+ for (x = 0; x != wq_sz; x++) {
+ if (sq->mbuf[x].mbuf != NULL) {
+ bus_dmamap_unload(sq->dma_tag, sq->mbuf[x].dma_map);
+ m_freem(sq->mbuf[x].mbuf);
+ }
bus_dmamap_destroy(sq->dma_tag, sq->mbuf[x].dma_map);
+ }
free(sq->mbuf, M_MLX5EN);
}
Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu May 16 17:33:24 2019 (r347826)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu May 16 17:34:09 2019 (r347827)
@@ -496,7 +496,7 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, int budget)
for (x = 0; x != sq->cev_factor; x++) {
ci = sqcc & sq->wq.sz_m1;
mb = sq->mbuf[ci].mbuf;
- sq->mbuf[ci].mbuf = NULL; /* Safety clear */
+ sq->mbuf[ci].mbuf = NULL;
if (mb == NULL) {
if (sq->mbuf[ci].num_bytes == 0) {
More information about the svn-src-stable-11
mailing list