* Re: Hyper-V TODO file
From: Greg KH @ 2011-09-01 20:30 UTC (permalink / raw)
To: K. Y. Srinivasan; +Cc: gregkh, linux-kernel, devel, virtualization
In-Reply-To: <20110901202733.GA15185@kroah.com>
On Thu, Sep 01, 2011 at 01:27:33PM -0700, Greg KH wrote:
> On Wed, Aug 31, 2011 at 03:16:51PM -0700, K. Y. Srinivasan wrote:
> > 2) With your help, we have fixed all of the issues related to these drivers
> > conforming to the Linux Device Driver model. One of the TODO work items is
> > "audit the vmbus to verify it is working properly with the driver model".
>
> I have a few comments about this, I'll respond in another email.
Ok, it looks a _lot_ better, but I have a few minor nits, and one larger
one:
- rename the vmbus_child_* functions to vmbus_* as there's no need to
think of "children" here.
- vmbus_onoffer comment is incorrect. You handle offers from lots of
other types. Or if not, am I reading the code incorrectly?
- the static hv_cb_utils array needs to go away. In the hv_utils.c
util_probe() call, properly register the channel callback, and the
same goes for the util_remove() call, unregister things there.
Note, you can use the driver_data field to determine exactly which
callback needs to be registered to make things easy. Something like
the following (pseudo code only):
static const struct hv_vmbus_device_id id_table[] = {
/* Shutdown guid */
{ VMBUS_DEVICE(0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB),
.driver_data = &shutdown_onchannelcallback },
....
};
util_probe(struct hv_device *dev, const struct hv_vmbus_device_id *id)
[ Yes, you will have to change the probe callback signature, but that's fine. ]
{
void *fn(void *context);
u8 *buffer;
fn = id->driver_data;
buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
/* Hook up callback and buffer with a call to the proper vmbus
* function
*/
...
}
util_remove()
{
/* undo what you did in util_probe(), unhooking the callback and
* freeing the data */
}
Does that make any sense?
thanks,
greg k-h
^ permalink raw reply
* Re: Hyper-V TODO file
From: Greg KH @ 2011-09-01 20:27 UTC (permalink / raw)
To: K. Y. Srinivasan; +Cc: gregkh, linux-kernel, devel, virtualization
In-Reply-To: <1314829011-28922-1-git-send-email-kys@microsoft.com>
On Wed, Aug 31, 2011 at 03:16:51PM -0700, K. Y. Srinivasan wrote:
>
> Greg,
>
> The TODO file for Hyper-V drivers has not been updated in a while and does
> not reflect the current state of these drivers:
>
> 1) There are no more checkpatch warnings/errors in this code. One of the TODO
> work items is "fix remaining checkpatch warnings and errors".
Great, you can delete it.
> 2) With your help, we have fixed all of the issues related to these drivers
> conforming to the Linux Device Driver model. One of the TODO work items is
> "audit the vmbus to verify it is working properly with the driver model".
I have a few comments about this, I'll respond in another email.
> 3) Like all other virtualization platforms, the protocol to communicate with
> the host is very host specific. The ringbuffer control structures are shared
> between the host and the guest and so, the guest is compelled to follow the
> mandates of the host. Thus, it is not possible for us to merge the vmbus with
> other virtual buses in the system. One of the TODO work items is "see if the
> vmbus can be merged with the other virtual busses in the kernel".
Sure, you can delete it.
> 4) A couple of months ago, we had posted the network driver for community review.
> We have submitted patches (and these have been applied) to address the review
> comments. One of the TODO work items is "audit the network driver"
Leave that until the network subsystem authors agree that this is all
taken care of by merging the driver into their subsystem.
> 5) Recently, we have merged the IDE and scsi drivers into a single driver that
> can handle both IDE and SCSI devices. These patches have been already checked in.
> As part of this effort, we have addressed all of the community comments on the
> combined storage driver. The TODO file currently has two work items on this
> issue: "audit the block driver" and "audit the scsi driver".
Same as above for the network driver, but you can leave just one entry
now.
I can't apply patches right now due to the kernel.org infrastructure
reworking, so you will have to wait a few days for me to apply your
previous ones, but feel free to send a patch cleaning up the TODO file
now.
thanks,
greg k-h
^ permalink raw reply
* [PATCH 10/10] staging: hv: fix some typos in netvsc.c
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization
In-Reply-To: <1314904788-32746-1-git-send-email-haiyangz@microsoft.com>
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/staging/hv/netvsc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index efbc8a0..115629f 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -218,7 +218,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
if (init_packet->msg.v1_msg.
send_recv_buf_complete.status != NVSP_STAT_SUCCESS) {
netdev_err(ndev, "Unable to complete receive buffer "
- "initialzation with NetVsp - status %d\n",
+ "initialization with NetVsp - status %d\n",
init_packet->msg.v1_msg.
send_recv_buf_complete.status);
ret = -EINVAL;
@@ -695,7 +695,7 @@ static void netvsc_receive(struct hv_device *device,
xferpage_packet->count = count - 1;
if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
- netdev_err(ndev, "Needed %d netvsc pkts to satisy "
+ netdev_err(ndev, "Needed %d netvsc pkts to satisfy "
"this xfer page...got %d\n",
vmxferpage_packet->range_cnt, xferpage_packet->count);
}
--
1.6.3.2
^ permalink raw reply related
* [PATCH 09/10] staging: hv: fix the page buffer when rndis data go across page boundary
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization
In-Reply-To: <1314904788-32746-1-git-send-email-haiyangz@microsoft.com>
In rndis_filter_receive_data(), we need to drop the 0th page and move the
rest of pages forward if the rndis data go across page boundary, otherwise
the page offset will overflow.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/staging/hv/rndis_filter.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index 20e673d..b325345 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -323,6 +323,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
{
struct rndis_packet *rndis_pkt;
u32 data_offset;
+ int i;
rndis_pkt = &msg->msg.pkt;
@@ -338,6 +339,15 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
pkt->page_buf[0].offset += data_offset;
pkt->page_buf[0].len -= data_offset;
+ /* Drop the 0th page, if rndis data go beyond page boundary */
+ if (pkt->page_buf[0].offset >= PAGE_SIZE) {
+ pkt->page_buf[1].offset = pkt->page_buf[0].offset - PAGE_SIZE;
+ pkt->page_buf[1].len -= pkt->page_buf[1].offset;
+ pkt->page_buf_cnt--;
+ for (i = 0; i < pkt->page_buf_cnt; i++)
+ pkt->page_buf[i] = pkt->page_buf[i+1];
+ }
+
pkt->is_data_pkt = true;
netvsc_recv_callback(dev->net_dev->dev, pkt);
--
1.6.3.2
^ permalink raw reply related
* [PATCH 08/10] staging: hv: fix the return status of netvsc_start_xmit()
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization
In-Reply-To: <1314904788-32746-1-git-send-email-haiyangz@microsoft.com>
Fix the return status, so the upper layer will retry if transmission
fails.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/staging/hv/netvsc_drv.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 81e3c49..30b9c80 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -140,12 +140,12 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
(num_pages * sizeof(struct hv_page_buffer)) +
sizeof(struct rndis_filter_packet), GFP_ATOMIC);
if (!packet) {
- /* out of memory, silently drop packet */
+ /* out of memory, drop packet */
netdev_err(net, "unable to allocate hv_netvsc_packet\n");
dev_kfree_skb(skb);
net->stats.tx_dropped++;
- return NETDEV_TX_OK;
+ return NETDEV_TX_BUSY;
}
packet->extension = (void *)(unsigned long)packet +
@@ -194,7 +194,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
dev_kfree_skb_any(skb);
}
- return NETDEV_TX_OK;
+ return ret ? NETDEV_TX_BUSY : NETDEV_TX_OK;
}
/*
--
1.6.3.2
^ permalink raw reply related
* [PATCH 07/10] staging: hv: fix counting of available buffer slots when send fails
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization
In-Reply-To: <1314904788-32746-1-git-send-email-haiyangz@microsoft.com>
Because the number of available buffer slots doesn't decrease for failed
sends, we should not call netvsc_xmit_completion(), which increase the
count of available slots. In this failed case, just free the memory is
enough.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/staging/hv/netvsc_drv.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index b49a08f..81e3c49 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -190,7 +190,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
} else {
/* we are shutting down or bus overloaded, just drop packet */
net->stats.tx_dropped++;
- netvsc_xmit_completion(packet);
+ kfree(packet);
+ dev_kfree_skb_any(skb);
}
return NETDEV_TX_OK;
--
1.6.3.2
^ permalink raw reply related
* [PATCH 06/10] staging: hv: fix counting of #outstanding-sends in failed sends
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization
In-Reply-To: <1314904788-32746-1-git-send-email-haiyangz@microsoft.com>
If the packet failed to be sent, we shouldn't count it as the
number of outstanding sends.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/staging/hv/netvsc.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 82b129b..efbc8a0 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -494,8 +494,9 @@ int netvsc_send(struct hv_device *device,
if (ret != 0)
netdev_err(ndev, "Unable to send packet %p ret %d\n",
packet, ret);
+ else
+ atomic_inc(&net_device->num_outstanding_sends);
- atomic_inc(&net_device->num_outstanding_sends);
return ret;
}
--
1.6.3.2
^ permalink raw reply related
* [PATCH 05/10] staging: hv: re-order the code in netvsc_probe()
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization
In-Reply-To: <1314904788-32746-1-git-send-email-haiyangz@microsoft.com>
Re-order the code in netvsc_probe() to prevent a guest crash caused by
packets possibly received from NetVSP before call to register_netdev().
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/staging/hv/netvsc_drv.c | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index e6513be..b49a08f 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -348,19 +348,6 @@ static int netvsc_probe(struct hv_device *dev)
dev_set_drvdata(&dev->device, net);
INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_send_garp);
- /* Notify the netvsc driver of the new device */
- device_info.ring_size = ring_size;
- ret = rndis_filter_device_add(dev, &device_info);
- if (ret != 0) {
- free_netdev(net);
- dev_set_drvdata(&dev->device, NULL);
- return ret;
- }
-
- netif_carrier_on(net);
-
- memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
-
net->netdev_ops = &device_ops;
/* TODO: Add GSO and Checksum offload */
@@ -372,11 +359,26 @@ static int netvsc_probe(struct hv_device *dev)
ret = register_netdev(net);
if (ret != 0) {
- /* Remove the device and release the resource */
- rndis_filter_device_remove(dev);
+ pr_err("Unable to register netdev.\n");
free_netdev(net);
+ goto out;
}
+ /* Notify the netvsc driver of the new device */
+ device_info.ring_size = ring_size;
+ ret = rndis_filter_device_add(dev, &device_info);
+ if (ret != 0) {
+ netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
+ unregister_netdev(net);
+ free_netdev(net);
+ dev_set_drvdata(&dev->device, NULL);
+ return ret;
+ }
+ memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
+
+ netif_carrier_on(net);
+
+out:
return ret;
}
--
1.6.3.2
^ permalink raw reply related
* [PATCH 04/10] staging: hv: fix a kernel warning in netvsc_linkstatus_callback()
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization; +Cc: stable
In-Reply-To: <1314904788-32746-1-git-send-email-haiyangz@microsoft.com>
netif_notify_peers() caused a kernel warning in netvsc_linkstatus_callback(),
because netvsc_linkstatus_callback() is within IRQ context. So we move
the first call to netif_notify_peers() into queued work as well, but with
zero delay.
In addition to "staging-next", this should also be back-ported to stable
kernels 2.6.32 and later.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: stable <stable@kernel.org>
---
drivers/staging/hv/netvsc_drv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 30a0cb2..e6513be 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -214,8 +214,8 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
if (status == 1) {
netif_carrier_on(net);
netif_wake_queue(net);
- netif_notify_peers(net);
ndev_ctx = netdev_priv(net);
+ schedule_delayed_work(&ndev_ctx->dwork, 0);
schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20));
} else {
netif_carrier_off(net);
--
1.6.3.2
^ permalink raw reply related
* [PATCH 03/10] staging: hv: convert dev_<loglevel> to netdev_<loglevel> in netvsc
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization
In-Reply-To: <1314904788-32746-1-git-send-email-haiyangz@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/staging/hv/netvsc.c | 68 +++++++++++++++++++++----------------
drivers/staging/hv/rndis_filter.c | 17 +++++----
2 files changed, 49 insertions(+), 36 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index ef764e6..82b129b 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -27,6 +27,7 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/slab.h>
+#include <linux/netdevice.h>
#include "hyperv_net.h"
@@ -80,6 +81,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
{
struct nvsp_message *revoke_packet;
int ret = 0;
+ struct net_device *ndev = dev_get_drvdata(&net_device->dev->device);
/*
* If we got a section count, it means we received a
@@ -107,7 +109,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
* have a leak rather than continue and a bugchk
*/
if (ret != 0) {
- dev_err(&net_device->dev->device, "unable to send "
+ netdev_err(ndev, "unable to send "
"revoke receive buffer to netvsp\n");
return ret;
}
@@ -122,7 +124,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
* rather than continue and a bugchk
*/
if (ret != 0) {
- dev_err(&net_device->dev->device,
+ netdev_err(ndev,
"unable to teardown receive buffer's gpadl\n");
return ret;
}
@@ -151,10 +153,11 @@ static int netvsc_init_recv_buf(struct hv_device *device)
int t;
struct netvsc_device *net_device;
struct nvsp_message *init_packet;
+ struct net_device *ndev = dev_get_drvdata(&device->device);
net_device = get_outbound_net_device(device);
if (!net_device) {
- dev_err(&device->device, "unable to get net device..."
+ netdev_err(ndev, "unable to get net device..."
"device being destroyed?\n");
return -ENODEV;
}
@@ -163,7 +166,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
(void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
get_order(net_device->recv_buf_size));
if (!net_device->recv_buf) {
- dev_err(&device->device, "unable to allocate receive "
+ netdev_err(ndev, "unable to allocate receive "
"buffer of size %d\n", net_device->recv_buf_size);
ret = -ENOMEM;
goto cleanup;
@@ -178,7 +181,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
net_device->recv_buf_size,
&net_device->recv_buf_gpadl_handle);
if (ret != 0) {
- dev_err(&device->device,
+ netdev_err(ndev,
"unable to establish receive buffer's gpadl\n");
goto cleanup;
}
@@ -202,7 +205,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) {
- dev_err(&device->device,
+ netdev_err(ndev,
"unable to send receive buffer's gpadl to netvsp\n");
goto cleanup;
}
@@ -214,7 +217,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
/* Check the response */
if (init_packet->msg.v1_msg.
send_recv_buf_complete.status != NVSP_STAT_SUCCESS) {
- dev_err(&device->device, "Unable to complete receive buffer "
+ netdev_err(ndev, "Unable to complete receive buffer "
"initialzation with NetVsp - status %d\n",
init_packet->msg.v1_msg.
send_recv_buf_complete.status);
@@ -266,10 +269,11 @@ static int netvsc_connect_vsp(struct hv_device *device)
struct netvsc_device *net_device;
struct nvsp_message *init_packet;
int ndis_version;
+ struct net_device *ndev = dev_get_drvdata(&device->device);
net_device = get_outbound_net_device(device);
if (!net_device) {
- dev_err(&device->device, "unable to get net device..."
+ netdev_err(ndev, "unable to get net device..."
"device being destroyed?\n");
return -ENODEV;
}
@@ -360,7 +364,7 @@ int netvsc_device_remove(struct hv_device *device)
/* Wait for all send completions */
while (atomic_read(&net_device->num_outstanding_sends)) {
- dev_err(&device->device,
+ dev_info(&device->device,
"waiting for %d requests to complete...\n",
atomic_read(&net_device->num_outstanding_sends));
udelay(100);
@@ -403,10 +407,11 @@ static void netvsc_send_completion(struct hv_device *device,
struct netvsc_device *net_device;
struct nvsp_message *nvsp_packet;
struct hv_netvsc_packet *nvsc_packet;
+ struct net_device *ndev = dev_get_drvdata(&device->device);
net_device = get_inbound_net_device(device);
if (!net_device) {
- dev_err(&device->device, "unable to get net device..."
+ netdev_err(ndev, "unable to get net device..."
"device being destroyed?\n");
return;
}
@@ -435,7 +440,7 @@ static void netvsc_send_completion(struct hv_device *device,
atomic_dec(&net_device->num_outstanding_sends);
} else {
- dev_err(&device->device, "Unknown send completion packet type- "
+ netdev_err(ndev, "Unknown send completion packet type- "
"%d received!!\n", nvsp_packet->hdr.msg_type);
}
@@ -446,12 +451,12 @@ int netvsc_send(struct hv_device *device,
{
struct netvsc_device *net_device;
int ret = 0;
-
struct nvsp_message sendMessage;
+ struct net_device *ndev = dev_get_drvdata(&device->device);
net_device = get_outbound_net_device(device);
if (!net_device) {
- dev_err(&device->device, "net device (%p) shutting down..."
+ netdev_err(ndev, "net device (%p) shutting down..."
"ignoring outbound packets\n", net_device);
return -ENODEV;
}
@@ -487,7 +492,7 @@ int netvsc_send(struct hv_device *device,
}
if (ret != 0)
- dev_err(&device->device, "Unable to send packet %p ret %d\n",
+ netdev_err(ndev, "Unable to send packet %p ret %d\n",
packet, ret);
atomic_inc(&net_device->num_outstanding_sends);
@@ -500,6 +505,7 @@ static void netvsc_send_recv_completion(struct hv_device *device,
struct nvsp_message recvcompMessage;
int retries = 0;
int ret;
+ struct net_device *ndev = dev_get_drvdata(&device->device);
recvcompMessage.hdr.msg_type =
NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE;
@@ -519,19 +525,19 @@ retry_send_cmplt:
} else if (ret == -EAGAIN) {
/* no more room...wait a bit and attempt to retry 3 times */
retries++;
- dev_err(&device->device, "unable to send receive completion pkt"
+ netdev_err(ndev, "unable to send receive completion pkt"
" (tid %llx)...retrying %d\n", transaction_id, retries);
if (retries < 4) {
udelay(100);
goto retry_send_cmplt;
} else {
- dev_err(&device->device, "unable to send receive "
+ netdev_err(ndev, "unable to send receive "
"completion pkt (tid %llx)...give up retrying\n",
transaction_id);
}
} else {
- dev_err(&device->device, "unable to send receive "
+ netdev_err(ndev, "unable to send receive "
"completion pkt - %llx\n", transaction_id);
}
}
@@ -545,6 +551,7 @@ static void netvsc_receive_completion(void *context)
u64 transaction_id = 0;
bool fsend_receive_comp = false;
unsigned long flags;
+ struct net_device *ndev = dev_get_drvdata(&device->device);
/*
* Even though it seems logical to do a GetOutboundNetDevice() here to
@@ -553,7 +560,7 @@ static void netvsc_receive_completion(void *context)
*/
net_device = get_inbound_net_device(device);
if (!net_device) {
- dev_err(&device->device, "unable to get net device..."
+ netdev_err(ndev, "unable to get net device..."
"device being destroyed?\n");
return;
}
@@ -599,12 +606,13 @@ static void netvsc_receive(struct hv_device *device,
int i, j;
int count = 0, bytes_remain = 0;
unsigned long flags;
+ struct net_device *ndev = dev_get_drvdata(&device->device);
LIST_HEAD(listHead);
net_device = get_inbound_net_device(device);
if (!net_device) {
- dev_err(&device->device, "unable to get net device..."
+ netdev_err(ndev, "unable to get net device..."
"device being destroyed?\n");
return;
}
@@ -614,7 +622,7 @@ static void netvsc_receive(struct hv_device *device,
* packet
*/
if (packet->type != VM_PKT_DATA_USING_XFER_PAGES) {
- dev_err(&device->device, "Unknown packet type received - %d\n",
+ netdev_err(ndev, "Unknown packet type received - %d\n",
packet->type);
return;
}
@@ -625,7 +633,7 @@ static void netvsc_receive(struct hv_device *device,
/* Make sure this is a valid nvsp packet */
if (nvsp_packet->hdr.msg_type !=
NVSP_MSG1_TYPE_SEND_RNDIS_PKT) {
- dev_err(&device->device, "Unknown nvsp packet type received-"
+ netdev_err(ndev, "Unknown nvsp packet type received-"
" %d\n", nvsp_packet->hdr.msg_type);
return;
}
@@ -633,7 +641,7 @@ static void netvsc_receive(struct hv_device *device,
vmxferpage_packet = (struct vmtransfer_page_packet_header *)packet;
if (vmxferpage_packet->xfer_pageset_id != NETVSC_RECEIVE_BUFFER_ID) {
- dev_err(&device->device, "Invalid xfer page set id - "
+ netdev_err(ndev, "Invalid xfer page set id - "
"expecting %x got %x\n", NETVSC_RECEIVE_BUFFER_ID,
vmxferpage_packet->xfer_pageset_id);
return;
@@ -659,7 +667,7 @@ static void netvsc_receive(struct hv_device *device,
* some of the xfer page packet ranges...
*/
if (count < 2) {
- dev_err(&device->device, "Got only %d netvsc pkt...needed "
+ netdev_err(ndev, "Got only %d netvsc pkt...needed "
"%d pkts. Dropping this xfer page packet completely!\n",
count, vmxferpage_packet->range_cnt + 1);
@@ -686,7 +694,7 @@ static void netvsc_receive(struct hv_device *device,
xferpage_packet->count = count - 1;
if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
- dev_err(&device->device, "Needed %d netvsc pkts to satisy "
+ netdev_err(ndev, "Needed %d netvsc pkts to satisy "
"this xfer page...got %d\n",
vmxferpage_packet->range_cnt, xferpage_packet->count);
}
@@ -775,6 +783,7 @@ static void netvsc_channel_cb(void *context)
struct vmpacket_descriptor *desc;
unsigned char *buffer;
int bufferlen = NETVSC_PACKET_SIZE;
+ struct net_device *ndev = dev_get_drvdata(&device->device);
packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char),
GFP_ATOMIC);
@@ -784,7 +793,7 @@ static void netvsc_channel_cb(void *context)
net_device = get_inbound_net_device(device);
if (!net_device) {
- dev_err(&device->device, "net device (%p) shutting down..."
+ netdev_err(ndev, "net device (%p) shutting down..."
"ignoring inbound packets\n", net_device);
goto out;
}
@@ -805,7 +814,7 @@ static void netvsc_channel_cb(void *context)
break;
default:
- dev_err(&device->device,
+ netdev_err(ndev,
"unhandled packet type %d, "
"tid %llx len %d\n",
desc->type, request_id,
@@ -834,7 +843,7 @@ static void netvsc_channel_cb(void *context)
buffer = kmalloc(bytes_recvd, GFP_ATOMIC);
if (buffer == NULL) {
/* Try again next time around */
- dev_err(&device->device,
+ netdev_err(ndev,
"unable to allocate buffer of size "
"(%d)!!\n", bytes_recvd);
break;
@@ -861,6 +870,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
((struct netvsc_device_info *)additional_info)->ring_size;
struct netvsc_device *net_device;
struct hv_netvsc_packet *packet, *pos;
+ struct net_device *ndev = dev_get_drvdata(&device->device);
net_device = alloc_net_device(device);
if (!net_device) {
@@ -892,7 +902,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
netvsc_channel_cb, device);
if (ret != 0) {
- dev_err(&device->device, "unable to open channel: %d\n", ret);
+ netdev_err(ndev, "unable to open channel: %d\n", ret);
goto cleanup;
}
@@ -902,7 +912,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
/* Connect with the NetVsp */
ret = netvsc_connect_vsp(device);
if (ret != 0) {
- dev_err(&device->device,
+ netdev_err(ndev,
"unable to connect to NetVSP - %d\n", ret);
goto close;
}
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index 8416bf2..20e673d 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -249,6 +249,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
struct rndis_request *request = NULL;
bool found = false;
unsigned long flags;
+ struct net_device *ndev = dev_get_drvdata(&dev->net_dev->dev->device);
spin_lock_irqsave(&dev->request_lock, flags);
list_for_each_entry(request, &dev->req_list, list_ent) {
@@ -269,7 +270,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
memcpy(&request->response_msg, resp,
resp->msg_len);
} else {
- dev_err(&dev->net_dev->dev->device,
+ netdev_err(ndev,
"rndis response buffer overflow "
"detected (size %u max %zu)\n",
resp->msg_len,
@@ -289,7 +290,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
complete(&request->wait_event);
} else {
- dev_err(&dev->net_dev->dev->device,
+ netdev_err(ndev,
"no rndis request found for this response "
"(id 0x%x res type 0x%x)\n",
resp->msg.init_complete.req_id,
@@ -349,20 +350,21 @@ int rndis_filter_receive(struct hv_device *dev,
struct rndis_device *rndis_dev;
struct rndis_message rndis_msg;
struct rndis_message *rndis_hdr;
+ struct net_device *ndev = dev_get_drvdata(&dev->device);
if (!net_dev)
return -EINVAL;
/* Make sure the rndis device state is initialized */
if (!net_dev->extension) {
- dev_err(&dev->device, "got rndis message but no rndis device - "
+ netdev_err(ndev, "got rndis message but no rndis device - "
"dropping this message!\n");
return -ENODEV;
}
rndis_dev = (struct rndis_device *)net_dev->extension;
if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) {
- dev_err(&dev->device, "got rndis message but rndis device "
+ netdev_err(ndev, "got rndis message but rndis device "
"uninitialized...dropping this message!\n");
return -ENODEV;
}
@@ -376,7 +378,7 @@ int rndis_filter_receive(struct hv_device *dev,
/* Make sure we got a valid rndis message */
if ((rndis_hdr->ndis_msg_type != REMOTE_NDIS_PACKET_MSG) &&
(rndis_hdr->msg_len > sizeof(struct rndis_message))) {
- dev_err(&dev->device, "incoming rndis message buffer overflow "
+ netdev_err(ndev, "incoming rndis message buffer overflow "
"detected (got %u, max %zu)..marking it an error!\n",
rndis_hdr->msg_len,
sizeof(struct rndis_message));
@@ -409,7 +411,7 @@ int rndis_filter_receive(struct hv_device *dev,
rndis_filter_receive_indicate_status(rndis_dev, &rndis_msg);
break;
default:
- dev_err(&dev->device,
+ netdev_err(ndev,
"unhandled rndis message (type %u len %u)\n",
rndis_msg.ndis_msg_type,
rndis_msg.msg_len);
@@ -505,6 +507,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
struct rndis_set_complete *set_complete;
u32 status;
int ret, t;
+ struct net_device *ndev = dev_get_drvdata(&dev->net_dev->dev->device);
request = get_rndis_request(dev, REMOTE_NDIS_SET_MSG,
RNDIS_MESSAGE_SIZE(struct rndis_set_request) +
@@ -530,7 +533,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) {
- dev_err(&dev->net_dev->dev->device,
+ netdev_err(ndev,
"timeout before we got a set response...\n");
/*
* We can't deallocate the request since we may still receive a
--
1.6.3.2
^ permalink raw reply related
* [PATCH 02/10] staging: hv: add newline to log messages in netvsc
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization
In-Reply-To: <1314904788-32746-1-git-send-email-haiyangz@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/staging/hv/netvsc.c | 58 +++++++++++++++++++++---------------------
1 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 9a9228c..ef764e6 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -108,7 +108,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
*/
if (ret != 0) {
dev_err(&net_device->dev->device, "unable to send "
- "revoke receive buffer to netvsp");
+ "revoke receive buffer to netvsp\n");
return ret;
}
}
@@ -123,7 +123,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
*/
if (ret != 0) {
dev_err(&net_device->dev->device,
- "unable to teardown receive buffer's gpadl");
+ "unable to teardown receive buffer's gpadl\n");
return ret;
}
net_device->recv_buf_gpadl_handle = 0;
@@ -155,7 +155,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
net_device = get_outbound_net_device(device);
if (!net_device) {
dev_err(&device->device, "unable to get net device..."
- "device being destroyed?");
+ "device being destroyed?\n");
return -ENODEV;
}
@@ -164,7 +164,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
get_order(net_device->recv_buf_size));
if (!net_device->recv_buf) {
dev_err(&device->device, "unable to allocate receive "
- "buffer of size %d", net_device->recv_buf_size);
+ "buffer of size %d\n", net_device->recv_buf_size);
ret = -ENOMEM;
goto cleanup;
}
@@ -179,7 +179,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
&net_device->recv_buf_gpadl_handle);
if (ret != 0) {
dev_err(&device->device,
- "unable to establish receive buffer's gpadl");
+ "unable to establish receive buffer's gpadl\n");
goto cleanup;
}
@@ -203,7 +203,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) {
dev_err(&device->device,
- "unable to send receive buffer's gpadl to netvsp");
+ "unable to send receive buffer's gpadl to netvsp\n");
goto cleanup;
}
@@ -215,7 +215,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
if (init_packet->msg.v1_msg.
send_recv_buf_complete.status != NVSP_STAT_SUCCESS) {
dev_err(&device->device, "Unable to complete receive buffer "
- "initialzation with NetVsp - status %d",
+ "initialzation with NetVsp - status %d\n",
init_packet->msg.v1_msg.
send_recv_buf_complete.status);
ret = -EINVAL;
@@ -270,7 +270,7 @@ static int netvsc_connect_vsp(struct hv_device *device)
net_device = get_outbound_net_device(device);
if (!net_device) {
dev_err(&device->device, "unable to get net device..."
- "device being destroyed?");
+ "device being destroyed?\n");
return -ENODEV;
}
@@ -361,7 +361,7 @@ int netvsc_device_remove(struct hv_device *device)
/* Wait for all send completions */
while (atomic_read(&net_device->num_outstanding_sends)) {
dev_err(&device->device,
- "waiting for %d requests to complete...",
+ "waiting for %d requests to complete...\n",
atomic_read(&net_device->num_outstanding_sends));
udelay(100);
}
@@ -381,7 +381,7 @@ int netvsc_device_remove(struct hv_device *device)
spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
/* At this point, no one should be accessing netDevice except in here */
- dev_notice(&device->device, "net device safe to remove");
+ dev_notice(&device->device, "net device safe to remove\n");
/* Now, we can close the channel safely */
vmbus_close(device->channel);
@@ -407,7 +407,7 @@ static void netvsc_send_completion(struct hv_device *device,
net_device = get_inbound_net_device(device);
if (!net_device) {
dev_err(&device->device, "unable to get net device..."
- "device being destroyed?");
+ "device being destroyed?\n");
return;
}
@@ -436,7 +436,7 @@ static void netvsc_send_completion(struct hv_device *device,
atomic_dec(&net_device->num_outstanding_sends);
} else {
dev_err(&device->device, "Unknown send completion packet type- "
- "%d received!!", nvsp_packet->hdr.msg_type);
+ "%d received!!\n", nvsp_packet->hdr.msg_type);
}
}
@@ -452,7 +452,7 @@ int netvsc_send(struct hv_device *device,
net_device = get_outbound_net_device(device);
if (!net_device) {
dev_err(&device->device, "net device (%p) shutting down..."
- "ignoring outbound packets", net_device);
+ "ignoring outbound packets\n", net_device);
return -ENODEV;
}
@@ -487,7 +487,7 @@ int netvsc_send(struct hv_device *device,
}
if (ret != 0)
- dev_err(&device->device, "Unable to send packet %p ret %d",
+ dev_err(&device->device, "Unable to send packet %p ret %d\n",
packet, ret);
atomic_inc(&net_device->num_outstanding_sends);
@@ -520,19 +520,19 @@ retry_send_cmplt:
/* no more room...wait a bit and attempt to retry 3 times */
retries++;
dev_err(&device->device, "unable to send receive completion pkt"
- " (tid %llx)...retrying %d", transaction_id, retries);
+ " (tid %llx)...retrying %d\n", transaction_id, retries);
if (retries < 4) {
udelay(100);
goto retry_send_cmplt;
} else {
dev_err(&device->device, "unable to send receive "
- "completion pkt (tid %llx)...give up retrying",
+ "completion pkt (tid %llx)...give up retrying\n",
transaction_id);
}
} else {
dev_err(&device->device, "unable to send receive "
- "completion pkt - %llx", transaction_id);
+ "completion pkt - %llx\n", transaction_id);
}
}
@@ -554,7 +554,7 @@ static void netvsc_receive_completion(void *context)
net_device = get_inbound_net_device(device);
if (!net_device) {
dev_err(&device->device, "unable to get net device..."
- "device being destroyed?");
+ "device being destroyed?\n");
return;
}
@@ -605,7 +605,7 @@ static void netvsc_receive(struct hv_device *device,
net_device = get_inbound_net_device(device);
if (!net_device) {
dev_err(&device->device, "unable to get net device..."
- "device being destroyed?");
+ "device being destroyed?\n");
return;
}
@@ -614,7 +614,7 @@ static void netvsc_receive(struct hv_device *device,
* packet
*/
if (packet->type != VM_PKT_DATA_USING_XFER_PAGES) {
- dev_err(&device->device, "Unknown packet type received - %d",
+ dev_err(&device->device, "Unknown packet type received - %d\n",
packet->type);
return;
}
@@ -626,7 +626,7 @@ static void netvsc_receive(struct hv_device *device,
if (nvsp_packet->hdr.msg_type !=
NVSP_MSG1_TYPE_SEND_RNDIS_PKT) {
dev_err(&device->device, "Unknown nvsp packet type received-"
- " %d", nvsp_packet->hdr.msg_type);
+ " %d\n", nvsp_packet->hdr.msg_type);
return;
}
@@ -634,7 +634,7 @@ static void netvsc_receive(struct hv_device *device,
if (vmxferpage_packet->xfer_pageset_id != NETVSC_RECEIVE_BUFFER_ID) {
dev_err(&device->device, "Invalid xfer page set id - "
- "expecting %x got %x", NETVSC_RECEIVE_BUFFER_ID,
+ "expecting %x got %x\n", NETVSC_RECEIVE_BUFFER_ID,
vmxferpage_packet->xfer_pageset_id);
return;
}
@@ -660,7 +660,7 @@ static void netvsc_receive(struct hv_device *device,
*/
if (count < 2) {
dev_err(&device->device, "Got only %d netvsc pkt...needed "
- "%d pkts. Dropping this xfer page packet completely!",
+ "%d pkts. Dropping this xfer page packet completely!\n",
count, vmxferpage_packet->range_cnt + 1);
/* Return it to the freelist */
@@ -687,7 +687,7 @@ static void netvsc_receive(struct hv_device *device,
if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
dev_err(&device->device, "Needed %d netvsc pkts to satisy "
- "this xfer page...got %d",
+ "this xfer page...got %d\n",
vmxferpage_packet->range_cnt, xferpage_packet->count);
}
@@ -785,7 +785,7 @@ static void netvsc_channel_cb(void *context)
net_device = get_inbound_net_device(device);
if (!net_device) {
dev_err(&device->device, "net device (%p) shutting down..."
- "ignoring inbound packets", net_device);
+ "ignoring inbound packets\n", net_device);
goto out;
}
@@ -836,7 +836,7 @@ static void netvsc_channel_cb(void *context)
/* Try again next time around */
dev_err(&device->device,
"unable to allocate buffer of size "
- "(%d)!!", bytes_recvd);
+ "(%d)!!\n", bytes_recvd);
break;
}
@@ -892,18 +892,18 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
netvsc_channel_cb, device);
if (ret != 0) {
- dev_err(&device->device, "unable to open channel: %d", ret);
+ dev_err(&device->device, "unable to open channel: %d\n", ret);
goto cleanup;
}
/* Channel is opened */
- pr_info("hv_netvsc channel opened successfully");
+ pr_info("hv_netvsc channel opened successfully\n");
/* Connect with the NetVsp */
ret = netvsc_connect_vsp(device);
if (ret != 0) {
dev_err(&device->device,
- "unable to connect to NetVSP - %d", ret);
+ "unable to connect to NetVSP - %d\n", ret);
goto close;
}
--
1.6.3.2
^ permalink raw reply related
* [PATCH 01/10] staging: hv: remove unnecessary includes in netvsc
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization
In-Reply-To: <1314904788-32746-1-git-send-email-haiyangz@microsoft.com>
hyperv.h is included by hyperv_net.h already, so no need to include it
again in these C files.
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/staging/hv/netvsc.c | 1 -
drivers/staging/hv/netvsc_drv.c | 1 -
drivers/staging/hv/rndis_filter.c | 1 -
3 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 30d3139..9a9228c 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -28,7 +28,6 @@
#include <linux/io.h>
#include <linux/slab.h>
-#include "hyperv.h"
#include "hyperv_net.h"
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 90a3198..30a0cb2 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -38,7 +38,6 @@
#include <net/sock.h>
#include <net/pkt_sched.h>
-#include "hyperv.h"
#include "hyperv_net.h"
struct net_device_context {
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index 6db48b9..8416bf2 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -27,7 +27,6 @@
#include <linux/if_ether.h>
#include <linux/netdevice.h>
-#include "hyperv.h"
#include "hyperv_net.h"
--
1.6.3.2
^ permalink raw reply related
* [PATCH 00/10] netvsc bug fixes and cleanups
From: Haiyang Zhang @ 2011-09-01 19:19 UTC (permalink / raw)
To: haiyangz, hjanssen, kys, gregkh, linux-kernel, devel,
virtualization
Fixed a set of bugs in netvsc module, and cleaned up some coding style issues.
Haiyang Zhang (10):
staging: hv: remove unnecessary includes in netvsc
staging: hv: add newline to log messages in netvsc
staging: hv: convert dev_<loglevel> to netdev_<loglevel> in netvsc
staging: hv: fix a kernel warning in netvsc_linkstatus_callback()
staging: hv: re-order the code in netvsc_probe()
staging: hv: fix counting of #outstanding-sends in failed sends
staging: hv: fix counting of available buffer slots when send fails
staging: hv: fix the return status of netvsc_start_xmit()
staging: hv: fix the page buffer when rndis data go across page
boundary
staging: hv: fix some typos in netvsc.c
drivers/staging/hv/netvsc.c | 124 ++++++++++++++++++++-----------------
drivers/staging/hv/netvsc_drv.c | 44 +++++++------
drivers/staging/hv/rndis_filter.c | 28 ++++++---
3 files changed, 110 insertions(+), 86 deletions(-)
^ permalink raw reply
* [PATCH RFC] ata_piix: ignore disks in a hyper-v guest
From: Olaf Hering @ 2011-09-01 15:43 UTC (permalink / raw)
To: linux-ide; +Cc: KY Srinivasan, devel, gregkh, linux-kernel, virtualization
In-Reply-To: <20110831091156.GA16104@aepfle.de>
On Wed, Aug 31, Olaf Hering wrote:
> After some more testing it looks like the hv_blkvsc driver claimed the
> ide major #3, so the ide_core could not bind to the emulated IDE
> hardware. The modprobe.conf rules prevented that ata_piix gets loaded.
> If I force a module load order of 'ata_piix ;hv_blkvsc' both ata_piix
> and hv_blkvsc will bind to the same drive, just as shown in my previous
> mail. So there is appearently no way to shutdown the IDE ports like it
> is done with xen_emul_unplug= option for Xen guests.
>
> Maybe some hack is needed for a hyper-v specific unplug if Windows does
> indeed lack that feature. Now that ata_piix is compiled into the kernel,
> there is nothing to a modprobe.conf rule can "fix".
Here is an attempt to ignore disks in a hyper-v disks, and let ata_piix
handle only the configured cdrom devices (iso of physical).
If the disks are not ignored, they will appear twice, once through
ata_piix and once through hv_storvsc.
Once hv_storvsc can also handle the configured cdrom devices, the added
piix_pata_read_id() function can be removed again. Only the check in
piix_init() or something similar needs to be done.
Maybe there is a better way enable only ATA_DEV_ATAPI?
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
drivers/ata/ata_piix.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -98,6 +98,10 @@
#define DRV_NAME "ata_piix"
#define DRV_VERSION "2.13"
+#if defined(CONFIG_HYPERV_STORAGE) || defined(CONFIG_HYPERV_STORAGE_MODULE)
+#define PIIX_IGNORE_ATA_ON_HYPERV 1
+#endif
+
enum {
PIIX_IOCFG = 0x54, /* IDE I/O configuration register */
ICH5_PMR = 0x90, /* port mapping register */
@@ -164,6 +168,7 @@ struct piix_host_priv {
static int piix_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent);
static void piix_remove_one(struct pci_dev *pdev);
+static unsigned int piix_pata_read_id(struct ata_device *adev, struct ata_taskfile *tf, u16 *id);
static int piix_pata_prereset(struct ata_link *link, unsigned long deadline);
static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev);
static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev);
@@ -346,6 +351,7 @@ static struct ata_port_operations piix_p
.set_piomode = piix_set_piomode,
.set_dmamode = piix_set_dmamode,
.prereset = piix_pata_prereset,
+ .read_id = piix_pata_read_id,
};
static struct ata_port_operations piix_vmw_ops = {
@@ -619,6 +625,24 @@ MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, piix_pci_tbl);
MODULE_VERSION(DRV_VERSION);
+#if defined(PIIX_IGNORE_ATA_ON_HYPERV)
+static int piix_msft_hyperv(void)
+{
+ static const struct dmi_system_id hv_dmi_ident[] = {
+ {
+ .ident = "Hyper-V",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
+ DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
+ },
+ },
+ { } /* terminate list */
+ };
+ return !!dmi_check_system(hv_dmi_ident);
+}
+#endif
+
struct ich_laptop {
u16 device;
u16 subvendor;
@@ -702,6 +726,29 @@ static int piix_pata_prereset(struct ata
return ata_sff_prereset(link, deadline);
}
+/**
+ *
+ */
+static unsigned int piix_pata_read_id(struct ata_device *adev, struct ata_taskfile *tf, u16 *id)
+{
+ unsigned int err_mask = ata_do_dev_read_id(adev, tf, id);
+#if defined(PIIX_IGNORE_ATA_ON_HYPERV)
+ /*
+ * Ignore disks in a hyper-v guest.
+ * There is no unplug protocol like it is done with xen_emul_unplug= option.
+ * Emulate the unplug by ignoring disks when the hv_storvsc driver is enabled.
+ * If the disks are not ignored, they will appear twice: once through piix and once through hv_storvsc.
+ * Because hv_storvsc does not handle ATAPI devices, the piix driver is still required.
+ * Once hv_storvsc handles all devices, this function can be removed and the whole driver should be disabled in a hyper-v guest.
+ */
+ if (ata_id_is_ata(id) && piix_msft_hyperv()) {
+ ata_dev_printk(adev, KERN_WARNING, "ATA device ignored in Hyper-V guest\n");
+ id[ATA_ID_CONFIG] |= (1 << 15);
+ }
+#endif
+ return err_mask;
+}
+
static DEFINE_SPINLOCK(piix_lock);
/**
@@ -1679,6 +1726,13 @@ static int __init piix_init(void)
{
int rc;
+#if defined(PIIX_IGNORE_ATA_ON_HYPERV)
+ /* disabled until hv_storvsc drives also cdrom devices */
+ if (0 && piix_msft_hyperv()) {
+ printk(KERN_DEBUG "%s: hv_storvsc will bind to storage\n", __func__);
+ return -ENODEV;
+ }
+#endif
DPRINTK("pci_register_driver\n");
rc = pci_register_driver(&piix_pci_driver);
if (rc)
^ permalink raw reply
* Re: Hyper-V TODO file
From: Peter Foley @ 2011-08-31 23:11 UTC (permalink / raw)
To: K. Y. Srinivasan; +Cc: gregkh, Linux Kernel Mailing List, devel, virtualization
In-Reply-To: <1314829011-28922-1-git-send-email-kys@microsoft.com>
On Wed, 31 Aug 2011, K. Y. Srinivasan wrote:
> Greg, as I have been pestering you for some time now, we are very interested in
> exiting staging and we are willing to dedicate the necessary development
> resources to address whatever issues that may still be pending. So, your help
> in identifying what needs to be done will be greatly appreciated. To that end,
> I think it will be useful to update the TODO file to reflect the current state of
> the drivers. Let us know how we should proceed here.
An issue I've come across in the hyper-v drivers is the forced modular
build. You might want to see if the "depends on m" is still needed.
Thanks,
Peter Foley
^ permalink raw reply
* Hyper-V TODO file
From: K. Y. Srinivasan @ 2011-08-31 22:16 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization, kys
Greg,
The TODO file for Hyper-V drivers has not been updated in a while and does
not reflect the current state of these drivers:
1) There are no more checkpatch warnings/errors in this code. One of the TODO
work items is "fix remaining checkpatch warnings and errors".
2) With your help, we have fixed all of the issues related to these drivers
conforming to the Linux Device Driver model. One of the TODO work items is
"audit the vmbus to verify it is working properly with the driver model".
3) Like all other virtualization platforms, the protocol to communicate with
the host is very host specific. The ringbuffer control structures are shared
between the host and the guest and so, the guest is compelled to follow the
mandates of the host. Thus, it is not possible for us to merge the vmbus with
other virtual buses in the system. One of the TODO work items is "see if the
vmbus can be merged with the other virtual busses in the kernel".
4) A couple of months ago, we had posted the network driver for community review.
We have submitted patches (and these have been applied) to address the review
comments. One of the TODO work items is "audit the network driver"
5) Recently, we have merged the IDE and scsi drivers into a single driver that
can handle both IDE and SCSI devices. These patches have been already checked in.
As part of this effort, we have addressed all of the community comments on the
combined storage driver. The TODO file currently has two work items on this
issue: "audit the block driver" and "audit the scsi driver".
Greg, as I have been pestering you for some time now, we are very interested in
exiting staging and we are willing to dedicate the necessary development
resources to address whatever issues that may still be pending. So, your help
in identifying what needs to be done will be greatly appreciated. To that end,
I think it will be useful to update the TODO file to reflect the current state of
the drivers. Let us know how we should proceed here.
Regards,
K. Y
^ permalink raw reply
* [PATCH 4/4] Staging: hv: vmbus: Cleanup the code in process_chn_event()
From: K. Y. Srinivasan @ 2011-08-31 21:35 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization
Cc: K. Y. Srinivasan, Haiyang Zhang
In-Reply-To: <1314826557-28755-1-git-send-email-kys@microsoft.com>
A channel in Hyper-V is equivalent to a device. Thus, a channel is
persistent once it is presented to the guest, even if the driver
managing this device is unloaded. By checking and invoking the driver
specific callback function under the protection of the channel
inbound_lock, we can properly deal with racing driver unloads since an
unloading driver sets the callback to NULL under the protection of this
inbound_lock.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/connection.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
index 9e99c04..649b91b 100644
--- a/drivers/staging/hv/connection.c
+++ b/drivers/staging/hv/connection.c
@@ -219,11 +219,25 @@ static void process_chn_event(u32 relid)
*/
channel = relid2channel(relid);
+ if (!channel) {
+ pr_err("channel not found for relid - %u\n", relid);
+ return;
+ }
+
+ /*
+ * A channel once created is persistent even when there
+ * is no driver handling the device. An unloading driver
+ * sets the onchannel_callback to NULL under the
+ * protection of the channel inbound_lock. Thus, checking
+ * and invoking the driver specific callback takes care of
+ * orderly unloading of the driver.
+ */
+
spin_lock_irqsave(&channel->inbound_lock, flags);
- if (channel && (channel->onchannel_callback != NULL))
+ if (channel->onchannel_callback != NULL)
channel->onchannel_callback(channel->channel_callback_context);
else
- pr_err("channel not found for relid - %u\n", relid);
+ pr_err("no channel callback for relid - %u\n", relid);
spin_unlock_irqrestore(&channel->inbound_lock, flags);
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 3/4] Staging: hv: vmbus: Check for events before messages
From: K. Y. Srinivasan @ 2011-08-31 21:35 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1314826557-28755-1-git-send-email-kys@microsoft.com>
The Windows team has informed us that on Windows guests on Hyper-V,
they check for events before messages. They also recommended that we do
the same. This patch addresses this.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/vmbus_drv.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index b5e06d6..cd43ddd 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -442,14 +442,11 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id)
union hv_synic_event_flags *event;
bool handled = false;
- page_addr = hv_context.synic_message_page[cpu];
- msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT;
-
- /* Check if there are actual msgs to be process */
- if (msg->header.message_type != HVMSG_NONE) {
- handled = true;
- tasklet_schedule(&msg_dpc);
- }
+ /*
+ * Check for events before checking for messages. This is the order
+ * in which events and messages are checked in Windows guests on
+ * Hyper-V, and the Windows team suggested we do the same.
+ */
page_addr = hv_context.synic_event_page[cpu];
event = (union hv_synic_event_flags *)page_addr + VMBUS_MESSAGE_SINT;
@@ -460,6 +457,15 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id)
tasklet_schedule(&event_dpc);
}
+ page_addr = hv_context.synic_message_page[cpu];
+ msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT;
+
+ /* Check if there are actual msgs to be processed */
+ if (msg->header.message_type != HVMSG_NONE) {
+ handled = true;
+ tasklet_schedule(&msg_dpc);
+ }
+
if (handled)
return IRQ_HANDLED;
else
--
1.7.4.1
^ permalink raw reply related
* [PATCH 2/4] Staging: hv: vmbus: Fix a bug in error handling in vmbus_bus_init()
From: K. Y. Srinivasan @ 2011-08-31 21:35 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization
Cc: K. Y. Srinivasan, Haiyang Zhang
In-Reply-To: <1314826557-28755-1-git-send-email-kys@microsoft.com>
Fix a bug in error handling in vmbus_bus_init().
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/vmbus_drv.c | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 757943b..b5e06d6 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -492,7 +492,7 @@ static int vmbus_bus_init(int irq)
ret = bus_register(&hv_bus);
if (ret)
- return ret;
+ goto err_cleanup;
ret = request_irq(irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
driver_name, hv_acpi_dev);
@@ -500,10 +500,7 @@ static int vmbus_bus_init(int irq)
if (ret != 0) {
pr_err("Unable to request IRQ %d\n",
irq);
-
- bus_unregister(&hv_bus);
-
- return ret;
+ goto err_unregister;
}
vector = IRQ0_VECTOR + irq;
@@ -514,16 +511,23 @@ static int vmbus_bus_init(int irq)
*/
on_each_cpu(hv_synic_init, (void *)&vector, 1);
ret = vmbus_connect();
- if (ret) {
- free_irq(irq, hv_acpi_dev);
- bus_unregister(&hv_bus);
- return ret;
- }
-
+ if (ret)
+ goto err_irq;
vmbus_request_offers();
return 0;
+
+err_irq:
+ free_irq(irq, hv_acpi_dev);
+
+err_unregister:
+ bus_unregister(&hv_bus);
+
+err_cleanup:
+ hv_cleanup();
+
+ return ret;
}
/**
--
1.7.4.1
^ permalink raw reply related
* [PATCH 1/4] Staging: hv: util: Deal with driver register failures
From: K. Y. Srinivasan @ 2011-08-31 21:35 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization
Cc: K. Y. Srinivasan, Haiyang Zhang
In-Reply-To: <1314826529-28716-1-git-send-email-kys@microsoft.com>
Properly deal with vmbus_driver_register() failures.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/hv_util.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index e29a2a2..6039217 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -277,6 +277,7 @@ static struct hv_driver util_drv = {
static int __init init_hyperv_utils(void)
{
+ int ret;
pr_info("Registering HyperV Utility Driver\n");
if (hv_kvp_init())
@@ -289,12 +290,15 @@ static int __init init_hyperv_utils(void)
if (!shut_txf_buf || !time_txf_buf || !hbeat_txf_buf) {
pr_info("Unable to allocate memory for receive buffer\n");
- kfree(shut_txf_buf);
- kfree(time_txf_buf);
- kfree(hbeat_txf_buf);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto err;
}
+ ret = vmbus_driver_register(&util_drv);
+
+ if (ret != 0)
+ goto err;
+
hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback;
hv_cb_utils[HV_TIMESYNC_MSG].callback = ×ync_onchannelcallback;
@@ -303,7 +307,14 @@ static int __init init_hyperv_utils(void)
hv_cb_utils[HV_KVP_MSG].callback = &hv_kvp_onchannelcallback;
- return vmbus_driver_register(&util_drv);
+ return 0;
+
+err:
+ kfree(shut_txf_buf);
+ kfree(time_txf_buf);
+ kfree(hbeat_txf_buf);
+
+ return ret;
}
static void exit_hyperv_utils(void)
--
1.7.4.1
^ permalink raw reply related
* [PATCH 0000/0004] Staging: hv: Driver cleanup
From: K. Y. Srinivasan @ 2011-08-31 21:35 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: K. Y. Srinivasan
Address the comments on the last couple of patch sets.
Regards,
K. Y
^ permalink raw reply
* Re: [PATCH] virtio-net: Read MAC only after initializing MSI-X
From: Sasha Levin @ 2011-08-31 16:24 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: netdev, linux-kernel, kvm, virtualization
In-Reply-To: <20110822083613.GA18556@redhat.com>
I'm wondering if we can switch to using a linked list 'capabilities'
structure similar to whats being done with PCI capabilities.
Here are the pros and the cons as I see them:
Pros:
* Simpler code - currently before each access to the virtio config
space we have to check whether MSI-X is on and whether the device has
64bit features. This isn't necessarily slow, but it complicates the
code.
* Future proof - code will be a mess once 5-6 features can change the
config space.
* 'Concept reuse' - using same concepts in virtio-pci as the ones used
in PCI ('PCI Capabilities list') would make it easier to understand, and
would implement the same method to use optional features as in the layer
above.
Cons:
* MSI-X is already moving the config space, we'll need to keep
supporting it for a while, but it would mean that it's the only thing we
need to keep backwards compatible.
* 64bit features also move config space, but they're brand new in the
spec and aren't implemented in the kernel yet - I doubt anyone
implemented it anywhere else yet.
On Mon, 2011-08-22 at 11:36 +0300, Michael S. Tsirkin wrote:
> On Mon, Aug 22, 2011 at 09:54:50AM +0930, Rusty Russell wrote:
> > On Fri, 19 Aug 2011 18:23:35 +0300, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> > > On Sat, Aug 13, 2011 at 11:51:01AM +0300, Sasha Levin wrote:
> > > > The MAC of a virtio-net device is located at the first field of the device
> > > > specific header. This header is located at offset 20 if the device doesn't
> > > > support MSI-X or offset 24 if it does.
> > > >
> > > > Current code in virtnet_probe() used to probe the MAC before checking for
> > > > MSI-X, which means that the read was always made from offset 20 regardless
> > > > of whether MSI-X in enabled or not.
> > > >
> > > > This patch moves the MAC probe to after the detection of whether MSI-X is
> > > > enabled. This way the MAC will be read from offset 24 if the device indeed
> > > > supports MSI-X.
> > > >
> > > > Cc: Rusty Russell <rusty@rustcorp.com.au>
> > > > Cc: Michael S. Tsirkin <mst@redhat.com>
> > > > Cc: virtualization@lists.linux-foundation.org
> > > > Cc: netdev@vger.kernel.org
> > > > Cc: kvm@vger.kernel.org
> > > > Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> > >
> > > I am not sure I see a bug in virtio: the config pace layout simply
> > > changes as msix is enabled and disabled (and if you look at the latest
> > > draft, also on whether 64 bit features are enabled).
> > > It doesn't depend on msix capability being present in device.
> > >
> > > The spec seems to be explicit enough:
> > > If MSI-X is enabled for the device, two additional fields immediately
> > > follow this header.
> > >
> > > So I'm guessing the bug is in kvm tools which assume
> > > same layout for when msix is enabled and disabled.
> > > qemu-kvm seems to do the right thing so the device
> > > seems to get the correct mac.
> >
> > So, the config space moves once MSI-X is enabled? In which case, it
> > should say "ONCE MSI-X is enabled..."
> >
> > Thanks,
> > Rusty.
>
> Yes. Or maybe 'WHEN' - since if MSI-X is disabled again, it moves back.
> Let's update the spec to make it clearer?
>
--
Sasha.
^ permalink raw reply
* RE: [PATCH 0000/0046] Staging: hv: Driver cleanup
From: KY Srinivasan @ 2011-08-31 14:27 UTC (permalink / raw)
To: Olaf Hering, Greg KH
Cc: devel@linuxdriverproject.org, gregkh@suse.de,
linux-kernel@vger.kernel.org, virtualization@lists.osdl.org
In-Reply-To: <20110830180434.GA10090@aepfle.de>
> -----Original Message-----
> From: Olaf Hering [mailto:olaf@aepfle.de]
> Sent: Tuesday, August 30, 2011 2:05 PM
> To: Greg KH
> Cc: KY Srinivasan; devel@linuxdriverproject.org; gregkh@suse.de; linux-
> kernel@vger.kernel.org; virtualization@lists.osdl.org
> Subject: Re: [PATCH 0000/0046] Staging: hv: Driver cleanup
>
> On Tue, Aug 30, Greg KH wrote:
>
> > > > In my test system, the IDE drives are now discovered twice, once by
> > > > hv_storvsc and once by libata:
> > >
> > > This is a known (old problem). The way this was handled earlier was to have
> the
> > > modprobe rules in place to setup a dependency that would force the load of
> the
> > > hyper-v driver (blk / stor) ahead of the native driver and if the load of the PV
> > > driver succeeded, we would not load the native driver. In sles11 sp1, we had a
> rule for
> > > loading blkvsc. With the merge of blkvsc and storvsc, the only change we
> need to make
> > > is to have storvsc in the rule (instaed of blkvsc).
> >
> > Why do we need a rule at all? Shouldn't the module dependancy stuff
> > handle the autoloading of the drivers properly from the initrd now that
> > the hotplug logic is hooked up properly?
>
> There is no plan to load hv_vmbus (or xen-platform-pci) earlier than
> native drivers. That was the purpose of the modprobe.conf files. Now
> that there is a vmbus, that fact could be checked before any other
> attempt to load drivers is made and hv_vmbus should be loaded and all of
> its devices have to be probed manually by modprobe `cat modulealias`.
The strategy I was describing was what was used in sles11 sp1.
>
> > Or is the hotplug code not working correctly?
>
> There is nothing to hotplug. hv_vmbus has to be loaded first so that it
> can take over the devices. But it seems that there is no shutdown of the
> emulated hardware, thats why the disk "sda" is shown twice.
>
> I spot a flaw here.
> KY, can hv_vmbus shutdown emulated hardware? At least the disks, because
> cdroms are appearently still be handled by native drivers?
Olaf, unfortunately the vmbus driver does not stop the emulation of the disk devices.
The earlier modprobe rule was also instrumental in preventing the loading of the
native drivers if the hyperv- driver load succeeded.
Regards,
K. Y
^ permalink raw reply
* RE: [PATCH 37/46] Staging: hv: vmbus: Check for events before messages
From: KY Srinivasan @ 2011-08-31 14:22 UTC (permalink / raw)
To: Greg KH
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, virtualization@lists.osdl.org,
Haiyang Zhang
In-Reply-To: <20110830173818.GC22868@kroah.com>
> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Tuesday, August 30, 2011 1:38 PM
> To: KY Srinivasan
> Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org; Haiyang Zhang
> Subject: Re: [PATCH 37/46] Staging: hv: vmbus: Check for events before
> messages
>
> On Tue, Aug 30, 2011 at 05:06:39PM +0000, KY Srinivasan wrote:
> > > On Sat, Aug 27, 2011 at 11:31:36AM -0700, K. Y. Srinivasan wrote:
> > > > Conform to Windows specification by checking for events before messages.
> > >
> > > What specification?
> > >
> > > Care to provide a comment in the code that you are doing this in this
> > > explicit order because of some rule that the hypervisor imposes on us?
> >
> > I am not sure if this is documented anywhere (publicly). In talking to Windows
> > guys, they suggested this is the order in which it is done on Windows guests
> and suggested
> > I should do the same. I will see if there is some public documentation that
> specifies this.
>
> All you need to do is just document it in the code and I'll be happy.
> We don't rely on external documentation for things to be changed, in
> fact, there usually isn't any such thing :)
Ok; will do.
Regards,
K. Y
^ permalink raw reply
* RE: [PATCH 44/46] Staging: hv: vmbus: Fix checkpatch warnings in connection.c
From: KY Srinivasan @ 2011-08-31 14:21 UTC (permalink / raw)
To: Greg KH
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, virtualization@lists.osdl.org,
Haiyang Zhang
In-Reply-To: <20110830174157.GD22868@kroah.com>
> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Tuesday, August 30, 2011 1:42 PM
> To: KY Srinivasan
> Cc: gregkh@suse.de; linux-kernel@vger.kernel.org;
> devel@linuxdriverproject.org; virtualization@lists.osdl.org; Haiyang Zhang
> Subject: Re: [PATCH 44/46] Staging: hv: vmbus: Fix checkpatch warnings in
> connection.c
>
> On Tue, Aug 30, 2011 at 05:11:57PM +0000, KY Srinivasan wrote:
> > Thanks Greg. I will fix this. I got these patches out just before Hurricane Irene
> > hit the east coast. While we were lucky that it was not as bad as was predicted,
> > we lost power and we still don't have power. I have come to a public library in
> > a nearby town to check my email. So, my responses will be sporadic over the
> > next couple of days (until we get power). I will try to address the issues you
> > have raised as quickly as possible.
>
> Ouch, good luck with the power and other cleanup, hopefully you didn't
> have any water damage.
>
> I'm in no rush for further patches, that's being driven by your end :)
Power was restored early this morning. Fortunately, except for lack power and
a few broken branches, we did not really feel the brunt of this hurricane. I am starting
work on addressing the issues you and others have raised.
Regards,
K. Y
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox