Commit ea7fd2a5 authored by Jim Harris's avatar Jim Harris
Browse files

nvmf/tcp: simplify nvmf_tcp_poll_group_poll event counting



Upcoming patches will remove the await_req TAILQ, so simplify the
code here for now to just always count processing a tqpair on this
TAILQ as an event, and don't return error status if one of the tqpairs
fails processing.

This technically is more correct anyways. The upper layer aggregates
the return value from all of the transports, so returning a negative
value on error could mess up accounting (i.e. TCP returns -1, RDMA
returns 1, they cancel each other out...)

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: I0bad2be71edf7c046b6543a05efd0165f5166136
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25173


Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
parent 35cd3e84
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -3554,7 +3554,7 @@ static int
nvmf_tcp_poll_group_poll(struct spdk_nvmf_transport_poll_group *group)
{
	struct spdk_nvmf_tcp_poll_group *tgroup;
	int num_events, rc = 0, rc2;
	int num_events, rc;
	struct spdk_nvmf_tcp_qpair *tqpair, *tqpair_tmp;

	tgroup = SPDK_CONTAINEROF(group, struct spdk_nvmf_tcp_poll_group, group);
@@ -3569,18 +3569,16 @@ nvmf_tcp_poll_group_poll(struct spdk_nvmf_transport_poll_group *group)
	}

	TAILQ_FOREACH_SAFE(tqpair, &tgroup->await_req, link, tqpair_tmp) {
		rc2 = nvmf_tcp_sock_process(tqpair);
		num_events++;
		rc = nvmf_tcp_sock_process(tqpair);

		/* If there was a new socket error, disconnect */
		if (spdk_unlikely(rc2 < 0)) {
		if (spdk_unlikely(rc < 0)) {
			nvmf_tcp_qpair_disconnect(tqpair);
			if (rc == 0) {
				rc = rc2;
			}
		}
	}

	return rc == 0 ? num_events : rc;
	return num_events;
}

static int