Skip to content

Commit 1fffb02

Browse files
emuslnkuba-moo
authored andcommitted
ionic: clear up notifyq alloc commentary
Make sure the q+cq alloc for NotifyQ is clearly documented and don't bother with unnecessary local variables. Signed-off-by: Shannon Nelson <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e8797a0 commit 1fffb02

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/net/ethernet/pensando/ionic/ionic_lif.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,15 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
573573
}
574574

575575
if (flags & IONIC_QCQ_F_NOTIFYQ) {
576-
int q_size, cq_size;
576+
int q_size;
577577

578-
/* q & cq need to be contiguous in case of notifyq */
578+
/* q & cq need to be contiguous in NotifyQ, so alloc it all in q
579+
* and don't alloc qc. We leave new->qc_size and new->qc_base
580+
* as 0 to be sure we don't try to free it later.
581+
*/
579582
q_size = ALIGN(num_descs * desc_size, PAGE_SIZE);
580-
cq_size = ALIGN(num_descs * cq_desc_size, PAGE_SIZE);
581-
582-
new->q_size = PAGE_SIZE + q_size + cq_size;
583+
new->q_size = PAGE_SIZE + q_size +
584+
ALIGN(num_descs * cq_desc_size, PAGE_SIZE);
583585
new->q_base = dma_alloc_coherent(dev, new->q_size,
584586
&new->q_base_pa, GFP_KERNEL);
585587
if (!new->q_base) {

0 commit comments

Comments
 (0)