summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/nes/nes.h
diff options
context:
space:
mode:
authorTatyana Nikolova <Tatyana.E.Nikolova@intel.com>2012-09-20 21:08:04 +0000
committerRoland Dreier <roland@purestorage.com>2012-09-30 20:34:55 -0700
commit818216442b6dd49fa93a4caf9d7b56af364b502b (patch)
treef9f576907c2b3ae24a9a681fcb161b82802fea86 /drivers/infiniband/hw/nes/nes.h
parentfc4ba7291b3dc7ace34794f51c47f041949c7a92 (diff)
RDMA/nes: Print hardware resource type
Hardware resource types are added and when a resource isn't available, its type is printed. Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/nes/nes.h')
-rw-r--r--drivers/infiniband/hw/nes/nes.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h
index c438e4691b3c..0da62b904d00 100644
--- a/drivers/infiniband/hw/nes/nes.h
+++ b/drivers/infiniband/hw/nes/nes.h
@@ -399,11 +399,20 @@ static inline void nes_write8(void __iomem *addr, u8 val)
writeb(val, addr);
}
-
+enum nes_resource {
+ NES_RESOURCE_MW = 1,
+ NES_RESOURCE_FAST_MR,
+ NES_RESOURCE_PHYS_MR,
+ NES_RESOURCE_USER_MR,
+ NES_RESOURCE_PD,
+ NES_RESOURCE_QP,
+ NES_RESOURCE_CQ,
+ NES_RESOURCE_ARP
+};
static inline int nes_alloc_resource(struct nes_adapter *nesadapter,
unsigned long *resource_array, u32 max_resources,
- u32 *req_resource_num, u32 *next)
+ u32 *req_resource_num, u32 *next, enum nes_resource resource_type)
{
unsigned long flags;
u32 resource_num;
@@ -414,7 +423,7 @@ static inline int nes_alloc_resource(struct nes_adapter *nesadapter,
if (resource_num >= max_resources) {
resource_num = find_first_zero_bit(resource_array, max_resources);
if (resource_num >= max_resources) {
- printk(KERN_ERR PFX "%s: No available resourcess.\n", __func__);
+ printk(KERN_ERR PFX "%s: No available resources [type=%u].\n", __func__, resource_type);
spin_unlock_irqrestore(&nesadapter->resource_lock, flags);
return -EMFILE;
}