[ofa-general] Re: [PATCH 2/2] IB/mlx4_ib: fix SRQ buffer allocation

Roland Dreier rdreier at cisco.com
Sun Jun 10 08:52:06 PDT 2007


 > > +		/* HW requires >= 1 RQ entry with >= 1 gather entry */
 > > +		if (is_user && (!cap->max_recv_wr || !cap->max_recv_sge))
 > > +			return -EINVAL;
 > 
 > I think we may have a problem here: if a user, not being aware of the HW
 > requirement of none zero length receive queue, creates a QP with zero in
 > cap->max_recv_sge, the above kernel code will cause a failure since
 > libmlx4 does not fix the value in this field. So I think this should be
 > taken care of in libmlx4.

OK, I'll add something to make sure max_recv_sge >= 1 to libmlx4.

 > +       /* Sanity check for SQ size */
 > +       if (ucmd->log_sq_bb_count > 15 || ucmd->log_sq_stride > 11)
 > +               return -EINVAL;
 > +
 > 
 > Shouldn't we use a condition like this to prevent misconfiguration of
 > the QP if libmlx4 passes improper values?

Yeah, I guess so.  I dropped that chunk because I didn't like the
hard-coded and unexplained values, but I left the checking on my to do
list.

Thanks...



More information about the general mailing list