[ofa-general][PATCH 8/11 v3] mlx4: Default value for automatic completion vector selection

Roland Dreier rdreier at cisco.com
Fri Jul 11 08:33:53 PDT 2008


I haven't read this all very carefully yet, but this seems funny:

 > IB_CQ_VECTOR_LEAST_ATTACHED is redefined in device.h as MLX4_ANY_VECTOR
 > because we don't want all mlx4_core clients (Ethernet and FCoE) to
 > include <rdma/ib_verbs.h>

OK, but...

 > --- a/include/linux/mlx4/device.h
 > +++ b/include/linux/mlx4/device.h
 > @@ -37,6 +37,8 @@
 >  #include <linux/completion.h>
 >  #include <linux/radix-tree.h>
 > 
 > +#include <rdma/ib_verbs.h>
 > 
 > +#define MLX4_ANY_VECTOR		IB_CQ_VECTOR_LEAST_ATTACHED

you just add <rdma/ib_verbs.h> to a common header, which means all
mlx4_core clients end up including it!

I would suggest just doing

#define MLX4_LEAST_ATTACHED_VECTOR	0xffffffff

and then doing something like this in the IB driver:

	err = mlx4_cq_alloc(dev->dev, entries, &cq->buf.mtt, uar,
			    cq->db.dma, &cq->mcq,
			    vector == IB_CQ_VECTOR_LEAST_ATTACHED ?
			    MLX4_LEAST_ATTACHED_VECTOR : vector, 0);

 > +#define IB_CQ_VECTOR_LEAST_ATTACHED	0xff

And making this such a low value seems like a bad idea, given that even
mlx4 devices have a 256 entry MSI-X table, and in the not-too distant
future even bigger tables are easily possible.

 - R.



More information about the general mailing list