nvme: Use a non-temporal move instruction when copying NVMe cmd

When copying the NVMe command from the request to the actual
submission queue slot, use a non-temporal move instruction.

The submission queue slots are never read by software - only
written to. So don't pollute the CPU cache with their contents.

Change-Id: I112f721abfac03bd7b33ec9ddf783d4bf2952b42
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450193
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Ben Walker 2019-04-04 11:14:49 -07:00 committed by Jim Harris
parent 794b2533de
commit 7b0579df17

View File

@ -1079,16 +1079,16 @@ nvme_pcie_copy_command(struct spdk_nvme_cmd *dst, const struct spdk_nvme_cmd *sr
__m256i *d256 = (__m256i *)dst;
const __m256i *s256 = (const __m256i *)src;
_mm256_store_si256(&d256[0], _mm256_load_si256(&s256[0]));
_mm256_store_si256(&d256[1], _mm256_load_si256(&s256[1]));
_mm256_stream_si256(&d256[0], _mm256_load_si256(&s256[0]));
_mm256_stream_si256(&d256[1], _mm256_load_si256(&s256[1]));
#elif defined(__SSE2__)
__m128i *d128 = (__m128i *)dst;
const __m128i *s128 = (const __m128i *)src;
_mm_store_si128(&d128[0], _mm_load_si128(&s128[0]));
_mm_store_si128(&d128[1], _mm_load_si128(&s128[1]));
_mm_store_si128(&d128[2], _mm_load_si128(&s128[2]));
_mm_store_si128(&d128[3], _mm_load_si128(&s128[3]));
_mm_stream_si128(&d128[0], _mm_load_si128(&s128[0]));
_mm_stream_si128(&d128[1], _mm_load_si128(&s128[1]));
_mm_stream_si128(&d128[2], _mm_load_si128(&s128[2]));
_mm_stream_si128(&d128[3], _mm_load_si128(&s128[3]));
#else
*dst = *src;
#endif