/* Management event queue polling period in microseconds */
#define SFC_MGMT_EV_QPOLL_PERIOD_US (US_PER_S)
+static const char *
+sfc_evq_type2str(enum sfc_evq_type type)
+{
+ switch (type) {
+ case SFC_EVQ_TYPE_MGMT:
+ return "mgmt-evq";
+ case SFC_EVQ_TYPE_RX:
+ return "rx-evq";
+ case SFC_EVQ_TYPE_TX:
+ return "tx-evq";
+ default:
+ SFC_ASSERT(B_FALSE);
+ return NULL;
+ }
+}
static boolean_t
sfc_ev_initialized(void *arg)
int
sfc_ev_qinit(struct sfc_adapter *sa, unsigned int sw_index,
+ enum sfc_evq_type type, unsigned int type_index,
unsigned int entries, int socket_id)
{
struct sfc_evq_info *evq_info;
struct sfc_evq *evq;
int rc;
- sfc_log_init(sa, "sw_index=%u", sw_index);
+ sfc_log_init(sa, "sw_index=%u type=%s type_index=%u",
+ sw_index, sfc_evq_type2str(type), type_index);
evq_info = &sa->evq_info[sw_index];
evq->sa = sa;
evq->evq_index = sw_index;
+ evq->type = type;
/* Allocate DMA space */
- rc = sfc_dma_alloc(sa, "evq", sw_index, EFX_EVQ_SIZE(evq_info->entries),
+ rc = sfc_dma_alloc(sa, sfc_evq_type2str(type), type_index,
+ EFX_EVQ_SIZE(evq_info->entries),
socket_id, &evq->mem);
if (rc != 0)
goto fail_dma_alloc;
goto fail_ev_qinit_info;
}
- rc = sfc_ev_qinit(sa, sa->mgmt_evq_index, SFC_MGMT_EVQ_ENTRIES,
- sa->socket_id);
+ rc = sfc_ev_qinit(sa, sa->mgmt_evq_index, SFC_EVQ_TYPE_MGMT, 0,
+ SFC_MGMT_EVQ_ENTRIES, sa->socket_id);
if (rc != 0)
goto fail_mgmt_evq_init;
SFC_EVQ_NSTATES
};
+enum sfc_evq_type {
+ SFC_EVQ_TYPE_MGMT = 0,
+ SFC_EVQ_TYPE_RX,
+ SFC_EVQ_TYPE_TX,
+
+ SFC_EVQ_NTYPES
+};
+
struct sfc_evq {
/* Used on datapath */
efx_evq_t *common;
struct sfc_adapter *sa;
unsigned int evq_index;
enum sfc_evq_state init_state;
+ enum sfc_evq_type type;
};
struct sfc_evq_info {
void sfc_ev_stop(struct sfc_adapter *sa);
int sfc_ev_qinit(struct sfc_adapter *sa, unsigned int sw_index,
+ enum sfc_evq_type type, unsigned int type_index,
unsigned int entries, int socket_id);
void sfc_ev_qfini(struct sfc_adapter *sa, unsigned int sw_index);
int sfc_ev_qstart(struct sfc_adapter *sa, unsigned int sw_index);
evq_index = sfc_evq_index_by_rxq_sw_index(sa, sw_index);
- rc = sfc_ev_qinit(sa, evq_index, rxq_info->entries, socket_id);
+ rc = sfc_ev_qinit(sa, evq_index, SFC_EVQ_TYPE_RX, sw_index,
+ rxq_info->entries, socket_id);
if (rc != 0)
goto fail_ev_qinit;
SFC_ASSERT(nb_tx_desc <= sa->txq_max_entries);
txq_info->entries = nb_tx_desc;
- rc = sfc_ev_qinit(sa, evq_index, txq_info->entries, socket_id);
+ rc = sfc_ev_qinit(sa, evq_index, SFC_EVQ_TYPE_TX, sw_index,
+ txq_info->entries, socket_id);
if (rc != 0)
goto fail_ev_qinit;