* [PATCH net, 1/3] hyperv: Fix the max_xfer_size in RNDIS initialization
@ 2012-10-01 22:30 Haiyang Zhang
2012-10-01 22:30 ` [PATCH net, 2/3] hyperv: Fix the missing return value in rndis_filter_set_packet_filter() Haiyang Zhang
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Haiyang Zhang @ 2012-10-01 22:30 UTC (permalink / raw)
To: davem, netdev; +Cc: olaf, jasowang, linux-kernel, devel, haiyangz
According to RNDIS specs, Windows sets this size to
0x4000. I use the same value here.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/net/hyperv/rndis_filter.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 1e88a10..3cb7486 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -678,8 +678,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
init = &request->request_msg.msg.init_req;
init->major_ver = RNDIS_MAJOR_VERSION;
init->minor_ver = RNDIS_MINOR_VERSION;
- /* FIXME: Use 1536 - rounded ethernet frame size */
- init->max_xfer_size = 2048;
+ init->max_xfer_size = 0x4000;
dev->state = RNDIS_DEV_INITIALIZING;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net, 2/3] hyperv: Fix the missing return value in rndis_filter_set_packet_filter()
2012-10-01 22:30 [PATCH net, 1/3] hyperv: Fix the max_xfer_size in RNDIS initialization Haiyang Zhang
@ 2012-10-01 22:30 ` Haiyang Zhang
2012-10-01 22:30 ` [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request() Haiyang Zhang
2012-10-01 22:39 ` [PATCH net,1/3] hyperv: Fix the max_xfer_size in RNDIS initialization David Miller
2 siblings, 0 replies; 7+ messages in thread
From: Haiyang Zhang @ 2012-10-01 22:30 UTC (permalink / raw)
To: davem, netdev; +Cc: olaf, jasowang, linux-kernel, devel, haiyangz
Return ETIMEDOUT when the reply message is not received in time.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/net/hyperv/rndis_filter.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 3cb7486..2909dd8 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -641,6 +641,7 @@ int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter)
if (t == 0) {
netdev_err(ndev,
"timeout before we got a set response...\n");
+ ret = -ETIMEDOUT;
/*
* We can't deallocate the request since we may still receive a
* send completion for it.
--
1.7.4.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request()
2012-10-01 22:30 [PATCH net, 1/3] hyperv: Fix the max_xfer_size in RNDIS initialization Haiyang Zhang
2012-10-01 22:30 ` [PATCH net, 2/3] hyperv: Fix the missing return value in rndis_filter_set_packet_filter() Haiyang Zhang
@ 2012-10-01 22:30 ` Haiyang Zhang
2012-10-02 8:38 ` Dan Carpenter
2012-10-01 22:39 ` [PATCH net,1/3] hyperv: Fix the max_xfer_size in RNDIS initialization David Miller
2 siblings, 1 reply; 7+ messages in thread
From: Haiyang Zhang @ 2012-10-01 22:30 UTC (permalink / raw)
To: davem, netdev; +Cc: olaf, jasowang, linux-kernel, devel, haiyangz
Add another page buffer if the request message crossed page boundary.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request()
2012-10-01 22:30 ` [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request() Haiyang Zhang
@ 2012-10-02 8:38 ` Dan Carpenter
2012-10-02 14:28 ` Haiyang Zhang
0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2012-10-02 8:38 UTC (permalink / raw)
To: Haiyang Zhang; +Cc: olaf, netdev, jasowang, linux-kernel, devel, davem
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request()
2012-10-02 8:38 ` Dan Carpenter
@ 2012-10-02 14:28 ` Haiyang Zhang
0 siblings, 0 replies; 7+ messages in thread
From: Haiyang Zhang @ 2012-10-02 14:28 UTC (permalink / raw)
To: Dan Carpenter
Cc: olaf@aepfle.de, netdev@vger.kernel.org, jasowang@redhat.com,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
davem@davemloft.net
> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Tuesday, October 02, 2012 4:39 AM
> To: Haiyang Zhang
> Cc: davem@davemloft.net; netdev@vger.kernel.org; olaf@aepfle.de;
> jasowang@redhat.com; linux-kernel@vger.kernel.org;
> devel@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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net,1/3] hyperv: Fix the max_xfer_size in RNDIS initialization
2012-10-01 22:30 [PATCH net, 1/3] hyperv: Fix the max_xfer_size in RNDIS initialization Haiyang Zhang
2012-10-01 22:30 ` [PATCH net, 2/3] hyperv: Fix the missing return value in rndis_filter_set_packet_filter() Haiyang Zhang
2012-10-01 22:30 ` [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request() Haiyang Zhang
@ 2012-10-01 22:39 ` David Miller
2012-10-02 2:07 ` Haiyang Zhang
2 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2012-10-01 22:39 UTC (permalink / raw)
To: haiyangz; +Cc: netdev, kys, olaf, jasowang, linux-kernel, devel
These patches do not apply cleanly to the current net-next tree
which is the only place where patches should be targetted right
now.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH net,1/3] hyperv: Fix the max_xfer_size in RNDIS initialization
2012-10-01 22:39 ` [PATCH net,1/3] hyperv: Fix the max_xfer_size in RNDIS initialization David Miller
@ 2012-10-02 2:07 ` Haiyang Zhang
0 siblings, 0 replies; 7+ messages in thread
From: Haiyang Zhang @ 2012-10-02 2:07 UTC (permalink / raw)
To: David Miller
Cc: netdev@vger.kernel.org, KY Srinivasan, olaf@aepfle.de,
jasowang@redhat.com, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org
________________________________________
> From: David Miller [davem@davemloft.net]
> Sent: Monday, October 01, 2012 6:39 PM
> To: Haiyang Zhang
> Cc: netdev@vger.kernel.org; KY Srinivasan; olaf@aepfle.de; jasowang@redhat.com; linux-kernel@vger.kernel.org; devel@linuxdriverproject.org
> Subject: Re: [PATCH net,1/3] hyperv: Fix the max_xfer_size in RNDIS initialization
> These patches do not apply cleanly to the current net-next tree
> which is the only place where patches should be targetted right
> now.
I will rebase the patch set to the net-next tree soon.
Thanks,
- Haiyang
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-10-02 14:28 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-01 22:30 [PATCH net, 1/3] hyperv: Fix the max_xfer_size in RNDIS initialization Haiyang Zhang
2012-10-01 22:30 ` [PATCH net, 2/3] hyperv: Fix the missing return value in rndis_filter_set_packet_filter() Haiyang Zhang
2012-10-01 22:30 ` [PATCH net, 3/3] hyperv: Fix page buffer handling in rndis_filter_send_request() Haiyang Zhang
2012-10-02 8:38 ` Dan Carpenter
2012-10-02 14:28 ` Haiyang Zhang
2012-10-01 22:39 ` [PATCH net,1/3] hyperv: Fix the max_xfer_size in RNDIS initialization David Miller
2012-10-02 2:07 ` Haiyang Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).