Portal, portal group, initiator group, and target node don't use fixed size
array anymore. To use the same naming rule in iSCSI subsystem and in SPDK
is helpful to understand and maintain. Current naming rule is not bad but
to use unified and compact name is prioritized at this time.
This patch changes function names as follows:
- spdk_iscsi_init_tgt_nodes() -> spdk_iscsi_parse_tgt_nodes()
- spdk_cf_add_iscsi_tgt_node() -> spdk_iscsi_parse_tgt_node()
- spdk_iscsi_portal_grp_array_create() -> spdk_iscsi_parse_portal_grps()
- spdk_iscsi_portal_grp_create_from_configfile() -> spdk_iscsi_parse_portal_grp()
- spdk_iscsi_portal_create_from_configline() -> spdk_iscsi_parse_portal()
- spdk_iscsi_portal_grp_array_destroy() -> spdk_iscsi_portal_grps_destroy()
- spdk_iscsi_init_grp_array_create() -> spdk_iscsi_parse_init_grps()
- spdk_iscsi_init_grp_create_from_configfile() -> spdk_iscsi_parse_init_grp()
- spdk_iscsi_init_grp_array_destroy() -> spdk_iscsi_init_grps_destroy()
For example "parse" is already used to explain the operation in portal_grp.c.
Hence using "parse" is familiar and not strange in iSCSI.
Change-Id: Ieff952069d39bd96b7afa1586bfff927968accc2
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403149
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This provides an abstraction layer around TCP
sockets. Previously we just used fd integers, but
we don't want to be tied to integers for alternative
userspace TCP stacks.
Future patches will do more work to enable multiple
implementations of this abstraction. For now, just
get the abstraction in place for POSIX sockets and
make all of the iSCSI changes associated with it.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9a825e9e02eb6927c8702d205665c626f57b3771
Reviewed-on: https://review.gerrithub.io/398861
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Orderings of portal group create operation are diferrent between
config file and JSON-RPC. Unification is necessary for correct
concurrency control and the global accept poller like NVMf-tgt.
Hence unify the ordering of operations in this patch.
Common ordering of portal group create operation between configuration
file and JSON-RPC after this patch is the following:
- create a portal group
- create portals
- add the portals to the portal group
- open the portals of the portal group
- add the portal group to the global portal group list
After this patch, the gap between listening socket and accepting socket
will be increased a little when portals groups are creted by config file.
However this will cause no issue because of the TCP backlog and resend
mechanism.
Besides, necessary concurrency control is added and minor refactoring
is done.
About portal group delete operation, orderings of application shutdown
and JSON-RPC are already unified.
Change-Id: I1db7ef4400388127134d7734c68e138a4573b734
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/396848
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Checking uniqueness of portal group is done without mutex and
before register/unregister. This is not thread-safe.
Hence this patch is added to ensure PG uniqueness.
A little related refactoring is also done.
Change-Id: Iaa3b5e380f2be5cfdaa2d69f9f2763c98954b0c3
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/396847
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Fixes github issue #218.
This patch introduces spdk_cpuset object to store and manipulate
the set of individual CPUs. The main objective of this object is
to replace cpumask declared as uint64_t and extend the limitation
of supported CPUs (lcores) above 64 CPUs.
spdk_cpuset is always allocated dynamically and accessed by opaque
pointer, what makes it easier to extend in the future without
breaking API/ABI.
This patch also extends parsing function allowing to set cpumask
using a list of cpus e.g. "[0-4,10,12]" sets mask of 0,1,2,3,4,10,12
as well as hexadecimal string with and without "0x" prefix.
Change-Id: I475c3ba7fab629021a22e03176e57e400dd24a49
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/390794
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Currently cpumask cannot be specified for each portal when it is
created by JSON-RPC and portal group creation is not unified
between iSCSI.conf and JSON-RPC.
This patch does the following:
- cpumask string is decoded in spdk_iscsi_portal_create() which
is common between iSCSI.conf and JSON-RPC.
- parsing configline of portal is difficult to understand and
hence it is refactored.
- UT code is added.
JSON-RPC will be added by the next patch.
Change-Id: I13b9989263fae5facff260de32a55ec99f5d5a06
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/392447
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>
1 Some functions should be static.
2 For the unused API, we delete them first. When it is used, we should add
them back.
Change-Id: I2c39e8bef96155fc71801c76534955d9cf6cb0bd
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/392721
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
By supporting the management based on linked list for PG and IG
the group state of PG and IG are no longer necessary.
Change-Id: I249424cacd2d27dda4e4cb2182442d0d1e9bfb8e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/388863
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
A few foundational change to support safe removal of portal.
- global login poller -> login poller per portal
- Caching portal data for active connection
Change-Id: I62f4d90c9ac11a433ad47421b2b0c69bfc3c70b7
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379930
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Check duplication of registration of portals by using a global
portal list
Change-Id: I608fc9bd4473c11e69686e6474892f3f4272cd53
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379929
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Group the code fragments of open/close portal procedure
and create spdk_iscsi_portal_open/close() function.
Change-Id: Id6e291f3f6e5a926f3ea0d01741a200fa64db81b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379934
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This function was only useful for old (and incorrect) iSCSI topology.
Hence this function can be removed.
Change-Id: I1898f6a5fbffd27a55904a55cd137dafbbdf5946
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381241
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Fixed double free in spdk_rpc_add_portal_group()
spdk_iscsi_portal_create() now takes string arguments as const char* and makes internal copies of them.
This patch also fixes potential memory leak when id == NULL
Change-Id: I4d0efb101471fb2368ceb8ceecb0e40614e3585d
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>