copy/ioat: Change the default of IOAT from Enabled to Disabled

This patch changes the default setting of IOAT copy engine from
Enabled to Disabled. Accordingly this patch changes the config file
specification for IOAT copy engine from "Disable Yes/No" to
"Enable No/Yes".

Subsequent patches will add a new JSON RPC to configure IOAT
copy engine dynamically.

Change-Id: I754990cbb6ecc096953dd2fb9d34366b91111bf8
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/410757
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2018-06-06 08:33:20 +09:00 committed by Jim Harris
parent 46a3d50baa
commit 239e63be7d
10 changed files with 46 additions and 25 deletions

View File

@ -40,6 +40,12 @@ Results are recorded in the `make.log` file.
To enable type: 'git config core.hooksPath .githooks'. To override after configuration use To enable type: 'git config core.hooksPath .githooks'. To override after configuration use
the `git --no-verify` flag. the `git --no-verify` flag.
### IOAT
IOAT for copy engine is disabled by default. It can be enabled by specifying the Enable
option with "Yes" in `[Ioat]` section of the configuration file. The Disable option is
now deprecated and will be removed in a future release.
## v18.04: Logical Volume Snapshot/Clone, iSCSI Initiator, Bdev QoS, VPP Userspace TCP/IP ## v18.04: Logical Volume Snapshot/Clone, iSCSI Initiator, Bdev QoS, VPP Userspace TCP/IP
### vhost ### vhost

View File

@ -121,9 +121,10 @@
# Users may change this section to create a different number or size of # Users may change this section to create a different number or size of
# malloc LUNs. # malloc LUNs.
# If the system has hardware DMA engine, it will use an IOAT # If the system has hardware DMA engine, it can use an IOAT
# (i.e. Crystal Beach DMA) channel to do the copy instead of memcpy. # (i.e. Crystal Beach DMA) channel to do the copy instead of memcpy
# Of course, users can disable offload even it is available. # by specifying "Enable Yes" in [Ioat] section.
# Offload is disabled by default even it is available.
[Malloc] [Malloc]
# Number of Malloc targets # Number of Malloc targets
NumberOfLuns 3 NumberOfLuns 3
@ -132,11 +133,12 @@
# Block size. Default is 512 bytes. # Block size. Default is 512 bytes.
BlockSize 4096 BlockSize 4096
# Users may not want to use offload even it is available. # Users can use offload by specifying "Enable Yes" in this section
# if it is available.
# Users may use the whitelist to initialize specified devices, IDS # Users may use the whitelist to initialize specified devices, IDS
# uses BUS:DEVICE.FUNCTION to identify each Ioat channel. # uses BUS:DEVICE.FUNCTION to identify each Ioat channel.
[Ioat] [Ioat]
Disable Yes Enable No
Whitelist 00:04.0 Whitelist 00:04.0
Whitelist 00:04.1 Whitelist 00:04.1

View File

@ -17,6 +17,6 @@
#ReactorMask 0x1 #ReactorMask 0x1
[Ioat] [Ioat]
Disable Yes Enable No
# [Nvme] section will get appended here by scripts/gen_nvme.sh. # [Nvme] section will get appended here by scripts/gen_nvme.sh.

View File

@ -29,11 +29,12 @@
# Set to 0xFFFFFFFFFFFFFFFF to enable all tracepoint groups. # Set to 0xFFFFFFFFFFFFFFFF to enable all tracepoint groups.
#TpointGroupMask 0x0 #TpointGroupMask 0x0
# Users may not want to use offload even it is available. # Users can use offload by specifying "Enable Yes" in this section
# if it is available.
# Users may use the whitelist to initialize specified devices, IDS # Users may use the whitelist to initialize specified devices, IDS
# uses BUS:DEVICE.FUNCTION to identify each Ioat channel. # uses BUS:DEVICE.FUNCTION to identify each Ioat channel.
[Ioat] [Ioat]
Disable Yes Enable No
#Whitelist 00:04.0 #Whitelist 00:04.0
#Whitelist 00:04.1 #Whitelist 00:04.1
@ -51,9 +52,10 @@
# Users may change this section to create a different number or size of # Users may change this section to create a different number or size of
# malloc LUNs. # malloc LUNs.
# If the system has hardware DMA engine, it will use an IOAT # If the system has hardware DMA engine, it can use an IOAT
# (i.e. Crystal Beach DMA) channel to do the copy instead of memcpy. # (i.e. Crystal Beach DMA) channel to do the copy instead of memcpy
# Of course, users can disable offload even it is available. # by specifying "Enable Yes" in [Ioat] section.
# Offload is disabled by default even it is available.
[Malloc] [Malloc]
# Number of Malloc targets # Number of Malloc targets
NumberOfLuns 3 NumberOfLuns 3

