diff options
author | Shannon Nelson <shannon.nelson@amd.com> | 2024-03-06 15:29:50 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-03-08 11:54:34 +0000 |
commit | 65e548f6b0ffc4222a99feda8a033a2a9fb9f3e7 (patch) | |
tree | 64d64b48e377494e254c8cddcc5b0664c8e96dc9 /drivers/net/ethernet/pensando/ionic/ionic_main.c | |
parent | ae24a8f88b3fc8ef463e8dffd41ebba48c81cfd4 (diff) |
ionic: remove the cq_info to save more memory
With a little simple math we don't need another struct array to
find the completion structs, so we can remove the ionic_cq_info
altogether. This doesn't really save anything in the ionic_cq
since it gets padded out to the cacheline, but it does remove
the parallel array allocation of 8 * num_descriptors, or about
8 Kbytes per queue in a default configuration.
Suggested-by: Neel Patel <npatel2@amd.com>
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/ethernet/pensando/ionic/ionic_main.c')
-rw-r--r-- | drivers/net/ethernet/pensando/ionic/ionic_main.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 023c2c37056e..2c092858bc0d 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -249,16 +249,13 @@ static int ionic_adminq_check_err(struct ionic_lif *lif, static void ionic_adminq_clean(struct ionic_queue *q, struct ionic_desc_info *desc_info, - struct ionic_cq_info *cq_info) + struct ionic_admin_comp *comp) { struct ionic_admin_ctx *ctx = desc_info->arg; - struct ionic_admin_comp *comp; if (!ctx) return; - comp = cq_info->cq_desc; - memcpy(&ctx->comp, comp, sizeof(*comp)); dev_dbg(q->dev, "comp admin queue command:\n"); @@ -268,16 +265,17 @@ static void ionic_adminq_clean(struct ionic_queue *q, complete_all(&ctx->work); } -bool ionic_notifyq_service(struct ionic_cq *cq, - struct ionic_cq_info *cq_info) +bool ionic_notifyq_service(struct ionic_cq *cq) { - union ionic_notifyq_comp *comp = cq_info->cq_desc; struct ionic_deferred_work *work; + union ionic_notifyq_comp *comp; struct net_device *netdev; struct ionic_queue *q; struct ionic_lif *lif; u64 eid; + comp = &((union ionic_notifyq_comp *)cq->base)[cq->tail_idx]; + q = cq->bound_q; lif = q->info[0].arg; netdev = lif->netdev; @@ -320,14 +318,14 @@ bool ionic_notifyq_service(struct ionic_cq *cq, return true; } -bool ionic_adminq_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info) +bool ionic_adminq_service(struct ionic_cq *cq) { struct ionic_queue *q = cq->bound_q; struct ionic_desc_info *desc_info; struct ionic_admin_comp *comp; u16 index; - comp = cq_info->cq_desc; + comp = &((struct ionic_admin_comp *)cq->base)[cq->tail_idx]; if (!color_match(comp->color, cq->done_color)) return false; @@ -341,7 +339,7 @@ bool ionic_adminq_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info) index = q->tail_idx; q->tail_idx = (q->tail_idx + 1) & (q->num_descs - 1); if (likely(desc_info->arg)) - ionic_adminq_clean(q, desc_info, cq_info); + ionic_adminq_clean(q, desc_info, comp); desc_info->arg = NULL; } while (index != le16_to_cpu(comp->comp_index)); |