diff options
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma_verbs.c')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 92 |
1 files changed, 45 insertions, 47 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 38c145b28f5c..882a8198d820 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | |||
@@ -114,8 +114,8 @@ int ocrdma_query_port(struct ib_device *ibdev, | |||
114 | 114 | ||
115 | dev = get_ocrdma_dev(ibdev); | 115 | dev = get_ocrdma_dev(ibdev); |
116 | if (port > 1) { | 116 | if (port > 1) { |
117 | ocrdma_err("%s(%d) invalid_port=0x%x\n", __func__, | 117 | pr_err("%s(%d) invalid_port=0x%x\n", __func__, |
118 | dev->id, port); | 118 | dev->id, port); |
119 | return -EINVAL; | 119 | return -EINVAL; |
120 | } | 120 | } |
121 | netdev = dev->nic_info.netdev; | 121 | netdev = dev->nic_info.netdev; |
@@ -155,8 +155,7 @@ int ocrdma_modify_port(struct ib_device *ibdev, u8 port, int mask, | |||
155 | 155 | ||
156 | dev = get_ocrdma_dev(ibdev); | 156 | dev = get_ocrdma_dev(ibdev); |
157 | if (port > 1) { | 157 | if (port > 1) { |
158 | ocrdma_err("%s(%d) invalid_port=0x%x\n", __func__, | 158 | pr_err("%s(%d) invalid_port=0x%x\n", __func__, dev->id, port); |
159 | dev->id, port); | ||
160 | return -EINVAL; | 159 | return -EINVAL; |
161 | } | 160 | } |
162 | return 0; | 161 | return 0; |
@@ -442,8 +441,8 @@ static struct ocrdma_mr *ocrdma_alloc_lkey(struct ib_pd *ibpd, | |||
442 | struct ocrdma_dev *dev = pd->dev; | 441 | struct ocrdma_dev *dev = pd->dev; |
443 | 442 | ||
444 | if (acc & IB_ACCESS_REMOTE_WRITE && !(acc & IB_ACCESS_LOCAL_WRITE)) { | 443 | if (acc & IB_ACCESS_REMOTE_WRITE && !(acc & IB_ACCESS_LOCAL_WRITE)) { |
445 | ocrdma_err("%s(%d) leaving err, invalid access rights\n", | 444 | pr_err("%s(%d) leaving err, invalid access rights\n", |
446 | __func__, dev->id); | 445 | __func__, dev->id); |
447 | return ERR_PTR(-EINVAL); | 446 | return ERR_PTR(-EINVAL); |
448 | } | 447 | } |
449 | 448 | ||
@@ -703,8 +702,8 @@ static int ocrdma_copy_cq_uresp(struct ocrdma_cq *cq, struct ib_udata *udata, | |||
703 | uresp.phase_change = cq->phase_change ? 1 : 0; | 702 | uresp.phase_change = cq->phase_change ? 1 : 0; |
704 | status = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); | 703 | status = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); |
705 | if (status) { | 704 | if (status) { |
706 | ocrdma_err("%s(%d) copy error cqid=0x%x.\n", | 705 | pr_err("%s(%d) copy error cqid=0x%x.\n", |
707 | __func__, cq->dev->id, cq->id); | 706 | __func__, cq->dev->id, cq->id); |
708 | goto err; | 707 | goto err; |
709 | } | 708 | } |
710 | uctx = get_ocrdma_ucontext(ib_ctx); | 709 | uctx = get_ocrdma_ucontext(ib_ctx); |
@@ -822,57 +821,56 @@ static int ocrdma_check_qp_params(struct ib_pd *ibpd, struct ocrdma_dev *dev, | |||
822 | if (attrs->qp_type != IB_QPT_GSI && | 821 | if (attrs->qp_type != IB_QPT_GSI && |
823 | attrs->qp_type != IB_QPT_RC && | 822 | attrs->qp_type != IB_QPT_RC && |
824 | attrs->qp_type != IB_QPT_UD) { | 823 | attrs->qp_type != IB_QPT_UD) { |
825 | ocrdma_err("%s(%d) unsupported qp type=0x%x requested\n", | 824 | pr_err("%s(%d) unsupported qp type=0x%x requested\n", |
826 | __func__, dev->id, attrs->qp_type); | 825 | __func__, dev->id, attrs->qp_type); |
827 | return -EINVAL; | 826 | return -EINVAL; |
828 | } | 827 | } |
829 | if (attrs->cap.max_send_wr > dev->attr.max_wqe) { | 828 | if (attrs->cap.max_send_wr > dev->attr.max_wqe) { |
830 | ocrdma_err("%s(%d) unsupported send_wr=0x%x requested\n", | 829 | pr_err("%s(%d) unsupported send_wr=0x%x requested\n", |
831 | __func__, dev->id, attrs->cap.max_send_wr); | 830 | __func__, dev->id, attrs->cap.max_send_wr); |
832 | ocrdma_err("%s(%d) supported send_wr=0x%x\n", | 831 | pr_err("%s(%d) supported send_wr=0x%x\n", |
833 | __func__, dev->id, dev->attr.max_wqe); | 832 | __func__, dev->id, dev->attr.max_wqe); |
834 | return -EINVAL; | 833 | return -EINVAL; |
835 | } | 834 | } |
836 | if (!attrs->srq && (attrs->cap.max_recv_wr > dev->attr.max_rqe)) { | 835 | if (!attrs->srq && (attrs->cap.max_recv_wr > dev->attr.max_rqe)) { |
837 | ocrdma_err("%s(%d) unsupported recv_wr=0x%x requested\n", | 836 | pr_err("%s(%d) unsupported recv_wr=0x%x requested\n", |
838 | __func__, dev->id, attrs->cap.max_recv_wr); | 837 | __func__, dev->id, attrs->cap.max_recv_wr); |
839 | ocrdma_err("%s(%d) supported recv_wr=0x%x\n", | 838 | pr_err("%s(%d) supported recv_wr=0x%x\n", |
840 | __func__, dev->id, dev->attr.max_rqe); | 839 | __func__, dev->id, dev->attr.max_rqe); |
841 | return -EINVAL; | 840 | return -EINVAL; |
842 | } | 841 | } |
843 | if (attrs->cap.max_inline_data > dev->attr.max_inline_data) { | 842 | if (attrs->cap.max_inline_data > dev->attr.max_inline_data) { |
844 | ocrdma_err("%s(%d) unsupported inline data size=0x%x" | 843 | pr_err("%s(%d) unsupported inline data size=0x%x requested\n", |
845 | " requested\n", __func__, dev->id, | 844 | __func__, dev->id, attrs->cap.max_inline_data); |
846 | attrs->cap.max_inline_data); | 845 | pr_err("%s(%d) supported inline data size=0x%x\n", |
847 | ocrdma_err("%s(%d) supported inline data size=0x%x\n", | 846 | __func__, dev->id, dev->attr.max_inline_data); |
848 | __func__, dev->id, dev->attr.max_inline_data); | ||
849 | return -EINVAL; | 847 | return -EINVAL; |
850 | } | 848 | } |
851 | if (attrs->cap.max_send_sge > dev->attr.max_send_sge) { | 849 | if (attrs->cap.max_send_sge > dev->attr.max_send_sge) { |
852 | ocrdma_err("%s(%d) unsupported send_sge=0x%x requested\n", | 850 | pr_err("%s(%d) unsupported send_sge=0x%x requested\n", |
853 | __func__, dev->id, attrs->cap.max_send_sge); | 851 | __func__, dev->id, attrs->cap.max_send_sge); |
854 | ocrdma_err("%s(%d) supported send_sge=0x%x\n", | 852 | pr_err("%s(%d) supported send_sge=0x%x\n", |
855 | __func__, dev->id, dev->attr.max_send_sge); | 853 | __func__, dev->id, dev->attr.max_send_sge); |
856 | return -EINVAL; | 854 | return -EINVAL; |
857 | } | 855 | } |
858 | if (attrs->cap.max_recv_sge > dev->attr.max_recv_sge) { | 856 | if (attrs->cap.max_recv_sge > dev->attr.max_recv_sge) { |
859 | ocrdma_err("%s(%d) unsupported recv_sge=0x%x requested\n", | 857 | pr_err("%s(%d) unsupported recv_sge=0x%x requested\n", |
860 | __func__, dev->id, attrs->cap.max_recv_sge); | 858 | __func__, dev->id, attrs->cap.max_recv_sge); |
861 | ocrdma_err("%s(%d) supported recv_sge=0x%x\n", | 859 | pr_err("%s(%d) supported recv_sge=0x%x\n", |
862 | __func__, dev->id, dev->attr.max_recv_sge); | 860 | __func__, dev->id, dev->attr.max_recv_sge); |
863 | return -EINVAL; | 861 | return -EINVAL; |
864 | } | 862 | } |
865 | /* unprivileged user space cannot create special QP */ | 863 | /* unprivileged user space cannot create special QP */ |
866 | if (ibpd->uobject && attrs->qp_type == IB_QPT_GSI) { | 864 | if (ibpd->uobject && attrs->qp_type == IB_QPT_GSI) { |
867 | ocrdma_err | 865 | pr_err |
868 | ("%s(%d) Userspace can't create special QPs of type=0x%x\n", | 866 | ("%s(%d) Userspace can't create special QPs of type=0x%x\n", |
869 | __func__, dev->id, attrs->qp_type); | 867 | __func__, dev->id, attrs->qp_type); |
870 | return -EINVAL; | 868 | return -EINVAL; |
871 | } | 869 | } |
872 | /* allow creating only one GSI type of QP */ | 870 | /* allow creating only one GSI type of QP */ |
873 | if (attrs->qp_type == IB_QPT_GSI && dev->gsi_qp_created) { | 871 | if (attrs->qp_type == IB_QPT_GSI && dev->gsi_qp_created) { |
874 | ocrdma_err("%s(%d) GSI special QPs already created.\n", | 872 | pr_err("%s(%d) GSI special QPs already created.\n", |
875 | __func__, dev->id); | 873 | __func__, dev->id); |
876 | return -EINVAL; | 874 | return -EINVAL; |
877 | } | 875 | } |
878 | /* verify consumer QPs are not trying to use GSI QP's CQ */ | 876 | /* verify consumer QPs are not trying to use GSI QP's CQ */ |
@@ -881,8 +879,8 @@ static int ocrdma_check_qp_params(struct ib_pd *ibpd, struct ocrdma_dev *dev, | |||
881 | (dev->gsi_sqcq == get_ocrdma_cq(attrs->recv_cq)) || | 879 | (dev->gsi_sqcq == get_ocrdma_cq(attrs->recv_cq)) || |
882 | (dev->gsi_rqcq == get_ocrdma_cq(attrs->send_cq)) || | 880 | (dev->gsi_rqcq == get_ocrdma_cq(attrs->send_cq)) || |
883 | (dev->gsi_rqcq == get_ocrdma_cq(attrs->recv_cq))) { | 881 | (dev->gsi_rqcq == get_ocrdma_cq(attrs->recv_cq))) { |
884 | ocrdma_err("%s(%d) Consumer QP cannot use GSI CQs.\n", | 882 | pr_err("%s(%d) Consumer QP cannot use GSI CQs.\n", |
885 | __func__, dev->id); | 883 | __func__, dev->id); |
886 | return -EINVAL; | 884 | return -EINVAL; |
887 | } | 885 | } |
888 | } | 886 | } |
@@ -934,7 +932,7 @@ static int ocrdma_copy_qp_uresp(struct ocrdma_qp *qp, | |||
934 | } | 932 | } |
935 | status = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); | 933 | status = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); |
936 | if (status) { | 934 | if (status) { |
937 | ocrdma_err("%s(%d) user copy error.\n", __func__, dev->id); | 935 | pr_err("%s(%d) user copy error.\n", __func__, dev->id); |
938 | goto err; | 936 | goto err; |
939 | } | 937 | } |
940 | status = ocrdma_add_mmap(pd->uctx, uresp.sq_page_addr[0], | 938 | status = ocrdma_add_mmap(pd->uctx, uresp.sq_page_addr[0], |
@@ -1088,7 +1086,7 @@ mbx_err: | |||
1088 | kfree(qp->wqe_wr_id_tbl); | 1086 | kfree(qp->wqe_wr_id_tbl); |
1089 | kfree(qp->rqe_wr_id_tbl); | 1087 | kfree(qp->rqe_wr_id_tbl); |
1090 | kfree(qp); | 1088 | kfree(qp); |
1091 | ocrdma_err("%s(%d) error=%d\n", __func__, dev->id, status); | 1089 | pr_err("%s(%d) error=%d\n", __func__, dev->id, status); |
1092 | gen_err: | 1090 | gen_err: |
1093 | return ERR_PTR(status); | 1091 | return ERR_PTR(status); |
1094 | } | 1092 | } |
@@ -1138,10 +1136,10 @@ int ocrdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
1138 | spin_unlock_irqrestore(&qp->q_lock, flags); | 1136 | spin_unlock_irqrestore(&qp->q_lock, flags); |
1139 | 1137 | ||
1140 | if (!ib_modify_qp_is_ok(old_qps, new_qps, ibqp->qp_type, attr_mask)) { | 1138 | if (!ib_modify_qp_is_ok(old_qps, new_qps, ibqp->qp_type, attr_mask)) { |
1141 | ocrdma_err("%s(%d) invalid attribute mask=0x%x specified for " | 1139 | pr_err("%s(%d) invalid attribute mask=0x%x specified for\n" |
1142 | "qpn=0x%x of type=0x%x old_qps=0x%x, new_qps=0x%x\n", | 1140 | "qpn=0x%x of type=0x%x old_qps=0x%x, new_qps=0x%x\n", |
1143 | __func__, dev->id, attr_mask, qp->id, ibqp->qp_type, | 1141 | __func__, dev->id, attr_mask, qp->id, ibqp->qp_type, |
1144 | old_qps, new_qps); | 1142 | old_qps, new_qps); |
1145 | goto param_err; | 1143 | goto param_err; |
1146 | } | 1144 | } |
1147 | 1145 | ||
@@ -1640,9 +1638,9 @@ static int ocrdma_build_inline_sges(struct ocrdma_qp *qp, | |||
1640 | { | 1638 | { |
1641 | if (wr->send_flags & IB_SEND_INLINE) { | 1639 | if (wr->send_flags & IB_SEND_INLINE) { |
1642 | if (wr->sg_list[0].length > qp->max_inline_data) { | 1640 | if (wr->sg_list[0].length > qp->max_inline_data) { |
1643 | ocrdma_err("%s() supported_len=0x%x," | 1641 | pr_err("%s() supported_len=0x%x,\n" |
1644 | " unspported len req=0x%x\n", __func__, | 1642 | " unspported len req=0x%x\n", __func__, |
1645 | qp->max_inline_data, wr->sg_list[0].length); | 1643 | qp->max_inline_data, wr->sg_list[0].length); |
1646 | return -EINVAL; | 1644 | return -EINVAL; |
1647 | } | 1645 | } |
1648 | memcpy(sge, | 1646 | memcpy(sge, |
@@ -2057,8 +2055,8 @@ static void ocrdma_update_wc(struct ocrdma_qp *qp, struct ib_wc *ibwc, | |||
2057 | break; | 2055 | break; |
2058 | default: | 2056 | default: |
2059 | ibwc->status = IB_WC_GENERAL_ERR; | 2057 | ibwc->status = IB_WC_GENERAL_ERR; |
2060 | ocrdma_err("%s() invalid opcode received = 0x%x\n", | 2058 | pr_err("%s() invalid opcode received = 0x%x\n", |
2061 | __func__, hdr->cw & OCRDMA_WQE_OPCODE_MASK); | 2059 | __func__, hdr->cw & OCRDMA_WQE_OPCODE_MASK); |
2062 | break; | 2060 | break; |
2063 | }; | 2061 | }; |
2064 | } | 2062 | } |