From 8fd2882fb25ee353b981c49a60eb1d2d72485d38 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Mon, 18 Dec 2017 13:32:42 +0900 Subject: [PATCH] etc/spdk/iscsi.conf.in: How to use cpumask for the connection User can specify processor affinity for each iSCSI connection by specifying cpumask in the configuration file. However the example of iscsi.conf.in does not have any description about this. Hence it is very difficult for user to use this. The portal group section of the config dump file has the same description. Hence it is also changed. Change-Id: I6e7b3bb67e10e78f4a47165525f023555080f146 Signed-off-by: Shuhei Matsumoto Reviewed-on: https://review.gerrithub.io/391510 Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp Reviewed-by: Ben Walker Tested-by: SPDK Automated Test System --- etc/spdk/iscsi.conf.in | 16 +++++++++++++--- lib/iscsi/iscsi_subsystem.c | 19 ++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/etc/spdk/iscsi.conf.in b/etc/spdk/iscsi.conf.in index 872fbbff0..32ba448dd 100644 --- a/etc/spdk/iscsi.conf.in +++ b/etc/spdk/iscsi.conf.in @@ -64,11 +64,21 @@ # Users must change the PortalGroup section(s) to match the IP addresses # for their environment. -# PortalGroup sections define which TCP ports the iSCSI server will use -# to listen for incoming connections. These are also used to determine -# which targets are accessible over each portal group. +# PortalGroup sections define which network portals the iSCSI target +# will use to listen for incoming connections. These are also used to +# determine which targets are accessible over each portal group. +# Up to 1024 Portal directives are allowed. These define the network +# portals of the portal group. The user must specify a IP address +# for each network portal, and may optionally specify a port and +# a cpumask. If the port is omitted, 3260 will be used. Cpumask will +# be used to set the processor affinity of the iSCSI connection +# through the portal. If the cpumask is omitted, cpumask will be +# set to all available processors. +# Syntax: +# Portal [:[@]] [PortalGroup1] Portal DA1 192.168.2.21:3260 + Portal DA2 192.168.2.22:3260@0xF # Users must change the InitiatorGroup section(s) to match the IP # addresses and initiator configuration in their environment. diff --git a/lib/iscsi/iscsi_subsystem.c b/lib/iscsi/iscsi_subsystem.c index 2898e0009..d481e3767 100644 --- a/lib/iscsi/iscsi_subsystem.c +++ b/lib/iscsi/iscsi_subsystem.c @@ -117,16 +117,25 @@ static const char *portal_group_section = \ "\n" "# Users must change the PortalGroup section(s) to match the IP addresses\n" "# for their environment.\n" - "# PortalGroup sections define which TCP ports the iSCSI server will use\n" - "# to listen for incoming connections. These are also used to determine\n" - "# which targets are accessible over each portal group.\n"; + "# PortalGroup sections define which network portals the iSCSI target\n" + "# will use to listen for incoming connections. These are also used to\n" + "# determine which targets are accessible over each portal group.\n" + "# Up to 1024 Portal directives are allowed. These define the network\n" + "# portals of the portal group. The user must specify a IP address\n" + "# for each network portal, and may optionally specify a port and\n" + "# a cpumask. If the port is omitted, 3260 will be used. Cpumask will\n" + "# be used to set the processor affinity of the iSCSI connection\n" + "# through the portal. If the cpumask is omitted, cpumask will be\n" + "# set to all available processors.\n" + "# Syntax:\n" + "# Portal [:[@]]\n"; #define PORTAL_GROUP_TMPL \ "[PortalGroup%d]\n" \ " Comment \"Portal%d\"\n" #define PORTAL_TMPL \ -" Portal DA1 %s:%s\n" +" Portal DA1 %s:%s@0x%" PRIx64 "\n" static void spdk_iscsi_config_dump_portal_groups(FILE *fp) @@ -144,7 +153,7 @@ spdk_iscsi_config_dump_portal_groups(FILE *fp) /* Dump portals */ TAILQ_FOREACH(p, &pg->head, per_pg_tailq) { if (NULL == p) { continue; } - fprintf(fp, PORTAL_TMPL, p->host, p->port); + fprintf(fp, PORTAL_TMPL, p->host, p->port, p->cpumask); } } }