From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 55BEEC484 for ; Wed, 17 Jun 2015 18:54:53 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 17 Jun 2015 09:54:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,633,1427785200"; d="scan'208";a="729337647" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 17 Jun 2015 09:54:51 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t5HGspJd023823; Wed, 17 Jun 2015 17:54:51 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t5HGsoEH024313; Wed, 17 Jun 2015 17:54:50 +0100 Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id t5HGsot9024309; Wed, 17 Jun 2015 17:54:50 +0100 From: Konstantin Ananyev To: dev@dpdk.org Date: Wed, 17 Jun 2015 17:54:42 +0100 Message-Id: <1434560084-21237-4-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1434560084-21237-1-git-send-email-konstantin.ananyev@intel.com> References: <1434560084-21237-1-git-send-email-konstantin.ananyev@intel.com> Subject: [dpdk-dev] [PATCH 3/5] ixgbe: add support for eth_(rx|tx)_qinfo_get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2015 16:54:54 -0000 Signed-off-by: Konstantin Ananyev --- drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++++ drivers/net/ixgbe/ixgbe_ethdev.h | 6 ++++++ drivers/net/ixgbe/ixgbe_rxtx.c | 42 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 7414a2e..bed33b0 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -386,6 +386,8 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = { .rss_hash_conf_get = ixgbe_dev_rss_hash_conf_get, .filter_ctrl = ixgbe_dev_filter_ctrl, .set_mc_addr_list = ixgbe_dev_set_mc_addr_list, + .rx_qinfo_get = ixgbe_rx_qinfo_get, + .tx_qinfo_get = ixgbe_tx_qinfo_get, }; /* @@ -412,6 +414,8 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = { .mac_addr_add = ixgbevf_add_mac_addr, .mac_addr_remove = ixgbevf_remove_mac_addr, .set_mc_addr_list = ixgbe_dev_set_mc_addr_list, + .rx_qinfo_get = ixgbe_rx_qinfo_get, + .tx_qinfo_get = ixgbe_tx_qinfo_get, }; /** diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h index 19237b8..03ac00d 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.h +++ b/drivers/net/ixgbe/ixgbe_ethdev.h @@ -343,6 +343,12 @@ int ixgbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id); int ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); +void ixgbe_rx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rx_qinfo *qinfo); + +void ixgbe_tx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_tx_qinfo *qinfo); + int ixgbevf_dev_rx_init(struct rte_eth_dev *dev); void ixgbevf_dev_tx_init(struct rte_eth_dev *dev); diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index 4f9ab22..23d7053 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -4501,6 +4501,48 @@ ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) return 0; } +void +ixgbe_rx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rx_qinfo *qinfo) +{ + struct ixgbe_rx_queue *rxq; + + rxq = dev->data->rx_queues[queue_id]; + + qinfo->mp = rxq->mb_pool; + qinfo->scattered_rx = dev->data->scattered_rx; + + qinfo->nb_desc = rxq->nb_rx_desc; + qinfo->max_desc = IXGBE_MAX_RING_DESC; + qinfo->min_desc = IXGBE_MIN_RING_DESC; + + qinfo->conf.rx_free_thresh = rxq->rx_free_thresh; + qinfo->conf.rx_drop_en = rxq->drop_en; + qinfo->conf.rx_deferred_start = rxq->rx_deferred_start; +} + +void +ixgbe_tx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_tx_qinfo *qinfo) +{ + struct ixgbe_tx_queue *txq; + + txq = dev->data->tx_queues[queue_id]; + + qinfo->nb_desc = txq->nb_tx_desc; + qinfo->max_desc = IXGBE_MAX_RING_DESC; + qinfo->min_desc = IXGBE_MIN_RING_DESC; + + qinfo->conf.tx_thresh.pthresh = txq->pthresh; + qinfo->conf.tx_thresh.hthresh = txq->hthresh; + qinfo->conf.tx_thresh.wthresh = txq->wthresh; + + qinfo->conf.tx_free_thresh = txq->tx_free_thresh; + qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh; + qinfo->conf.txq_flags = txq->txq_flags; + qinfo->conf.tx_deferred_start = txq->tx_deferred_start; +} + /* * [VF] Initializes Receive Unit. */ -- 1.8.5.3