From: Jan Dakinevich <jan.dakinev...@virtuozzo.com>

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.dakinev...@virtuozzo.com>
Acked-by: Denis V. Lunev <d...@openvz.org>

Rebased to vz8:
 - dma_zalloc_coherent -> dma_alloc_coherent since it is now zeroing memory

(cherry-picked from vz7 commit 8c91e519af93 ("bnx2x: suppress warnings on DMA
memory allocation"))

Signed-off-by: Andrey Zhadchenko <andrey.zhadche...@virtuozzo.com>

khorenko@: replaced generic flag __GFP_NOWARN with vz specific
__GFP_ORDER_NOWARN.

(cherry picked from vz8 commit 6d8af521756464a73eee319ca6e329454c452db3)
Signed-off-by: Andrey Zhadchenko <andrey.zhadche...@virtuozzo.com>
---
 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 d8b1824..d805fea 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -52,22 +52,26 @@
 
 #define BNX2X_PCI_ALLOC(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_ORDER_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_ORDER_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;                                                              \
 })
 
-- 
1.8.3.1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to