diff options
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_qp.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_qp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index 5899f0c765be..dd4e13303e96 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
@@ -918,10 +918,12 @@ static void mthca_adjust_qp_caps(struct mthca_dev *dev, | |||
918 | else | 918 | else |
919 | qp->max_inline_data = max_data_size - MTHCA_INLINE_HEADER_SIZE; | 919 | qp->max_inline_data = max_data_size - MTHCA_INLINE_HEADER_SIZE; |
920 | 920 | ||
921 | qp->sq.max_gs = max_data_size / sizeof (struct mthca_data_seg); | 921 | qp->sq.max_gs = min_t(int, dev->limits.max_sg, |
922 | qp->rq.max_gs = (min(dev->limits.max_desc_sz, 1 << qp->rq.wqe_shift) - | 922 | max_data_size / sizeof (struct mthca_data_seg)); |
923 | sizeof (struct mthca_next_seg)) / | 923 | qp->rq.max_gs = min_t(int, dev->limits.max_sg, |
924 | sizeof (struct mthca_data_seg); | 924 | (min(dev->limits.max_desc_sz, 1 << qp->rq.wqe_shift) - |
925 | sizeof (struct mthca_next_seg)) / | ||
926 | sizeof (struct mthca_data_seg)); | ||
925 | } | 927 | } |
926 | 928 | ||
927 | /* | 929 | /* |