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 4BBC5424E7; Mon, 4 Sep 2023 07:00:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6ABEF402EC; Mon, 4 Sep 2023 06:58:15 +0200 (CEST) Received: from VLXDG1SPAM1.ramaxel.com (email.unionmem.com [221.4.138.186]) by mails.dpdk.org (Postfix) with ESMTP id CAE7C410D5 for ; Mon, 4 Sep 2023 06:58:05 +0200 (CEST) Received: from V12DG1MBS03.ramaxel.local ([172.26.18.33]) by VLXDG1SPAM1.ramaxel.com with ESMTP id 3844vJXL054297; Mon, 4 Sep 2023 12:57:19 +0800 (GMT-8) (envelope-from wanry@3snic.com) Received: from localhost.localdomain (10.64.136.151) by V12DG1MBS03.ramaxel.local (172.26.18.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.17; Mon, 4 Sep 2023 12:57:18 +0800 From: To: CC: , Renyong Wan , Steven Song Subject: [PATCH v5 27/32] net/sssnic: support dev queue info get Date: Mon, 4 Sep 2023 12:56:53 +0800 Message-ID: <20230904045658.238185-28-wanry@3snic.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230904045658.238185-1-wanry@3snic.com> References: <20230904045658.238185-1-wanry@3snic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Originating-IP: [10.64.136.151] X-ClientProxiedBy: V12DG1MBS03.ramaxel.local (172.26.18.33) To V12DG1MBS03.ramaxel.local (172.26.18.33) X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: VLXDG1SPAM1.ramaxel.com 3844vJXL054297 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 From: Renyong Wan Signed-off-by: Steven Song Signed-off-by: Renyong Wan --- drivers/net/sssnic/sssnic_ethdev.c | 2 ++ drivers/net/sssnic/sssnic_ethdev_rx.c | 13 +++++++++++++ drivers/net/sssnic/sssnic_ethdev_rx.h | 2 ++ drivers/net/sssnic/sssnic_ethdev_tx.c | 11 +++++++++++ drivers/net/sssnic/sssnic_ethdev_tx.h | 2 ++ 5 files changed, 30 insertions(+) diff --git a/drivers/net/sssnic/sssnic_ethdev.c b/drivers/net/sssnic/sssnic_ethdev.c index b086e91d2d..bde8d89ddc 100644 --- a/drivers/net/sssnic/sssnic_ethdev.c +++ b/drivers/net/sssnic/sssnic_ethdev.c @@ -777,6 +777,8 @@ static const struct eth_dev_ops sssnic_ethdev_ops = { .reta_update = sssnic_ethdev_rss_reta_update, .reta_query = sssnic_ethdev_rss_reta_query, .mtu_set = sssnic_ethdev_mtu_set, + .rxq_info_get = sssnic_ethdev_rx_queue_info_get, + .txq_info_get = sssnic_ethdev_tx_queue_info_get, }; static int diff --git a/drivers/net/sssnic/sssnic_ethdev_rx.c b/drivers/net/sssnic/sssnic_ethdev_rx.c index 2874a93a54..6c5f209262 100644 --- a/drivers/net/sssnic/sssnic_ethdev_rx.c +++ b/drivers/net/sssnic/sssnic_ethdev_rx.c @@ -1363,3 +1363,16 @@ sssnic_ethdev_rx_pkt_burst(void *rx_queue, struct rte_mbuf **rx_pkts, return nb_rx; } + +void +sssnic_ethdev_rx_queue_info_get(struct rte_eth_dev *ethdev, + uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo) +{ + struct sssnic_ethdev_rxq *rxq = ethdev->data->rx_queues[rx_queue_id]; + + qinfo->rx_buf_size = rxq->rx_buf_size; + qinfo->nb_desc = rxq->depth; + qinfo->queue_state = ethdev->data->rx_queue_state[rx_queue_id]; + qinfo->mp = rxq->mp; + qinfo->conf.rx_free_thresh = rxq->rx_free_thresh; +} diff --git a/drivers/net/sssnic/sssnic_ethdev_rx.h b/drivers/net/sssnic/sssnic_ethdev_rx.h index b0b35dee73..20e4d1ac0e 100644 --- a/drivers/net/sssnic/sssnic_ethdev_rx.h +++ b/drivers/net/sssnic/sssnic_ethdev_rx.h @@ -44,5 +44,7 @@ void sssnic_ethdev_rx_queue_stats_clear(struct rte_eth_dev *ethdev, uint16_t qid); uint16_t sssnic_ethdev_rx_pkt_burst(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); +void sssnic_ethdev_rx_queue_info_get(struct rte_eth_dev *ethdev, + uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo); #endif diff --git a/drivers/net/sssnic/sssnic_ethdev_tx.c b/drivers/net/sssnic/sssnic_ethdev_tx.c index 533befb6ea..51931df645 100644 --- a/drivers/net/sssnic/sssnic_ethdev_tx.c +++ b/drivers/net/sssnic/sssnic_ethdev_tx.c @@ -1110,3 +1110,14 @@ sssnic_ethdev_tx_pkt_burst(void *tx_queue, struct rte_mbuf **tx_pkts, return nb_tx; } + +void +sssnic_ethdev_tx_queue_info_get(struct rte_eth_dev *ethdev, + uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo) +{ + struct sssnic_ethdev_txq *txq = ethdev->data->tx_queues[tx_queue_id]; + + qinfo->nb_desc = txq->depth; + qinfo->queue_state = ethdev->data->tx_queue_state[tx_queue_id]; + qinfo->conf.tx_free_thresh = txq->tx_free_thresh; +} diff --git a/drivers/net/sssnic/sssnic_ethdev_tx.h b/drivers/net/sssnic/sssnic_ethdev_tx.h index 3a7cd47080..6130ade4d1 100644 --- a/drivers/net/sssnic/sssnic_ethdev_tx.h +++ b/drivers/net/sssnic/sssnic_ethdev_tx.h @@ -39,5 +39,7 @@ void sssnic_ethdev_tx_queue_stats_clear(struct rte_eth_dev *ethdev, uint16_t qid); uint16_t sssnic_ethdev_tx_pkt_burst(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +void sssnic_ethdev_tx_queue_info_get(struct rte_eth_dev *ethdev, + uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo); #endif /* _SSSNIC_ETHDEV_TX_H_ */ -- 2.27.0