Re: [PATCH V4 00/13] x86/Hyper-V: Add Hyper-V Isolation VM support
From: Christoph Hellwig
Date: Thu Sep 02 2021 - 03:51:43 EST
On Tue, Aug 31, 2021 at 11:20:06PM +0800, Tianyu Lan wrote:
>> If so I suspect the best way to allocate them is by not using vmalloc
>> but just discontiguous pages, and then use kmap_local_pfn where the
>> PFN includes the share_gpa offset when actually copying from/to the
>> skbs.
>>
> When netvsc needs to copy packet data to send buffer, it needs to caculate
> position with section_index and send_section_size.
> Please seee netvsc_copy_to_send_buf() detail. So the contiguous virtual
> address of send buffer is necessary to copy data and batch packets.
Actually that makes the kmap approach much easier. The phys_to_virt
can just be replaced with a kmap_local_pfn and the unmap needs to
be added. I've been mostly focussing on the receive path, which
would need a similar treatment.