Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328567
b: refs/heads/master
c: ef3d0c4
h: refs/heads/master
i:
  328565: eb3e62d
  328563: dc3e62e
  328559: b72c62b
v: v3
  • Loading branch information
Tatyana Nikolova authored and Roland Dreier committed Oct 1, 2012
1 parent 03f13f3 commit 476f760
Show file tree
Hide file tree
Showing 28 changed files with 349 additions and 7,188 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aadf4f3f66a7b710b05b31ac0839fbbf59e41f7c
refs/heads/master: ef3d0c4a5e8c7ad3429b9f9ef66cf5a7563cd513
43 changes: 1 addition & 42 deletions trunk/drivers/infiniband/core/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ int ib_find_cached_pkey(struct ib_device *device,
unsigned long flags;
int i;
int ret = -ENOENT;
int partial_ix = -1;

if (port_num < start_port(device) || port_num > end_port(device))
return -EINVAL;
Expand All @@ -180,46 +179,6 @@ int ib_find_cached_pkey(struct ib_device *device,

for (i = 0; i < cache->table_len; ++i)
if ((cache->table[i] & 0x7fff) == (pkey & 0x7fff)) {
if (cache->table[i] & 0x8000) {
*index = i;
ret = 0;
break;
} else
partial_ix = i;
}

if (ret && partial_ix >= 0) {
*index = partial_ix;
ret = 0;
}

read_unlock_irqrestore(&device->cache.lock, flags);

return ret;
}
EXPORT_SYMBOL(ib_find_cached_pkey);

int ib_find_exact_cached_pkey(struct ib_device *device,
u8 port_num,
u16 pkey,
u16 *index)
{
struct ib_pkey_cache *cache;
unsigned long flags;
int i;
int ret = -ENOENT;

if (port_num < start_port(device) || port_num > end_port(device))
return -EINVAL;

read_lock_irqsave(&device->cache.lock, flags);

cache = device->cache.pkey_cache[port_num - start_port(device)];

*index = -1;

for (i = 0; i < cache->table_len; ++i)
if (cache->table[i] == pkey) {
*index = i;
ret = 0;
break;
Expand All @@ -229,7 +188,7 @@ int ib_find_exact_cached_pkey(struct ib_device *device,

return ret;
}
EXPORT_SYMBOL(ib_find_exact_cached_pkey);
EXPORT_SYMBOL(ib_find_cached_pkey);

int ib_get_cached_lmc(struct ib_device *device,
u8 port_num,
Expand Down
16 changes: 3 additions & 13 deletions trunk/drivers/infiniband/core/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,28 +707,18 @@ int ib_find_pkey(struct ib_device *device,
{
int ret, i;
u16 tmp_pkey;
int partial_ix = -1;

for (i = 0; i < device->pkey_tbl_len[port_num - start_port(device)]; ++i) {
ret = ib_query_pkey(device, port_num, i, &tmp_pkey);
if (ret)
return ret;

if ((pkey & 0x7fff) == (tmp_pkey & 0x7fff)) {
/* if there is full-member pkey take it.*/
if (tmp_pkey & 0x8000) {
*index = i;
return 0;
}
if (partial_ix < 0)
partial_ix = i;
*index = i;
return 0;
}
}

/*no full-member, if exists take the limited*/
if (partial_ix >= 0) {
*index = partial_ix;
return 0;
}
return -ENOENT;
}
EXPORT_SYMBOL(ib_find_pkey);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/mlx4/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
obj-$(CONFIG_MLX4_INFINIBAND) += mlx4_ib.o

mlx4_ib-y := ah.o cq.o doorbell.o mad.o main.o mr.o qp.o srq.o mcg.o cm.o alias_GUID.o sysfs.o
mlx4_ib-y := ah.o cq.o doorbell.o mad.o main.o mr.o qp.o srq.o
Loading

0 comments on commit 476f760

Please sign in to comment.