diff options
Diffstat (limited to 'drivers/infiniband')
26 files changed, 65 insertions, 85 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index b37b0c02a7b9..5034a87cc72d 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
@@ -808,9 +808,12 @@ static ssize_t ucma_accept(struct ucma_file *file, const char __user *inbuf, | |||
808 | return PTR_ERR(ctx); | 808 | return PTR_ERR(ctx); |
809 | 809 | ||
810 | if (cmd.conn_param.valid) { | 810 | if (cmd.conn_param.valid) { |
811 | ctx->uid = cmd.uid; | ||
812 | ucma_copy_conn_param(&conn_param, &cmd.conn_param); | 811 | ucma_copy_conn_param(&conn_param, &cmd.conn_param); |
812 | mutex_lock(&file->mut); | ||
813 | ret = rdma_accept(ctx->cm_id, &conn_param); | 813 | ret = rdma_accept(ctx->cm_id, &conn_param); |
814 | if (!ret) | ||
815 | ctx->uid = cmd.uid; | ||
816 | mutex_unlock(&file->mut); | ||
814 | } else | 817 | } else |
815 | ret = rdma_accept(ctx->cm_id, NULL); | 818 | ret = rdma_accept(ctx->cm_id, NULL); |
816 | 819 | ||
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index b930da4c0c63..4d27e4c3fe34 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c | |||
@@ -1485,6 +1485,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file, | |||
1485 | qp->event_handler = attr.event_handler; | 1485 | qp->event_handler = attr.event_handler; |
1486 | qp->qp_context = attr.qp_context; | 1486 | qp->qp_context = attr.qp_context; |
1487 | qp->qp_type = attr.qp_type; | 1487 | qp->qp_type = attr.qp_type; |
1488 | atomic_set(&qp->usecnt, 0); | ||
1488 | atomic_inc(&pd->usecnt); | 1489 | atomic_inc(&pd->usecnt); |
1489 | atomic_inc(&attr.send_cq->usecnt); | 1490 | atomic_inc(&attr.send_cq->usecnt); |
1490 | if (attr.recv_cq) | 1491 | if (attr.recv_cq) |
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 602b1bd723a9..575b78045aaf 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c | |||
@@ -421,6 +421,7 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd, | |||
421 | qp->uobject = NULL; | 421 | qp->uobject = NULL; |
422 | qp->qp_type = qp_init_attr->qp_type; | 422 | qp->qp_type = qp_init_attr->qp_type; |
423 | 423 | ||
424 | atomic_set(&qp->usecnt, 0); | ||
424 | if (qp_init_attr->qp_type == IB_QPT_XRC_TGT) { | 425 | if (qp_init_attr->qp_type == IB_QPT_XRC_TGT) { |
425 | qp->event_handler = __ib_shared_qp_event_handler; | 426 | qp->event_handler = __ib_shared_qp_event_handler; |
426 | qp->qp_context = qp; | 427 | qp->qp_context = qp; |
@@ -430,7 +431,6 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd, | |||
430 | qp->xrcd = qp_init_attr->xrcd; | 431 | qp->xrcd = qp_init_attr->xrcd; |
431 | atomic_inc(&qp_init_attr->xrcd->usecnt); | 432 | atomic_inc(&qp_init_attr->xrcd->usecnt); |
432 | INIT_LIST_HEAD(&qp->open_list); | 433 | INIT_LIST_HEAD(&qp->open_list); |
433 | atomic_set(&qp->usecnt, 0); | ||
434 | 434 | ||
435 | real_qp = qp; | 435 | real_qp = qp; |
436 | qp = __ib_open_qp(real_qp, qp_init_attr->event_handler, | 436 | qp = __ib_open_qp(real_qp, qp_init_attr->event_handler, |
diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c index b7d4216db3c3..a4de9d58e9b4 100644 --- a/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/drivers/infiniband/hw/ipath/ipath_fs.c | |||
@@ -89,7 +89,7 @@ static int create_file(const char *name, umode_t mode, | |||
89 | error = ipathfs_mknod(parent->d_inode, *dentry, | 89 | error = ipathfs_mknod(parent->d_inode, *dentry, |
90 | mode, fops, data); | 90 | mode, fops, data); |
91 | else | 91 | else |
92 | error = PTR_ERR(dentry); | 92 | error = PTR_ERR(*dentry); |
93 | mutex_unlock(&parent->d_inode->i_mutex); | 93 | mutex_unlock(&parent->d_inode->i_mutex); |
94 | 94 | ||
95 | return error; | 95 | return error; |
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c index 95c94d8f0254..259b0670b51c 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c | |||
@@ -257,12 +257,9 @@ static int ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num, | |||
257 | return IB_MAD_RESULT_SUCCESS; | 257 | return IB_MAD_RESULT_SUCCESS; |
258 | 258 | ||
259 | /* | 259 | /* |
260 | * Don't process SMInfo queries or vendor-specific | 260 | * Don't process SMInfo queries -- the SMA can't handle them. |
261 | * MADs -- the SMA can't handle them. | ||
262 | */ | 261 | */ |
263 | if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO || | 262 | if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO) |
264 | ((in_mad->mad_hdr.attr_id & IB_SMP_ATTR_VENDOR_MASK) == | ||
265 | IB_SMP_ATTR_VENDOR_MASK)) | ||
266 | return IB_MAD_RESULT_SUCCESS; | 263 | return IB_MAD_RESULT_SUCCESS; |
267 | } else if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_PERF_MGMT || | 264 | } else if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_PERF_MGMT || |
268 | in_mad->mad_hdr.mgmt_class == MLX4_IB_VENDOR_CLASS1 || | 265 | in_mad->mad_hdr.mgmt_class == MLX4_IB_VENDOR_CLASS1 || |
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c index 7013da5e9eda..7140199f562e 100644 --- a/drivers/infiniband/hw/nes/nes.c +++ b/drivers/infiniband/hw/nes/nes.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. | 3 | * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. |
4 | * | 4 | * |
5 | * This software is available to you under a choice of one of two | 5 | * This software is available to you under a choice of one of two |
diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h index 568b4f11380a..c438e4691b3c 100644 --- a/drivers/infiniband/hw/nes/nes.h +++ b/drivers/infiniband/hw/nes/nes.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. | 3 | * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. |
4 | * | 4 | * |
5 | * This software is available to you under a choice of one of two | 5 | * This software is available to you under a choice of one of two |
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 425065b36b8c..a4972abedef1 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -233,6 +233,7 @@ static int send_mpa_reject(struct nes_cm_node *cm_node) | |||
233 | u8 *start_ptr = &start_addr; | 233 | u8 *start_ptr = &start_addr; |
234 | u8 **start_buff = &start_ptr; | 234 | u8 **start_buff = &start_ptr; |
235 | u16 buff_len = 0; | 235 | u16 buff_len = 0; |
236 | struct ietf_mpa_v1 *mpa_frame; | ||
236 | 237 | ||
237 | skb = dev_alloc_skb(MAX_CM_BUFFER); | 238 | skb = dev_alloc_skb(MAX_CM_BUFFER); |
238 | if (!skb) { | 239 | if (!skb) { |
@@ -242,6 +243,8 @@ static int send_mpa_reject(struct nes_cm_node *cm_node) | |||
242 | 243 | ||
243 | /* send an MPA reject frame */ | 244 | /* send an MPA reject frame */ |
244 | cm_build_mpa_frame(cm_node, start_buff, &buff_len, NULL, MPA_KEY_REPLY); | 245 | cm_build_mpa_frame(cm_node, start_buff, &buff_len, NULL, MPA_KEY_REPLY); |
246 | mpa_frame = (struct ietf_mpa_v1 *)*start_buff; | ||
247 | mpa_frame->flags |= IETF_MPA_FLAGS_REJECT; | ||
245 | form_cm_frame(skb, cm_node, NULL, 0, *start_buff, buff_len, SET_ACK | SET_FIN); | 248 | form_cm_frame(skb, cm_node, NULL, 0, *start_buff, buff_len, SET_ACK | SET_FIN); |
246 | 249 | ||
247 | cm_node->state = NES_CM_STATE_FIN_WAIT1; | 250 | cm_node->state = NES_CM_STATE_FIN_WAIT1; |
@@ -1360,8 +1363,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi | |||
1360 | if (!memcmp(nesadapter->arp_table[arpindex].mac_addr, | 1363 | if (!memcmp(nesadapter->arp_table[arpindex].mac_addr, |
1361 | neigh->ha, ETH_ALEN)) { | 1364 | neigh->ha, ETH_ALEN)) { |
1362 | /* Mac address same as in nes_arp_table */ | 1365 | /* Mac address same as in nes_arp_table */ |
1363 | ip_rt_put(rt); | 1366 | goto out; |
1364 | return rc; | ||
1365 | } | 1367 | } |
1366 | 1368 | ||
1367 | nes_manage_arp_cache(nesvnic->netdev, | 1369 | nes_manage_arp_cache(nesvnic->netdev, |
@@ -1377,6 +1379,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi | |||
1377 | neigh_event_send(neigh, NULL); | 1379 | neigh_event_send(neigh, NULL); |
1378 | } | 1380 | } |
1379 | } | 1381 | } |
1382 | |||
1383 | out: | ||
1380 | rcu_read_unlock(); | 1384 | rcu_read_unlock(); |
1381 | ip_rt_put(rt); | 1385 | ip_rt_put(rt); |
1382 | return rc; | 1386 | return rc; |
diff --git a/drivers/infiniband/hw/nes/nes_cm.h b/drivers/infiniband/hw/nes/nes_cm.h index bdfa1fbb35fc..4646e6666087 100644 --- a/drivers/infiniband/hw/nes/nes_cm.h +++ b/drivers/infiniband/hw/nes/nes_cm.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/hw/nes/nes_context.h b/drivers/infiniband/hw/nes/nes_context.h index b4393a16099d..a69eef16d72d 100644 --- a/drivers/infiniband/hw/nes/nes_context.h +++ b/drivers/infiniband/hw/nes/nes_context.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index 055f4b545df0..d42c9f435b1b 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h index 0b590e152c6a..d748e4b31b8d 100644 --- a/drivers/infiniband/hw/nes/nes_hw.h +++ b/drivers/infiniband/hw/nes/nes_hw.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/hw/nes/nes_mgt.c b/drivers/infiniband/hw/nes/nes_mgt.c index b3b2a240c6e9..3ba7be369452 100644 --- a/drivers/infiniband/hw/nes/nes_mgt.c +++ b/drivers/infiniband/hw/nes/nes_mgt.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel-NE, Inc. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel-NE, Inc. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/hw/nes/nes_mgt.h b/drivers/infiniband/hw/nes/nes_mgt.h index 8c8af254555a..4f7f701c4a81 100644 --- a/drivers/infiniband/hw/nes/nes_mgt.h +++ b/drivers/infiniband/hw/nes/nes_mgt.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2010 Intel-NE, Inc. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel-NE, Inc. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index 4b3fa711a247..f3a3ecf8d09e 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/hw/nes/nes_user.h b/drivers/infiniband/hw/nes/nes_user.h index 71e133ab209b..4926de744488 100644 --- a/drivers/infiniband/hw/nes/nes_user.h +++ b/drivers/infiniband/hw/nes/nes_user.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * Copyright (c) 2005 Topspin Communications. All rights reserved. | 3 | * Copyright (c) 2005 Topspin Communications. All rights reserved. |
4 | * Copyright (c) 2005 Cisco Systems. All rights reserved. | 4 | * Copyright (c) 2005 Cisco Systems. All rights reserved. |
5 | * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. | 5 | * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. |
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c index 8b4c2ff54888..e98f4fc0b768 100644 --- a/drivers/infiniband/hw/nes/nes_utils.c +++ b/drivers/infiniband/hw/nes/nes_utils.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 5095bc41c6cc..0927b5cc65d3 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * | 3 | * |
4 | * This software is available to you under a choice of one of two | 4 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 5 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -3428,6 +3428,8 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, | |||
3428 | NES_IWARP_SQ_FMR_WQE_LENGTH_LOW_IDX, | 3428 | NES_IWARP_SQ_FMR_WQE_LENGTH_LOW_IDX, |
3429 | ib_wr->wr.fast_reg.length); | 3429 | ib_wr->wr.fast_reg.length); |
3430 | set_wqe_32bit_value(wqe->wqe_words, | 3430 | set_wqe_32bit_value(wqe->wqe_words, |
3431 | NES_IWARP_SQ_FMR_WQE_LENGTH_HIGH_IDX, 0); | ||
3432 | set_wqe_32bit_value(wqe->wqe_words, | ||
3431 | NES_IWARP_SQ_FMR_WQE_MR_STAG_IDX, | 3433 | NES_IWARP_SQ_FMR_WQE_MR_STAG_IDX, |
3432 | ib_wr->wr.fast_reg.rkey); | 3434 | ib_wr->wr.fast_reg.rkey); |
3433 | /* Set page size: */ | 3435 | /* Set page size: */ |
@@ -3724,7 +3726,7 @@ static int nes_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry) | |||
3724 | entry->opcode = IB_WC_SEND; | 3726 | entry->opcode = IB_WC_SEND; |
3725 | break; | 3727 | break; |
3726 | case NES_IWARP_SQ_OP_LOCINV: | 3728 | case NES_IWARP_SQ_OP_LOCINV: |
3727 | entry->opcode = IB_WR_LOCAL_INV; | 3729 | entry->opcode = IB_WC_LOCAL_INV; |
3728 | break; | 3730 | break; |
3729 | case NES_IWARP_SQ_OP_FAST_REG: | 3731 | case NES_IWARP_SQ_OP_FAST_REG: |
3730 | entry->opcode = IB_WC_FAST_REG_MR; | 3732 | entry->opcode = IB_WC_FAST_REG_MR; |
diff --git a/drivers/infiniband/hw/nes/nes_verbs.h b/drivers/infiniband/hw/nes/nes_verbs.h index fe6b6e92fa90..0eff7c44d76b 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.h +++ b/drivers/infiniband/hw/nes/nes_verbs.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved. | 2 | * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. |
3 | * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. | 3 | * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. |
4 | * | 4 | * |
5 | * This software is available to you under a choice of one of two | 5 | * This software is available to you under a choice of one of two |
diff --git a/drivers/infiniband/hw/qib/qib_iba6120.c b/drivers/infiniband/hw/qib/qib_iba6120.c index 4f18e2d332df..d0c64d514813 100644 --- a/drivers/infiniband/hw/qib/qib_iba6120.c +++ b/drivers/infiniband/hw/qib/qib_iba6120.c | |||
@@ -2105,7 +2105,7 @@ static void alloc_dummy_hdrq(struct qib_devdata *dd) | |||
2105 | dd->cspec->dummy_hdrq = dma_alloc_coherent(&dd->pcidev->dev, | 2105 | dd->cspec->dummy_hdrq = dma_alloc_coherent(&dd->pcidev->dev, |
2106 | dd->rcd[0]->rcvhdrq_size, | 2106 | dd->rcd[0]->rcvhdrq_size, |
2107 | &dd->cspec->dummy_hdrq_phys, | 2107 | &dd->cspec->dummy_hdrq_phys, |
2108 | GFP_KERNEL | __GFP_COMP); | 2108 | GFP_ATOMIC | __GFP_COMP); |
2109 | if (!dd->cspec->dummy_hdrq) { | 2109 | if (!dd->cspec->dummy_hdrq) { |
2110 | qib_devinfo(dd->pcidev, "Couldn't allocate dummy hdrq\n"); | 2110 | qib_devinfo(dd->pcidev, "Couldn't allocate dummy hdrq\n"); |
2111 | /* fallback to just 0'ing */ | 2111 | /* fallback to just 0'ing */ |
diff --git a/drivers/infiniband/hw/qib/qib_pcie.c b/drivers/infiniband/hw/qib/qib_pcie.c index f695061d688e..0fde788e1100 100644 --- a/drivers/infiniband/hw/qib/qib_pcie.c +++ b/drivers/infiniband/hw/qib/qib_pcie.c | |||
@@ -560,7 +560,7 @@ static int qib_tune_pcie_coalesce(struct qib_devdata *dd) | |||
560 | * BIOS may not set PCIe bus-utilization parameters for best performance. | 560 | * BIOS may not set PCIe bus-utilization parameters for best performance. |
561 | * Check and optionally adjust them to maximize our throughput. | 561 | * Check and optionally adjust them to maximize our throughput. |
562 | */ | 562 | */ |
563 | static int qib_pcie_caps = 0x51; | 563 | static int qib_pcie_caps; |
564 | module_param_named(pcie_caps, qib_pcie_caps, int, S_IRUGO); | 564 | module_param_named(pcie_caps, qib_pcie_caps, int, S_IRUGO); |
565 | MODULE_PARM_DESC(pcie_caps, "Max PCIe tuning: Payload (0..3), ReadReq (4..7)"); | 565 | MODULE_PARM_DESC(pcie_caps, "Max PCIe tuning: Payload (0..3), ReadReq (4..7)"); |
566 | 566 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index b3cc1e062b17..86df632ea612 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/mutex.h> | 44 | #include <linux/mutex.h> |
45 | 45 | ||
46 | #include <net/neighbour.h> | 46 | #include <net/neighbour.h> |
47 | #include <net/sch_generic.h> | ||
47 | 48 | ||
48 | #include <linux/atomic.h> | 49 | #include <linux/atomic.h> |
49 | 50 | ||
@@ -117,8 +118,9 @@ struct ipoib_header { | |||
117 | u16 reserved; | 118 | u16 reserved; |
118 | }; | 119 | }; |
119 | 120 | ||
120 | struct ipoib_pseudoheader { | 121 | struct ipoib_cb { |
121 | u8 hwaddr[INFINIBAND_ALEN]; | 122 | struct qdisc_skb_cb qdisc_cb; |
123 | u8 hwaddr[INFINIBAND_ALEN]; | ||
122 | }; | 124 | }; |
123 | 125 | ||
124 | /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */ | 126 | /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */ |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 3514ca05deea..3974c290b667 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -653,7 +653,7 @@ static void ipoib_path_lookup(struct sk_buff *skb, struct neighbour *n, struct n | |||
653 | } | 653 | } |
654 | 654 | ||
655 | static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, | 655 | static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, |
656 | struct ipoib_pseudoheader *phdr) | 656 | struct ipoib_cb *cb) |
657 | { | 657 | { |
658 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 658 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
659 | struct ipoib_path *path; | 659 | struct ipoib_path *path; |
@@ -661,17 +661,15 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, | |||
661 | 661 | ||
662 | spin_lock_irqsave(&priv->lock, flags); | 662 | spin_lock_irqsave(&priv->lock, flags); |
663 | 663 | ||
664 | path = __path_find(dev, phdr->hwaddr + 4); | 664 | path = __path_find(dev, cb->hwaddr + 4); |
665 | if (!path || !path->valid) { | 665 | if (!path || !path->valid) { |
666 | int new_path = 0; | 666 | int new_path = 0; |
667 | 667 | ||
668 | if (!path) { | 668 | if (!path) { |
669 | path = path_rec_create(dev, phdr->hwaddr + 4); | 669 | path = path_rec_create(dev, cb->hwaddr + 4); |
670 | new_path = 1; | 670 | new_path = 1; |
671 | } | 671 | } |
672 | if (path) { | 672 | if (path) { |
673 | /* put pseudoheader back on for next time */ | ||
674 | skb_push(skb, sizeof *phdr); | ||
675 | __skb_queue_tail(&path->queue, skb); | 673 | __skb_queue_tail(&path->queue, skb); |
676 | 674 | ||
677 | if (!path->query && path_rec_start(dev, path)) { | 675 | if (!path->query && path_rec_start(dev, path)) { |
@@ -695,12 +693,10 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, | |||
695 | be16_to_cpu(path->pathrec.dlid)); | 693 | be16_to_cpu(path->pathrec.dlid)); |
696 | 694 | ||
697 | spin_unlock_irqrestore(&priv->lock, flags); | 695 | spin_unlock_irqrestore(&priv->lock, flags); |
698 | ipoib_send(dev, skb, path->ah, IPOIB_QPN(phdr->hwaddr)); | 696 | ipoib_send(dev, skb, path->ah, IPOIB_QPN(cb->hwaddr)); |
699 | return; | 697 | return; |
700 | } else if ((path->query || !path_rec_start(dev, path)) && | 698 | } else if ((path->query || !path_rec_start(dev, path)) && |
701 | skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) { | 699 | skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) { |
702 | /* put pseudoheader back on for next time */ | ||
703 | skb_push(skb, sizeof *phdr); | ||
704 | __skb_queue_tail(&path->queue, skb); | 700 | __skb_queue_tail(&path->queue, skb); |
705 | } else { | 701 | } else { |
706 | ++dev->stats.tx_dropped; | 702 | ++dev->stats.tx_dropped; |
@@ -774,16 +770,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
774 | dev_kfree_skb_any(skb); | 770 | dev_kfree_skb_any(skb); |
775 | } | 771 | } |
776 | } else { | 772 | } else { |
777 | struct ipoib_pseudoheader *phdr = | 773 | struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb; |
778 | (struct ipoib_pseudoheader *) skb->data; | ||
779 | skb_pull(skb, sizeof *phdr); | ||
780 | 774 | ||
781 | if (phdr->hwaddr[4] == 0xff) { | 775 | if (cb->hwaddr[4] == 0xff) { |
782 | /* Add in the P_Key for multicast*/ | 776 | /* Add in the P_Key for multicast*/ |
783 | phdr->hwaddr[8] = (priv->pkey >> 8) & 0xff; | 777 | cb->hwaddr[8] = (priv->pkey >> 8) & 0xff; |
784 | phdr->hwaddr[9] = priv->pkey & 0xff; | 778 | cb->hwaddr[9] = priv->pkey & 0xff; |
785 | 779 | ||
786 | ipoib_mcast_send(dev, phdr->hwaddr + 4, skb); | 780 | ipoib_mcast_send(dev, cb->hwaddr + 4, skb); |
787 | } else { | 781 | } else { |
788 | /* unicast GID -- should be ARP or RARP reply */ | 782 | /* unicast GID -- should be ARP or RARP reply */ |
789 | 783 | ||
@@ -792,14 +786,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
792 | ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n", | 786 | ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n", |
793 | skb_dst(skb) ? "neigh" : "dst", | 787 | skb_dst(skb) ? "neigh" : "dst", |
794 | be16_to_cpup((__be16 *) skb->data), | 788 | be16_to_cpup((__be16 *) skb->data), |
795 | IPOIB_QPN(phdr->hwaddr), | 789 | IPOIB_QPN(cb->hwaddr), |
796 | phdr->hwaddr + 4); | 790 | cb->hwaddr + 4); |
797 | dev_kfree_skb_any(skb); | 791 | dev_kfree_skb_any(skb); |
798 | ++dev->stats.tx_dropped; | 792 | ++dev->stats.tx_dropped; |
799 | goto unlock; | 793 | goto unlock; |
800 | } | 794 | } |
801 | 795 | ||
802 | unicast_arp_send(skb, dev, phdr); | 796 | unicast_arp_send(skb, dev, cb); |
803 | } | 797 | } |
804 | } | 798 | } |
805 | unlock: | 799 | unlock: |
@@ -825,8 +819,6 @@ static int ipoib_hard_header(struct sk_buff *skb, | |||
825 | const void *daddr, const void *saddr, unsigned len) | 819 | const void *daddr, const void *saddr, unsigned len) |
826 | { | 820 | { |
827 | struct ipoib_header *header; | 821 | struct ipoib_header *header; |
828 | struct dst_entry *dst; | ||
829 | struct neighbour *n; | ||
830 | 822 | ||
831 | header = (struct ipoib_header *) skb_push(skb, sizeof *header); | 823 | header = (struct ipoib_header *) skb_push(skb, sizeof *header); |
832 | 824 | ||
@@ -834,18 +826,13 @@ static int ipoib_hard_header(struct sk_buff *skb, | |||
834 | header->reserved = 0; | 826 | header->reserved = 0; |
835 | 827 | ||
836 | /* | 828 | /* |
837 | * If we don't have a neighbour structure, stuff the | 829 | * If we don't have a dst_entry structure, stuff the |
838 | * destination address onto the front of the skb so we can | 830 | * destination address into skb->cb so we can figure out where |
839 | * figure out where to send the packet later. | 831 | * to send the packet later. |
840 | */ | 832 | */ |
841 | dst = skb_dst(skb); | 833 | if (!skb_dst(skb)) { |
842 | n = NULL; | 834 | struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb; |
843 | if (dst) | 835 | memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN); |
844 | n = dst_get_neighbour_noref_raw(dst); | ||
845 | if ((!dst || !n) && daddr) { | ||
846 | struct ipoib_pseudoheader *phdr = | ||
847 | (struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr); | ||
848 | memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN); | ||
849 | } | 836 | } |
850 | 837 | ||
851 | return 0; | 838 | return 0; |
@@ -1021,11 +1008,7 @@ static void ipoib_setup(struct net_device *dev) | |||
1021 | 1008 | ||
1022 | dev->flags |= IFF_BROADCAST | IFF_MULTICAST; | 1009 | dev->flags |= IFF_BROADCAST | IFF_MULTICAST; |
1023 | 1010 | ||
1024 | /* | 1011 | dev->hard_header_len = IPOIB_ENCAP_LEN; |
1025 | * We add in INFINIBAND_ALEN to allow for the destination | ||
1026 | * address "pseudoheader" for skbs without neighbour struct. | ||
1027 | */ | ||
1028 | dev->hard_header_len = IPOIB_ENCAP_LEN + INFINIBAND_ALEN; | ||
1029 | dev->addr_len = INFINIBAND_ALEN; | 1012 | dev->addr_len = INFINIBAND_ALEN; |
1030 | dev->type = ARPHRD_INFINIBAND; | 1013 | dev->type = ARPHRD_INFINIBAND; |
1031 | dev->tx_queue_len = ipoib_sendq_size * 2; | 1014 | dev->tx_queue_len = ipoib_sendq_size * 2; |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index f7ff9dd66cda..20ebc6fd1bb9 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -262,21 +262,13 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast, | |||
262 | netif_tx_lock_bh(dev); | 262 | netif_tx_lock_bh(dev); |
263 | while (!skb_queue_empty(&mcast->pkt_queue)) { | 263 | while (!skb_queue_empty(&mcast->pkt_queue)) { |
264 | struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue); | 264 | struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue); |
265 | struct dst_entry *dst = skb_dst(skb); | ||
266 | struct neighbour *n = NULL; | ||
267 | 265 | ||
268 | netif_tx_unlock_bh(dev); | 266 | netif_tx_unlock_bh(dev); |
269 | 267 | ||
270 | skb->dev = dev; | 268 | skb->dev = dev; |
271 | if (dst) | ||
272 | n = dst_get_neighbour_noref_raw(dst); | ||
273 | if (!dst || !n) { | ||
274 | /* put pseudoheader back on for next time */ | ||
275 | skb_push(skb, sizeof (struct ipoib_pseudoheader)); | ||
276 | } | ||
277 | |||
278 | if (dev_queue_xmit(skb)) | 269 | if (dev_queue_xmit(skb)) |
279 | ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n"); | 270 | ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n"); |
271 | |||
280 | netif_tx_lock_bh(dev); | 272 | netif_tx_lock_bh(dev); |
281 | } | 273 | } |
282 | netif_tx_unlock_bh(dev); | 274 | netif_tx_unlock_bh(dev); |
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index cd5d05e22a77..2b73d43cd691 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c | |||
@@ -69,8 +69,8 @@ MODULE_LICENSE("Dual BSD/GPL"); | |||
69 | */ | 69 | */ |
70 | 70 | ||
71 | static u64 srpt_service_guid; | 71 | static u64 srpt_service_guid; |
72 | static spinlock_t srpt_dev_lock; /* Protects srpt_dev_list. */ | 72 | static DEFINE_SPINLOCK(srpt_dev_lock); /* Protects srpt_dev_list. */ |
73 | static struct list_head srpt_dev_list; /* List of srpt_device structures. */ | 73 | static LIST_HEAD(srpt_dev_list); /* List of srpt_device structures. */ |
74 | 74 | ||
75 | static unsigned srp_max_req_size = DEFAULT_MAX_REQ_SIZE; | 75 | static unsigned srp_max_req_size = DEFAULT_MAX_REQ_SIZE; |
76 | module_param(srp_max_req_size, int, 0444); | 76 | module_param(srp_max_req_size, int, 0444); |
@@ -687,6 +687,7 @@ err: | |||
687 | while (--i >= 0) | 687 | while (--i >= 0) |
688 | srpt_free_ioctx(sdev, ring[i], dma_size, dir); | 688 | srpt_free_ioctx(sdev, ring[i], dma_size, dir); |
689 | kfree(ring); | 689 | kfree(ring); |
690 | ring = NULL; | ||
690 | out: | 691 | out: |
691 | return ring; | 692 | return ring; |
692 | } | 693 | } |
@@ -2595,7 +2596,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
2595 | } | 2596 | } |
2596 | 2597 | ||
2597 | ch->sess = transport_init_session(); | 2598 | ch->sess = transport_init_session(); |
2598 | if (!ch->sess) { | 2599 | if (IS_ERR(ch->sess)) { |
2599 | rej->reason = __constant_cpu_to_be32( | 2600 | rej->reason = __constant_cpu_to_be32( |
2600 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); | 2601 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); |
2601 | pr_debug("Failed to create session\n"); | 2602 | pr_debug("Failed to create session\n"); |
@@ -3264,8 +3265,7 @@ static void srpt_add_one(struct ib_device *device) | |||
3264 | for (i = 0; i < sdev->srq_size; ++i) | 3265 | for (i = 0; i < sdev->srq_size; ++i) |
3265 | srpt_post_recv(sdev, sdev->ioctx_ring[i]); | 3266 | srpt_post_recv(sdev, sdev->ioctx_ring[i]); |
3266 | 3267 | ||
3267 | WARN_ON(sdev->device->phys_port_cnt | 3268 | WARN_ON(sdev->device->phys_port_cnt > ARRAY_SIZE(sdev->port)); |
3268 | > sizeof(sdev->port)/sizeof(sdev->port[0])); | ||
3269 | 3269 | ||
3270 | for (i = 1; i <= sdev->device->phys_port_cnt; i++) { | 3270 | for (i = 1; i <= sdev->device->phys_port_cnt; i++) { |
3271 | sport = &sdev->port[i - 1]; | 3271 | sport = &sdev->port[i - 1]; |
@@ -4010,13 +4010,10 @@ static int __init srpt_init_module(void) | |||
4010 | goto out; | 4010 | goto out; |
4011 | } | 4011 | } |
4012 | 4012 | ||
4013 | spin_lock_init(&srpt_dev_lock); | ||
4014 | INIT_LIST_HEAD(&srpt_dev_list); | ||
4015 | |||
4016 | ret = -ENODEV; | ||
4017 | srpt_target = target_fabric_configfs_init(THIS_MODULE, "srpt"); | 4013 | srpt_target = target_fabric_configfs_init(THIS_MODULE, "srpt"); |
4018 | if (!srpt_target) { | 4014 | if (IS_ERR(srpt_target)) { |
4019 | printk(KERN_ERR "couldn't register\n"); | 4015 | printk(KERN_ERR "couldn't register\n"); |
4016 | ret = PTR_ERR(srpt_target); | ||
4020 | goto out; | 4017 | goto out; |
4021 | } | 4018 | } |
4022 | 4019 | ||
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h index b4b4bbcd7f16..61e52b830816 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.h +++ b/drivers/infiniband/ulp/srpt/ib_srpt.h | |||
@@ -35,7 +35,6 @@ | |||
35 | #ifndef IB_SRPT_H | 35 | #ifndef IB_SRPT_H |
36 | #define IB_SRPT_H | 36 | #define IB_SRPT_H |
37 | 37 | ||
38 | #include <linux/version.h> | ||
39 | #include <linux/types.h> | 38 | #include <linux/types.h> |
40 | #include <linux/list.h> | 39 | #include <linux/list.h> |
41 | #include <linux/wait.h> | 40 | #include <linux/wait.h> |