Hi Oliver, > -----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 4/6] net/e1000: implement descriptor status API (em) > > Signed-off-by: Olivier Matz <olivier.m...@6wind.com> > +int > +eth_em_tx_descriptor_status(struct rte_eth_dev *dev, uint16_t tx_queue_id, > + uint16_t offset) > +{ > + volatile uint8_t *status; > + struct em_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; > + /* go to next desc that has the RS bit */ > + desc = ((desc + txq->tx_rs_thresh - 1) / txq->tx_rs_thresh) * > + txq->tx_rs_thresh; The descriptor may be changed here. So the return value may not be for the offset one. Why?
> + status = &txq->tx_ring[desc].upper.fields.status; > + if (*status & E1000_TXD_STAT_DD) > + return RTE_ETH_TX_DESC_DONE; > + > + return RTE_ETH_TX_DESC_FULL; > +} > + > void > em_dev_clear_queues(struct rte_eth_dev *dev) { > -- > 2.8.1