Commit 1fffb025 authored by Shannon Nelson's avatar Shannon Nelson Committed by Jakub Kicinski

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: default avatarShannon Nelson <shannon.nelson@amd.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e8797a05
......@@ -573,13 +573,15 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
}
if (flags & IONIC_QCQ_F_NOTIFYQ) {
int q_size, cq_size;
int q_size;
/* q & cq need to be contiguous in case of notifyq */
/* q & cq need to be contiguous in NotifyQ, so alloc it all in q
* and don't alloc qc. We leave new->qc_size and new->qc_base
* as 0 to be sure we don't try to free it later.
*/
q_size = ALIGN(num_descs * desc_size, PAGE_SIZE);
cq_size = ALIGN(num_descs * cq_desc_size, PAGE_SIZE);
new->q_size = PAGE_SIZE + q_size + cq_size;
new->q_size = PAGE_SIZE + q_size +
ALIGN(num_descs * cq_desc_size, PAGE_SIZE);
new->q_base = dma_alloc_coherent(dev, new->q_size,
&new->q_base_pa, GFP_KERNEL);
if (!new->q_base) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment