sfc_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
{
struct sfc_adapter *sa = dev->data->dev_private;
+ struct sfc_rxq *rxq;
+
+ SFC_ASSERT(rx_queue_id < sa->rxq_count);
+ rxq = sa->rxq_info[rx_queue_id].rxq;
- return sfc_rx_qdesc_npending(sa, rx_queue_id);
+ if (rxq == NULL || (rxq->state & SFC_RXQ_STARTED) == 0)
+ return 0;
+
+ return sa->dp_rx->qdesc_npending(rxq->dp);
}
static int
sfc_rx_descriptor_done(void *queue, uint16_t offset)
{
struct sfc_dp_rxq *dp_rxq = queue;
+ struct sfc_rxq *rxq = sfc_rxq_by_dp_rxq(dp_rxq);
- return sfc_rx_qdesc_done(dp_rxq, offset);
+ return offset < rxq->evq->sa->dp_rx->qdesc_npending(dp_rxq);
}
static int
.pkt_burst = sfc_efx_recv_pkts,
};
-unsigned int
-sfc_rx_qdesc_npending(struct sfc_adapter *sa, unsigned int sw_index)
-{
- struct sfc_rxq *rxq;
-
- SFC_ASSERT(sw_index < sa->rxq_count);
- rxq = sa->rxq_info[sw_index].rxq;
-
- if (rxq == NULL || (rxq->state & SFC_RXQ_STARTED) == 0)
- return 0;
-
- return sa->dp_rx->qdesc_npending(rxq->dp);
-}
-
-int
-sfc_rx_qdesc_done(struct sfc_dp_rxq *dp_rxq, unsigned int offset)
-{
- struct sfc_rxq *rxq = sfc_rxq_by_dp_rxq(dp_rxq);
-
- return offset < rxq->evq->sa->dp_rx->qdesc_npending(dp_rxq);
-}
-
static void
sfc_rx_qflush(struct sfc_adapter *sa, unsigned int sw_index)
{
void sfc_rx_qflush_done(struct sfc_rxq *rxq);
void sfc_rx_qflush_failed(struct sfc_rxq *rxq);
-unsigned int sfc_rx_qdesc_npending(struct sfc_adapter *sa,
- unsigned int sw_index);
-int sfc_rx_qdesc_done(struct sfc_dp_rxq *dp_rxq, unsigned int offset);
-
int sfc_rx_hash_init(struct sfc_adapter *sa);
void sfc_rx_hash_fini(struct sfc_adapter *sa);
int sfc_rx_hf_rte_to_efx(struct sfc_adapter *sa, uint64_t rte,