nvme_tcp: Use qpair->poll_group only if it is not NULL
nvme_transport_poll_group_remove() clears qpair->poll_group. Hence we should not use it after that. Fixes #2170 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I57ceee8c66684e2d02b51b8a0f3d66aacbcb9915 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9560 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: GangCao <gang.cao@intel.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Dong Yi <dongx.yi@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
1eabc7fc1d
commit
c95dcb657e
@ -383,7 +383,7 @@ _pdu_write_done(void *cb_arg, int err)
|
|||||||
{
|
{
|
||||||
struct nvme_tcp_pdu *pdu = cb_arg;
|
struct nvme_tcp_pdu *pdu = cb_arg;
|
||||||
struct nvme_tcp_qpair *tqpair = pdu->qpair;
|
struct nvme_tcp_qpair *tqpair = pdu->qpair;
|
||||||
struct nvme_tcp_poll_group *pgroup = nvme_tcp_poll_group(tqpair->qpair.poll_group);
|
struct nvme_tcp_poll_group *pgroup;
|
||||||
|
|
||||||
/* If there are queued requests, we assume they are queued because they are waiting
|
/* If there are queued requests, we assume they are queued because they are waiting
|
||||||
* for resources to be released. Those resources are almost certainly released in
|
* for resources to be released. Those resources are almost certainly released in
|
||||||
@ -391,7 +391,10 @@ _pdu_write_done(void *cb_arg, int err)
|
|||||||
* the qpair needs to be polled and we can't rely on another network event to make
|
* the qpair needs to be polled and we can't rely on another network event to make
|
||||||
* that happen. Add it to a list of qpairs to poll regardless of network activity
|
* that happen. Add it to a list of qpairs to poll regardless of network activity
|
||||||
* here. */
|
* here. */
|
||||||
if (pgroup && !STAILQ_EMPTY(&tqpair->qpair.queued_req) && !tqpair->needs_poll) {
|
if (tqpair->qpair.poll_group && !STAILQ_EMPTY(&tqpair->qpair.queued_req) &&
|
||||||
|
!tqpair->needs_poll) {
|
||||||
|
pgroup = nvme_tcp_poll_group(tqpair->qpair.poll_group);
|
||||||
|
|
||||||
TAILQ_INSERT_TAIL(&pgroup->needs_poll, tqpair, link);
|
TAILQ_INSERT_TAIL(&pgroup->needs_poll, tqpair, link);
|
||||||
tqpair->needs_poll = true;
|
tqpair->needs_poll = true;
|
||||||
}
|
}
|
||||||
@ -1073,7 +1076,7 @@ tcp_data_recv_crc32_done(void *cb_arg, int status)
|
|||||||
tqpair = tcp_req->tqpair;
|
tqpair = tcp_req->tqpair;
|
||||||
assert(tqpair != NULL);
|
assert(tqpair != NULL);
|
||||||
|
|
||||||
if (!tqpair->needs_poll) {
|
if (tqpair->qpair.poll_group && !tqpair->needs_poll) {
|
||||||
pgroup = nvme_tcp_poll_group(tqpair->qpair.poll_group);
|
pgroup = nvme_tcp_poll_group(tqpair->qpair.poll_group);
|
||||||
TAILQ_INSERT_TAIL(&pgroup->needs_poll, tqpair, link);
|
TAILQ_INSERT_TAIL(&pgroup->needs_poll, tqpair, link);
|
||||||
tqpair->needs_poll = true;
|
tqpair->needs_poll = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user