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 1BCD741B9D; Wed, 1 Feb 2023 11:29:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00036427F5; Wed, 1 Feb 2023 11:29:26 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 46987427E9 for ; Wed, 1 Feb 2023 11:29:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675247364; 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=tharUAeKh1x1RkSnIs3WvuMHgpb7XfBMaoN8rG273bg=; b=PN1pl1Z9q/6HjytribK3TGiMk6YSn/XSc0DDw9LmM1enMTqa4jWBMgzstx+CdAvAzRT5C8 S5ahqAk/wuXpdgAsRCuDEq9e853r4+gdVEmEcPgh86Aea0RpwfP+ouUTTjke4MDMwngE5L 47GDTrPO0bjNITyUx95odGraWuQqAgI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-650-3bR9rKccP8SLZbdbZE6qFQ-1; Wed, 01 Feb 2023 05:29:23 -0500 X-MC-Unique: 3bR9rKccP8SLZbdbZE6qFQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08BA6101A521; Wed, 1 Feb 2023 10:29:23 +0000 (UTC) Received: from [10.39.208.22] (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 815372166B33; Wed, 1 Feb 2023 10:29:21 +0000 (UTC) Message-ID: <90207259-2f89-f236-be96-19b30de1d27e@redhat.com> Date: Wed, 1 Feb 2023 11:29:17 +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 2/2] net/vhost: 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-3-fengchengwen@huawei.com> From: Maxime Coquelin In-Reply-To: <20230119123056.14338-3-fengchengwen@huawei.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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/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 Reviewed-by: Maxime Coquelin Thanks, Maxime