> wr->opcode cannot be less than 0, can it?

why not?  The struct field is signed, isn't it?  What prevents a
consumer from passing in a negative garbage value?

 > but note below that in mlx4_ib_opcodeIB_WR_RDMA_READ_WITH_INV is
 > missing, so shouldn't this be:

 >              if (wr->opcode > IB_WR_FAST_REG_MR) {
 >                         err = -EINVAL;
 >                         goto out;
 >                 }

I don't understand the difference between explicitly saying
IB_WR_FAST_REG_MR and using ARRAY_SIZE(), except that if we add new
opcodes then the ARRAY_SIZE() way works without having to remember it.

It is true that if someone passes in IB_WR_RDMA_READ_WITH_INV, then the
mlx4 code won't return an error for that unimplemented operation, but I
don't see how your change fixes that (or indeed fixes anything).

 - R.
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to