From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
Gal Pressman <gal@nvidia.com>,
Leon Romanovsky <leonro@nvidia.com>,
Gerd Bayer <gbayer@linux.ibm.com>,
Zhu Yanjun <yanjun.zhu@linux.dev>,
Maxim Mikityanskiy <maxtram95@gmail.com>
Subject: [net 1/8] net/mlx5: Fix error path in multi-packet WQE transmit
Date: Wed, 25 Sep 2024 13:20:06 -0700 [thread overview]
Message-ID: <20240925202013.45374-2-saeed@kernel.org> (raw)
In-Reply-To: <20240925202013.45374-1-saeed@kernel.org>
From: Gerd Bayer <gbayer@linux.ibm.com>
Remove the erroneous unmap in case no DMA mapping was established
The multi-packet WQE transmit code attempts to obtain a DMA mapping for
the skb. This could fail, e.g. under memory pressure, when the IOMMU
driver just can't allocate more memory for page tables. While the code
tries to handle this in the path below the err_unmap label it erroneously
unmaps one entry from the sq's FIFO list of active mappings. Since the
current map attempt failed this unmap is removing some random DMA mapping
that might still be required. If the PCI function now presents that IOVA,
the IOMMU may assumes a rogue DMA access and e.g. on s390 puts the PCI
function in error state.
The erroneous behavior was seen in a stress-test environment that created
memory pressure.
Fixes: 5af75c747e2a ("net/mlx5e: Enhanced TX MPWQE for SKBs")
Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Acked-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index b09e9abd39f3..f8c7912abe0e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -642,7 +642,6 @@ mlx5e_sq_xmit_mpwqe(struct mlx5e_txqsq *sq, struct sk_buff *skb,
return;
err_unmap:
- mlx5e_dma_unmap_wqe_err(sq, 1);
sq->stats->dropped++;
dev_kfree_skb_any(skb);
mlx5e_tx_flush(sq);
--
2.46.1
next prev parent reply other threads:[~2024-09-25 20:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 20:20 [pull request][net 0/8] mlx5 fixes 2024-09-25 Saeed Mahameed
2024-09-25 20:20 ` Saeed Mahameed [this message]
2024-10-03 0:30 ` [net 1/8] net/mlx5: Fix error path in multi-packet WQE transmit patchwork-bot+netdevbpf
2024-09-25 20:20 ` [net 2/8] net/mlx5: Added cond_resched() to crdump collection Saeed Mahameed
2024-09-25 20:20 ` [net 3/8] net/mlx5e: Fix NULL deref in mlx5e_tir_builder_alloc() Saeed Mahameed
2024-09-25 20:20 ` [net 4/8] net/mlx5: Fix wrong reserved field in hca_cap_2 in mlx5_ifc Saeed Mahameed
2024-09-25 20:20 ` [net 5/8] net/mlx5: HWS, fixed double-free in error flow of creating SQ Saeed Mahameed
2024-09-25 20:20 ` [net 6/8] net/mlx5: HWS, changed E2BIG error to a negative return code Saeed Mahameed
2024-09-25 20:20 ` [net 7/8] net/mlx5e: SHAMPO, Fix overflow of hd_per_wq Saeed Mahameed
2024-09-25 20:20 ` [net 8/8] net/mlx5e: Fix crash caused by calling __xfrm_state_delete() twice Saeed Mahameed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240925202013.45374-2-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=gbayer@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=leonro@nvidia.com \
--cc=maxtram95@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
--cc=yanjun.zhu@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).