Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242643
b: refs/heads/master
c: 9ace5e0
h: refs/heads/master
i:
  242641: 33007f6
  242639: bb79789
v: v3
  • Loading branch information
Eli Cohen authored and David S. Miller committed Mar 23, 2011
1 parent 15a24ff commit d263552
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42d1e017e2f040c3e3d62b6cfa3a26351a865d04
refs/heads/master: 9ace5e0176f165f04537497143506621d33a0139
8 changes: 8 additions & 0 deletions trunk/drivers/net/mlx4/pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
#include "mlx4.h"
#include "icm.h"

enum {
MLX4_NUM_RESERVED_UARS = 8
};

int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn)
{
struct mlx4_priv *priv = mlx4_priv(dev);
Expand Down Expand Up @@ -104,6 +108,10 @@ int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf)
if (!list_empty(&priv->bf_list))
uar = list_entry(priv->bf_list.next, struct mlx4_uar, bf_list);
else {
if (mlx4_bitmap_avail(&priv->uar_table.bitmap) < MLX4_NUM_RESERVED_UARS) {
err = -ENOMEM;
goto out;
}
uar = kmalloc(sizeof *uar, GFP_KERNEL);
if (!uar) {
err = -ENOMEM;
Expand Down

0 comments on commit d263552

Please sign in to comment.