[dpdk-dev] [PATCH 3/8] net/bnxt: add support for rx_descriptor_status
Ferruh Yigit
ferruh.yigit at intel.com
Tue Aug 29 18:11:06 CEST 2017
On 8/24/2017 5:29 PM, Ajit Khaparde wrote:
> add support for rx_descriptor_status dev_op
> Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
<...>
> +static int
> +bnxt_rx_descriptor_status_op(void *rx_queue, uint16_t offset)
> +{
> + struct bnxt_rx_queue *rxq = (struct bnxt_rx_queue *)rx_queue;
> + struct bnxt_cp_ring_info *cpr;
> + struct rx_pkt_cmpl *rxcmp;
> + uint32_t cons;
> +
> + if (!rxq)
> + return -EINVAL;
> +
> + cpr = rxq->cp_ring;
> +
> + if (offset >= rxq->nb_rx_desc)
> + return -EINVAL;
> +
> + cons = RING_CMP(cpr->cp_ring_struct, offset);
> + rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons];
> +
> + if (CMP_VALID(rxcmp, offset, cpr->cp_ring_struct))
> + return RTE_ETH_RX_DESC_DONE;
> +
> + return RTE_ETH_RX_DESC_AVAIL;
Do we need a check to be sure if descriptor is available. Is PMD using
rx_free_thresh?
If so descriptor can be in a state that packet parsed by software but
descriptor not freed yet: RTE_ETH_RX_DESC_UNAVAIL
> +}
<...>
More information about the dev
mailing list