Hi Olivier, > -----Original Message----- > From: Olivier Matz [mailto:olivier.m...@6wind.com] > Sent: Thursday, March 2, 2017 1:19 AM > To: dev@dpdk.org; thomas.monja...@6wind.com; Ananyev, Konstantin; Lu, > Wenzhuo; Zhang, Helin; Wu, Jingjing; adrien.mazarg...@6wind.com; > nelio.laranje...@6wind.com > Cc: Yigit, Ferruh; Richardson, Bruce > Subject: [PATCH 3/6] net/e1000: implement descriptor status API (igb) > > Signed-off-by: Olivier Matz <olivier.m...@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