[Devel] [PATCH RHEL7 COMMIT] bnx2x: suppress warnings on DMA memory allocation

Konstantin Khorenko khorenko at virtuozzo.com
Wed Oct 10 18:56:11 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.14.4.vz7.72.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.14.4.vz7.72.6
------>
commit 8c91e519af93fe48615b584c0fc45a3b85584fd9
Author: Jan Dakinevich <jan.dakinevich at virtuozzo.com>
Date:   Wed Oct 10 18:56:07 2018 +0300

    bnx2x: suppress warnings on DMA memory allocation
    
    Suppress all allocator's warnings to skip checking for high page order,
    and re-raise own warning if the allocation failed.
    
    https://jira.sw.ru/browse/HCI-140
    Signed-off-by: Jan Dakinevich <jan.dakinevich at virtuozzo.com>
    Acked-by: Denis V. Lunev <den at openvz.org>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
index a5265e1344f1..39ffb37e8d6d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -52,22 +52,26 @@ extern int bnx2x_num_queues;
 
 #define BNX2X_PCI_ALLOC(y, size)					\
 ({									\
-	void *x = dma_zalloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \
+	void *x = dma_zalloc_coherent(&bp->pdev->dev, size, y,		\
+				      GFP_KERNEL | __GFP_NOWARN);	\
 	if (x)								\
 		DP(NETIF_MSG_HW,					\
 		   "BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n",	\
 		   (unsigned long long)(*y), x);			\
+	WARN_ON(!x);							\
 	x;								\
 })
 #define BNX2X_PCI_FALLOC(y, size)					\
 ({									\
-	void *x = dma_alloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \
+	void *x = dma_alloc_coherent(&bp->pdev->dev, size, y,		\
+				     GFP_KERNEL | __GFP_NOWARN);	\
 	if (x) {							\
 		memset(x, 0xff, size);					\
 		DP(NETIF_MSG_HW,					\
 		   "BNX2X_PCI_FALLOC: Physical %Lx Virtual %p\n",	\
 		   (unsigned long long)(*y), x);			\
 	}								\
+	WARN_ON(!x);							\
 	x;								\
 })
 



More information about the Devel mailing list