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 DB6D3C484 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="748460811" 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 t5HGspJ2023826; 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 t5HGspaP024320; Wed, 17 Jun 2015 17:54:51 +0100 Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id t5HGspnK024316; Wed, 17 Jun 2015 17:54:51 +0100 From: Konstantin Ananyev To: dev@dpdk.org Date: Wed, 17 Jun 2015 17:54:43 +0100 Message-Id: <1434560084-21237-5-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 4/5] e1000: 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/e1000/e1000_ethdev.h | 12 ++++++++++++ drivers/net/e1000/em_ethdev.c | 2 ++ drivers/net/e1000/em_rxtx.c | 38 ++++++++++++++++++++++++++++++++++++++ drivers/net/e1000/igb_ethdev.c | 4 ++++ drivers/net/e1000/igb_rxtx.c | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+) diff --git a/drivers/net/e1000/e1000_ethdev.h b/drivers/net/e1000/e1000_ethdev.h index c451faa..6001066 100644 --- a/drivers/net/e1000/e1000_ethdev.h +++ b/drivers/net/e1000/e1000_ethdev.h @@ -302,6 +302,12 @@ void igb_pf_mbx_process(struct rte_eth_dev *eth_dev); int igb_pf_host_configure(struct rte_eth_dev *eth_dev); +void igb_rx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rx_qinfo *qinfo); + +void igb_tx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_tx_qinfo *qinfo); + /* * RX/TX EM function prototypes */ @@ -337,4 +343,10 @@ uint16_t eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); +void em_rx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rx_qinfo *qinfo); + +void em_tx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_tx_qinfo *qinfo); + #endif /* _E1000_ETHDEV_H_ */ diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index a306c55..d9188a4 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -166,6 +166,8 @@ static const struct eth_dev_ops eth_em_ops = { .mac_addr_add = eth_em_rar_set, .mac_addr_remove = eth_em_rar_clear, .set_mc_addr_list = eth_em_set_mc_addr_list, + .rx_qinfo_get = em_rx_qinfo_get, + .tx_qinfo_get = em_tx_qinfo_get, }; /** diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index fdc825f..39d6b25 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -1862,3 +1862,41 @@ eth_em_tx_init(struct rte_eth_dev *dev) /* This write will effectively turn on the transmit unit. */ E1000_WRITE_REG(hw, E1000_TCTL, tctl); } + +void +em_rx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rx_qinfo *qinfo) +{ + struct em_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 = EM_MAX_RING_DESC; + qinfo->min_desc = EM_MIN_RING_DESC; + + qinfo->conf.rx_free_thresh = rxq->rx_free_thresh; +} + +void +em_tx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_tx_qinfo *qinfo) +{ + struct em_tx_queue *txq; + + txq = dev->data->tx_queues[queue_id]; + + qinfo->nb_desc = txq->nb_tx_desc; + qinfo->max_desc = EM_MAX_RING_DESC; + qinfo->min_desc = EM_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; +} diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 24c7510..1e11918 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -274,6 +274,8 @@ static const struct eth_dev_ops eth_igb_ops = { .rss_hash_conf_get = eth_igb_rss_hash_conf_get, .filter_ctrl = eth_igb_filter_ctrl, .set_mc_addr_list = eth_igb_set_mc_addr_list, + .rx_qinfo_get = igb_rx_qinfo_get, + .tx_qinfo_get = igb_tx_qinfo_get, }; /* @@ -295,6 +297,8 @@ static const struct eth_dev_ops igbvf_eth_dev_ops = { .tx_queue_setup = eth_igb_tx_queue_setup, .tx_queue_release = eth_igb_tx_queue_release, .set_mc_addr_list = eth_igb_set_mc_addr_list, + .rx_qinfo_get = igb_rx_qinfo_get, + .tx_qinfo_get = igb_tx_qinfo_get, }; /** diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index 43d6703..48d58f6 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -2394,3 +2394,39 @@ eth_igbvf_tx_init(struct rte_eth_dev *dev) } } + +void +igb_rx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rx_qinfo *qinfo) +{ + struct igb_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 = IGB_MAX_RING_DESC; + qinfo->min_desc = IGB_MIN_RING_DESC; + + qinfo->conf.rx_free_thresh = rxq->rx_free_thresh; + qinfo->conf.rx_drop_en = rxq->drop_en; +} + +void +igb_tx_qinfo_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_tx_qinfo *qinfo) +{ + struct igb_tx_queue *txq; + + txq = dev->data->tx_queues[queue_id]; + + qinfo->nb_desc = txq->nb_tx_desc; + qinfo->max_desc = IGB_MAX_RING_DESC; + qinfo->min_desc = IGB_MIN_RING_DESC; + + qinfo->conf.tx_thresh.pthresh = txq->pthresh; + qinfo->conf.tx_thresh.hthresh = txq->hthresh; + qinfo->conf.tx_thresh.wthresh = txq->wthresh; +} -- 1.8.5.3