From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B64011D0492; Tue, 15 Oct 2024 11:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728993331; cv=none; b=u8yu7RwVeutrlEYqwGTJSmKamGTSHKTiMrrVEq6ymPjn1EGOjFKI4C5GCdQqICLQXSP275u8vleb74OjPeYMeNZ9U6+ojHMRAOtX41fnn6cPaE0vbfTmG6hCwdhpwr5+BLn27ufwy6xrJtkDNwaVq+k55HrSVFYNGJ23+nG5+4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728993331; c=relaxed/simple; bh=JqmUzMniTJVjGrgu8PraT93SNKUQNjAVD83p/O5UtAg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zz2r48ehjrR5Q/JiQOxXUcqYBp9QdaWBAe8kXS9DB7qHC1s2fm5GpSUnp1m5jeK8kZv88G4B3xytL7N6NavRVqUTFfYiojrgFwoqVDqABZ2vsaaMkTM50y1ZkiOhhrMbYZynRVWF3xQcjRvZiOXxlWYInDn2aE3UdrMw27byXsc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=tgi3m5/V; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="tgi3m5/V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40369C4CEC6; Tue, 15 Oct 2024 11:55:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728993331; bh=JqmUzMniTJVjGrgu8PraT93SNKUQNjAVD83p/O5UtAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tgi3m5/V+Wn47MGk26honAx+YaNW0z/Haoe58v32HRBfSGjj3sEmjr4bmXV5qsJmW PT+QBcBQWrK5lkR8pp2oQGC3ns5Ln0QBl30oR2+y4CTSsb6MAfGlYWob9Hnd7qiC+0 HGq/BfNW2sjXH73DnLkS7cPlLqdM7QnU2yvtrMYU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gerd Bayer , Zhu Yanjun , Maxim Mikityanskiy , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.15 378/691] net/mlx5: Fix error path in multi-packet WQE transmit Date: Tue, 15 Oct 2024 13:25:26 +0200 Message-ID: <20241015112455.348752958@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015112440.309539031@linuxfoundation.org> References: <20241015112440.309539031@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gerd Bayer [ Upstream commit 2bcae12c795f32ddfbf8c80d1b5f1d3286341c32 ] 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 Reviewed-by: Zhu Yanjun Acked-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- 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 6813279b57f89..7ec8a5ae7ea74 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -685,7 +685,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.43.0