]> git.droids-corp.org - dpdk.git/commitdiff
net/thunderx: get Rx queue count
authorJerin Jacob <jerin.jacob@caviumnetworks.com>
Fri, 17 Jun 2016 13:29:49 +0000 (18:59 +0530)
committerBruce Richardson <bruce.richardson@intel.com>
Mon, 20 Jun 2016 15:21:55 +0000 (17:21 +0200)
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Slawomir Rosek <slawomir.rosek@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
drivers/net/thunderx/nicvf_ethdev.c
drivers/net/thunderx/nicvf_rxtx.c
drivers/net/thunderx/nicvf_rxtx.h

index 46f0d7b0c45cb2b6d06e84cdeb2a7ea80b4ae669..33d5fba682eacc694e34d329b993a5f42b8366e6 100644 (file)
@@ -935,6 +935,7 @@ static const struct eth_dev_ops nicvf_eth_dev_ops = {
        .rss_hash_conf_get        = nicvf_dev_rss_hash_conf_get,
        .rx_queue_setup           = nicvf_dev_rx_queue_setup,
        .rx_queue_release         = nicvf_dev_rx_queue_release,
+       .rx_queue_count           = nicvf_dev_rx_queue_count,
        .tx_queue_setup           = nicvf_dev_tx_queue_setup,
        .tx_queue_release         = nicvf_dev_tx_queue_release,
        .get_reg_length           = nicvf_dev_get_reg_length,
index fed08596233edb95bcb5242fd698b52ab3892b92..1c6d6a8861c8e33b14832c70b9903c9c75858d4e 100644 (file)
@@ -570,3 +570,12 @@ nicvf_recv_pkts_multiseg(void *rx_queue, struct rte_mbuf **rx_pkts,
 
        return to_process;
 }
+
+uint32_t
+nicvf_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t queue_idx)
+{
+       struct nicvf_rxq *rxq;
+
+       rxq = dev->data->rx_queues[queue_idx];
+       return nicvf_addr_read(rxq->cq_status) & NICVF_CQ_CQE_COUNT_MASK;
+}
index d2ca2c9cfa2880b48e9a8e13901fd30abb442aae..ded87f3c80187eb023337214770087476ebec406 100644 (file)
@@ -84,6 +84,8 @@ fill_sq_desc_gather(union sq_entry_t *entry, struct rte_mbuf *pkt)
 }
 #endif
 
+uint32_t nicvf_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t queue_idx);
+
 uint16_t nicvf_recv_pkts(void *rxq, struct rte_mbuf **rx_pkts, uint16_t pkts);
 uint16_t nicvf_recv_pkts_multiseg(void *rx_queue, struct rte_mbuf **rx_pkts,
                                  uint16_t nb_pkts);