Commit 4beaacc6 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net/mlx4_en: remove fallback after kzalloc_node()

kzalloc_node(..., GFP_KERNEL, node) will attempt to allocate
memory as close as possible to the node.

There is no need to fallback to kzalloc() if this has failed.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c03b0358
...@@ -53,13 +53,10 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, ...@@ -53,13 +53,10 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv,
int err; int err;
cq = kzalloc_node(sizeof(*cq), GFP_KERNEL, node); cq = kzalloc_node(sizeof(*cq), GFP_KERNEL, node);
if (!cq) {
cq = kzalloc(sizeof(*cq), GFP_KERNEL);
if (!cq) { if (!cq) {
en_err(priv, "Failed to allocate CQ structure\n"); en_err(priv, "Failed to allocate CQ structure\n");
return -ENOMEM; return -ENOMEM;
} }
}
cq->size = entries; cq->size = entries;
cq->buf_size = cq->size * mdev->dev->caps.cqe_size; cq->buf_size = cq->size * mdev->dev->caps.cqe_size;
......
...@@ -270,13 +270,10 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv, ...@@ -270,13 +270,10 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
int tmp; int tmp;
ring = kzalloc_node(sizeof(*ring), GFP_KERNEL, node); ring = kzalloc_node(sizeof(*ring), GFP_KERNEL, node);
if (!ring) {
ring = kzalloc(sizeof(*ring), GFP_KERNEL);
if (!ring) { if (!ring) {
en_err(priv, "Failed to allocate RX ring structure\n"); en_err(priv, "Failed to allocate RX ring structure\n");
return -ENOMEM; return -ENOMEM;
} }
}
ring->prod = 0; ring->prod = 0;
ring->cons = 0; ring->cons = 0;
......
...@@ -56,13 +56,10 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, ...@@ -56,13 +56,10 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
int err; int err;
ring = kzalloc_node(sizeof(*ring), GFP_KERNEL, node); ring = kzalloc_node(sizeof(*ring), GFP_KERNEL, node);
if (!ring) {
ring = kzalloc(sizeof(*ring), GFP_KERNEL);
if (!ring) { if (!ring) {
en_err(priv, "Failed allocating TX ring\n"); en_err(priv, "Failed allocating TX ring\n");
return -ENOMEM; return -ENOMEM;
} }
}
ring->size = size; ring->size = size;
ring->size_mask = size - 1; ring->size_mask = size - 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment