pub fn count_valid_packets(batches: &[PacketBatch]) -> usize