}
void
-sfc_tx_qflush_done(struct sfc_txq *txq)
+sfc_tx_qflush_done(struct sfc_txq_info *txq_info)
{
- txq->state |= SFC_TXQ_FLUSHED;
- txq->state &= ~SFC_TXQ_FLUSHING;
+ txq_info->state |= SFC_TXQ_FLUSHED;
+ txq_info->state &= ~SFC_TXQ_FLUSHING;
}
int
evq->dp_txq = txq->dp;
- txq->state = SFC_TXQ_INITIALIZED;
+ txq_info->state = SFC_TXQ_INITIALIZED;
txq_info->deferred_start = (tx_conf->tx_deferred_start != 0);
txq = txq_info->txq;
SFC_ASSERT(txq != NULL);
- SFC_ASSERT(txq->state == SFC_TXQ_INITIALIZED);
+ SFC_ASSERT(txq_info->state == SFC_TXQ_INITIALIZED);
sa->priv.dp_tx->qdestroy(txq->dp);
txq->dp = NULL;
txq = txq_info->txq;
SFC_ASSERT(txq != NULL);
- SFC_ASSERT(txq->state == SFC_TXQ_INITIALIZED);
+ SFC_ASSERT(txq_info->state == SFC_TXQ_INITIALIZED);
evq = txq->evq;
efx_tx_qenable(txq->common);
- txq->state |= SFC_TXQ_STARTED;
+ txq_info->state |= SFC_TXQ_STARTED;
rc = sa->priv.dp_tx->qstart(txq->dp, evq->read_ptr, desc_index);
if (rc != 0)
return 0;
fail_dp_qstart:
- txq->state = SFC_TXQ_INITIALIZED;
+ txq_info->state = SFC_TXQ_INITIALIZED;
efx_tx_qdestroy(txq->common);
fail_tx_qcreate:
txq = txq_info->txq;
- if (txq == NULL || txq->state == SFC_TXQ_INITIALIZED)
+ if (txq == NULL || txq_info->state == SFC_TXQ_INITIALIZED)
return;
- SFC_ASSERT(txq->state & SFC_TXQ_STARTED);
+ SFC_ASSERT(txq_info->state & SFC_TXQ_STARTED);
sa->priv.dp_tx->qstop(txq->dp, &txq->evq->read_ptr);
* timeout; in the worst case it can delay for 6 seconds
*/
for (retry_count = 0;
- ((txq->state & SFC_TXQ_FLUSHED) == 0) &&
+ ((txq_info->state & SFC_TXQ_FLUSHED) == 0) &&
(retry_count < SFC_TX_QFLUSH_ATTEMPTS);
++retry_count) {
rc = efx_tx_qflush(txq->common);
if (rc != 0) {
- txq->state |= (rc == EALREADY) ?
+ txq_info->state |= (rc == EALREADY) ?
SFC_TXQ_FLUSHED : SFC_TXQ_FLUSH_FAILED;
break;
}
do {
rte_delay_ms(SFC_TX_QFLUSH_POLL_WAIT_MS);
sfc_ev_qpoll(txq->evq);
- } while ((txq->state & SFC_TXQ_FLUSHING) &&
+ } while ((txq_info->state & SFC_TXQ_FLUSHING) &&
wait_count++ < SFC_TX_QFLUSH_POLL_ATTEMPTS);
- if (txq->state & SFC_TXQ_FLUSHING)
+ if (txq_info->state & SFC_TXQ_FLUSHING)
sfc_err(sa, "TxQ %u flush timed out", sw_index);
- if (txq->state & SFC_TXQ_FLUSHED)
+ if (txq_info->state & SFC_TXQ_FLUSHED)
sfc_notice(sa, "TxQ %u flushed", sw_index);
}
sa->priv.dp_tx->qreap(txq->dp);
- txq->state = SFC_TXQ_INITIALIZED;
+ txq_info->state = SFC_TXQ_INITIALIZED;
efx_tx_qdestroy(txq->common);
return pkts_sent;
}
-struct sfc_txq *
-sfc_txq_by_dp_txq(const struct sfc_dp_txq *dp_txq)
+struct sfc_txq_info *
+sfc_txq_info_by_dp_txq(const struct sfc_dp_txq *dp_txq)
{
const struct sfc_dp_queue *dpq = &dp_txq->dpq;
struct rte_eth_dev *eth_dev;
struct sfc_adapter *sa;
- struct sfc_txq *txq;
SFC_ASSERT(rte_eth_dev_is_valid_port(dpq->port_id));
eth_dev = &rte_eth_devices[dpq->port_id];
sa = eth_dev->data->dev_private;
SFC_ASSERT(dpq->queue_id < sa->txq_count);
- txq = sa->txq_info[dpq->queue_id].txq;
+ return &sa->txq_info[dpq->queue_id];
+}
- SFC_ASSERT(txq != NULL);
- return txq;
+struct sfc_txq *
+sfc_txq_by_dp_txq(const struct sfc_dp_txq *dp_txq)
+{
+ struct sfc_txq_info *txq_info;
+
+ txq_info = sfc_txq_info_by_dp_txq(dp_txq);
+
+ SFC_ASSERT(txq_info->txq != NULL);
+ return txq_info->txq;
}
static sfc_dp_tx_qsize_up_rings_t sfc_efx_tx_qsize_up_rings;
* Allocated on the socket specified on the queue setup.
*/
struct sfc_txq {
- unsigned int state;
unsigned int hw_index;
struct sfc_evq *evq;
efsys_mem_t mem;
}
struct sfc_txq_info {
+ unsigned int state;
unsigned int entries;
struct sfc_txq *txq;
boolean_t deferred_start;
uint64_t offloads;
};
+struct sfc_txq_info *sfc_txq_info_by_dp_txq(const struct sfc_dp_txq *dp_txq);
+
int sfc_tx_configure(struct sfc_adapter *sa);
void sfc_tx_close(struct sfc_adapter *sa);
const struct rte_eth_txconf *tx_conf);
void sfc_tx_qfini(struct sfc_adapter *sa, unsigned int sw_index);
-void sfc_tx_qflush_done(struct sfc_txq *txq);
+void sfc_tx_qflush_done(struct sfc_txq_info *txq_info);
int sfc_tx_qstart(struct sfc_adapter *sa, unsigned int sw_index);
void sfc_tx_qstop(struct sfc_adapter *sa, unsigned int sw_index);
int sfc_tx_start(struct sfc_adapter *sa);