[PATCH V2 12/12] nvmet: use inline bio for passthru fast path

Logan Gunthorpe logang at deltatee.com
Wed Sep 2 11:41:00 EDT 2020



On 2020-09-01 6:39 p.m., Chaitanya Kulkarni wrote:
> On 9/1/20 10:29, Logan Gunthorpe wrote:
>>> +	if (req->transfer_len <= NVMET_MAX_INLINE_DATA_LEN) {
>>> +		bio = &req->p.inline_bio;
>>> +		bio_init(bio, req->inline_bvec, ARRAY_SIZE(req->inline_bvec));
>>> +	} else {
>>> +		bio = bio_alloc(GFP_KERNEL, min(sg_cnt, BIO_MAX_PAGES));
>>> +	}
>>> +
>>> +	bio->bi_end_io = nvmet_passthru_bio_done;
>>>   	bio->bi_opf = req_op(rq) | op_flags;
>>> +	bio->bi_private = req;
>> I still think this would be cleaner to just do:
>>
>> if (req->transfer_len <= NVMET_MAX_INLINE_DATA_LEN) {
>> 	bio = &req->p.inline_bio;
>> 	bio_init(bio, req->inline_bvec, ARRAY_SIZE(req->inline_bvec));
>> } else {
>> 	bio = bio_alloc(GFP_KERNEL, min(sg_cnt, BIO_MAX_PAGES));
>>          bio->bi_end_io = bio_put
> This is intentionally kept consistent with what we have for bdev-ns.

So then cleanup bdev-ns... Doing something in a less clean way because
somebody else did it is not good reasoning.

Logan



More information about the Linux-nvme mailing list