aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2022-08-26 13:17:48 +0100
committerMichael Brown <mcb30@ipxe.org>2022-08-26 19:38:27 +0100
commita80124456ee9ade7a63b69f167c3b1348c8d93c0 (patch)
tree5ed5cd2eb0f432831df1e2f83da578bab335970b /src
parent3b81a4e2568cfca50893095638a03069785cd33e (diff)
downloadipxe-a80124456ee9ade7a63b69f167c3b1348c8d93c0.zip
ipxe-a80124456ee9ade7a63b69f167c3b1348c8d93c0.tar.gz
ipxe-a80124456ee9ade7a63b69f167c3b1348c8d93c0.tar.bz2
[ena] Increase receive ring size to 128 entries
Some versions of the ENA hardware (observed on a c6i.large instance in eu-west-2) seem to require a receive ring containing at least 128 entries: any smaller ring will never see receive completions or will stall after the first few completions. Increase the receive ring size to 128 entries (determined empirically) for compatibility with these hardware versions. Limit the receive ring fill level to 16 (as at present) to avoid consuming more memory than will typically be available in the internal heap. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/net/ena.c6
-rw-r--r--src/drivers/net/ena.h11
2 files changed, 12 insertions, 5 deletions
diff --git a/src/drivers/net/ena.c b/src/drivers/net/ena.c
index c2a48a2..400ae44 100644
--- a/src/drivers/net/ena.c
+++ b/src/drivers/net/ena.c
@@ -395,7 +395,7 @@ static int ena_create_sq ( struct ena_nic *ena, struct ena_sq *sq,
sq->phase = ENA_SQE_PHASE;
/* Calculate fill level */
- sq->fill = sq->count;
+ sq->fill = sq->max;
if ( sq->fill > cq->actual )
sq->fill = cq->actual;
@@ -1010,11 +1010,11 @@ static int ena_probe ( struct pci_device *pci ) {
ena->acq.phase = ENA_ACQ_PHASE;
ena_cq_init ( &ena->tx.cq, ENA_TX_COUNT,
sizeof ( ena->tx.cq.cqe.tx[0] ) );
- ena_sq_init ( &ena->tx.sq, ENA_SQ_TX, ENA_TX_COUNT,
+ ena_sq_init ( &ena->tx.sq, ENA_SQ_TX, ENA_TX_COUNT, ENA_TX_COUNT,
sizeof ( ena->tx.sq.sqe.tx[0] ), ena->tx_ids );
ena_cq_init ( &ena->rx.cq, ENA_RX_COUNT,
sizeof ( ena->rx.cq.cqe.rx[0] ) );
- ena_sq_init ( &ena->rx.sq, ENA_SQ_RX, ENA_RX_COUNT,
+ ena_sq_init ( &ena->rx.sq, ENA_SQ_RX, ENA_RX_COUNT, ENA_RX_FILL,
sizeof ( ena->rx.sq.sqe.rx[0] ), ena->rx_ids );
/* Fix up PCI device */
diff --git a/src/drivers/net/ena.h b/src/drivers/net/ena.h
index cbee1e7..4e1896e 100644
--- a/src/drivers/net/ena.h
+++ b/src/drivers/net/ena.h
@@ -28,7 +28,10 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ENA_TX_COUNT 16
/** Number of receive queue entries */
-#define ENA_RX_COUNT 16
+#define ENA_RX_COUNT 128
+
+/** Receive queue maximum fill level */
+#define ENA_RX_FILL 16
/** Base address low register offset */
#define ENA_BASE_LO 0x0
@@ -608,6 +611,8 @@ struct ena_sq {
uint8_t direction;
/** Number of entries */
uint8_t count;
+ /** Maximum fill level */
+ uint8_t max;
/** Fill level (limited to completion queue size) */
uint8_t fill;
};
@@ -618,16 +623,18 @@ struct ena_sq {
* @v sq Submission queue
* @v direction Direction
* @v count Number of entries
+ * @v max Maximum fill level
* @v size Size of each entry
* @v ids Buffer IDs
*/
static inline __attribute__ (( always_inline )) void
ena_sq_init ( struct ena_sq *sq, unsigned int direction, unsigned int count,
- size_t size, uint8_t *ids ) {
+ unsigned int max, size_t size, uint8_t *ids ) {
sq->len = ( count * size );
sq->direction = direction;
sq->count = count;
+ sq->max = max;
sq->ids = ids;
}