extern "C" {
#endif
+#define EF10_RXQ_MAXNDESCS 4096
+#define EF10_RXQ_MINNDESCS 512
+
#define EF10_TXQ_MINNDESCS 512
/* Number of hardware PIO buffers (for compile-time resource dimensions) */
uint32_t dma_mode;
boolean_t want_outer_classes;
- EFSYS_ASSERT3U(ndescs, <=, EFX_RXQ_MAXNDESCS);
+ EFSYS_ASSERT3U(ndescs, <=, encp->enc_rxq_max_ndescs);
if ((esmp == NULL) || (EFSYS_MEM_SIZE(esmp) < EFX_RXQ_SIZE(ndescs))) {
rc = EINVAL;
EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);
EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);
- EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MAXNDESCS));
- EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MINNDESCS));
+ EFSYS_ASSERT(ISP2(encp->enc_rxq_max_ndescs));
+ EFSYS_ASSERT(ISP2(encp->enc_rxq_min_ndescs));
if (!ISP2(ndescs) ||
- (ndescs < EFX_RXQ_MINNDESCS) || (ndescs > EFX_RXQ_MAXNDESCS)) {
+ (ndescs < encp->enc_rxq_min_ndescs) ||
+ (ndescs > encp->enc_rxq_max_ndescs)) {
rc = EINVAL;
goto fail1;
}
uint32_t enc_evq_limit;
uint32_t enc_txq_limit;
uint32_t enc_rxq_limit;
+ uint32_t enc_rxq_max_ndescs;
+ uint32_t enc_rxq_min_ndescs;
uint32_t enc_txq_max_ndescs;
uint32_t enc_txq_min_ndescs;
uint32_t enc_buftbl_limit;
__in uint8_t *buffer,
__out uint16_t *pkt_lengthp);
-#define EFX_RXQ_MAXNDESCS 4096
-#define EFX_RXQ_MINNDESCS 512
+/*
+ * These symbols are deprecated and will be removed.
+ * Use the fields from efx_nic_cfg_t instead.
+ */
+#define EFX_RXQ_MAXNDESCS 4096
+#define EFX_RXQ_MINNDESCS 512
#define EFX_RXQ_SIZE(_ndescs) ((_ndescs) * sizeof (efx_qword_t))
#define EFX_RXQ_NBUFS(_ndescs) (EFX_RXQ_SIZE(_ndescs) / EFX_BUF_SIZE)
EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);
EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);
- EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MAXNDESCS));
- EFX_STATIC_ASSERT(ISP2(EFX_RXQ_MINNDESCS));
+ EFSYS_ASSERT(ISP2(encp->enc_rxq_max_ndescs));
+ EFSYS_ASSERT(ISP2(encp->enc_rxq_min_ndescs));
if (!ISP2(ndescs) ||
- (ndescs < EFX_RXQ_MINNDESCS) || (ndescs > EFX_RXQ_MAXNDESCS)) {
+ (ndescs < encp->enc_rxq_min_ndescs) ||
+ (ndescs > encp->enc_rxq_max_ndescs)) {
rc = EINVAL;
goto fail1;
}
rc = EINVAL;
goto fail2;
}
- for (size = 0; (1 << size) <= (EFX_RXQ_MAXNDESCS / EFX_RXQ_MINNDESCS);
+ for (size = 0;
+ (1U << size) <= encp->enc_rxq_max_ndescs / encp->enc_rxq_min_ndescs;
size++)
- if ((1 << size) == (int)(ndescs / EFX_RXQ_MINNDESCS))
+ if ((1U << size) == (uint32_t)ndescs / encp->enc_rxq_min_ndescs)
break;
if (id + (1 << size) >= encp->enc_buftbl_limit) {
rc = EINVAL;
encp->enc_rx_buf_align_start = 1;
encp->enc_rx_buf_align_end = 64; /* RX DMA end padding */
+ encp->enc_rxq_max_ndescs = EF10_RXQ_MAXNDESCS;
+ encp->enc_rxq_min_ndescs = EF10_RXQ_MINNDESCS;
+
/*
* The workaround for bug35388 uses the top bit of transmit queue
* descriptor writes, preventing the use of 4096 descriptor TXQs.
}
encp->enc_rx_buf_align_end = end_padding;
+ encp->enc_rxq_max_ndescs = EF10_RXQ_MAXNDESCS;
+ encp->enc_rxq_min_ndescs = EF10_RXQ_MINNDESCS;
+
/*
* The maximum supported transmit queue size is 2048. TXQs with 4096
* descriptors are not supported as the top bit is used for vfifo
}
encp->enc_rx_buf_align_end = end_padding;
+ encp->enc_rxq_max_ndescs = EF10_RXQ_MAXNDESCS;
+ encp->enc_rxq_min_ndescs = EF10_RXQ_MINNDESCS;
+
/*
* The maximum supported transmit queue size is 2048. TXQs with 4096
* descriptors are not supported as the top bit is used for vfifo
#define SIENA_TXQ_MAXNDESCS 4096
#define SIENA_TXQ_MINNDESCS 512
+#define SIENA_RXQ_MAXNDESCS 4096
+#define SIENA_RXQ_MINNDESCS 512
+
#define SIENA_NVRAM_CHUNK 0x80
encp->enc_rxq_limit = MIN(EFX_RXQ_LIMIT_TARGET, nrxq);
encp->enc_txq_limit = MIN(EFX_TXQ_LIMIT_TARGET, ntxq);
+ encp->enc_rxq_max_ndescs = EF10_RXQ_MAXNDESCS;
+ encp->enc_rxq_min_ndescs = EF10_RXQ_MINNDESCS;
+
encp->enc_txq_max_ndescs = SIENA_TXQ_MAXNDESCS;
encp->enc_txq_min_ndescs = SIENA_TXQ_MINNDESCS;