]> git.droids-corp.org - dpdk.git/commitdiff
igb: check DD bit of 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_e1000/e1000_ethdev.h
lib/librte_pmd_e1000/em_ethdev.c
lib/librte_pmd_e1000/em_rxtx.c
lib/librte_pmd_e1000/igb_ethdev.c
lib/librte_pmd_e1000/igb_rxtx.c

index 9ebb5ba493a1dfb4b9fe572b5392ed467004baf8..999420a60cf31e9f19ae4c6d111b2ad0e74bc215 100644 (file)
@@ -120,6 +120,8 @@ int eth_igb_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 uint32_t eth_igb_rx_queue_count(struct rte_eth_dev *dev, 
                uint16_t rx_queue_id);
 
+int eth_igb_rx_descriptor_done(void *rx_queue, uint16_t offset);
+
 int eth_igb_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
                uint16_t nb_tx_desc, unsigned int socket_id,
                const struct rte_eth_txconf *tx_conf);
@@ -166,6 +168,8 @@ int eth_em_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 uint32_t eth_em_rx_queue_count(struct rte_eth_dev *dev, 
                uint16_t rx_queue_id);
 
+int eth_em_rx_descriptor_done(void *rx_queue, uint16_t offset);
+
 int eth_em_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
                uint16_t nb_tx_desc, unsigned int socket_id,
                const struct rte_eth_txconf *tx_conf);
index dd73e22ba85349b91f27a520ff10bbb0e649861a..9c6ff202658668c8b82234c637c171e714466b31 100644 (file)
@@ -148,6 +148,7 @@ static struct eth_dev_ops eth_em_ops = {
        .rx_queue_setup       = eth_em_rx_queue_setup,
        .rx_queue_release     = eth_em_rx_queue_release,
        .rx_queue_count       = eth_em_rx_queue_count,
+       .rx_descriptor_done   = eth_em_rx_descriptor_done,
        .tx_queue_setup       = eth_em_tx_queue_setup,
        .tx_queue_release     = eth_em_tx_queue_release,
        .dev_led_on           = eth_em_led_on,
index a6b2acd3bac899c0bb65a5ef348d0087bce653fc..eb00b0cc211bea4ca02923478cc4c53c081d13c4 100644 (file)
@@ -1445,6 +1445,23 @@ eth_em_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
        return desc;
 }
 
+int
+eth_em_rx_descriptor_done(void *rx_queue, uint16_t offset)
+{
+       volatile struct e1000_rx_desc *rxdp;
+       struct em_rx_queue *rxq = rx_queue;
+       uint16_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->status & E1000_RXD_STAT_DD);
+}
+
 void
 em_dev_clear_queues(struct rte_eth_dev *dev)
 {
index b8be40e3cdadd60c15adf5a814ccf0a51cec27f5..14bdc2b93ee82abdab742b31a5d98b27c1868d50 100644 (file)
@@ -184,6 +184,7 @@ static struct eth_dev_ops eth_igb_ops = {
        .rx_queue_setup       = eth_igb_rx_queue_setup,
        .rx_queue_release     = eth_igb_rx_queue_release,
        .rx_queue_count       = eth_igb_rx_queue_count,
+       .rx_descriptor_done   = eth_igb_rx_descriptor_done,
        .tx_queue_setup       = eth_igb_tx_queue_setup,
        .tx_queue_release     = eth_igb_tx_queue_release,
        .dev_led_on           = eth_igb_led_on,
index b816fb59f1b4a9209edf51a3cb3d1a3356a8177c..71f2ef441e93d41b980eac6128215bcef47df663 100644 (file)
@@ -1416,6 +1416,23 @@ eth_igb_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
        return 0;
 }
 
+int
+eth_igb_rx_descriptor_done(void *rx_queue, uint16_t offset)
+{
+       volatile union e1000_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 & E1000_RXD_STAT_DD);
+}
+
 void
 igb_dev_clear_queues(struct rte_eth_dev *dev)
 {