[dpdk-dev] [PATCH 3/6] net/e1000: implement descriptor status API (igb)

Lu, Wenzhuo wenzhuo.lu at intel.com
Thu Mar 2 02:28:21 CET 2017


Hi Olivier,

> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz at 6wind.com]
> Sent: Thursday, March 2, 2017 1:19 AM
> To: dev at dpdk.org; thomas.monjalon at 6wind.com; Ananyev, Konstantin; Lu,
> Wenzhuo; Zhang, Helin; Wu, Jingjing; adrien.mazarguil at 6wind.com;
> nelio.laranjeiro at 6wind.com
> Cc: Yigit, Ferruh; Richardson, Bruce
> Subject: [PATCH 3/6] net/e1000: implement descriptor status API (igb)
> 
> Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
> +
> +int
> +eth_igb_tx_descriptor_status(struct rte_eth_dev *dev, uint16_t tx_queue_id,
> +	uint16_t offset)
> +{
> +	volatile uint32_t *status;
> +	struct igb_tx_queue *txq;
> +	uint32_t desc;
> +
> +	txq = dev->data->tx_queues[tx_queue_id];
> +	if (unlikely(offset >= txq->nb_tx_desc))
> +		return -EINVAL;
> +
> +	desc = txq->tx_tail + offset;
Should we check nb_tx_desc here? The same for em.

> +	status = &txq->tx_ring[desc].wb.status;
> +	if (*status & rte_cpu_to_le_32(E1000_TXD_STAT_DD))
> +		return RTE_ETH_TX_DESC_DONE;
> +
> +	return RTE_ETH_TX_DESC_FULL;
> +}
> +
>  void
>  igb_dev_clear_queues(struct rte_eth_dev *dev)  {
> --
> 2.8.1



More information about the dev mailing list