aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/core/cm_msgs.h1
-rw-r--r--drivers/infiniband/core/cma.c6
-rw-r--r--drivers/infiniband/core/ucm.c3
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c27
-rw-r--r--drivers/infiniband/hw/mlx4/ah.c2
-rw-r--r--drivers/infiniband/hw/mlx4/cq.c6
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c4
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c1
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c6
-rw-r--r--drivers/infiniband/hw/nes/nes_utils.c2
-rw-r--r--include/rdma/ib_addr.h2
-rw-r--r--include/rdma/ib_cm.h3
12 files changed, 39 insertions, 24 deletions
diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h
index 505db2a59e7f..7da9b2102341 100644
--- a/drivers/infiniband/core/cm_msgs.h
+++ b/drivers/infiniband/core/cm_msgs.h
@@ -799,6 +799,7 @@ struct cm_apr_msg {
799 799
800 u8 info_length; 800 u8 info_length;
801 u8 ap_status; 801 u8 ap_status;
802 __be16 rsvd;
802 u8 info[IB_CM_APR_INFO_LENGTH]; 803 u8 info[IB_CM_APR_INFO_LENGTH];
803 804
804 u8 private_data[IB_CM_APR_PRIVATE_DATA_SIZE]; 805 u8 private_data[IB_CM_APR_PRIVATE_DATA_SIZE];
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index d0d4aa9f4802..fdd8ef8dad32 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1110,7 +1110,7 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id,
1110 if (cma_any_addr((struct sockaddr *) &rt->addr.src_addr)) { 1110 if (cma_any_addr((struct sockaddr *) &rt->addr.src_addr)) {
1111 rt->addr.dev_addr.dev_type = ARPHRD_INFINIBAND; 1111 rt->addr.dev_addr.dev_type = ARPHRD_INFINIBAND;
1112 rdma_addr_set_sgid(&rt->addr.dev_addr, &rt->path_rec[0].sgid); 1112 rdma_addr_set_sgid(&rt->addr.dev_addr, &rt->path_rec[0].sgid);
1113 ib_addr_set_pkey(&rt->addr.dev_addr, rt->path_rec[0].pkey); 1113 ib_addr_set_pkey(&rt->addr.dev_addr, be16_to_cpu(rt->path_rec[0].pkey));
1114 } else { 1114 } else {
1115 ret = rdma_translate_ip((struct sockaddr *) &rt->addr.src_addr, 1115 ret = rdma_translate_ip((struct sockaddr *) &rt->addr.src_addr,
1116 &rt->addr.dev_addr); 1116 &rt->addr.dev_addr);
@@ -2926,7 +2926,7 @@ static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast)
2926 mutex_lock(&id_priv->qp_mutex); 2926 mutex_lock(&id_priv->qp_mutex);
2927 if (!status && id_priv->id.qp) 2927 if (!status && id_priv->id.qp)
2928 status = ib_attach_mcast(id_priv->id.qp, &multicast->rec.mgid, 2928 status = ib_attach_mcast(id_priv->id.qp, &multicast->rec.mgid,
2929 multicast->rec.mlid); 2929 be16_to_cpu(multicast->rec.mlid));
2930 mutex_unlock(&id_priv->qp_mutex); 2930 mutex_unlock(&id_priv->qp_mutex);
2931 2931
2932 memset(&event, 0, sizeof event); 2932 memset(&event, 0, sizeof event);
@@ -3187,7 +3187,7 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
3187 if (id->qp) 3187 if (id->qp)
3188 ib_detach_mcast(id->qp, 3188 ib_detach_mcast(id->qp,
3189 &mc->multicast.ib->rec.mgid, 3189 &mc->multicast.ib->rec.mgid,
3190 mc->multicast.ib->rec.mlid); 3190 be16_to_cpu(mc->multicast.ib->rec.mlid));
3191 if (rdma_node_get_transport(id_priv->cma_dev->device->node_type) == RDMA_TRANSPORT_IB) { 3191 if (rdma_node_get_transport(id_priv->cma_dev->device->node_type) == RDMA_TRANSPORT_IB) {
3192 switch (rdma_port_get_link_layer(id->device, id->port_num)) { 3192 switch (rdma_port_get_link_layer(id->device, id->port_num)) {
3193 case IB_LINK_LAYER_INFINIBAND: 3193 case IB_LINK_LAYER_INFINIBAND:
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index b8a0b4a7811b..06f08713f487 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -106,9 +106,6 @@ enum {
106 IB_UCM_MAX_DEVICES = 32 106 IB_UCM_MAX_DEVICES = 32
107}; 107};
108 108
109/* ib_cm and ib_user_cm modules share /sys/class/infiniband_cm */
110extern struct class cm_class;
111
112#define IB_UCM_BASE_DEV MKDEV(IB_UCM_MAJOR, IB_UCM_BASE_MINOR) 109#define IB_UCM_BASE_DEV MKDEV(IB_UCM_MAJOR, IB_UCM_BASE_MINOR)
113 110
114static void ib_ucm_add_one(struct ib_device *device); 111static void ib_ucm_add_one(struct ib_device *device);
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 254f1649c734..b930da4c0c63 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -241,11 +241,24 @@ static struct ib_qp *idr_read_qp(int qp_handle, struct ib_ucontext *context)
241 return idr_read_obj(&ib_uverbs_qp_idr, qp_handle, context, 0); 241 return idr_read_obj(&ib_uverbs_qp_idr, qp_handle, context, 0);
242} 242}
243 243
244static struct ib_qp *idr_write_qp(int qp_handle, struct ib_ucontext *context)
245{
246 struct ib_uobject *uobj;
247
248 uobj = idr_write_uobj(&ib_uverbs_qp_idr, qp_handle, context);
249 return uobj ? uobj->object : NULL;
250}
251
244static void put_qp_read(struct ib_qp *qp) 252static void put_qp_read(struct ib_qp *qp)
245{ 253{
246 put_uobj_read(qp->uobject); 254 put_uobj_read(qp->uobject);
247} 255}
248 256
257static void put_qp_write(struct ib_qp *qp)
258{
259 put_uobj_write(qp->uobject);
260}
261
249static struct ib_srq *idr_read_srq(int srq_handle, struct ib_ucontext *context) 262static struct ib_srq *idr_read_srq(int srq_handle, struct ib_ucontext *context)
250{ 263{
251 return idr_read_obj(&ib_uverbs_srq_idr, srq_handle, context, 0); 264 return idr_read_obj(&ib_uverbs_srq_idr, srq_handle, context, 0);
@@ -2375,7 +2388,7 @@ ssize_t ib_uverbs_attach_mcast(struct ib_uverbs_file *file,
2375 if (copy_from_user(&cmd, buf, sizeof cmd)) 2388 if (copy_from_user(&cmd, buf, sizeof cmd))
2376 return -EFAULT; 2389 return -EFAULT;
2377 2390
2378 qp = idr_read_qp(cmd.qp_handle, file->ucontext); 2391 qp = idr_write_qp(cmd.qp_handle, file->ucontext);
2379 if (!qp) 2392 if (!qp)
2380 return -EINVAL; 2393 return -EINVAL;
2381 2394
@@ -2404,7 +2417,7 @@ ssize_t ib_uverbs_attach_mcast(struct ib_uverbs_file *file,
2404 kfree(mcast); 2417 kfree(mcast);
2405 2418
2406out_put: 2419out_put:
2407 put_qp_read(qp); 2420 put_qp_write(qp);
2408 2421
2409 return ret ? ret : in_len; 2422 return ret ? ret : in_len;
2410} 2423}
@@ -2422,7 +2435,7 @@ ssize_t ib_uverbs_detach_mcast(struct ib_uverbs_file *file,
2422 if (copy_from_user(&cmd, buf, sizeof cmd)) 2435 if (copy_from_user(&cmd, buf, sizeof cmd))
2423 return -EFAULT; 2436 return -EFAULT;
2424 2437
2425 qp = idr_read_qp(cmd.qp_handle, file->ucontext); 2438 qp = idr_write_qp(cmd.qp_handle, file->ucontext);
2426 if (!qp) 2439 if (!qp)
2427 return -EINVAL; 2440 return -EINVAL;
2428 2441
@@ -2441,14 +2454,14 @@ ssize_t ib_uverbs_detach_mcast(struct ib_uverbs_file *file,
2441 } 2454 }
2442 2455
2443out_put: 2456out_put:
2444 put_qp_read(qp); 2457 put_qp_write(qp);
2445 2458
2446 return ret ? ret : in_len; 2459 return ret ? ret : in_len;
2447} 2460}
2448 2461
2449int __uverbs_create_xsrq(struct ib_uverbs_file *file, 2462static int __uverbs_create_xsrq(struct ib_uverbs_file *file,
2450 struct ib_uverbs_create_xsrq *cmd, 2463 struct ib_uverbs_create_xsrq *cmd,
2451 struct ib_udata *udata) 2464 struct ib_udata *udata)
2452{ 2465{
2453 struct ib_uverbs_create_srq_resp resp; 2466 struct ib_uverbs_create_srq_resp resp;
2454 struct ib_usrq_object *obj; 2467 struct ib_usrq_object *obj;
diff --git a/drivers/infiniband/hw/mlx4/ah.c b/drivers/infiniband/hw/mlx4/ah.c
index 4b8f9c49397e..a251becdaa98 100644
--- a/drivers/infiniband/hw/mlx4/ah.c
+++ b/drivers/infiniband/hw/mlx4/ah.c
@@ -126,7 +126,7 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
126 ah->av.ib.dlid = cpu_to_be16(0xc000); 126 ah->av.ib.dlid = cpu_to_be16(0xc000);
127 127
128 memcpy(ah->av.eth.dgid, ah_attr->grh.dgid.raw, 16); 128 memcpy(ah->av.eth.dgid, ah_attr->grh.dgid.raw, 16);
129 ah->av.eth.sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 28); 129 ah->av.eth.sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 29);
130 130
131 return &ah->ibah; 131 return &ah->ibah;
132} 132}
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index e8df155bc3b0..5ecf38d97269 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -715,13 +715,17 @@ repoll:
715 } 715 }
716 716
717 wc->slid = be16_to_cpu(cqe->rlid); 717 wc->slid = be16_to_cpu(cqe->rlid);
718 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12;
719 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); 718 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn);
720 wc->src_qp = g_mlpath_rqpn & 0xffffff; 719 wc->src_qp = g_mlpath_rqpn & 0xffffff;
721 wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f; 720 wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f;
722 wc->wc_flags |= g_mlpath_rqpn & 0x80000000 ? IB_WC_GRH : 0; 721 wc->wc_flags |= g_mlpath_rqpn & 0x80000000 ? IB_WC_GRH : 0;
723 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f; 722 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f;
724 wc->csum_ok = mlx4_ib_ipoib_csum_ok(cqe->status, cqe->checksum); 723 wc->csum_ok = mlx4_ib_ipoib_csum_ok(cqe->status, cqe->checksum);
724 if (rdma_port_get_link_layer(wc->qp->device,
725 (*cur_qp)->port) == IB_LINK_LAYER_ETHERNET)
726 wc->sl = be16_to_cpu(cqe->sl_vid) >> 13;
727 else
728 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12;
725 } 729 }
726 730
727 return 0; 731 return 0;
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index a16f0c8e6f3f..aa2aefa4236c 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -962,7 +962,7 @@ static int mlx4_set_path(struct mlx4_ib_dev *dev, const struct ib_ah_attr *ah,
962 962
963 if (is_eth) { 963 if (is_eth) {
964 path->sched_queue = MLX4_IB_DEFAULT_SCHED_QUEUE | 964 path->sched_queue = MLX4_IB_DEFAULT_SCHED_QUEUE |
965 ((port - 1) << 6) | ((ah->sl & 7) << 3) | ((ah->sl & 8) >> 1); 965 ((port - 1) << 6) | ((ah->sl & 7) << 3);
966 966
967 if (!(ah->ah_flags & IB_AH_GRH)) 967 if (!(ah->ah_flags & IB_AH_GRH))
968 return -1; 968 return -1;
@@ -1437,7 +1437,7 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
1437 u16 pcp; 1437 u16 pcp;
1438 1438
1439 sqp->ud_header.vlan.type = cpu_to_be16(MLX4_IB_IBOE_ETHERTYPE); 1439 sqp->ud_header.vlan.type = cpu_to_be16(MLX4_IB_IBOE_ETHERTYPE);
1440 pcp = (be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 27 & 3) << 13; 1440 pcp = (be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 29) << 13;
1441 sqp->ud_header.vlan.tag = cpu_to_be16(vlan | pcp); 1441 sqp->ud_header.vlan.tag = cpu_to_be16(vlan | pcp);
1442 } 1442 }
1443 } else { 1443 } else {
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 0a52d72371ee..db0831dc533c 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -2838,6 +2838,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp)
2838 issue_disconn = 1; 2838 issue_disconn = 1;
2839 issue_close = 1; 2839 issue_close = 1;
2840 nesqp->cm_id = NULL; 2840 nesqp->cm_id = NULL;
2841 del_timer(&nesqp->terminate_timer);
2841 if (nesqp->flush_issued == 0) { 2842 if (nesqp->flush_issued == 0) {
2842 nesqp->flush_issued = 1; 2843 nesqp->flush_issued = 1;
2843 issue_flush = 1; 2844 issue_flush = 1;
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index 7c0ff19ce382..055f4b545df0 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -1529,7 +1529,7 @@ int nes_init_phy(struct nes_device *nesdev)
1529 } else { 1529 } else {
1530 /* setup 10G MDIO operation */ 1530 /* setup 10G MDIO operation */
1531 tx_config &= 0xFFFFFFE3; 1531 tx_config &= 0xFFFFFFE3;
1532 tx_config |= 0x15; 1532 tx_config |= 0x1D;
1533 } 1533 }
1534 nes_write_indexed(nesdev, NES_IDX_MAC_TX_CONFIG, tx_config); 1534 nes_write_indexed(nesdev, NES_IDX_MAC_TX_CONFIG, tx_config);
1535 1535
@@ -3619,10 +3619,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
3619 } 3619 }
3620 break; 3620 break;
3621 case NES_AEQE_AEID_LLP_CLOSE_COMPLETE: 3621 case NES_AEQE_AEID_LLP_CLOSE_COMPLETE:
3622 if (nesqp->term_flags) {
3623 nes_terminate_done(nesqp, 0);
3624 return;
3625 }
3626 spin_lock_irqsave(&nesqp->lock, flags); 3622 spin_lock_irqsave(&nesqp->lock, flags);
3627 nesqp->hw_iwarp_state = iwarp_state; 3623 nesqp->hw_iwarp_state = iwarp_state;
3628 nesqp->hw_tcp_state = tcp_state; 3624 nesqp->hw_tcp_state = tcp_state;
diff --git a/drivers/infiniband/hw/nes/nes_utils.c b/drivers/infiniband/hw/nes/nes_utils.c
index cd10968bfa22..8b4c2ff54888 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -56,7 +56,7 @@ static u16 nes_read16_eeprom(void __iomem *addr, u16 offset);
56u32 mh_detected; 56u32 mh_detected;
57u32 mh_pauses_sent; 57u32 mh_pauses_sent;
58 58
59u32 nes_set_pau(struct nes_device *nesdev) 59static u32 nes_set_pau(struct nes_device *nesdev)
60{ 60{
61 u32 ret = 0; 61 u32 ret = 0;
62 u32 counter; 62 u32 counter;
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index 639a4491fc0d..99965395c5f3 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -281,7 +281,7 @@ static inline u16 rdma_get_vlan_id(union ib_gid *dgid)
281static inline struct net_device *rdma_vlan_dev_real_dev(const struct net_device *dev) 281static inline struct net_device *rdma_vlan_dev_real_dev(const struct net_device *dev)
282{ 282{
283 return dev->priv_flags & IFF_802_1Q_VLAN ? 283 return dev->priv_flags & IFF_802_1Q_VLAN ?
284 vlan_dev_real_dev(dev) : 0; 284 vlan_dev_real_dev(dev) : NULL;
285} 285}
286 286
287#endif /* IB_ADDR_H */ 287#endif /* IB_ADDR_H */
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h
index c8f94e8db69c..83f77ac33957 100644
--- a/include/rdma/ib_cm.h
+++ b/include/rdma/ib_cm.h
@@ -38,6 +38,9 @@
38#include <rdma/ib_mad.h> 38#include <rdma/ib_mad.h>
39#include <rdma/ib_sa.h> 39#include <rdma/ib_sa.h>
40 40
41/* ib_cm and ib_user_cm modules share /sys/class/infiniband_cm */
42extern struct class cm_class;
43
41enum ib_cm_state { 44enum ib_cm_state {
42 IB_CM_IDLE, 45 IB_CM_IDLE,
43 IB_CM_LISTEN, 46 IB_CM_LISTEN,