[ofa-general] [PATCH] infiniband: modify ammasso driver to use send with invalidate

Mikkel Hagen mhagen at iol.unh.edu
Tue May 1 10:39:00 PDT 2007


I don't believe that we can make it into one line as Roland pointed out 
earlier - it introduces an accumulation bug because it is within a while 
loop.

Mikkel Hagen
Project Assistant - Fibre Channel/SAS/SATA Consortiums
Research and Development Engineer - iWARP Consortium	
FC/SAS/SATA:1-603-862-0701  iWARP:1-603-862-5083  Fax:1-603-862-4181
UNH-IOL
121 Technology Drive, Suite 2
Durham, NH 03824



Steve Wise wrote:
> The code looks correct.  
>
> I'd make the msg_size lines just one statement:
>
> 	msg_size = sizeof(struct c2wr_send_req) +
> 		   sizeof(struct c2_data_addr) * ib_wr->num_sge;
>
> Have you tested that it works? 
>
>
> Steve.
>
>
> On Tue, 2007-05-01 at 10:20 -0400, mhagen at iol.unh.edu wrote:
>   
>> Modification to the ammasso driver to use the iWARP verbs SEND with INV
>> and SEND with SE and INV.
>>
>> --- linux-2.6.21.1/drivers/infiniband/hw/amso1100/c2_qp.c	2007-04-30
>> 13:12:54.000000000 -0400
>> +++ linux-2.6.21.1/drivers/infiniband/hw/amso1100/c2_qp.c	2007-04-30
>> 16:24:38.000000000 -0400
>> @@ -810,16 +810,25 @@ int c2_post_send(struct ib_qp *ibqp, str
>>
>>  		switch (ib_wr->opcode) {
>>  		case IB_WR_SEND:
>> -			if (ib_wr->send_flags & IB_SEND_SOLICITED) {
>> +			if (ib_wr->send_flags & IB_SEND_SOLICITED
>> +				&& ib_wr->send_flags & IB_SEND_INVALIDATE) {
>> +				c2_wr_set_id(&wr, C2_WR_TYPE_SEND_SE_INV);
>> +				wr.sqwr.send.remote_stag =
>> +					cpu_to_be32(ib_wr->wr.invalidate.rkey);
>> +			} else if (ib_wr->send_flags & IB_SEND_SOLICITED) {
>>  				c2_wr_set_id(&wr, C2_WR_TYPE_SEND_SE);
>> -				msg_size = sizeof(struct c2wr_send_req);
>> +				wr.sqwr.send.remote_stag = 0;
>> +			} else if (ib_wr->send_flags & IB_SEND_INVALIDATE) {
>> +				c2_wr_set_id(&wr, C2_WR_TYPE_SEND_INV);
>> +				wr.sqwr.send.remote_stag =
>> +					cpu_to_be32(ib_wr->wr.invalidate.rkey);
>>  			} else {
>>  				c2_wr_set_id(&wr, C2_WR_TYPE_SEND);
>> -				msg_size = sizeof(struct c2wr_send_req);
>> +				wr.sqwr.send.remote_stag = 0;
>>  			}
>>
>> -			wr.sqwr.send.remote_stag = 0;
>> -			msg_size += sizeof(struct c2_data_addr) * ib_wr->num_sge;
>> +			msg_size = sizeof(struct c2wr_send_req);
>> +			msg_size += sizeof(struct c2_data_addr)	* ib_wr->num_sge;
>>  			if (ib_wr->num_sge > qp->send_sgl_depth) {
>>  				err = -EINVAL;
>>  				break;
>>
>>
>>
>>     



More information about the general mailing list