From 57efada508344d12b34da576b8e102a3695870cf Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Fri, 5 Jul 2019 18:11:46 +0800 Subject: [PATCH] nvmf/tcp: reorg the structure of struct spdk_nvmf_tcp_req I used pahole to see whether the alignment of the structure is reasonable. After reorgnization, we can saved 16 bytes and 1 cacheline according to the information by pahole. Signed-off-by: Ziye Yang Change-Id: I1347e7c582fe2b00707e2841690b87d53cc61e33 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460572 Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Tested-by: SPDK CI Jenkins --- lib/nvmf/tcp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/nvmf/tcp.c b/lib/nvmf/tcp.c index e5abb529d..93687a161 100644 --- a/lib/nvmf/tcp.c +++ b/lib/nvmf/tcp.c @@ -167,11 +167,15 @@ struct spdk_nvmf_tcp_req { uint8_t *buf; bool data_from_pool; - void *buffers[SPDK_NVMF_MAX_SGL_ENTRIES]; + bool has_incapsule_data; /* transfer_tag */ uint16_t ttag; + enum spdk_nvmf_tcp_req_state state; + + void *buffers[SPDK_NVMF_MAX_SGL_ENTRIES]; + /* * next_expected_r2t_offset is used when we receive the h2c_data PDU. */ @@ -184,9 +188,6 @@ struct spdk_nvmf_tcp_req { uint32_t c2h_data_offset; uint32_t c2h_data_pdu_num; - enum spdk_nvmf_tcp_req_state state; - bool has_incapsule_data; - TAILQ_ENTRY(spdk_nvmf_tcp_req) link; TAILQ_ENTRY(spdk_nvmf_tcp_req) state_link; };