DPDK patches and discussions
 help / color / mirror / Atom feed
From: Remy Horton <remy.horton@intel.com>
To: helin.zhang@intel.com, huawei.xie@intel.com, yongwang@vmware.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v1 2/3] drivers/net/virtio: Add ethdev functions
Date: Thu, 28 Jan 2016 08:48:14 +0000	[thread overview]
Message-ID: <1453970895-2639-3-git-send-email-remy.horton@intel.com> (raw)
In-Reply-To: <1453970895-2639-1-git-send-email-remy.horton@intel.com>

Implements driver support for fetching Tx and Rx queue information.

Signed-off-by: Remy Horton <remy.horton@intel.com>
---
 doc/guides/rel_notes/release_2_3.rst |  4 +++
 drivers/net/virtio/virtio_ethdev.c   | 47 ++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/doc/guides/rel_notes/release_2_3.rst b/doc/guides/rel_notes/release_2_3.rst
index 2ac48dd..e6dab98 100644
--- a/doc/guides/rel_notes/release_2_3.rst
+++ b/doc/guides/rel_notes/release_2_3.rst
@@ -9,6 +9,10 @@ New Features
   Implemented driver functions for Register dumping, EEPROM dumping, and
   setting of MAC address.
 
+* **virtio: Added ethdev support functions.**
+
+  Implemented Tx & Rx queue information fetching functions.
+
 
 Resolved Issues
 ---------------
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index d928339..032e4dc 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -95,6 +95,12 @@ static void virtio_mac_addr_add(struct rte_eth_dev *dev,
 static void virtio_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index);
 static void virtio_mac_addr_set(struct rte_eth_dev *dev,
 				struct ether_addr *mac_addr);
+static void virtio_rxq_info_get(struct rte_eth_dev *dev,
+				uint16_t queue_id,
+				struct rte_eth_rxq_info *qinfo);
+static void virtio_txq_info_get(struct rte_eth_dev *dev,
+				uint16_t queue_id,
+				struct rte_eth_txq_info *qinfo);
 
 static int virtio_dev_queue_stats_mapping_set(
 	__rte_unused struct rte_eth_dev *eth_dev,
@@ -620,6 +626,8 @@ static const struct eth_dev_ops virtio_eth_dev_ops = {
 	.mac_addr_add            = virtio_mac_addr_add,
 	.mac_addr_remove         = virtio_mac_addr_remove,
 	.mac_addr_set            = virtio_mac_addr_set,
+	.rxq_info_get            = virtio_rxq_info_get,
+	.txq_info_get            = virtio_txq_info_get,
 };
 
 static inline int
@@ -1672,6 +1680,45 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	};
 }
 
+static void virtio_rxq_info_get(struct rte_eth_dev *dev,
+				uint16_t queue_id,
+				struct rte_eth_rxq_info *qinfo)
+{
+	struct virtqueue *rxq;
+
+	rxq = dev->data->rx_queues[queue_id];
+
+	qinfo->mp = rxq->mpool;
+	qinfo->scattered_rx = dev->data->scattered_rx;
+	qinfo->nb_desc = rxq->vq_nentries;
+
+	qinfo->conf.rx_free_thresh = rxq->vq_free_thresh;
+
+	/* Virtio does not have these */
+	qinfo->conf.rx_drop_en = 0;
+	qinfo->conf.rx_deferred_start = 0;
+}
+
+static void virtio_txq_info_get(struct rte_eth_dev *dev,
+				uint16_t queue_id,
+				struct rte_eth_txq_info *qinfo)
+{
+	struct virtqueue *txq;
+
+	txq = dev->data->tx_queues[queue_id];
+
+	qinfo->nb_desc = txq->vq_nentries;
+	qinfo->conf.tx_free_thresh = txq->vq_free_thresh;
+
+	/* Virtio does not have these */
+	qinfo->conf.tx_thresh.pthresh = 0;
+	qinfo->conf.tx_thresh.hthresh = 0;
+	qinfo->conf.tx_thresh.wthresh = 0;
+	qinfo->conf.tx_rs_thresh = 0;
+	qinfo->conf.txq_flags = 0;
+	qinfo->conf.tx_deferred_start = 0;
+}
+
 /*
  * It enables testpmd to collect per queue stats.
  */
-- 
2.5.0

  parent reply	other threads:[~2016-01-28  8:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  8:48 [dpdk-dev] [PATCH v1 0/3] Add missing ethdev driver support Remy Horton
2016-01-28  8:48 ` [dpdk-dev] [PATCH v1 1/3] drivers/net/i40e: Add ethdev functions Remy Horton
2016-02-23  2:06   ` Zhang, Helin
2016-02-24 10:32     ` Remy Horton
2016-02-24 10:43       ` Ananyev, Konstantin
2016-01-28  8:48 ` Remy Horton [this message]
2016-01-28  8:48 ` [dpdk-dev] [PATCH v1 3/3] drivers/net/vmxnet3: " Remy Horton
2016-02-16 23:42   ` Yong Wang
2016-02-16 12:02 ` [dpdk-dev] [PATCH v1 0/3] Add missing ethdev driver support Bruce Richardson
2016-02-16 18:54 ` Stephen Hemminger
2016-02-23 12:19   ` Remy Horton
2016-03-04 15:25 ` [dpdk-dev] [PATCH v2 0/2] " Remy Horton
2016-03-04 15:25   ` [dpdk-dev] [PATCH v2 1/2] drivers/net/i40e: add ethdev functions Remy Horton
2016-03-04 15:25   ` [dpdk-dev] [PATCH v2 2/2] drivers/net/vmxnet3: " Remy Horton
2016-03-04 19:12     ` Yong Wang
2016-03-04 20:34     ` Stephen Hemminger
2016-03-07 12:26       ` Remy Horton
     [not found]         ` <20160307080747.02cc1f1b@xeon-e3>
2016-03-07 17:06           ` Remy Horton
2016-03-07 19:19             ` Stephen Hemminger
2016-03-09 13:29   ` [dpdk-dev] [PATCH v3 0/1] Add missing ethdev driver support Remy Horton
2016-03-09 13:29     ` [dpdk-dev] [PATCH v3 1/1] drivers/net/i40e: add ethdev functions Remy Horton
2016-03-10 12:25       ` Mcnamara, John
2016-03-14 10:22         ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453970895-2639-3-git-send-email-remy.horton@intel.com \
    --to=remy.horton@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=huawei.xie@intel.com \
    --cc=yongwang@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).