net/sfc: get RxQ descriptor done
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Andrew Lee <alee@solarflare.com> Reviewed-by: Robert Stonehouse <rstonehouse@solarflare.com>
This commit is contained in:
parent
04aa6b9c5f
commit
36d84f87b3
@ -854,6 +854,14 @@ sfc_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
|
||||
return sfc_rx_qdesc_npending(sa, rx_queue_id);
|
||||
}
|
||||
|
||||
static int
|
||||
sfc_rx_descriptor_done(void *queue, uint16_t offset)
|
||||
{
|
||||
struct sfc_rxq *rxq = queue;
|
||||
|
||||
return sfc_rx_qdesc_done(rxq, offset);
|
||||
}
|
||||
|
||||
static const struct eth_dev_ops sfc_eth_dev_ops = {
|
||||
.dev_configure = sfc_dev_configure,
|
||||
.dev_start = sfc_dev_start,
|
||||
@ -875,6 +883,7 @@ static const struct eth_dev_ops sfc_eth_dev_ops = {
|
||||
.rx_queue_setup = sfc_rx_queue_setup,
|
||||
.rx_queue_release = sfc_rx_queue_release,
|
||||
.rx_queue_count = sfc_rx_queue_count,
|
||||
.rx_descriptor_done = sfc_rx_descriptor_done,
|
||||
.tx_queue_setup = sfc_tx_queue_setup,
|
||||
.tx_queue_release = sfc_tx_queue_release,
|
||||
.flow_ctrl_get = sfc_flow_ctrl_get,
|
||||
|
@ -273,6 +273,17 @@ sfc_rx_qdesc_npending(struct sfc_adapter *sa, unsigned int sw_index)
|
||||
return rxq->pending - rxq->completed;
|
||||
}
|
||||
|
||||
int
|
||||
sfc_rx_qdesc_done(struct sfc_rxq *rxq, unsigned int offset)
|
||||
{
|
||||
if ((rxq->state & SFC_RXQ_RUNNING) == 0)
|
||||
return 0;
|
||||
|
||||
sfc_ev_qpoll(rxq->evq);
|
||||
|
||||
return offset < (rxq->pending - rxq->completed);
|
||||
}
|
||||
|
||||
static void
|
||||
sfc_rx_qpurge(struct sfc_rxq *rxq)
|
||||
{
|
||||
|
@ -142,6 +142,7 @@ uint16_t sfc_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
|
||||
|
||||
unsigned int sfc_rx_qdesc_npending(struct sfc_adapter *sa,
|
||||
unsigned int sw_index);
|
||||
int sfc_rx_qdesc_done(struct sfc_rxq *rxq, unsigned int offset);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user