Re: [RFC v2 07/11] hv_netvsc: Use HV_HYP_PAGE_SIZE for Hyper-V communication

From: Boqun Feng
Date: Sun Sep 06 2020 - 20:09:31 EST


On Sat, Sep 05, 2020 at 12:30:48AM +0000, Michael Kelley wrote:
> From: Boqun Feng <boqun.feng@xxxxxxxxx> Sent: Tuesday, September 1, 2020 8:01 PM
[...]
> > struct rndis_request {
> > struct list_head list_ent;
> > struct completion wait_event;
> > @@ -215,18 +215,18 @@ static int rndis_filter_send_request(struct rndis_device *dev,
> > packet->page_buf_cnt = 1;
> >
> > pb[0].pfn = virt_to_phys(&req->request_msg) >>
> > - PAGE_SHIFT;
> > + HV_HYP_PAGE_SHIFT;
> > pb[0].len = req->request_msg.msg_len;
> > pb[0].offset =
> > - (unsigned long)&req->request_msg & (PAGE_SIZE - 1);
> > + (unsigned long)&req->request_msg & (HV_HYP_PAGE_SIZE - 1);
>
> Use offset_in_hvpage() as defined in patch 6 of the series?
>

Fair enough, I will use offset_in_hvpage() in the next version

Regards,
Boqun

> >
> > /* Add one page_buf when request_msg crossing page boundary */
> > - if (pb[0].offset + pb[0].len > PAGE_SIZE) {
> > + if (pb[0].offset + pb[0].len > HV_HYP_PAGE_SIZE) {
> > packet->page_buf_cnt++;
> > - pb[0].len = PAGE_SIZE -
> > + pb[0].len = HV_HYP_PAGE_SIZE -
> > pb[0].offset;
> > pb[1].pfn = virt_to_phys((void *)&req->request_msg
> > - + pb[0].len) >> PAGE_SHIFT;
> > + + pb[0].len) >> HV_HYP_PAGE_SHIFT;
> > pb[1].offset = 0;
> > pb[1].len = req->request_msg.msg_len -
> > pb[0].len;
> > --
> > 2.28.0
>