netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next,1/2] hyperv: Add a check for ring_size value
@ 2012-07-25 18:08 Haiyang Zhang
  2012-07-25 18:08 ` [PATCH net-next,2/2] hyperv: Add error handling to rndis_filter_device_add() Haiyang Zhang
  2012-07-25 22:48 ` [PATCH net-next,1/2] hyperv: Add a check for ring_size value David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Haiyang Zhang @ 2012-07-25 18:08 UTC (permalink / raw)
  To: davem, netdev; +Cc: haiyangz, kys, olaf, linux-kernel, devel

It prevents ring_size being set to a too small value.

Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/net/hyperv/netvsc_drv.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 8e23c08..8c5a1c4 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -47,7 +47,7 @@ struct net_device_context {
 	struct work_struct work;
 };
 
-
+#define RING_SIZE_MIN 64
 static int ring_size = 128;
 module_param(ring_size, int, S_IRUGO);
 MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
@@ -518,6 +518,11 @@ static void __exit netvsc_drv_exit(void)
 
 static int __init netvsc_drv_init(void)
 {
+	if (ring_size < RING_SIZE_MIN) {
+		ring_size = RING_SIZE_MIN;
+		pr_info("Increased ring_size to %d (min allowed)\n",
+			ring_size);
+	}
 	return vmbus_driver_register(&netvsc_drv);
 }
 
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next,2/2] hyperv: Add error handling to rndis_filter_device_add()
  2012-07-25 18:08 [PATCH net-next,1/2] hyperv: Add a check for ring_size value Haiyang Zhang
@ 2012-07-25 18:08 ` Haiyang Zhang
  2012-07-25 22:49   ` David Miller
  2012-07-25 22:48 ` [PATCH net-next,1/2] hyperv: Add a check for ring_size value David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Haiyang Zhang @ 2012-07-25 18:08 UTC (permalink / raw)
  To: davem, netdev; +Cc: haiyangz, kys, olaf, linux-kernel, devel

Reported-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/net/hyperv/rndis_filter.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index fbf5394..e5d6146 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -804,18 +804,15 @@ int rndis_filter_device_add(struct hv_device *dev,
 	/* Send the rndis initialization message */
 	ret = rndis_filter_init_device(rndis_device);
 	if (ret != 0) {
-		/*
-		 * TODO: If rndis init failed, we will need to shut down the
-		 * channel
-		 */
+		rndis_filter_device_remove(dev);
+		return ret;
 	}
 
 	/* Get the mac address */
 	ret = rndis_filter_query_device_mac(rndis_device);
 	if (ret != 0) {
-		/*
-		 * TODO: shutdown rndis device and the channel
-		 */
+		rndis_filter_device_remove(dev);
+		return ret;
 	}
 
 	memcpy(device_info->mac_adr, rndis_device->hw_mac_adr, ETH_ALEN);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next,1/2] hyperv: Add a check for ring_size value
  2012-07-25 18:08 [PATCH net-next,1/2] hyperv: Add a check for ring_size value Haiyang Zhang
  2012-07-25 18:08 ` [PATCH net-next,2/2] hyperv: Add error handling to rndis_filter_device_add() Haiyang Zhang
@ 2012-07-25 22:48 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2012-07-25 22:48 UTC (permalink / raw)
  To: haiyangz; +Cc: netdev, kys, olaf, linux-kernel, devel

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Wed, 25 Jul 2012 11:08:41 -0700

> It prevents ring_size being set to a too small value.
> 
> Reported-by: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next,2/2] hyperv: Add error handling to rndis_filter_device_add()
  2012-07-25 18:08 ` [PATCH net-next,2/2] hyperv: Add error handling to rndis_filter_device_add() Haiyang Zhang
@ 2012-07-25 22:49   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-07-25 22:49 UTC (permalink / raw)
  To: haiyangz; +Cc: netdev, olaf, linux-kernel, devel

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Wed, 25 Jul 2012 11:08:42 -0700

> Reported-by: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-25 22:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-25 18:08 [PATCH net-next,1/2] hyperv: Add a check for ring_size value Haiyang Zhang
2012-07-25 18:08 ` [PATCH net-next,2/2] hyperv: Add error handling to rndis_filter_device_add() Haiyang Zhang
2012-07-25 22:49   ` David Miller
2012-07-25 22:48 ` [PATCH net-next,1/2] hyperv: Add a check for ring_size value David Miller

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).