From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HK_RANDOM_FROM,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E97A0C10F14 for ; Thu, 10 Oct 2019 14:41:32 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 81A77208C3 for ; Thu, 10 Oct 2019 14:41:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81A77208C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 497ED1EAB9; Thu, 10 Oct 2019 16:40:44 +0200 (CEST) Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by dpdk.org (Postfix) with ESMTP id 496181EA05 for ; Thu, 10 Oct 2019 16:40:39 +0200 (CEST) Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9DF48BBC41963689A87A for ; Thu, 10 Oct 2019 22:40:37 +0800 (CST) Received: from tester.localdomain (10.175.119.39) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Thu, 10 Oct 2019 22:40:28 +0800 From: Xiaoyun wang To: CC: , , , , , , Xiaoyun wang Date: Thu, 10 Oct 2019 22:52:03 +0800 Message-ID: X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.119.39] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v4 19/19] net/hinic: add support for getting rxq or txq info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" This patch adds support for getting rxq or txq info. Signed-off-by: Xiaoyun wang --- drivers/net/hinic/hinic_pmd_ethdev.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c index 54b9b49..9f37a40 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.c +++ b/drivers/net/hinic/hinic_pmd_ethdev.c @@ -53,6 +53,11 @@ #define HINIC_MIN_RX_BUF_SIZE 1024 #define HINIC_MAX_UC_MAC_ADDRS 128 #define HINIC_MAX_MC_MAC_ADDRS 2048 + +#define HINIC_DEFAULT_BURST_SIZE 32 +#define HINIC_DEFAULT_NB_QUEUES 1 +#define HINIC_DEFAULT_RING_SIZE 1024 + /* * vlan_id is a 12 bit number. * The VFTA array is actually a 4096 bit array, 128 of 32bit elements. @@ -753,6 +758,14 @@ static void hinic_get_speed_capa(struct rte_eth_dev *dev, uint32_t *speed_capa) info->rx_desc_lim = hinic_rx_desc_lim; info->tx_desc_lim = hinic_tx_desc_lim; + /* Driver-preferred Rx/Tx parameters */ + info->default_rxportconf.burst_size = HINIC_DEFAULT_BURST_SIZE; + info->default_txportconf.burst_size = HINIC_DEFAULT_BURST_SIZE; + info->default_rxportconf.nb_queues = HINIC_DEFAULT_NB_QUEUES; + info->default_txportconf.nb_queues = HINIC_DEFAULT_NB_QUEUES; + info->default_rxportconf.ring_size = HINIC_DEFAULT_RING_SIZE; + info->default_txportconf.ring_size = HINIC_DEFAULT_RING_SIZE; + return 0; } @@ -2157,6 +2170,23 @@ static int hinic_dev_xstats_get(struct rte_eth_dev *dev, return count; } +static void hinic_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_rxq_info *qinfo) +{ + struct hinic_rxq *rxq = dev->data->rx_queues[queue_id]; + + qinfo->mp = rxq->mb_pool; + qinfo->nb_desc = rxq->q_depth; +} + +static void hinic_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, + struct rte_eth_txq_info *qinfo) +{ + struct hinic_txq *txq = dev->data->tx_queues[queue_id]; + + qinfo->nb_desc = txq->q_depth; +} + /** * DPDK callback to retrieve names of extended device statistics * @@ -2873,6 +2903,8 @@ static void hinic_dev_close(struct rte_eth_dev *dev) .xstats_get = hinic_dev_xstats_get, .xstats_reset = hinic_dev_xstats_reset, .xstats_get_names = hinic_dev_xstats_get_names, + .rxq_info_get = hinic_rxq_info_get, + .txq_info_get = hinic_txq_info_get, .mac_addr_set = hinic_set_mac_addr, .mac_addr_remove = hinic_mac_addr_remove, .mac_addr_add = hinic_mac_addr_add, @@ -2906,6 +2938,8 @@ static void hinic_dev_close(struct rte_eth_dev *dev) .xstats_get = hinic_dev_xstats_get, .xstats_reset = hinic_dev_xstats_reset, .xstats_get_names = hinic_dev_xstats_get_names, + .rxq_info_get = hinic_rxq_info_get, + .txq_info_get = hinic_txq_info_get, .mac_addr_set = hinic_set_mac_addr, .mac_addr_remove = hinic_mac_addr_remove, .mac_addr_add = hinic_mac_addr_add, -- 1.8.3.1