Re: [PATCH 10/12] IB/srpt: convert to the generic RDMA READ/WRITE API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 13, 2016 at 11:57:57AM -0700, Bart Van Assche wrote:
> On 04/11/2016 02:32 PM, Christoph Hellwig wrote:
>>   static int srpt_get_desc_tbl(struct srpt_send_ioctx *ioctx,
>> -			     struct srp_cmd *srp_cmd,
>> -			     enum dma_data_direction *dir, u64 *data_len)
>> +		struct srp_cmd *srp_cmd, enum dma_data_direction *dir,
>> +		struct scatterlist **sg, unsigned *sg_cnt, u64 *data_len)
>>   {
> [ ... ]
>>
>> -		db = idb->desc_list;
>> -		memcpy(ioctx->rbufs, db, ioctx->n_rbuf * sizeof(*db));
>>   		*data_len = be32_to_cpu(idb->len);
>> +		return srpt_alloc_rw_ctxs(ioctx, idb->desc_list, nbufs,
>> +				sg, sg_cnt);
>> +	} else {
>> +		*data_len = 0;
>> +		return 0;
>>   	}
>> -out:
>> -	return ret;
>>   }
>
> srpt_get_desc_tbl() only has one caller. Have you considered to move 
> srpt_alloc_rw_ctxs() from this function to the caller of 
> srpt_get_desc_tbl()?

I looked into a couple options.  srpt_alloc_rw_ctxs needs the
pointer to the srp_direct_buf array, and the number of buffers, so we'd
need two more output arguments to srpt_get_desc_tbl, so it didn't
seem worthwhile to me.  If you want me to make the change anyway, I can
update the patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux