Commit 0e7362ff authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

bdev: Force driver_ctx to be cache line aligned



Now that we know the spdk_bdev_io is cache line aligned, we can
use a reserved value to force the driver_ctx to be cache line aligned
too.

Change-Id: I9de3369db47f35493a3ee7de375f255c31a82f4d
Signed-off-by: default avatarBen Walker <ben@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22493


Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent f87bd12c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1078,15 +1078,21 @@ struct spdk_bdev_io {
	/** Enumerated value representing the I/O type. */
	uint8_t type;

	uint8_t reserved0;

	/** Number of IO submission retries */
	uint16_t num_retries;

	uint32_t reserved1;

	/** A single iovec element for use by this bdev_io. */
	struct iovec iov;

	/** Array of iovecs used for I/O splitting. */
	struct iovec child_iov[SPDK_BDEV_IO_NUM_CHILD_IOV];

	uint8_t reserved2[32];

	/** Parameters filled in by the user */
	union {
		struct spdk_bdev_io_block_params bdev;
@@ -1096,6 +1102,8 @@ struct spdk_bdev_io {
		struct spdk_bdev_io_zone_mgmt_params zone_mgmt;
	} u;

	uint64_t reserved3;

	/**
	 *  Fields that are used internally by the bdev subsystem.  Bdev modules
	 *  must not read or write to these fields.
@@ -1109,6 +1117,8 @@ struct spdk_bdev_io {

	/* No members may be added after driver_ctx! */
};
SPDK_STATIC_ASSERT(offsetof(struct spdk_bdev_io, driver_ctx) % SPDK_CACHE_LINE_SIZE == 0,
		   "driver_ctx not cache line aligned");

/**
 * Register a new bdev.