Spdk/lib/iscsi
Shuhei Matsumoto 855d8e032a iscsi: change master_lcore to first_core for idle connection management
Currently idle iSCSI connections are managed by the master lcore,
but the master lcore is like BSP of OS and for initialization.

To manage idle iSCSI connections it is important that the core is
consistent.

Hence the first core is better than the master lcore.

In this patch the following are changed together:
- Errors of kqueue() and epoll_create1() are not related with master
  lcore. "master lcore" is removed and errno is added into the log.
- In spdk_iscsi_conn_allocate_reactor(), when cpumask is 0, 0 is
  selected as core number. 0 is not safe and first_core is used instead.

In spdk_iscsi_conn_allocate_reactor(), when first_core is used instead
of master_lcore, we may observe some contradiction in the following
code. But few changes are done in this patch.

In the current implementation we can assume the first lcore is
equal to the master lcore and the following code will be removed
in the subsequent patch.

/*
 * DPDK returns WAIT for the master lcore instead of RUNNING.
 * So we always treat the reactor on master core as RUNNING.
 */
if (i == master_lcore) {
    state = RUNNING;
} else {
    state = rte_eal_get_lcore_state(i);
}

Change-Id: I6cac06c27b289db5ea1f9452e33489286c64d2fa
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/391338
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-20 15:17:15 -05:00
..
acceptor.c iscsi: Remove nested, duplicated, or unreferenced file inclusion 2017-12-14 11:30:05 -05:00
acceptor.h iscsi: login poller per portal and portal cache 2017-10-06 17:00:45 -04:00
conn.c iscsi: change master_lcore to first_core for idle connection management 2017-12-20 15:17:15 -05:00
conn.h iscsi: Remove nested, duplicated, or unreferenced file inclusion 2017-12-14 11:30:05 -05:00
init_grp.c iscsi: Remove use of perror for malloc, strdup, and writev failure 2017-12-19 11:41:43 -05:00
init_grp.h iscsi: Remove gropu_state from IG and PG 2017-12-04 11:28:52 -05:00
iscsi_rpc.c iscsi: Set cpumask to all available CPUs when PG is created JSON-RPC 2017-12-19 15:22:05 -05:00
iscsi_subsystem.c etc/spdk/iscsi.conf.in: How to use cpumask for the connection 2017-12-20 11:31:45 -05:00
iscsi.c iscsi: Remove use of perror for malloc, strdup, and writev failure 2017-12-19 11:41:43 -05:00
iscsi.h iscsi: Use spdk_mempool for session and pdu related pool 2017-12-11 19:42:21 -05:00
Makefile util: add CRC32 utility functions 2017-08-02 19:47:35 -04:00
md5.c astyle: enforce braces around single-line statements 2017-12-11 11:19:32 -05:00
md5.h include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
param.c iscsi: Remove use of perror for malloc, strdup, and writev failure 2017-12-19 11:41:43 -05:00
param.h include: Move the remainder of the code base to stdinc.h 2017-05-08 13:20:36 -07:00
portal_grp.c iscsi: Remove use of perror for malloc, strdup, and writev failure 2017-12-19 11:41:43 -05:00
portal_grp.h iscsi: Remove gropu_state from IG and PG 2017-12-04 11:28:52 -05:00
task.c iscsi: let task_pool use spdk_mempool related functions 2017-12-06 17:03:15 -05:00
task.h iscsi: change iscsi_bhs_scsi_req variable names. 2017-07-18 13:14:16 -04:00
tgt_node.c scsi&test/iscsi_tgt: SCSI device == iSCSI name 2017-12-19 13:34:03 -05:00
tgt_node.h iscsi: Dynamic reconfiguration of PG-IG maps 2017-12-07 12:28:02 -05:00