iw_cxgb4: Max fastreg depth depends on DSGL support
[deliverable/linux.git] / drivers / infiniband / hw / cxgb4 / mem.c
index 7849890c478141e57136127c84f4cad9fd46227d..9274c909cd19348638792816c173fd70be86223b 100644 (file)
@@ -617,12 +617,14 @@ struct ib_mr *c4iw_alloc_mr(struct ib_pd *pd,
        int ret = 0;
        int length = roundup(max_num_sg * sizeof(u64), 32);
 
+       php = to_c4iw_pd(pd);
+       rhp = php->rhp;
+
        if (mr_type != IB_MR_TYPE_MEM_REG ||
-           max_num_sg > t4_max_fr_depth(use_dsgl))
+           max_num_sg > t4_max_fr_depth(&rhp->rdev.lldi.ulptx_memwrite_dsgl &&
+                                        use_dsgl))
                return ERR_PTR(-EINVAL);
 
-       php = to_c4iw_pd(pd);
-       rhp = php->rhp;
        mhp = kzalloc(sizeof(*mhp), GFP_KERNEL);
        if (!mhp) {
                ret = -ENOMEM;
This page took 0.02384 seconds and 5 git commands to generate.