From 9f81e97af5e3861ea2d0ad7b11f2c8746c2c52f9 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 26 Aug 2022 13:15:07 +0100 Subject: [PATCH] [ena] Specify the unused completion queue MSI-X vector as 0xffffffff Some versions of the ENA firmware (observed on a c6i.large instance in eu-west-2) will complain if the completion queue's MSI-X vector field is left empty, even though the queue configuration specifies that interrupts are not used. Work around these firmware versions by passing in what appears to be the magic "no MSI-X vector" value in this field. Signed-off-by: Michael Brown --- src/drivers/net/ena.c | 1 + src/drivers/net/ena.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/drivers/net/ena.c b/src/drivers/net/ena.c index 46351dd7d..bad0238fe 100644 --- a/src/drivers/net/ena.c +++ b/src/drivers/net/ena.c @@ -469,6 +469,7 @@ static int ena_create_cq ( struct ena_nic *ena, struct ena_cq *cq ) { req->header.opcode = ENA_CREATE_CQ; req->create_cq.size = cq->size; req->create_cq.count = cpu_to_le16 ( cq->requested ); + req->create_cq.vector = cpu_to_le32 ( ENA_MSIX_NONE ); req->create_cq.address = cpu_to_le64 ( virt_to_bus ( cq->cqe.raw ) ); /* Issue request */ diff --git a/src/drivers/net/ena.h b/src/drivers/net/ena.h index c76598730..78693e678 100644 --- a/src/drivers/net/ena.h +++ b/src/drivers/net/ena.h @@ -230,6 +230,14 @@ struct ena_create_cq_req { uint64_t address; } __attribute__ (( packed )); +/** Empty MSI-X vector + * + * Some versions of the ENA firmware will complain if the completion + * queue's MSI-X vector field is left empty, even though the queue + * configuration specifies that interrupts are not used. + */ +#define ENA_MSIX_NONE 0xffffffffUL + /** Create completion queue response */ struct ena_create_cq_rsp { /** Header */