From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C7CA2A0C50; Fri, 16 Jul 2021 16:28:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DB7C41399; Fri, 16 Jul 2021 16:28:17 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 594124138A for ; Fri, 16 Jul 2021 16:28:16 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10046"; a="191107324" X-IronPort-AV: E=Sophos;i="5.84,245,1620716400"; d="scan'208";a="191107324" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2021 07:28:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,245,1620716400"; d="scan'208";a="460769827" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.27]) by orsmga008.jf.intel.com with ESMTP; 16 Jul 2021 07:28:14 -0700 From: Ferruh Yigit To: Andrew Rybchenko , Thomas Monjalon Cc: Ferruh Yigit , dev@dpdk.org Date: Fri, 16 Jul 2021 15:27:57 +0100 Message-Id: <20210716142800.3853651-5-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210716142800.3853651-1-ferruh.yigit@intel.com> References: <20210617081449.2045195-1-ferruh.yigit@intel.com> <20210716142800.3853651-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [RFC v2 5/8] test/virtual_pmd: support get queue info device ops X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Ferruh Yigit --- app/test/virtual_pmd.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index f2d807de8d89..e0ea213ae231 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -31,6 +31,8 @@ struct virtual_ethdev_private { struct virtual_ethdev_queue { int port_id; int queue_id; + uint16_t nb_desc; + struct rte_eth_rxconf rx_conf; }; static int @@ -106,9 +108,9 @@ virtual_ethdev_info_get(struct rte_eth_dev *dev __rte_unused, static int virtual_ethdev_rx_queue_setup_success(struct rte_eth_dev *dev, - uint16_t rx_queue_id, uint16_t nb_rx_desc __rte_unused, + uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, - const struct rte_eth_rxconf *rx_conf __rte_unused, + const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool __rte_unused) { struct virtual_ethdev_queue *rx_q; @@ -121,6 +123,8 @@ virtual_ethdev_rx_queue_setup_success(struct rte_eth_dev *dev, rx_q->port_id = dev->data->port_id; rx_q->queue_id = rx_queue_id; + rx_q->nb_desc = nb_rx_desc; + rx_q->rx_conf = *rx_conf; dev->data->rx_queues[rx_queue_id] = rx_q; @@ -159,6 +163,23 @@ virtual_ethdev_tx_queue_setup_success(struct rte_eth_dev *dev, return 0; } +static void +virtual_ethdev_rx_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id, + struct rte_eth_rxq_info *qinfo) +{ + struct virtual_ethdev_queue *rx_q = dev->data->rx_queues[rx_queue_id]; + + qinfo->nb_desc = rx_q->nb_desc; + qinfo->conf = rx_q->rx_conf; +} + +static void +virtual_ethdev_tx_info_get(struct rte_eth_dev *dev __rte_unused, + uint16_t tx_queue_id __rte_unused, + struct rte_eth_txq_info *qinfo __rte_unused) +{ +} + static int virtual_ethdev_tx_queue_setup_fail(struct rte_eth_dev *dev __rte_unused, uint16_t tx_queue_id __rte_unused, uint16_t nb_tx_desc __rte_unused, @@ -248,6 +269,8 @@ static const struct eth_dev_ops virtual_ethdev_default_dev_ops = { .dev_infos_get = virtual_ethdev_info_get, .rx_queue_setup = virtual_ethdev_rx_queue_setup_success, .tx_queue_setup = virtual_ethdev_tx_queue_setup_success, + .rxq_info_get = virtual_ethdev_rx_info_get, + .txq_info_get = virtual_ethdev_tx_info_get, .rx_queue_release = virtual_ethdev_rx_queue_release, .tx_queue_release = virtual_ethdev_tx_queue_release, .link_update = virtual_ethdev_link_update_success, -- 2.31.1