From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 8CF14C4A6 for ; Wed, 17 Jun 2015 18:54:54 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.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="748460808" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.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 t5HGsonX023820; Wed, 17 Jun 2015 17:54:50 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t5HGso1U024306; Wed, 17 Jun 2015 17:54:50 +0100 Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id t5HGsoLB024302; Wed, 17 Jun 2015 17:54:50 +0100 From: Konstantin Ananyev To: dev@dpdk.org Date: Wed, 17 Jun 2015 17:54:41 +0100 Message-Id: <1434560084-21237-3-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 2/5] i40e: 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:55 -0000 Signed-off-by: Konstantin Ananyev --- drivers/net/i40e/i40e_ethdev.c | 2 ++ drivers/net/i40e/i40e_ethdev.h | 5 +++++ drivers/net/i40e/i40e_rxtx.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 2ada502..38a05d7 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -262,6 +262,8 @@ static const struct eth_dev_ops i40e_eth_dev_ops = { .udp_tunnel_add = i40e_dev_udp_tunnel_add, .udp_tunnel_del = i40e_dev_udp_tunnel_del, .filter_ctrl = i40e_dev_filter_ctrl, + .rx_qinfo_get = i40e_rx_qinfo_get, + .tx_qinfo_get = i40e_tx_qinfo_get, }; static struct eth_driver rte_i40e_pmd = { diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 587ee71..88576b7 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -479,6 +479,11 @@ int i40e_fdir_ctrl_func(struct rte_eth_dev *dev, enum rte_filter_op filter_op, void *arg); +void i40e_rx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rx_qinfo *qinfo); +void i40e_tx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_tx_qinfo *qinfo); + /* I40E_DEV_PRIVATE_TO */ #define I40E_DEV_PRIVATE_TO_PF(adapter) \ (&((struct i40e_adapter *)adapter)->pf) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 2de0ac4..c471db4 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -2706,3 +2706,45 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf) return I40E_SUCCESS; } + +void +i40e_rx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rx_qinfo *qinfo) +{ + struct i40e_rx_queue *rxq; + + rxq = dev->data->rx_queues[queue_id]; + + qinfo->mp = rxq->mp; + qinfo->scattered_rx = dev->data->scattered_rx; + + qinfo->nb_desc = rxq->nb_rx_desc; + qinfo->max_desc = I40E_MAX_RING_DESC; + qinfo->min_desc = I40E_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 +i40e_tx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_tx_qinfo *qinfo) +{ + struct i40e_tx_queue *txq; + + txq = dev->data->tx_queues[queue_id]; + + qinfo->nb_desc = txq->nb_tx_desc; + qinfo->max_desc = I40E_MAX_RING_DESC; + qinfo->min_desc = I40E_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; +} -- 1.8.5.3