From 6d4ce17380b86108a190d7fd2d8088ae448a45be Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 20 Dec 2016 16:10:20 -0700 Subject: [PATCH] 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: Jim Harris Change-Id: I8143ed01814c3154d0a06b8bbc548484437c1e88 --- lib/bdev/nvme/blockdev_nvme.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/bdev/nvme/blockdev_nvme.c b/lib/bdev/nvme/blockdev_nvme.c index ff2813e70..b99a9033c 100644 --- a/lib/bdev/nvme/blockdev_nvme.c +++ b/lib/bdev/nvme/blockdev_nvme.c @@ -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++;