On 5/6/2020 8:52 PM, Stephen Hemminger wrote:
> These functions are useful for applications and debugging.
> The netvsc PMD also transparently handles the rx/tx descriptor
> functions for underlying VF device.
> 
> Signed-off-by: Stephen Hemminger <step...@networkplumber.org>

<...>

> +int hn_dev_rx_queue_status(void *arg, uint16_t offset)
> +{
> +     const struct hn_rx_queue *rxq = arg;
> +
> +     hn_process_events(rxq->hv, rxq->queue_id, 0);
> +     if (offset >= rxq->rx_ring->capacity)
> +             return -EINVAL;
> +     else if (offset < rte_ring_count(rxq->rx_ring))

Is this logic correct, can we compare 'offset' with used entry count in circular
buffer?

> +             return RTE_ETH_RX_DESC_DONE;
> +     else
> +             return RTE_ETH_RX_DESC_AVAIL;
> +}

Can't there be descriptors with 'RTE_ETH_RX_DESC_UNAVAIL' status?

Reply via email to