ixgbe: check DD bit for specific RX descriptor
authorIntel <intel.com>
Mon, 22 Jul 2013 22:00:00 +0000 (00:00 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 17 Sep 2013 12:16:10 +0000 (14:16 +0200)
Signed-off-by: Intel
lib/librte_pmd_ixgbe/ixgbe_ethdev.c
lib/librte_pmd_ixgbe/ixgbe_ethdev.h
lib/librte_pmd_ixgbe/ixgbe_rxtx.c

index 1434ac9..e26d5b9 100644 (file)
@@ -244,6 +244,7 @@ static struct eth_dev_ops ixgbe_eth_dev_ops = {
        .rx_queue_setup       = ixgbe_dev_rx_queue_setup,
        .rx_queue_release     = ixgbe_dev_rx_queue_release,
        .rx_queue_count       = ixgbe_dev_rx_queue_count,
+       .rx_descriptor_done   = ixgbe_dev_rx_descriptor_done,
        .tx_queue_setup       = ixgbe_dev_tx_queue_setup,
        .tx_queue_release     = ixgbe_dev_tx_queue_release,
        .dev_led_on           = ixgbe_dev_led_on,
index e9ddfc2..260622a 100644 (file)
@@ -175,6 +175,8 @@ int  ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 uint32_t ixgbe_dev_rx_queue_count(struct rte_eth_dev *dev, 
                uint16_t rx_queue_id);
 
+int ixgbe_dev_rx_descriptor_done(void *rx_queue, uint16_t offset);
+
 int ixgbe_dev_rx_init(struct rte_eth_dev *dev);
 
 void ixgbe_dev_tx_init(struct rte_eth_dev *dev);
index 8e7cb26..3039faa 100644 (file)
@@ -2299,6 +2299,23 @@ ixgbe_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
        return desc;
 }
 
+int
+ixgbe_dev_rx_descriptor_done(void *rx_queue, uint16_t offset)
+{
+       volatile union ixgbe_adv_rx_desc *rxdp;
+       struct igb_rx_queue *rxq = rx_queue;
+       uint32_t desc;
+
+       if (unlikely(offset >= rxq->nb_rx_desc))
+               return 0;
+       desc = rxq->rx_tail + offset;
+       if (desc >= rxq->nb_rx_desc)
+               desc -= rxq->nb_rx_desc;
+
+       rxdp = &rxq->rx_ring[desc];
+       return !!(rxdp->wb.upper.status_error & IXGBE_RXDADV_STAT_DD);
+}
+
 void
 ixgbe_dev_clear_queues(struct rte_eth_dev *dev)
 {