View File

@ -44,7 +44,7 @@
#define IOAT_MAX_CHANNELS 64 #define IOAT_MAX_CHANNELS 64
static bool g_ioat_disable = false; static bool g_ioat_enable = false;
struct ioat_probe_ctx { struct ioat_probe_ctx {
int num_whitelist_devices; int num_whitelist_devices;
@ -282,13 +282,24 @@ static int
copy_engine_ioat_init(void) copy_engine_ioat_init(void)
{ {
struct spdk_conf_section *sp = spdk_conf_find_section(NULL, "Ioat"); struct spdk_conf_section *sp = spdk_conf_find_section(NULL, "Ioat");
const char *pci_bdf; const char *val, *pci_bdf;
int i; int i;
if (sp != NULL) { if (sp != NULL) {
if (spdk_conf_section_get_boolval(sp, "Disable", false)) { if (spdk_conf_section_get_boolval(sp, "Enable", false)) {
g_ioat_disable = true; g_ioat_enable = true;
/* Disable Ioat */ /* Enable Ioat */
}
val = spdk_conf_section_get_val(sp, "Disable");
if (val != NULL) {
SPDK_WARNLOG("\"Disable\" option is deprecated and will be removed in a future release.\n");
SPDK_WARNLOG("IOAT is now disabled by default. It may be enabled by \"Enable Yes\"\n");
if (g_ioat_enable && (strcasecmp(val, "Yes") == 0)) {
SPDK_ERRLOG("\"Enable Yes\" and \"Disable Yes\" cannot be set at the same time\n");
return -1;
}
} }
/* Init the whitelist */ /* Init the whitelist */
@ -307,7 +318,7 @@ copy_engine_ioat_init(void)
} }
} }
if (g_ioat_disable) { if (!g_ioat_enable) {
return 0; return 0;
} }
@ -329,8 +340,8 @@ copy_engine_ioat_init(void)
" # Users may use the whitelist to initialize specified devices, IDS\n" \ " # Users may use the whitelist to initialize specified devices, IDS\n" \
" # uses BUS:DEVICE.FUNCTION to identify each Ioat channel.\n" " # uses BUS:DEVICE.FUNCTION to identify each Ioat channel.\n"
#define COPY_ENGINE_IOAT_DISABLE_TMPL \ #define COPY_ENGINE_IOAT_ENABLE_TMPL \
" Disable %s\n" " Enable %s\n"
#define COPY_ENGINE_IOAT_WHITELIST_TMPL \ #define COPY_ENGINE_IOAT_WHITELIST_TMPL \
" Whitelist %.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 "\n" " Whitelist %.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 "\n"
@ -342,7 +353,7 @@ copy_engine_ioat_config_text(FILE *fp)
struct spdk_pci_addr *dev; struct spdk_pci_addr *dev;
fprintf(fp, COPY_ENGINE_IOAT_HEADER_TMPL); fprintf(fp, COPY_ENGINE_IOAT_HEADER_TMPL);
fprintf(fp, COPY_ENGINE_IOAT_DISABLE_TMPL, g_ioat_disable ? "Yes" : "No"); fprintf(fp, COPY_ENGINE_IOAT_ENABLE_TMPL, g_ioat_enable ? "Yes" : "No");
for (i = 0; i < g_probe_ctx.num_whitelist_devices; i++) { for (i = 0; i < g_probe_ctx.num_whitelist_devices; i++) {
dev = &g_probe_ctx.whitelist[i]; dev = &g_probe_ctx.whitelist[i];

View File

@ -19,7 +19,7 @@
AIO /tmp/aiofile AIO1 2048 AIO /tmp/aiofile AIO1 2048
[Ioat] [Ioat]
Disable Yes Enable No
[QoS] [QoS]
# QoS section defines limitation on performance # QoS section defines limitation on performance

View File

@ -1,2 +1,2 @@
[Ioat] [Ioat]
Disable Yes Enable No

View File

@ -1,7 +1,7 @@
[Global] [Global]
[Ioat] [Ioat]
Disable Yes Enable No
[Nvme] [Nvme]
HotplugEnable Yes HotplugEnable Yes

View File

@ -21,4 +21,4 @@
Queues 8 Queues 8
[Ioat] [Ioat]
Disable Yes Enable No

View File

@ -2,4 +2,4 @@
Enable Yes Enable Yes
[Ioat] [Ioat]
Disable Yes Enable No