Cap the number of CQEs. Not a real limitation for us, but expected by
the verbs code.
Signed-off-by: Bryan O'Sullivan <[email protected]>
diff -r e823378bd19c -r 1d3e85454b53 drivers/infiniband/hw/ipath/ipath_cq.c
--- a/drivers/infiniband/hw/ipath/ipath_cq.c Fri May 12 15:55:27 2006 -0700
+++ b/drivers/infiniband/hw/ipath/ipath_cq.c Fri May 12 15:55:27 2006 -0700
@@ -161,6 +161,11 @@ struct ib_cq *ipath_create_cq(struct ib_
struct ib_wc *wc;
struct ib_cq *ret;
+ if (entries > ib_ipath_max_cqe) {
+ ret = ERR_PTR(-EINVAL);
+ goto bail;
+ }
+
/*
* Need to use vmalloc() if we want to support large #s of
* entries.
diff -r e823378bd19c -r 1d3e85454b53 drivers/infiniband/hw/ipath/ipath_verbs.c
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c Fri May 12 15:55:27 2006 -0700
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c Fri May 12 15:55:27 2006 -0700
@@ -64,6 +64,11 @@ module_param_named(max_ahs, ib_ipath_max
module_param_named(max_ahs, ib_ipath_max_ahs, uint, S_IWUSR | S_IRUGO);
MODULE_PARM_DESC(max_ahs,
"Maximum number of address handles to support");
+
+unsigned int ib_ipath_max_cqe = 0xFFFF;
+module_param_named(max_cqe, ib_ipath_max_cqe, uint, S_IWUSR | S_IRUGO);
+MODULE_PARM_DESC(max_cqe,
+ "Maximum number of completion queue entries to support");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("PathScale <[email protected]>");
@@ -598,7 +603,7 @@ static int ipath_query_device(struct ib_
props->max_sge = 255;
props->max_cq = 0xffff;
props->max_ah = ib_ipath_max_ahs;
- props->max_cqe = 0xffff;
+ props->max_cqe = ib_ipath_max_cqe;
props->max_mr = dev->lk_table.max;
props->max_pd = ib_ipath_max_pds;
props->max_qp_rd_atom = 1;
diff -r e823378bd19c -r 1d3e85454b53 drivers/infiniband/hw/ipath/ipath_verbs.h
--- a/drivers/infiniband/hw/ipath/ipath_verbs.h Fri May 12 15:55:27 2006 -0700
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.h Fri May 12 15:55:27 2006 -0700
@@ -690,6 +690,8 @@ extern const int ib_ipath_state_ops[];
extern unsigned int ib_ipath_lkey_table_size;
+extern unsigned int ib_ipath_max_cqe;
+
extern const u32 ib_ipath_rnr_table[];
#endif /* IPATH_VERBS_H */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]