Skip to content

Commit 92bbe55

Browse files
tititiou36keithbusch
authored andcommitted
nvmet: reorder fields in 'struct nvmefc_fcp_req'
Group some variables based on their sizes to reduce holes. On x86_64, this shrinks the size of 'struct nvmefc_fcp_req' from 112 to 104 bytes. This structure is embedded in some other structures (nvme_fc_fcp_op which itself is embedded in nvme_fcp_op_w_sgl), so it helps reducing the size of these structures too. 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 0f5335e commit 92bbe55

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/linux/nvme-fc-driver.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ enum nvmefc_fcp_datadir {
185185
* @first_sgl: memory for 1st scatter/gather list segment for payload data
186186
* @sg_cnt: number of elements in the scatter/gather list
187187
* @io_dir: direction of the FCP request (see NVMEFC_FCP_xxx)
188-
* @sqid: The nvme SQID the command is being issued on
189188
* @done: The callback routine the LLDD is to invoke upon completion of
190189
* the FCP operation. req argument is the pointer to the original
191190
* FCP IO operation.
@@ -194,12 +193,13 @@ enum nvmefc_fcp_datadir {
194193
* while processing the operation. The length of the buffer
195194
* corresponds to the fcprqst_priv_sz value specified in the
196195
* nvme_fc_port_template supplied by the LLDD.
196+
* @sqid: The nvme SQID the command is being issued on
197197
*
198198
* Values set by the LLDD indicating completion status of the FCP operation.
199199
* Must be set prior to calling the done() callback.
200+
* @rcv_rsplen: length, in bytes, of the FCP RSP IU received.
200201
* @transferred_length: amount of payload data, in bytes, that were
201202
* transferred. Should equal payload_length on success.
202-
* @rcv_rsplen: length, in bytes, of the FCP RSP IU received.
203203
* @status: Completion status of the FCP operation. must be 0 upon success,
204204
* negative errno value upon failure (ex: -EIO). Note: this is
205205
* NOT a reflection of the NVME CQE completion status. Only the
@@ -219,14 +219,14 @@ struct nvmefc_fcp_req {
219219
int sg_cnt;
220220
enum nvmefc_fcp_datadir io_dir;
221221

222-
__le16 sqid;
223-
224222
void (*done)(struct nvmefc_fcp_req *req);
225223

226224
void *private;
227225

228-
u32 transferred_length;
226+
__le16 sqid;
227+
229228
u16 rcv_rsplen;
229+
u32 transferred_length;
230230
u32 status;
231231
} __aligned(sizeof(u64)); /* alignment for other things alloc'd with */
232232

0 commit comments

Comments
 (0)