mlx5_core: warn if no space left in alloc_4k()
Subsystems (5)
PATCH 1/1 mlx5_core: warn if no space left in alloc_4k()
The warning was unreachable. In the original code, it would print the line number and the function but I have added an error message.
---
I haven't tested this, hopefully the warning is not annoying.
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +1 -1
@@ -193,8 +193,8 @@ static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr)unsigned n;if (list_empty (&dev->priv.free_list)) { +mlx5_core_warn (dev,"no available space\n" );return -ENOMEM ; -mlx5_core_warn (dev,"\n" ); } fp = list_entry(dev->priv.free_list.next, struct fw_page, list);
A message that is not in the archive (sent off-list or not yet received): 20131101102044.GB29795-dZEljifmRObu9KfB+GxooP8+0UxHXcjY@public.gmane.org
Quoted 12 lines · Dan Carpenter
The warning was unreachable. In the original code, it would print the line number and the function but I have added an error message.
Signed-off-by Dan Carpenter <[email protected]>---
I haven't tested this, hopefully the warning is not annoying.drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +0
-0
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr) · line 198
Quoted 7 lines
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +1
-1@@ -193,8 +193,8 @@ static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr)unsigned n;if (list_empty (&dev->priv.free_list)) { +mlx5_core_warn (dev,"no available space\n" );return -ENOMEM ; -mlx5_core_warn (dev,"\n" ); }
What we really need to do here is silently return -ENOMEM. The list can be found empty on a regular basis so we don't want to flood dmesg with annoying messages. The statement was probably left there from a previous debug cycle.
Quoted 6 lines
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +0
-1fp = list_entry(dev->priv.free_list.next, struct fw_page, list); --To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 15 lines · Eli Cohen
Quoted 14 lines · Dan Carpenter
The warning was unreachable. In the original code, it would print the line number and the function but I have added an error message.
Signed-off-by Dan Carpenter <[email protected]>---
I haven't tested this, hopefully the warning is not annoying.drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +0
-0@@ -193,8 +193,8 @@ static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr)unsigned n;
Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr) · line 198
Quoted 5 lines
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +1
-1if (list_empty (&dev->priv.free_list)) { +mlx5_core_warn (dev,"no available space\n" );return -ENOMEM ; -mlx5_core_warn (dev,"\n" ); }What we really need to do here is silently return
-ENOMEM. The list can be found empty on a regular basis so we don't want to flood dmesg with annoying messages. The statement was probably left there from a previous debug cycle.
Ah, ok. Thanks for the review. I will remove the message.
regards,
dan carpenter
PATCH v2 1/1 mlx5_core: delete some dead code
In reply to Eli CohenThe printk() looks like it is left over debug code. I have removed it.
---
v2: Remove the printk instead of moving it infront of the return.
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +1 -3
@@ -192,10 +192,8 @@ static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr)struct fw_page *fp;unsigned n; -if (list_empty (&dev->priv.free_list)) { +if (list_empty (&dev->priv.free_list))return -ENOMEM ; -mlx5_core_warn (dev,"\n" ); - } fp = list_entry(dev->priv.free_list.next, struct fw_page, list); n =find_first_bit (&fp->bitmask,8 *sizeof (fp->bitmask));
David Miller
maintainerRe: [patch v2] mlx5_core: delete some dead code
From: Dan Carpenter <[email protected]>
Date: Tue, 5 Nov 2013 01:20:56 +0300
Quoted 5 lines
The
printk()looks like it is left over debug code. I have removed it.Signed-off-by Dan Carpenter <[email protected]>---
v2: Remove the printk instead of moving it infront of the return.
This doesn't apply to the current tree, I suspect some recent changes made this fix no longer applicable. Please take a look.
Thanks!