History

Merge tag 'rdma-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

Pull InfiniBand/RDMA fixes from Roland Dreier: "All in hardware drivers: - Fix crash in cxgb4 - Fixes to new ocrdma driver - Regression fixes for mlx4" * tag 'rdma-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: IB/mlx4: Fix max_wqe capacity reported from query device mlx4_core: Fix setting VL_cap in mlx4_SET_PORT wrapper flow IB/mlx4: Fix EQ deallocation in legacy mode RDMA/cxgb4: Fix crash when peer address is 0.0.0.0 RDMA/ocrdma: Remove unnecessary version.h includes RDMA/ocrdma: Fix signaled event for SRQ_LIMIT_REACHED RDMA/ocrdma: Correct queue free count math

Linus Torvalds committed 14 years ago

Commit ae501be2 parents 374916e 20952cd11 files · +39 −41Browse files

Unified · Split

11 files
  1. drivers/infiniband/hw/cxgb4/cm.c +4 −0
  2. drivers/infiniband/hw/mlx4/main.c +8 −13
  3. drivers/infiniband/hw/mlx4/mlx4_ib.h +8 −0
  4. drivers/infiniband/hw/mlx4/qp.c +15 −6
  5. drivers/infiniband/hw/ocrdma/ocrdma.h +0 −1
  6. drivers/infiniband/hw/ocrdma/ocrdma_abi.h +1 −4
  7. drivers/infiniband/hw/ocrdma/ocrdma_hw.c +1 −8
  8. drivers/infiniband/hw/ocrdma/ocrdma_main.c +0 −1
  9. drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +0 −5
  10. drivers/infiniband/hw/ocrdma/ocrdma_verbs.h +0 −1
  11. drivers/net/ethernet/mellanox/mlx4/port.c +2 −2
