lib/idxd: remove batch_op element from op struct
We can instead use a combination of the op code and the batch element in the op structure to determine if the op that is completing is part of a batch or not so we know whether to return it to the free list or not. Signed-off-by: paul luse <paul.e.luse@intel.com> Change-Id: I8e27c7b991f5a20e82394a25a52ece560cab5543 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9071 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
bc393d841c
commit
f3b423dc84
@ -380,7 +380,6 @@ _idxd_prep_command(struct spdk_idxd_io_channel *chan, spdk_idxd_req_cb cb_fn,
|
||||
op->cb_arg = cb_arg;
|
||||
op->cb_fn = cb_fn;
|
||||
op->batch = NULL;
|
||||
op->batch_op = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -805,7 +804,6 @@ _idxd_prep_batch_cmd(struct spdk_idxd_io_channel *chan, spdk_idxd_req_cb cb_fn,
|
||||
}
|
||||
|
||||
op->desc = desc;
|
||||
op->batch_op = true;
|
||||
SPDK_DEBUGLOG(idxd, "Prep batch %p index %u\n", batch, batch->index);
|
||||
|
||||
batch->index++;
|
||||
@ -1146,12 +1144,10 @@ spdk_idxd_process_events(struct spdk_idxd_io_channel *chan)
|
||||
|
||||
op->hw.status = status = 0;
|
||||
|
||||
if (op->batch_op == false) {
|
||||
TAILQ_INSERT_TAIL(&chan->ops_pool, op, link);
|
||||
}
|
||||
|
||||
if (op->desc->opcode == IDXD_OPCODE_BATCH) {
|
||||
_free_batch(op->batch, chan);
|
||||
} else if (op->batch == NULL) {
|
||||
TAILQ_INSERT_TAIL(&chan->ops_pool, op, link);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
|
@ -148,8 +148,7 @@ struct idxd_ops {
|
||||
struct idxd_batch *batch;
|
||||
struct idxd_hw_desc *desc;
|
||||
uint32_t *crc_dst;
|
||||
bool batch_op;
|
||||
char pad[7];
|
||||
char pad[8];
|
||||
TAILQ_ENTRY(idxd_ops) link;
|
||||
};
|
||||
SPDK_STATIC_ASSERT(sizeof(struct idxd_ops) == 96, "size mismatch");
|
||||
|
Loading…
Reference in New Issue
Block a user