diff options
Diffstat (limited to 'drivers/infiniband/core/verbs.c')
| -rw-r--r-- | drivers/infiniband/core/verbs.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 575b78045aaf..c5b94d647e1e 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c | |||
| @@ -1183,23 +1183,33 @@ EXPORT_SYMBOL(ib_dealloc_fmr); | |||
| 1183 | 1183 | ||
| 1184 | int ib_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid) | 1184 | int ib_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid) |
| 1185 | { | 1185 | { |
| 1186 | int ret; | ||
| 1187 | |||
| 1186 | if (!qp->device->attach_mcast) | 1188 | if (!qp->device->attach_mcast) |
| 1187 | return -ENOSYS; | 1189 | return -ENOSYS; |
| 1188 | if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD) | 1190 | if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD) |
| 1189 | return -EINVAL; | 1191 | return -EINVAL; |
| 1190 | 1192 | ||
| 1191 | return qp->device->attach_mcast(qp, gid, lid); | 1193 | ret = qp->device->attach_mcast(qp, gid, lid); |
| 1194 | if (!ret) | ||
| 1195 | atomic_inc(&qp->usecnt); | ||
| 1196 | return ret; | ||
| 1192 | } | 1197 | } |
| 1193 | EXPORT_SYMBOL(ib_attach_mcast); | 1198 | EXPORT_SYMBOL(ib_attach_mcast); |
| 1194 | 1199 | ||
| 1195 | int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid) | 1200 | int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid) |
| 1196 | { | 1201 | { |
| 1202 | int ret; | ||
| 1203 | |||
| 1197 | if (!qp->device->detach_mcast) | 1204 | if (!qp->device->detach_mcast) |
| 1198 | return -ENOSYS; | 1205 | return -ENOSYS; |
| 1199 | if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD) | 1206 | if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD) |
| 1200 | return -EINVAL; | 1207 | return -EINVAL; |
| 1201 | 1208 | ||
| 1202 | return qp->device->detach_mcast(qp, gid, lid); | 1209 | ret = qp->device->detach_mcast(qp, gid, lid); |
| 1210 | if (!ret) | ||
| 1211 | atomic_dec(&qp->usecnt); | ||
| 1212 | return ret; | ||
| 1203 | } | 1213 | } |
| 1204 | EXPORT_SYMBOL(ib_detach_mcast); | 1214 | EXPORT_SYMBOL(ib_detach_mcast); |
| 1205 | 1215 | ||
