Re: [PATCH net-next v4 02/10] enic: add admin channel open and close for SR-IOV

From: Jakub Kicinski

Date: Mon Apr 13 2026 - 20:21:32 EST


This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
enic: add admin channel open and close for SR-IOV

Introduce enic_admin_channel_open() and enic_admin_channel_close() to allocate
and initialize the admin WQ, RQ, two CQs, and one SR-IOV interrupt for the V2
SR-IOV PF-VF mailbox communication.

> diff --git a/drivers/net/ethernet/cisco/enic/enic_admin.c b/drivers/net/ethernet/cisco/enic/enic_admin.c
> new file mode 100644
> index 0000000000000..d1abe6a50095d
> --- /dev/null
> +++ b/drivers/net/ethernet/cisco/enic/enic_admin.c

[ ... ]

> + err = vnic_cq_alloc_with_type(enic->vdev, &enic->admin_cq[0], 0,
> + ENIC_ADMIN_DESC_COUNT,
> + sizeof(struct cq_desc),
> + RES_TYPE_ADMIN_CQ);
> + if (err)
> + goto free_rq;
> +
> + err = vnic_cq_alloc_with_type(enic->vdev, &enic->admin_cq[1], 1,
> + ENIC_ADMIN_DESC_COUNT,
> + 16 << enic->ext_cq,
^^^^^^^^^^^^^^^^^^

Does this code use the wrong descriptor size for the admin RQ's completion
queue?

The admin WQ's completion queue (admin_cq[0]) uses sizeof(struct cq_desc),
which is 16 bytes. If the admin channel handles PF-VF mailbox messages rather
than data packets with extended metadata, will firmware still write standard
16-byte completions here?

If so, won't allocating the ring with an extended size cause the host polling
loop to look for the color bit at the wrong offset (e.g., byte 31 instead of
byte 15), causing it to silently miss incoming admin messages?

> + RES_TYPE_ADMIN_CQ);
> + if (err)
> + goto free_cq0;
--
pw-bot: cr