This paper presents a novel unmanned aerial vehicle (UAV)-aided mobile edge computing (MEC) architecture for vehicular networks. It is considered that the vehicles should complete latencycritical computation-intensive tasks either locally with on-board computation units or by offloading part of their tasks to road side units (RSUs) with collocated MEC servers. In this direction, a hovering UAV can serve as an aerial RSU (ARSU) for task processing or act as an aerial relay and further offload the computation tasks to a ground RSU (GRSU). To significantly reduce the delay during data offloading and downloading, this architecture relies on the benefits of line-of-sight (LoS) massive multiple-input-multipleoutput (MIMO). Therefore, it is considered that the vehicles, the ARSU, and the GRSU employ large-scale antennas. A three-dimensional (3-D) geometrical representation of the MEC-enabled network is introduced and an optimization method is proposed that minimizes the computation-based and communication-based weighted total energy consumption (WTEC) of vehicles and ARSU subject to transmit power allocation, task allocation, and time slot scheduling. The results verify the theoretical derivations, emphasize on the effectiveness of the LoS massive MIMO transmission, and provide useful engineering insights.INDEX TERMS Computation offloading, energy efficiency, massive multiple-input multiple-output (MIMO), mobile edge computing (MEC), unmanned aerial vehicle (UAV), vehicular networks.