From: Andrew Rybchenko Date: Mon, 20 Mar 2017 10:15:09 +0000 (+0000) Subject: net/sfc: do not use Rx queue control state on datapath X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b762eca9dd7da4b1fb17c8d1b70189a490a2ef6f;p=dpdk.git net/sfc: do not use Rx queue control state on datapath Rx queue flags should keep the information required on datapath. It is a preparation to split control and data paths. Signed-off-by: Andrew Rybchenko --- diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c index bb22001565..cc2a30f097 100644 --- a/drivers/net/sfc/sfc_ev.c +++ b/drivers/net/sfc/sfc_ev.c @@ -101,7 +101,7 @@ sfc_ev_rx(void *arg, __rte_unused uint32_t label, uint32_t id, SFC_ASSERT(rxq != NULL); SFC_ASSERT(rxq->evq == evq); - SFC_ASSERT(rxq->state & SFC_RXQ_STARTED); + SFC_ASSERT(rxq->flags & SFC_RXQ_FLAG_STARTED); stop = (id + 1) & rxq->ptr_mask; pending_id = rxq->pending & rxq->ptr_mask; @@ -434,7 +434,8 @@ sfc_ev_qpoll(struct sfc_evq *evq) struct sfc_adapter *sa = evq->sa; int rc; - if ((evq->rxq != NULL) && (evq->rxq->state & SFC_RXQ_RUNNING)) { + if ((evq->rxq != NULL) && + (evq->rxq->flags & SFC_RXQ_FLAG_RUNNING)) { unsigned int rxq_sw_index = sfc_rxq_sw_index(evq->rxq); sfc_warn(sa, diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index d6ba4e9af7..6af15744cf 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -219,7 +219,7 @@ sfc_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) boolean_t discard_next = B_FALSE; struct rte_mbuf *scatter_pkt = NULL; - if (unlikely((rxq->state & SFC_RXQ_RUNNING) == 0)) + if (unlikely((rxq->flags & SFC_RXQ_FLAG_RUNNING) == 0)) return 0; sfc_ev_qpoll(rxq->evq); @@ -320,7 +320,7 @@ sfc_rx_qdesc_npending(struct sfc_adapter *sa, unsigned int sw_index) SFC_ASSERT(sw_index < sa->rxq_count); rxq = sa->rxq_info[sw_index].rxq; - if (rxq == NULL || (rxq->state & SFC_RXQ_RUNNING) == 0) + if (rxq == NULL || (rxq->flags & SFC_RXQ_FLAG_RUNNING) == 0) return 0; sfc_ev_qpoll(rxq->evq); @@ -331,7 +331,7 @@ sfc_rx_qdesc_npending(struct sfc_adapter *sa, unsigned int sw_index) int sfc_rx_qdesc_done(struct sfc_rxq *rxq, unsigned int offset) { - if ((rxq->state & SFC_RXQ_RUNNING) == 0) + if ((rxq->flags & SFC_RXQ_FLAG_RUNNING) == 0) return 0; sfc_ev_qpoll(rxq->evq); @@ -486,7 +486,8 @@ sfc_rx_qstart(struct sfc_adapter *sa, unsigned int sw_index) rxq->pending = rxq->completed = rxq->added = rxq->pushed = 0; - rxq->state |= (SFC_RXQ_STARTED | SFC_RXQ_RUNNING); + rxq->state |= SFC_RXQ_STARTED; + rxq->flags |= SFC_RXQ_FLAG_STARTED | SFC_RXQ_FLAG_RUNNING; sfc_rx_qrefill(rxq); @@ -533,13 +534,14 @@ sfc_rx_qstop(struct sfc_adapter *sa, unsigned int sw_index) sa->eth_dev->data->rx_queue_state[sw_index] = RTE_ETH_QUEUE_STATE_STOPPED; - rxq->state &= ~SFC_RXQ_RUNNING; + rxq->flags &= ~SFC_RXQ_FLAG_RUNNING; if (sw_index == 0) efx_mac_filter_default_rxq_clear(sa->nic); sfc_rx_qflush(sa, sw_index); + rxq->flags &= ~SFC_RXQ_FLAG_STARTED; rxq->state = SFC_RXQ_INITIALIZED; efx_rx_qdestroy(rxq->common); diff --git a/drivers/net/sfc/sfc_rx.h b/drivers/net/sfc/sfc_rx.h index 4e1b4c632d..b2ca1fa20e 100644 --- a/drivers/net/sfc/sfc_rx.h +++ b/drivers/net/sfc/sfc_rx.h @@ -61,8 +61,6 @@ enum sfc_rxq_state_bit { #define SFC_RXQ_INITIALIZED (1 << SFC_RXQ_INITIALIZED_BIT) SFC_RXQ_STARTED_BIT, #define SFC_RXQ_STARTED (1 << SFC_RXQ_STARTED_BIT) - SFC_RXQ_RUNNING_BIT, -#define SFC_RXQ_RUNNING (1 << SFC_RXQ_RUNNING_BIT) SFC_RXQ_FLUSHING_BIT, #define SFC_RXQ_FLUSHING (1 << SFC_RXQ_FLUSHING_BIT) SFC_RXQ_FLUSHED_BIT, @@ -79,16 +77,15 @@ struct sfc_rxq { /* Used on data path */ struct sfc_evq *evq; struct sfc_rx_sw_desc *sw_desc; - unsigned int state; + unsigned int flags; +#define SFC_RXQ_FLAG_STARTED 0x1 +#define SFC_RXQ_FLAG_RUNNING 0x2 +#define SFC_RXQ_FLAG_RSS_HASH 0x4 unsigned int ptr_mask; unsigned int pending; unsigned int completed; uint16_t batch_max; uint16_t prefix_size; -#if EFSYS_OPT_RX_SCALE - unsigned int flags; -#define SFC_RXQ_FLAG_RSS_HASH 0x1 -#endif /* Used on refill */ unsigned int added; @@ -102,6 +99,7 @@ struct sfc_rxq { /* Not used on data path */ unsigned int hw_index; + unsigned int state; }; static inline unsigned int