monitor: Fix not dequeing TX packet properly
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 28 Jul 2023 21:24:41 +0000 (14:24 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 13:34:03 +0000 (19:04 +0530)
num_completed_packets_evt contain a count for how many packets have been
completed per handle.

monitor/packet.c

index a56a678..fed51ea 100755 (executable)
@@ -10412,6 +10412,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;
@@ -10421,9 +10422,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)