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 274B64265D; Thu, 28 Sep 2023 09:46:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3424740A80; Thu, 28 Sep 2023 09:46:27 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 2961740296 for ; Thu, 28 Sep 2023 09:46:16 +0200 (CEST) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Rx58G2DTWz15NS7; Thu, 28 Sep 2023 15:43:58 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 28 Sep 2023 15:46:14 +0800 From: Jie Hai To: , Gaetan Rivet CC: , Subject: [PATCH v2 5/8] net/failsafe: support getting queue information Date: Thu, 28 Sep 2023 15:43:02 +0800 Message-ID: <20230928074305.2991100-6-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230928074305.2991100-1-haijie1@huawei.com> References: <20230908112901.1169869-1-haijie1@huawei.com> <20230928074305.2991100-1-haijie1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500020.china.huawei.com (7.221.188.8) X-CFilter-Loop: Reflected 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 This patch adds support for querying Rx/Tx queue information. Signed-off-by: Jie Hai --- drivers/net/failsafe/failsafe_ops.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index 35649b6244a5..e84dbae5563c 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -1565,6 +1565,28 @@ fs_rss_hash_update(struct rte_eth_dev *dev, return 0; } +static void +fs_rxq_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id, + struct rte_eth_rxq_info *qinfo) +{ + struct rxq *rxq; + + rxq = dev->data->rx_queues[rx_queue_id]; + qinfo->nb_desc = rxq->info.nb_desc; + qinfo->conf.rx_deferred_start = rxq->info.conf.rx_deferred_start; +} + +static void +fs_txq_info_get(struct rte_eth_dev *dev, uint16_t tx_queue_id, + struct rte_eth_txq_info *qinfo) +{ + struct txq *txq; + + txq = dev->data->tx_queues[tx_queue_id]; + qinfo->nb_desc = txq->info.nb_desc; + qinfo->conf.tx_deferred_start = txq->info.conf.tx_deferred_start; +} + static int fs_flow_ops_get(struct rte_eth_dev *dev __rte_unused, const struct rte_flow_ops **ops) @@ -1604,6 +1626,8 @@ const struct eth_dev_ops failsafe_ops = { .tx_queue_release = fs_tx_queue_release, .rx_queue_intr_enable = fs_rx_intr_enable, .rx_queue_intr_disable = fs_rx_intr_disable, + .rxq_info_get = fs_rxq_info_get, + .txq_info_get = fs_txq_info_get, .flow_ctrl_get = fs_flow_ctrl_get, .flow_ctrl_set = fs_flow_ctrl_set, .mac_addr_remove = fs_mac_addr_remove, -- 2.30.0