nvmf: clear-out qpair during poll group add

There are operations on nvmf which depends on proper values of qpair
attributes which can be intepreted as internal state.
e.g.
nvmf_ctrlr_process_fabrics_cmd execution relies on qpair->ctrlr
spdk_nvmf_qpair_disconnect relies on qpair->disconnect_started

As poll group add is like a registration of qpair into nvmf lets try
to initialize it to a defined and expected state.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I10494e7f70ff58ec5460cab1de8a52fd21cc4a48
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4479
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jacek Kalwas 2020-10-01 02:20:38 +02:00 committed by Tomasz Zawadzki
parent ffbddd4f3e
commit e1a9774cdc

View File

@ -843,6 +843,8 @@ spdk_nvmf_poll_group_add(struct spdk_nvmf_poll_group *group,
TAILQ_INIT(&qpair->outstanding); TAILQ_INIT(&qpair->outstanding);
qpair->group = group; qpair->group = group;
qpair->ctrlr = NULL;
qpair->disconnect_started = false;
TAILQ_FOREACH(tgroup, &group->tgroups, link) { TAILQ_FOREACH(tgroup, &group->tgroups, link) {
if (tgroup->transport == qpair->transport) { if (tgroup->transport == qpair->transport) {