Commit 24d8985c authored by Jim Harris's avatar Jim Harris
Browse files

thread: make spdk_iobuf_entry_abort() find its entry in the STAILQ



This prepares for upcoming changes where we will have multiple queues
to search, one per NUMA-node. We won't know which NUMA-node's queue
the entry will be found on.

We could theoretically store the numa_id in the spdk_iobuf_entry,
but that increases its size and requires other changes in existing
structures that include it. Since this is a very uncommon operation,
walking the STAILQs is fine.

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


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarAlliswell <hisunzhenliang@outlook.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 42d1bd28
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -576,6 +576,7 @@ spdk_iobuf_entry_abort(struct spdk_iobuf_channel *ch, struct spdk_iobuf_entry *e
{
	struct spdk_iobuf_node_cache *cache;
	struct spdk_iobuf_pool_cache *pool;
	struct spdk_iobuf_entry *e;

	cache = &ch->cache[0];

@@ -586,7 +587,12 @@ spdk_iobuf_entry_abort(struct spdk_iobuf_channel *ch, struct spdk_iobuf_entry *e
		pool = &cache->large;
	}

	STAILQ_FOREACH(e, pool->queue, stailq) {
		if (e == entry) {
			STAILQ_REMOVE(pool->queue, entry, spdk_iobuf_entry, stailq);
			return;
		}
	}
}

#define IOBUF_BATCH_SIZE 32