RE: [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request()

2012-10-02 Thread Haiyang Zhang


> -Original Message-
> From: Dan Carpenter [mailto:dan.carpen...@oracle.com]
> Sent: Tuesday, October 02, 2012 4:39 AM
> To: Haiyang Zhang
> Cc: da...@davemloft.net; net...@vger.kernel.org; o...@aepfle.de;
> jasow...@redhat.com; linux-kernel@vger.kernel.org;
> de...@linuxdriverproject.org
> Subject: Re: [PATCH net, 3/3] hyperv: Fix page buffer handling in
> rndis_filter_send_request()
> 
> On Mon, Oct 01, 2012 at 03:30:57PM -0700, Haiyang Zhang wrote:
> > Add another page buffer if the request message crossed page boundary.
> >
> 
> What are the user visible effects of this bug fix?  Please put that
> in the commit message.

Will do.

Thanks,
- Haiyang


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request()

2012-10-02 Thread Dan Carpenter
On Mon, Oct 01, 2012 at 03:30:57PM -0700, Haiyang Zhang wrote:
> Add another page buffer if the request message crossed page boundary.
> 

What are the user visible effects of this bug fix?  Please put that
in the commit message.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request()

2012-10-02 Thread Dan Carpenter
On Mon, Oct 01, 2012 at 03:30:57PM -0700, Haiyang Zhang wrote:
 Add another page buffer if the request message crossed page boundary.
 

What are the user visible effects of this bug fix?  Please put that
in the commit message.

regards,
dan carpenter

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request()

2012-10-02 Thread Haiyang Zhang


 -Original Message-
 From: Dan Carpenter [mailto:dan.carpen...@oracle.com]
 Sent: Tuesday, October 02, 2012 4:39 AM
 To: Haiyang Zhang
 Cc: da...@davemloft.net; net...@vger.kernel.org; o...@aepfle.de;
 jasow...@redhat.com; linux-kernel@vger.kernel.org;
 de...@linuxdriverproject.org
 Subject: Re: [PATCH net, 3/3] hyperv: Fix page buffer handling in
 rndis_filter_send_request()
 
 On Mon, Oct 01, 2012 at 03:30:57PM -0700, Haiyang Zhang wrote:
  Add another page buffer if the request message crossed page boundary.
 
 
 What are the user visible effects of this bug fix?  Please put that
 in the commit message.

Will do.

Thanks,
- Haiyang


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH net,3/3] hyperv: Fix page buffer handling in rndis_filter_send_request()

2012-10-01 Thread Haiyang Zhang
Add another page buffer if the request message crossed page boundary.

Signed-off-by: Haiyang Zhang 
Reviewed-by: K. Y. Srinivasan 

---
 drivers/net/hyperv/rndis_filter.c |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/drivers/net/hyperv/rndis_filter.c 
b/drivers/net/hyperv/rndis_filter.c
index 2909dd8..1cd8d45 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -45,7 +45,9 @@ struct rndis_request {
 
/* Simplify allocation by having a netvsc packet inline */
struct hv_netvsc_packet pkt;
-   struct hv_page_buffer buf;
+   /* Set 2 pages for rndis requests crossing page boundary */
+   struct hv_page_buffer buf[2];
+
/* FIXME: We assumed a fixed size request here. */
struct rndis_message request_msg;
u8 ext[100];
@@ -221,6 +223,18 @@ static int rndis_filter_send_request(struct rndis_device 
*dev,
packet->page_buf[0].offset =
(unsigned long)>request_msg & (PAGE_SIZE - 1);
 
+   /* Add one page_buf when request_msg crossing page boundary */
+   if (packet->page_buf[0].offset + packet->page_buf[0].len > PAGE_SIZE) {
+   packet->page_buf_cnt++;
+   packet->page_buf[0].len = PAGE_SIZE -
+   packet->page_buf[0].offset;
+   packet->page_buf[1].pfn = virt_to_phys((void *)>request_msg
+   + packet->page_buf[0].len) >> PAGE_SHIFT;
+   packet->page_buf[1].offset = 0;
+   packet->page_buf[1].len = req->request_msg.msg_len -
+   packet->page_buf[0].len;
+   }
+
packet->completion.send.send_completion_ctx = req;/* packet; */
packet->completion.send.send_completion =
rndis_filter_send_request_completion;
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH net,3/3] hyperv: Fix page buffer handling in rndis_filter_send_request()

2012-10-01 Thread Haiyang Zhang
Add another page buffer if the request message crossed page boundary.

Signed-off-by: Haiyang Zhang haiya...@microsoft.com
Reviewed-by: K. Y. Srinivasan k...@microsoft.com

---
 drivers/net/hyperv/rndis_filter.c |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/drivers/net/hyperv/rndis_filter.c 
b/drivers/net/hyperv/rndis_filter.c
index 2909dd8..1cd8d45 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -45,7 +45,9 @@ struct rndis_request {
 
/* Simplify allocation by having a netvsc packet inline */
struct hv_netvsc_packet pkt;
-   struct hv_page_buffer buf;
+   /* Set 2 pages for rndis requests crossing page boundary */
+   struct hv_page_buffer buf[2];
+
/* FIXME: We assumed a fixed size request here. */
struct rndis_message request_msg;
u8 ext[100];
@@ -221,6 +223,18 @@ static int rndis_filter_send_request(struct rndis_device 
*dev,
packet-page_buf[0].offset =
(unsigned long)req-request_msg  (PAGE_SIZE - 1);
 
+   /* Add one page_buf when request_msg crossing page boundary */
+   if (packet-page_buf[0].offset + packet-page_buf[0].len  PAGE_SIZE) {
+   packet-page_buf_cnt++;
+   packet-page_buf[0].len = PAGE_SIZE -
+   packet-page_buf[0].offset;
+   packet-page_buf[1].pfn = virt_to_phys((void *)req-request_msg
+   + packet-page_buf[0].len)  PAGE_SHIFT;
+   packet-page_buf[1].offset = 0;
+   packet-page_buf[1].len = req-request_msg.msg_len -
+   packet-page_buf[0].len;
+   }
+
packet-completion.send.send_completion_ctx = req;/* packet; */
packet-completion.send.send_completion =
rndis_filter_send_request_completion;
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/