summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIntel <intel.com>2013-07-23 00:00:00 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-09-17 14:16:10 +0200
commit11c378b199c662a133fe61482b06f870a56a4c5b (patch)
treee75946bd402bcb237cc7d3102a29a2c5581062ff
parentc32ee651a4c9618832016eb1cf13c1e08a31cf66 (diff)
downloaddpdk-11c378b199c662a133fe61482b06f870a56a4c5b.zip
dpdk-11c378b199c662a133fe61482b06f870a56a4c5b.tar.gz
dpdk-11c378b199c662a133fe61482b06f870a56a4c5b.tar.xz
ixgbe: check DD bit for specific RX descriptor
Signed-off-by: Intel
-rw-r--r--lib/librte_pmd_ixgbe/ixgbe_ethdev.c1
-rw-r--r--lib/librte_pmd_ixgbe/ixgbe_ethdev.h2
-rw-r--r--lib/librte_pmd_ixgbe/ixgbe_rxtx.c17
3 files changed, 20 insertions, 0 deletions
diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
index 1434ac9..e26d5b9 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
@@ -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,
diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h b/lib/librte_pmd_ixgbe/ixgbe_ethdev.h
index e9ddfc2..260622a 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h
+++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.h
@@ -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);
diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
index 8e7cb26..3039faa 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
@@ -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)
{