aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 20:20:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 20:20:40 -0400
commit7a9a2970b5c1c2ce73d4bb84edaa7ebf13e0c841 (patch)
treebd4909abfcd759b376cfd2fab06281df366f6a0f /drivers/infiniband/core
parentfc47912d9cda50ae6bd9ca30e97e8c03de5b7b60 (diff)
parentd172f5a4ab151a952a0d898ba3b0ff6a020171a6 (diff)
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull infiniband updates from Roland Dreier: "First batch of InfiniBand/RDMA changes for the 3.7 merge window: - mlx4 IB support for SR-IOV - A couple of SRP initiator fixes - Batch of nes hardware driver fixes - Fix for long-standing use-after-free crash in IPoIB - Other miscellaneous fixes" This merge also removes a new use of __cancel_delayed_work(), and replaces it with the regular cancel_delayed_work() that is now irq-safe thanks to the workqueue updates. That said, I suspect the sequence in question should probably use "mod_delayed_work()". I just did the minimal "don't use deprecated functions" fixup, though. * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (45 commits) IB/qib: Fix local access validation for user MRs mlx4_core: Disable SENSE_PORT for multifunction devices mlx4_core: Clean up enabling of SENSE_PORT for older (ConnectX-1/-2) HCAs mlx4_core: Stash PCI ID driver_data in mlx4_priv structure IB/srp: Avoid having aborted requests hang IB/srp: Fix use-after-free in srp_reset_req() IB/qib: Add a qib driver version RDMA/nes: Fix compilation error when nes_debug is enabled RDMA/nes: Print hardware resource type RDMA/nes: Fix for crash when TX checksum offload is off RDMA/nes: Cosmetic changes RDMA/nes: Fix for incorrect MSS when TSO is on RDMA/nes: Fix incorrect resolving of the loopback MAC address mlx4_core: Fix crash on uninitialized priv->cmd.slave_sem mlx4_core: Trivial cleanups to driver log messages mlx4_core: Trivial readability fix: "0X30" -> "0x30" IB/mlx4: Create paravirt contexts for VFs when master IB driver initializes mlx4: Modify proxy/tunnel QP mechanism so that guests do no calculations mlx4: Paravirtualize Node Guids for slaves mlx4: Activate SR-IOV mode for IB ...
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/cache.c43
-rw-r--r--drivers/infiniband/core/cma.c5
-rw-r--r--drivers/infiniband/core/device.c16
-rw-r--r--drivers/infiniband/core/ucm.c1
-rw-r--r--drivers/infiniband/core/ucma.c1
5 files changed, 59 insertions, 7 deletions
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
index 9353992f9eea..80f6cf2449fb 100644
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -167,6 +167,7 @@ int ib_find_cached_pkey(struct ib_device *device,
167 unsigned long flags; 167 unsigned long flags;
168 int i; 168 int i;
169 int ret = -ENOENT; 169 int ret = -ENOENT;
170 int partial_ix = -1;
170 171
171 if (port_num < start_port(device) || port_num > end_port(device)) 172 if (port_num < start_port(device) || port_num > end_port(device))
172 return -EINVAL; 173 return -EINVAL;
@@ -179,6 +180,46 @@ int ib_find_cached_pkey(struct ib_device *device,
179 180
180 for (i = 0; i < cache->table_len; ++i) 181 for (i = 0; i < cache->table_len; ++i)
181 if ((cache->table[i] & 0x7fff) == (pkey & 0x7fff)) { 182 if ((cache->table[i] & 0x7fff) == (pkey & 0x7fff)) {
183 if (cache->table[i] & 0x8000) {
184 *index = i;
185 ret = 0;
186 break;
187 } else
188 partial_ix = i;
189 }
190
191 if (ret && partial_ix >= 0) {
192 *index = partial_ix;
193 ret = 0;
194 }
195
196 read_unlock_irqrestore(&device->cache.lock, flags);
197
198 return ret;
199}
200EXPORT_SYMBOL(ib_find_cached_pkey);
201
202int ib_find_exact_cached_pkey(struct ib_device *device,
203 u8 port_num,
204 u16 pkey,
205 u16 *index)
206{
207 struct ib_pkey_cache *cache;
208 unsigned long flags;
209 int i;
210 int ret = -ENOENT;
211
212 if (port_num < start_port(device) || port_num > end_port(device))
213 return -EINVAL;
214
215 read_lock_irqsave(&device->cache.lock, flags);
216
217 cache = device->cache.pkey_cache[port_num - start_port(device)];
218
219 *index = -1;
220
221 for (i = 0; i < cache->table_len; ++i)
222 if (cache->table[i] == pkey) {
182 *index = i; 223 *index = i;
183 ret = 0; 224 ret = 0;
184 break; 225 break;
@@ -188,7 +229,7 @@ int ib_find_cached_pkey(struct ib_device *device,
188 229
189 return ret; 230 return ret;
190} 231}
191EXPORT_SYMBOL(ib_find_cached_pkey); 232EXPORT_SYMBOL(ib_find_exact_cached_pkey);
192 233
193int ib_get_cached_lmc(struct ib_device *device, 234int ib_get_cached_lmc(struct ib_device *device,
194 u8 port_num, 235 u8 port_num,
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 7172559ce0c1..26b37603dcf1 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -3058,7 +3058,10 @@ static int cma_join_ib_multicast(struct rdma_id_private *id_priv,
3058 3058
3059 if (id_priv->id.ps == RDMA_PS_IPOIB) 3059 if (id_priv->id.ps == RDMA_PS_IPOIB)
3060 comp_mask |= IB_SA_MCMEMBER_REC_RATE | 3060 comp_mask |= IB_SA_MCMEMBER_REC_RATE |
3061 IB_SA_MCMEMBER_REC_RATE_SELECTOR; 3061 IB_SA_MCMEMBER_REC_RATE_SELECTOR |
3062 IB_SA_MCMEMBER_REC_MTU_SELECTOR |
3063 IB_SA_MCMEMBER_REC_MTU |
3064 IB_SA_MCMEMBER_REC_HOP_LIMIT;
3062 3065
3063 mc->multicast.ib = ib_sa_join_multicast(&sa_client, id_priv->id.device, 3066 mc->multicast.ib = ib_sa_join_multicast(&sa_client, id_priv->id.device,
3064 id_priv->id.port_num, &rec, 3067 id_priv->id.port_num, &rec,
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index e711de400a01..18c1ece765f2 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -707,18 +707,28 @@ int ib_find_pkey(struct ib_device *device,
707{ 707{
708 int ret, i; 708 int ret, i;
709 u16 tmp_pkey; 709 u16 tmp_pkey;
710 int partial_ix = -1;
710 711
711 for (i = 0; i < device->pkey_tbl_len[port_num - start_port(device)]; ++i) { 712 for (i = 0; i < device->pkey_tbl_len[port_num - start_port(device)]; ++i) {
712 ret = ib_query_pkey(device, port_num, i, &tmp_pkey); 713 ret = ib_query_pkey(device, port_num, i, &tmp_pkey);
713 if (ret) 714 if (ret)
714 return ret; 715 return ret;
715
716 if ((pkey & 0x7fff) == (tmp_pkey & 0x7fff)) { 716 if ((pkey & 0x7fff) == (tmp_pkey & 0x7fff)) {
717 *index = i; 717 /* if there is full-member pkey take it.*/
718 return 0; 718 if (tmp_pkey & 0x8000) {
719 *index = i;
720 return 0;
721 }
722 if (partial_ix < 0)
723 partial_ix = i;
719 } 724 }
720 } 725 }
721 726
727 /*no full-member, if exists take the limited*/
728 if (partial_ix >= 0) {
729 *index = partial_ix;
730 return 0;
731 }
722 return -ENOENT; 732 return -ENOENT;
723} 733}
724EXPORT_SYMBOL(ib_find_pkey); 734EXPORT_SYMBOL(ib_find_pkey);
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index 06f08713f487..49b15ac1987e 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -397,7 +397,6 @@ static ssize_t ib_ucm_event(struct ib_ucm_file *file,
397 struct ib_ucm_event_get cmd; 397 struct ib_ucm_event_get cmd;
398 struct ib_ucm_event *uevent; 398 struct ib_ucm_event *uevent;
399 int result = 0; 399 int result = 0;
400 DEFINE_WAIT(wait);
401 400
402 if (out_len < sizeof(struct ib_ucm_event_resp)) 401 if (out_len < sizeof(struct ib_ucm_event_resp))
403 return -ENOSPC; 402 return -ENOSPC;
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 055ed59838dc..7972bae2e9b3 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -310,7 +310,6 @@ static ssize_t ucma_get_event(struct ucma_file *file, const char __user *inbuf,
310 struct rdma_ucm_get_event cmd; 310 struct rdma_ucm_get_event cmd;
311 struct ucma_event *uevent; 311 struct ucma_event *uevent;
312 int ret = 0; 312 int ret = 0;
313 DEFINE_WAIT(wait);
314 313
315 if (out_len < sizeof uevent->resp) 314 if (out_len < sizeof uevent->resp)
316 return -ENOSPC; 315 return -ENOSPC;