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 880B24234F; Thu, 12 Oct 2023 15:49:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 741BF4064C; Thu, 12 Oct 2023 15:49:26 +0200 (CEST) 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 0641F402C9 for ; Thu, 12 Oct 2023 15:49:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697118564; 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=G7mbrD7cuVKYDFcdZ+l9IS2nkBA/2vYAvM9ftzyaBI4=; b=aeDfXRZzZt4Tqvr5YfGNvSDPGr9Vv8Oiq70XJjHkIF1iXfU+UVPNHuUb7sRNQQJLppjz/H W+DlMIppFxS/Z0KkAPJv2AjtEqMlB8oPZx13bSBizzEOZAWS2kVaFsGI6b1kV6Tq7KQDNE RORCNkfGxkwL0WaPdKk8yLsIibsO9NI= Received: from mimecast-mx02.redhat.com (mx-ext.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-286-u_7oM11nOianP-tMwd8wIg-1; Thu, 12 Oct 2023 09:49:16 -0400 X-MC-Unique: u_7oM11nOianP-tMwd8wIg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A1B931C0152D; Thu, 12 Oct 2023 13:49:15 +0000 (UTC) Received: from [10.39.208.36] (unknown [10.39.208.36]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC66EC1598A; Thu, 12 Oct 2023 13:49:12 +0000 (UTC) Message-ID: <6548fb9c-3f01-8616-036f-040186ff2b69@redhat.com> Date: Thu, 12 Oct 2023 15:49:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] net/vhost: report TX errors in port stats To: Andrey Ignatov , dev@dpdk.org Cc: Chenbo Xia , Wei Shen References: <20230930010024.34377-1-rdna@apple.com> From: Maxime Coquelin In-Reply-To: <20230930010024.34377-1-rdna@apple.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 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 9/30/23 03:00, Andrey Ignatov wrote: > vhost device doesn't report TX errors what complicates debugging of > dropped packets. Add oerrors to port stats. > > - before (testpmd `show port stats`): > TX-packets: 18328512 TX-errors: 0 TX-bytes: 1173024768 > > - after: > TX-packets: 1737728 TX-errors: 131367616 TX-bytes: 111214592 > > Signed-off-by: Andrey Ignatov > --- > drivers/net/vhost/rte_eth_vhost.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c > index 8d37ec9775..48a9a79efe 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -1299,6 +1299,7 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) > unsigned i; > unsigned long rx_total = 0, tx_total = 0; > unsigned long rx_total_bytes = 0, tx_total_bytes = 0; > + unsigned long tx_total_errors = 0; > struct vhost_queue *vq; > > for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS && > @@ -1323,12 +1324,15 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) > > stats->q_obytes[i] = vq->stats.bytes; > tx_total_bytes += stats->q_obytes[i]; > + > + tx_total_errors += vq->stats.missed_pkts; > } > > stats->ipackets = rx_total; > stats->opackets = tx_total; > stats->ibytes = rx_total_bytes; > stats->obytes = tx_total_bytes; > + stats->oerrors = tx_total_errors; > > return 0; > } Applied to nex-virtio/for-next-net. Thanks, Maxime