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 5764E42417; Thu, 19 Jan 2023 13:37:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C23DF42D81; Thu, 19 Jan 2023 13:37:10 +0100 (CET) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 86DE9410DD for ; Thu, 19 Jan 2023 13:37:09 +0100 (CET) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4NyMTr4QJ6zJqGM; Thu, 19 Jan 2023 20:32:48 +0800 (CST) Received: from localhost.localdomain (10.50.163.32) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 19 Jan 2023 20:37:04 +0800 From: Chengwen Feng To: , , Maxime Coquelin , Chenbo Xia CC: Subject: [PATCH 1/2] net/virtio: support private dump Date: Thu, 19 Jan 2023 12:30:55 +0000 Message-ID: <20230119123056.14338-2-fengchengwen@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230119123056.14338-1-fengchengwen@huawei.com> References: <20230119123056.14338-1-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500024.china.huawei.com (7.185.36.10) 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 implements eth_dev_priv_dump callback which could use for debugging. Signed-off-by: Chengwen Feng --- drivers/net/virtio/virtio_ethdev.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 760ba4e368..0ad740b253 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1019,6 +1019,24 @@ virtio_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) return 0; } +static int +virtio_dev_priv_dump(struct rte_eth_dev *dev, FILE *f) +{ + struct virtio_hw *hw = dev->data->dev_private; + + fprintf(f, "guest_features: 0x%" PRIx64 "\n", hw->guest_features); + fprintf(f, "vtnet_hdr_size: %u\n", hw->vtnet_hdr_size); + fprintf(f, "use_vec: rx-%u tx-%u\n", hw->use_vec_rx, hw->use_vec_tx); + fprintf(f, "use_inorder: rx-%u tx-%u\n", hw->use_inorder_rx, hw->use_inorder_tx); + fprintf(f, "intr_lsc: %u\n", hw->intr_lsc); + fprintf(f, "max_mtu: %u\n", hw->max_mtu); + fprintf(f, "max_rx_pkt_len: %zu\n", hw->max_rx_pkt_len); + fprintf(f, "max_queue_pairs: %u\n", hw->max_queue_pairs); + fprintf(f, "req_guest_features: 0x%" PRIx64 "\n", hw->req_guest_features); + + return 0; +} + /* * dev_ops for virtio, bare necessities for basic operation */ @@ -1055,6 +1073,7 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { .mac_addr_remove = virtio_mac_addr_remove, .mac_addr_set = virtio_mac_addr_set, .get_monitor_addr = virtio_get_monitor_addr, + .eth_dev_priv_dump = virtio_dev_priv_dump, }; /* -- 2.17.1