From patchwork Thu Jan 19 12:30:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fengchengwen X-Patchwork-Id: 122352 X-Patchwork-Delegate: maxime.coquelin@redhat.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 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 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 Reviewed-by: Maxime Coquelin --- 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, }; /* From patchwork Thu Jan 19 12:30:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fengchengwen X-Patchwork-Id: 122351 X-Patchwork-Delegate: maxime.coquelin@redhat.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 9D88A42417; Thu, 19 Jan 2023 13:37:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E088C41143; Thu, 19 Jan 2023 13:37:09 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id B475240223 for ; Thu, 19 Jan 2023 13:37:07 +0100 (CET) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NyMY76zPzzJrSl; Thu, 19 Jan 2023 20:35:39 +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 2/2] net/vhost: support private dump Date: Thu, 19 Jan 2023 12:30:56 +0000 Message-ID: <20230119123056.14338-3-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 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 Reviewed-by: Maxime Coquelin --- drivers/net/vhost/rte_eth_vhost.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index b152279fac..9c609b45a3 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -1484,6 +1484,26 @@ vhost_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc) return 0; } +static int +vhost_dev_priv_dump(struct rte_eth_dev *dev, FILE *f) +{ + struct pmd_internal *internal = dev->data->dev_private; + + fprintf(f, "iface_name: %s\n", internal->iface_name); + fprintf(f, "flags: 0x%" PRIx64 "\n", internal->flags); + fprintf(f, "disable_flags: 0x%" PRIx64 "\n", internal->disable_flags); + fprintf(f, "features: 0x%" PRIx64 "\n", internal->features); + fprintf(f, "max_queues: %u\n", internal->max_queues); + fprintf(f, "vid: %d\n", internal->vid); + fprintf(f, "started: %d\n", rte_atomic32_read(&internal->started)); + fprintf(f, "dev_attached: %d\n", rte_atomic32_read(&internal->dev_attached)); + fprintf(f, "vlan_strip: %d\n", internal->vlan_strip); + fprintf(f, "rx_sw_csum: %d\n", internal->rx_sw_csum); + fprintf(f, "tx_sw_csum: %d\n", internal->tx_sw_csum); + + return 0; +} + static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop, @@ -1504,6 +1524,7 @@ static const struct eth_dev_ops ops = { .rx_queue_intr_enable = eth_rxq_intr_enable, .rx_queue_intr_disable = eth_rxq_intr_disable, .get_monitor_addr = vhost_get_monitor_addr, + .eth_dev_priv_dump = vhost_dev_priv_dump, }; static int