drivers/infiniband/hw/cxgb4/cm.c+4−0
@@ -1593,6 +1593,10 @@ static int import_ep(struct c4iw_ep *ep, __be32 peer_ip, struct dst_entry *dst, · 1592 unmodified lines
1593 struct net_device *pdev;1593 struct net_device *pdev;
1594 1594
1595 pdev = ip_dev_find(&init_net, peer_ip);1595 pdev = ip_dev_find(&init_net, peer_ip);
1596 if (!pdev) {
1597 err = -ENODEV;
1598 goto out;
1599 }
1596 ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,1600 ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,
1597 n, pdev, 0);1601 n, pdev, 0);
1598 if (!ep->l2t)1602 if (!ep->l2t)
drivers/infiniband/hw/mlx4/main.c+8−13
@@ -140,7 +140,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, · 139 unmodified lines
140 props->max_mr_size = ~0ull;140 props->max_mr_size = ~0ull;
141 props->page_size_cap = dev->dev->caps.page_size_cap;141 props->page_size_cap = dev->dev->caps.page_size_cap;
142 props->max_qp = dev->dev->caps.num_qps - dev->dev->caps.reserved_qps;142 props->max_qp = dev->dev->caps.num_qps - dev->dev->caps.reserved_qps;
143 props->max_qp_wr = dev->dev->caps.max_wqes;143 props->max_qp_wr = dev->dev->caps.max_wqes - MLX4_IB_SQ_MAX_SPARE;
144 props->max_sge = min(dev->dev->caps.max_sq_sg,144 props->max_sge = min(dev->dev->caps.max_sq_sg,
145 dev->dev->caps.max_rq_sg);145 dev->dev->caps.max_rq_sg);
146 props->max_cq = dev->dev->caps.num_cqs - dev->dev->caps.reserved_cqs;146 props->max_cq = dev->dev->caps.num_cqs - dev->dev->caps.reserved_cqs;
@@ -1084,12 +1084,9 @@ static void mlx4_ib_alloc_eqs(struct mlx4_dev *dev, struct mlx4_ib_dev *ibdev) · 937 unmodified lines
1084 int total_eqs = 0;1084 int total_eqs = 0;
1085 int i, j, eq;1085 int i, j, eq;
1086 1086
1087 /* Init eq table */1087 /* Legacy mode or comp_pool is not large enough */
1088 ibdev->eq_table = NULL;1088 if (dev->caps.comp_pool == 0 ||
1089 ibdev->eq_added = 0;1089 dev->caps.num_ports > dev->caps.comp_pool)
1090
1091 /* Legacy mode? */
1092 if (dev->caps.comp_pool == 0)
1093 return;1090 return;
1094 1091
1095 eq_per_port = rounddown_pow_of_two(dev->caps.comp_pool/1092 eq_per_port = rounddown_pow_of_two(dev->caps.comp_pool/
@@ -1135,7 +1132,10 @@ static void mlx4_ib_alloc_eqs(struct mlx4_dev *dev, struct mlx4_ib_dev *ibdev) · 39 unmodified lines
1135static void mlx4_ib_free_eqs(struct mlx4_dev *dev, struct mlx4_ib_dev *ibdev)1132static void mlx4_ib_free_eqs(struct mlx4_dev *dev, struct mlx4_ib_dev *ibdev)
1136{1133{
1137 int i;1134 int i;
1138 int total_eqs;1135
1136 /* no additional eqs were added */
1137 if (!ibdev->eq_table)
1138 return;
1139 1139
1140 /* Reset the advertised EQ number */1140 /* Reset the advertised EQ number */
1141 ibdev->ib_dev.num_comp_vectors = dev->caps.num_comp_vectors;1141 ibdev->ib_dev.num_comp_vectors = dev->caps.num_comp_vectors;
@@ -1148,12 +1148,7 @@ static void mlx4_ib_free_eqs(struct mlx4_dev *dev, struct mlx4_ib_dev *ibdev) · 6 unmodified lines
1148 mlx4_release_eq(dev, ibdev->eq_table[i]);1148 mlx4_release_eq(dev, ibdev->eq_table[i]);
1149 }1149 }
1150 1150
1151 total_eqs = dev->caps.num_comp_vectors + ibdev->eq_added;
1152 memset(ibdev->eq_table, 0, total_eqs * sizeof(int));
1153 kfree(ibdev->eq_table);1151 kfree(ibdev->eq_table);
1154
1155 ibdev->eq_table = NULL;
1156 ibdev->eq_added = 0;
1157}1152}
1158 1153
1159static void *mlx4_ib_add(struct mlx4_dev *dev)1154static void *mlx4_ib_add(struct mlx4_dev *dev)
drivers/infiniband/hw/mlx4/mlx4_ib.h+8−0
@@ -44,6 +44,14 @@ · 43 unmodified lines
44#include <linux/mlx4/device.h>44#include <linux/mlx4/device.h>
45#include <linux/mlx4/doorbell.h>45#include <linux/mlx4/doorbell.h>
46 46
47enum {
48 MLX4_IB_SQ_MIN_WQE_SHIFT = 6,
49 MLX4_IB_MAX_HEADROOM = 2048
50};
51
52#define MLX4_IB_SQ_HEADROOM(shift) ((MLX4_IB_MAX_HEADROOM >> (shift)) + 1)
53#define MLX4_IB_SQ_MAX_SPARE (MLX4_IB_SQ_HEADROOM(MLX4_IB_SQ_MIN_WQE_SHIFT))
54
47struct mlx4_ib_ucontext {55struct mlx4_ib_ucontext {
48 struct ib_ucontext ibucontext;56 struct ib_ucontext ibucontext;
49 struct mlx4_uar uar;57 struct mlx4_uar uar;
drivers/infiniband/hw/mlx4/qp.c+15−6
@@ -310,8 +310,8 @@ static int set_rq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap, · 309 unmodified lines
310 int is_user, int has_rq, struct mlx4_ib_qp *qp)310 int is_user, int has_rq, struct mlx4_ib_qp *qp)
311{311{
312 /* Sanity check RQ size before proceeding */312 /* Sanity check RQ size before proceeding */
313 if (cap->max_recv_wr > dev->dev->caps.max_wqes ||313 if (cap->max_recv_wr > dev->dev->caps.max_wqes - MLX4_IB_SQ_MAX_SPARE ||
314 cap->max_recv_sge > dev->dev->caps.max_rq_sg)314 cap->max_recv_sge > min(dev->dev->caps.max_sq_sg, dev->dev->caps.max_rq_sg))
315 return -EINVAL;315 return -EINVAL;
316 316
317 if (!has_rq) {317 if (!has_rq) {
@@ -329,8 +329,17 @@ static int set_rq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap, · 11 unmodified lines
329 qp->rq.wqe_shift = ilog2(qp->rq.max_gs * sizeof (struct mlx4_wqe_data_seg));329 qp->rq.wqe_shift = ilog2(qp->rq.max_gs * sizeof (struct mlx4_wqe_data_seg));
330 }330 }
331 331
332 cap->max_recv_wr = qp->rq.max_post = qp->rq.wqe_cnt;332 /* leave userspace return values as they were, so as not to break ABI */
333 cap->max_recv_sge = qp->rq.max_gs;333 if (is_user) {
334 cap->max_recv_wr = qp->rq.max_post = qp->rq.wqe_cnt;
335 cap->max_recv_sge = qp->rq.max_gs;
336 } else {
337 cap->max_recv_wr = qp->rq.max_post =
338 min(dev->dev->caps.max_wqes - MLX4_IB_SQ_MAX_SPARE, qp->rq.wqe_cnt);
339 cap->max_recv_sge = min(qp->rq.max_gs,
340 min(dev->dev->caps.max_sq_sg,
341 dev->dev->caps.max_rq_sg));
342 }
334 343
335 return 0;344 return 0;
336}345}
@@ -341,8 +350,8 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap, · 4 unmodified lines
341 int s;350 int s;
342 351
343 /* Sanity check SQ size before proceeding */352 /* Sanity check SQ size before proceeding */
344 if (cap->max_send_wr > dev->dev->caps.max_wqes ||353 if (cap->max_send_wr > (dev->dev->caps.max_wqes - MLX4_IB_SQ_MAX_SPARE) ||
345 cap->max_send_sge > dev->dev->caps.max_sq_sg ||354 cap->max_send_sge > min(dev->dev->caps.max_sq_sg, dev->dev->caps.max_rq_sg) ||
346 cap->max_inline_data + send_wqe_overhead(type, qp->flags) +355 cap->max_inline_data + send_wqe_overhead(type, qp->flags) +
347 sizeof (struct mlx4_wqe_inline_seg) > dev->dev->caps.max_sq_desc_sz)356 sizeof (struct mlx4_wqe_inline_seg) > dev->dev->caps.max_sq_desc_sz)
348 return -EINVAL;357 return -EINVAL;
drivers/infiniband/hw/ocrdma/ocrdma.h+0−1
@@ -231,7 +231,6 @@ struct ocrdma_qp_hwq_info { · 230 unmodified lines
231 u32 entry_size;231 u32 entry_size;
232 u32 max_cnt;232 u32 max_cnt;
233 u32 max_wqe_idx;233 u32 max_wqe_idx;
234 u32 free_delta;
235 u16 dbid; /* qid, where to ring the doorbell. */234 u16 dbid; /* qid, where to ring the doorbell. */
236 u32 len;235 u32 len;
237 dma_addr_t pa;236 dma_addr_t pa;
drivers/infiniband/hw/ocrdma/ocrdma_abi.h+1−4
@@ -101,8 +101,6 @@ struct ocrdma_create_qp_uresp { · 100 unmodified lines
101 u32 rsvd1;101 u32 rsvd1;
102 u32 num_wqe_allocated;102 u32 num_wqe_allocated;
103 u32 num_rqe_allocated;103 u32 num_rqe_allocated;
104 u32 free_wqe_delta;
105 u32 free_rqe_delta;
106 u32 db_sq_offset;104 u32 db_sq_offset;
107 u32 db_rq_offset;105 u32 db_rq_offset;
108 u32 db_shift;106 u32 db_shift;
@@ -126,8 +124,7 @@ struct ocrdma_create_srq_uresp { · 17 unmodified lines
126 u32 db_rq_offset;124 u32 db_rq_offset;
127 u32 db_shift;125 u32 db_shift;
128 126
129 u32 free_rqe_delta;127 u64 rsvd2;
130 u32 rsvd2;
131 u64 rsvd3;128 u64 rsvd3;
132} __packed;129} __packed;
133 130
drivers/infiniband/hw/ocrdma/ocrdma_hw.c+1−8
@@ -732,7 +732,7 @@ static void ocrdma_dispatch_ibevent(struct ocrdma_dev *dev, · 731 unmodified lines
732 break;732 break;
733 case OCRDMA_SRQ_LIMIT_EVENT:733 case OCRDMA_SRQ_LIMIT_EVENT:
734 ib_evt.element.srq = &qp->srq->ibsrq;734 ib_evt.element.srq = &qp->srq->ibsrq;
735 ib_evt.event = IB_EVENT_QP_LAST_WQE_REACHED;735 ib_evt.event = IB_EVENT_SRQ_LIMIT_REACHED;
736 srq_event = 1;736 srq_event = 1;
737 qp_event = 0;737 qp_event = 0;
738 break;738 break;
@@ -1990,19 +1990,12 @@ static void ocrdma_get_create_qp_rsp(struct ocrdma_create_qp_rsp *rsp, · 1251 unmodified lines
1990 max_wqe_allocated = 1 << max_wqe_allocated;1990 max_wqe_allocated = 1 << max_wqe_allocated;
1991 max_rqe_allocated = 1 << ((u16)rsp->max_wqe_rqe);1991 max_rqe_allocated = 1 << ((u16)rsp->max_wqe_rqe);
1992 1992
1993 if (qp->dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) {
1994 qp->sq.free_delta = 0;
1995 qp->rq.free_delta = 1;
1996 } else
1997 qp->sq.free_delta = 1;
1998
1999 qp->sq.max_cnt = max_wqe_allocated;1993 qp->sq.max_cnt = max_wqe_allocated;
2000 qp->sq.max_wqe_idx = max_wqe_allocated - 1;1994 qp->sq.max_wqe_idx = max_wqe_allocated - 1;
2001 1995
2002 if (!attrs->srq) {1996 if (!attrs->srq) {
2003 qp->rq.max_cnt = max_rqe_allocated;1997 qp->rq.max_cnt = max_rqe_allocated;
2004 qp->rq.max_wqe_idx = max_rqe_allocated - 1;1998 qp->rq.max_wqe_idx = max_rqe_allocated - 1;
2005 qp->rq.free_delta = 1;
2006 }1999 }
2007}2000}
2008 2001
drivers/infiniband/hw/ocrdma/ocrdma_main.c+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
26 *******************************************************************/26 *******************************************************************/
27 27
28#include <linux/module.h>28#include <linux/module.h>
29#include <linux/version.h>
30#include <linux/idr.h>29#include <linux/idr.h>
31#include <rdma/ib_verbs.h>30#include <rdma/ib_verbs.h>
32#include <rdma/ib_user_verbs.h>31#include <rdma/ib_user_verbs.h>
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c+0−5
@@ -940,8 +940,6 @@ static int ocrdma_copy_qp_uresp(struct ocrdma_qp *qp, · 939 unmodified lines
940 uresp.db_rq_offset = OCRDMA_DB_RQ_OFFSET;940 uresp.db_rq_offset = OCRDMA_DB_RQ_OFFSET;
941 uresp.db_shift = 16;941 uresp.db_shift = 16;
942 }942 }
943 uresp.free_wqe_delta = qp->sq.free_delta;
944 uresp.free_rqe_delta = qp->rq.free_delta;
945 943
946 if (qp->dpp_enabled) {944 if (qp->dpp_enabled) {
947 uresp.dpp_credit = dpp_credit_lmt;945 uresp.dpp_credit = dpp_credit_lmt;
@@ -1307,8 +1305,6 @@ static int ocrdma_hwq_free_cnt(struct ocrdma_qp_hwq_info *q) · 359 unmodified lines
1307 free_cnt = (q->max_cnt - q->head) + q->tail;1305 free_cnt = (q->max_cnt - q->head) + q->tail;
1308 else1306 else
1309 free_cnt = q->tail - q->head;1307 free_cnt = q->tail - q->head;
1310 if (q->free_delta)
1311 free_cnt -= q->free_delta;
1312 return free_cnt;1308 return free_cnt;
1313}1309}
1314 1310
@@ -1501,7 +1497,6 @@ static int ocrdma_copy_srq_uresp(struct ocrdma_srq *srq, struct ib_udata *udata) · 186 unmodified lines
1501 (srq->pd->id * srq->dev->nic_info.db_page_size);1497 (srq->pd->id * srq->dev->nic_info.db_page_size);
1502 uresp.db_page_size = srq->dev->nic_info.db_page_size;1498 uresp.db_page_size = srq->dev->nic_info.db_page_size;
1503 uresp.num_rqe_allocated = srq->rq.max_cnt;1499 uresp.num_rqe_allocated = srq->rq.max_cnt;
1504 uresp.free_rqe_delta = 1;
1505 if (srq->dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) {1500 if (srq->dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) {
1506 uresp.db_rq_offset = OCRDMA_DB_GEN2_RQ1_OFFSET;1501 uresp.db_rq_offset = OCRDMA_DB_GEN2_RQ1_OFFSET;
1507 uresp.db_shift = 24;1502 uresp.db_shift = 24;
drivers/infiniband/hw/ocrdma/ocrdma_verbs.h+0−1
@@ -28,7 +28,6 @@ · 27 unmodified lines
28#ifndef __OCRDMA_VERBS_H__28#ifndef __OCRDMA_VERBS_H__
29#define __OCRDMA_VERBS_H__29#define __OCRDMA_VERBS_H__
30 30
31#include <linux/version.h>
32int ocrdma_post_send(struct ib_qp *, struct ib_send_wr *,31int ocrdma_post_send(struct ib_qp *, struct ib_send_wr *,
33 struct ib_send_wr **bad_wr);32 struct ib_send_wr **bad_wr);
34int ocrdma_post_recv(struct ib_qp *, struct ib_recv_wr *,33int ocrdma_post_recv(struct ib_qp *, struct ib_recv_wr *,
drivers/net/ethernet/mellanox/mlx4/port.c+2−2
@@ -697,10 +697,10 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, · 696 unmodified lines
697 if (slave != dev->caps.function)697 if (slave != dev->caps.function)
698 memset(inbox->buf, 0, 256);698 memset(inbox->buf, 0, 256);
699 if (dev->flags & MLX4_FLAG_OLD_PORT_CMDS) {699 if (dev->flags & MLX4_FLAG_OLD_PORT_CMDS) {
700 *(u8 *) inbox->buf = !!reset_qkey_viols << 6;700 *(u8 *) inbox->buf |= !!reset_qkey_viols << 6;
701 ((__be32 *) inbox->buf)[2] = agg_cap_mask;701 ((__be32 *) inbox->buf)[2] = agg_cap_mask;
702 } else {702 } else {
703 ((u8 *) inbox->buf)[3] = !!reset_qkey_viols;703 ((u8 *) inbox->buf)[3] |= !!reset_qkey_viols;
704 ((__be32 *) inbox->buf)[1] = agg_cap_mask;704 ((__be32 *) inbox->buf)[1] = agg_cap_mask;
705 }705 }
706 706

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t