Skip to content

Commit 0f5335e

Browse files
tititiou36keithbusch
authored andcommitted
nvmet: reorder fields in 'struct nvme_dhchap_queue_context'
Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvme_dhchap_queue_context' from 416 to 400 bytes. This structure is kvcalloc()'ed in nvme_auth_init_ctrl(), so it is likely that the allocation can be relatively big. Saving 16 bytes per structure may might a slight difference. Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent e64b0c8 commit 0f5335e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/nvme/host/auth.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ struct nvme_dhchap_queue_context {
3030
u32 s2;
3131
u16 transaction;
3232
u8 status;
33+
u8 dhgroup_id;
3334
u8 hash_id;
3435
size_t hash_len;
35-
u8 dhgroup_id;
3636
u8 c1[64];
3737
u8 c2[64];
3838
u8 response[64];
3939
u8 *host_response;
4040
u8 *ctrl_key;
41-
int ctrl_key_len;
4241
u8 *host_key;
43-
int host_key_len;
4442
u8 *sess_key;
43+
int ctrl_key_len;
44+
int host_key_len;
4545
int sess_key_len;
4646
};
4747

0 commit comments

Comments
 (0)