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 531F641B9D; Wed, 1 Feb 2023 11:29:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E6C884021F; Wed, 1 Feb 2023 11:29:21 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id C199740141 for ; Wed, 1 Feb 2023 11:29:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675247359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HweO3Z7Ucx6jIFzzW8b8ULJJjx7/Ot9lltdRxFDKu2o=; b=fwxTw26Zy/P3RLxOHTnIUMHwNTe9QuSugDrqCtUbJaHSjCw80nL1jTpVoCVNXnty+5rNtK EOSdR1Rc62jxuvq3JTvP8Nn/mmRDV3LyUb0D3UJd/Ky1diZK/A9zAF5O2eAKhEUkxaif3w bkSwxGv3Vq5eg+STio3LzmQ2aVas2Ds= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-NkQg7FjpNZWABc8cXj0tqw-1; Wed, 01 Feb 2023 05:29:13 -0500 X-MC-Unique: NkQg7FjpNZWABc8cXj0tqw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4D7231C04192; Wed, 1 Feb 2023 10:29:13 +0000 (UTC) Received: from [10.39.208.22] (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 232072026D4B; Wed, 1 Feb 2023 10:29:11 +0000 (UTC) Message-ID: Date: Wed, 1 Feb 2023 11:29:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 1/2] net/virtio: support private dump To: Chengwen Feng , thomas@monjalon.net, ferruh.yigit@amd.com, Chenbo Xia Cc: dev@dpdk.org References: <20230119123056.14338-1-fengchengwen@huawei.com> <20230119123056.14338-2-fengchengwen@huawei.com> From: Maxime Coquelin In-Reply-To: <20230119123056.14338-2-fengchengwen@huawei.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 1/19/23 13:30, Chengwen Feng wrote: > 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, > }; > > /* Reviewed-by: Maxime Coquelin Thanks, Maxime