From patchwork Sat Sep 30 01:00:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Ignatov X-Patchwork-Id: 132249 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 5FF044267B; Sat, 30 Sep 2023 03:01:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D208B40268; Sat, 30 Sep 2023 03:01:24 +0200 (CEST) Received: from rn-mailsvcp-mx-lapp01.apple.com (rn-mailsvcp-mx-lapp01.apple.com [17.179.253.22]) by mails.dpdk.org (Postfix) with ESMTP id CACF340156 for ; Sat, 30 Sep 2023 03:01:23 +0200 (CEST) Received: from rn-mailsvcp-mta-lapp01.rno.apple.com (rn-mailsvcp-mta-lapp01.rno.apple.com [10.225.203.149]) by rn-mailsvcp-mx-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0S1R00DYPXIAQD40@rn-mailsvcp-mx-lapp01.rno.apple.com> for dev@dpdk.org; Fri, 29 Sep 2023 18:01:23 -0700 (PDT) X-Proofpoint-GUID: l4n7corkdjr20yRgJFancclvoLr8WIdX X-Proofpoint-ORIG-GUID: l4n7corkdjr20yRgJFancclvoLr8WIdX X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.619, 18.0.980 definitions=2023-09-29_21:2023-09-28, 2023-09-29 signatures=0 X-Proofpoint-Spam-Details: rule=interactive_user_notspam policy=interactive_user score=0 mlxscore=0 phishscore=0 adultscore=0 malwarescore=0 mlxlogscore=819 bulkscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309300006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=20180706; bh=iZhLpndfl7ZhpjAyO5zYZM9zxMoeQQK3f4qee5f2q50=; b=X3BsaqXZxY89INDRKVOak9vBSHv8oCbmzYcC2wx8jGrigbWCQ6y2/wfj5o496f0JBOMd 3nCV9oxfJpit1FkzNrYf+n649DCNMSsjymLueLBaXeC9MNG6lauQUdyBJo14nf/obnYI OXLkxCDFZ0tV0ImlUL4Kq9D4v6kL7zCftX3j4h1f8uw6EQbYxeYyZNQ/rdHsodxfdP/8 YFr19JLzYJmstlhtqyPTYnt2/ENLiQFdiAMXecdk6ypzFVgqYznalsY3TA69sDhwbGYv fv4jekKZmMyz84s+ZJcBA4psxHI8sbSiZLVR25aY7Tac0r21+TvJb53iPljeAkRkqnlm sw== Received: from rn-mailsvcp-mmp-lapp01.rno.apple.com (rn-mailsvcp-mmp-lapp01.rno.apple.com [17.179.253.14]) by rn-mailsvcp-mta-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPS id <0S1R00R83XIAEIN0@rn-mailsvcp-mta-lapp01.rno.apple.com>; Fri, 29 Sep 2023 18:01:22 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp01.rno.apple.com by rn-mailsvcp-mmp-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) id <0S1R00L00X15DY00@rn-mailsvcp-mmp-lapp01.rno.apple.com>; Fri, 29 Sep 2023 18:01:22 -0700 (PDT) X-Va-A: X-Va-T-CD: 890ecbe268e4da4a9b8ebf5646b77237 X-Va-E-CD: 280b9b926dbacefa91ba9c877bba08ef X-Va-R-CD: bec4b1bf10f980605dac9c6d17de9312 X-Va-ID: 3a769997-baea-465e-b3b0-acda675daa5c X-Va-CD: 0 X-V-A: X-V-T-CD: 890ecbe268e4da4a9b8ebf5646b77237 X-V-E-CD: 280b9b926dbacefa91ba9c877bba08ef X-V-R-CD: bec4b1bf10f980605dac9c6d17de9312 X-V-ID: 5af44de5-5c11-4d65-a318-708f5df763d1 X-V-CD: 0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.619, 18.0.980 definitions=2023-09-29_21:2023-09-28, 2023-09-29 signatures=0 Received: from localhost (unknown [17.192.171.171]) by rn-mailsvcp-mmp-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.23.20230328 64bit (built Mar 28 2023)) with ESMTPSA id <0S1R00CITXIAQC00@rn-mailsvcp-mmp-lapp01.rno.apple.com>; Fri, 29 Sep 2023 18:01:22 -0700 (PDT) From: Andrey Ignatov To: dev@dpdk.org Cc: Maxime Coquelin , Chenbo Xia , Wei Shen , Andrey Ignatov Subject: [PATCH] net/vhost: report TX errors in port stats Date: Fri, 29 Sep 2023 18:00:24 -0700 Message-id: <20230930010024.34377-1-rdna@apple.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) MIME-version: 1.0 Content-transfer-encoding: 8bit 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 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 Reviewed-by: Maxime Coquelin --- 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; }