Commit b65443be authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

iscsi: Allow to set cpumask more than active cores for iSCSI connection



Currently the cpumask must be a subset of the reactor mask.

However, this is different from sched_setaffinity() function
and taskset command of FreeBSD and Linux.  The latter will
be familier for more people. Hence the later is adopted.

The following is quoted from the FreeBSD Man Page of taskset:

  The CPU affinity is represented as a bitmask, with the lowest
  order bit corresponding to the first logical CPU and the
  highest order bit corresponding to the last logical CPU.

  Not all CPUs may exist on a given system but a mask may specify
  more CPUs than are present.

  A retrieved mask will reflect only the bits that correspond to
  CPUs physically on the system.

  If an invalid mask is given (i.e., one that corresponds to no
  valid CPUs on the current system) an error is returned.

  The masks are typically given in hexadecimal.

Change-Id: I7e0d2e029569bfc986f7fcdf78048791ab389f72
Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/392446


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 0241b85b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -302,9 +302,8 @@ spdk_iscsi_portal_create_from_configline(const char *portalstring,
			SPDK_ERRLOG("invalid portal cpumask %s\n", cpumask_str);
			goto error_out;
		}
		if ((cpumask & spdk_app_get_core_mask()) != cpumask) {
			SPDK_ERRLOG("portal cpumask %s not a subset of "
				    "reactor mask %jx\n", cpumask_str,
		if (cpumask == 0) {
			SPDK_ERRLOG("no cpu is selected among reactor mask(=%jx)\n",
				    spdk_app_get_core_mask());
			goto error_out;
		}