On 3/13/2019 7:55 PM, Christoph Hellwig wrote:
From: James Smart <jsmart2021@xxxxxxxxx>
For some nvme command, when issued by the nvme core layer, there
is an internal buffer which can cause blk_rq_payload_bytes() to
return a non-zero value yet there is no actual/real command payload
and sg list. An example is the WRITE ZEROES command.
To address this, when making choices on whether to dma map an sgl,
use blk_rq_nr_phys_segments() instead of blk_rq_payload_bytes().
When there is a sgl, blk_rq_payload_bytes() will return the amount
of data to be transferred by the sgl.
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
Signed-off-by: James Smart <jsmart2021@xxxxxxxxx>
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
I guess we'll need it for all transport.
I saw that pci is covered, RDMA isn't.
Also IMO tcp should be fixed (didn't dive into it yet, just high level
check for blk_rq_payload_bytes).
may we should have a core function for it to reduce code duplication.