diff mbox series

[BlueZ,v5,4/7] monitor: Fix not dequeing TX packet properly

Message ID 20230728224247.102057-4-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 77fb0ab5287c0cb2be2a3cfea00260eb0e649443
Headers show
Series [BlueZ,v5,1/7] monitor: Use gnuplot to plot graph of Latency-Packets | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Luiz Augusto von Dentz July 28, 2023, 10:42 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

num_completed_packets_evt contain a count for how many packets have been
completed per handle.
---
 monitor/packet.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/monitor/packet.c b/monitor/packet.c
index b905080edc60..badc9b9c7785 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -10406,6 +10406,7 @@  static void num_completed_packets_evt(struct timeval *tv, uint16_t index,
 	for (i = 0; i < evt->num_handles; i++) {
 		uint16_t handle;
 		uint16_t count;
+		int j;
 
 		if (!util_iov_pull_le16(&iov, &handle))
 			break;
@@ -10415,9 +10416,10 @@  static void num_completed_packets_evt(struct timeval *tv, uint16_t index,
 		if (!util_iov_pull_le16(&iov, &count))
 			break;
 
-		print_field("Count: %d", le16_to_cpu(evt->count));
+		print_field("Count: %d", count);
 
-		packet_dequeue_tx(tv, handle);
+		for (j = 0; j < count; j++)
+			packet_dequeue_tx(tv, handle);
 	}
 
 	if (iov.iov_len)