Commit 7dbad851 authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

lib/accel: Reapck & reorder accel_task



1. Change type of op_code tp uint8
2. Change type of status to int16
These chanes a bit reduces size of a hole and
size of structure:
Origianl accel task:
        /* size: 384, cachelines: 6, members: 22 */
        /* sum members: 380, holes: 1, sum holes: 4 */
With this change:
        /* size: 376, cachelines: 6, members: 22 */
        /* sum members: 375, holes: 1, sum holes: 1 */
        /* last cacheline: 56 bytes */

Main advanatage of this change is that "heavy" members
such as bounce and aux_iovs are now at the end of the
structure. These member are not used with each task,
e.g. bounce is only used when accel module doesn't
support memory domain.
All member which are almost always used in IO path
occupy first 4 cache lines

Signed-off-by: default avatarAlexey Marchuk <alexeymar@nvidia.com>
Change-Id: Ib5215723e838f96edb983bf7dff71fe82eb4c8a1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19037


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent ec2a01fc
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
/*   SPDX-License-Identifier: BSD-3-Clause
 *   Copyright (C) 2020 Intel Corporation.
 *   Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES
 *   Copyright (c) 2022, 2023 NVIDIA CORPORATION & AFFILIATES
 *   All rights reserved.
 */

@@ -121,17 +121,18 @@ struct spdk_accel_task {
		uint32_t		*output_size;
		uint32_t		block_size; /* for crypto op */
	};
	struct {
		struct spdk_accel_bounce_buffer s;
		struct spdk_accel_bounce_buffer d;
	} bounce;
	enum accel_opcode		op_code;
	uint64_t			iv; /* Initialization vector (tweak) for crypto op */
	/* Uses enum accel_opcode */
	uint8_t				op_code;
	int16_t				status;
	int				flags;
	int				status;
	struct iovec			aux_iovs[SPDK_ACCEL_AUX_IOV_MAX];
	TAILQ_ENTRY(spdk_accel_task)	link;
	TAILQ_ENTRY(spdk_accel_task)	seq_link;
	struct iovec			aux_iovs[SPDK_ACCEL_AUX_IOV_MAX];
	struct {
		struct spdk_accel_bounce_buffer s;
		struct spdk_accel_bounce_buffer d;
	} bounce;
};

struct spdk_accel_module_if {