Commit 6d4ce173 authored by Jim Harris's avatar Jim Harris Committed by Daniel Verkamp
Browse files

bdev/nvme: do not split SGE callbacks on 2MB boundaries



An SGE could be for a payload that is greater than the NVMe
devices MDTS (i.e. 128KB), but that SGE may not be aligned
on a sector-size boundary.  We can safely assume that each
iov is individually physically contiguous - the DPDK
mempools for example guarantee this.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I8143ed01814c3154d0a06b8bbc548484437c1e88
parent df8129fb
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -791,10 +791,6 @@ queued_reset_sgl(void *ref, uint32_t sgl_offset)
	}
}

#define min(a, b) (((a)<(b))?(a):(b))

#define _2MB_OFFSET(ptr)	(((uintptr_t)ptr) &  (0x200000 - 1))

static int
queued_next_sge(void *ref, void **address, uint32_t *length)
{
@@ -814,8 +810,6 @@ queued_next_sge(void *ref, void **address, uint32_t *length)
		*length -= bio->iov_offset;
	}

	*length = min(*length, 0x200000 - _2MB_OFFSET(*address));

	bio->iov_offset += *length;
	if (bio->iov_offset == iov->iov_len) {
		bio->iovpos++;