From patchwork Fri Sep 1 03:28:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renyong Wan X-Patchwork-Id: 131036 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DFCF742219; Fri, 1 Sep 2023 05:32:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 86B7640E13; Fri, 1 Sep 2023 05:29:52 +0200 (CEST) Received: from VLXDG1SPAM1.ramaxel.com (email.ramaxel.com [221.4.138.186]) by mails.dpdk.org (Postfix) with ESMTP id D180840A6C for ; Fri, 1 Sep 2023 05:29:44 +0200 (CEST) Received: from V12DG1MBS03.ramaxel.local ([172.26.18.33]) by VLXDG1SPAM1.ramaxel.com with ESMTP id 3813T2N1033389; Fri, 1 Sep 2023 11:29:02 +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; Fri, 1 Sep 2023 11:29:01 +0800 From: To: CC: , Renyong Wan , Steven Song Subject: [PATCH v3 27/32] net/sssnic: support dev queue info get Date: Fri, 1 Sep 2023 11:28:37 +0800 Message-ID: <20230901032842.223547-28-wanry@3snic.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230901032842.223547-1-wanry@3snic.com> References: <20230901032842.223547-1-wanry@3snic.com> MIME-Version: 1.0 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 3813T2N1033389 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 6fed0a85c2..cc0de9aa50 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_ */