diff options
author | Shannon Nelson | 2024-03-06 15:29:52 -0800 |
---|---|---|
committer | David S. Miller | 2024-03-08 11:54:34 +0000 |
commit | 8599bd4cf30f0e32954ae3915f65db05a0c3d5ea (patch) | |
tree | cc077b0720c11efe5ed955a1c022b0146130543b /drivers/net | |
parent | 4dcd4575bfb17d0f6e3d53e2f217a0414518a20c (diff) |
ionic: fold adminq clean into service routine
Since the AdminQ clean is a simple action called from only
one place, fold it back into the service routine.
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/pensando/ionic/ionic_main.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index d248f725ef44..c1259324b0be 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -247,24 +247,6 @@ static int ionic_adminq_check_err(struct ionic_lif *lif, return err; } -static void ionic_adminq_clean(struct ionic_queue *q, - struct ionic_admin_desc_info *desc_info, - struct ionic_admin_comp *comp) -{ - struct ionic_admin_ctx *ctx = desc_info->ctx; - - if (!ctx) - return; - - memcpy(&ctx->comp, comp, sizeof(*comp)); - - dev_dbg(q->dev, "comp admin queue command:\n"); - dynamic_hex_dump("comp ", DUMP_PREFIX_OFFSET, 16, 1, - &ctx->comp, sizeof(ctx->comp), true); - - complete_all(&ctx->work); -} - bool ionic_notifyq_service(struct ionic_cq *cq) { struct ionic_deferred_work *work; @@ -338,9 +320,17 @@ bool ionic_adminq_service(struct ionic_cq *cq) desc_info = &q->admin_info[q->tail_idx]; index = q->tail_idx; q->tail_idx = (q->tail_idx + 1) & (q->num_descs - 1); - if (likely(desc_info->ctx)) - ionic_adminq_clean(q, desc_info, comp); - desc_info->ctx = NULL; + if (likely(desc_info->ctx)) { + struct ionic_admin_ctx *ctx = desc_info->ctx; + + memcpy(&ctx->comp, comp, sizeof(*comp)); + + dev_dbg(q->dev, "comp admin queue command:\n"); + dynamic_hex_dump("comp ", DUMP_PREFIX_OFFSET, 16, 1, + &ctx->comp, sizeof(ctx->comp), true); + complete_all(&ctx->work); + desc_info->ctx = NULL; + } } while (index != le16_to_cpu(comp->comp_index)); return true; |