aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/netvsc_drv.c
diff options
context:
space:
mode:
authorHaiyang Zhang <haiyangz@microsoft.com>2011-12-15 16:45:15 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-04 19:13:05 -0500
commit453263421f88b4a7e508c2e7b639c97e99c5b118 (patch)
treeb38aaaccac96fda0b3b6e25c05b0bbbbe7a84567 /drivers/net/hyperv/netvsc_drv.c
parent3b148be0df8e45a0259d7e84001cf02e897af614 (diff)
net/hyperv: Remove unnecessary kmap_atomic in netvsc driver
__get_free_pages() doesn't return HI memory, so the memory is always mapped. kmap_atomic() is not necessary here. This patch removes the kmap_atomic() calls and related code for locking and page manipulation. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/hyperv/netvsc_drv.c')
-rw-r--r--drivers/net/hyperv/netvsc_drv.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 7da85ebd7ac..b7cbd126f20 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -251,9 +251,6 @@ int netvsc_recv_callback(struct hv_device *device_obj,
251{ 251{
252 struct net_device *net = dev_get_drvdata(&device_obj->device); 252 struct net_device *net = dev_get_drvdata(&device_obj->device);
253 struct sk_buff *skb; 253 struct sk_buff *skb;
254 void *data;
255 int i;
256 unsigned long flags;
257 struct netvsc_device *net_device; 254 struct netvsc_device *net_device;
258 255
259 net_device = hv_get_drvdata(device_obj); 256 net_device = hv_get_drvdata(device_obj);
@@ -272,27 +269,12 @@ int netvsc_recv_callback(struct hv_device *device_obj,
272 return 0; 269 return 0;
273 } 270 }
274 271
275 /* for kmap_atomic */
276 local_irq_save(flags);
277
278 /* 272 /*
279 * Copy to skb. This copy is needed here since the memory pointed by 273 * Copy to skb. This copy is needed here since the memory pointed by
280 * hv_netvsc_packet cannot be deallocated 274 * hv_netvsc_packet cannot be deallocated
281 */ 275 */
282 for (i = 0; i < packet->page_buf_cnt; i++) { 276 memcpy(skb_put(skb, packet->total_data_buflen), packet->data,
283 data = kmap_atomic(pfn_to_page(packet->page_buf[i].pfn), 277 packet->total_data_buflen);
284 KM_IRQ1);
285 data = (void *)(unsigned long)data +
286 packet->page_buf[i].offset;
287
288 memcpy(skb_put(skb, packet->page_buf[i].len), data,
289 packet->page_buf[i].len);
290
291 kunmap_atomic((void *)((unsigned long)data -
292 packet->page_buf[i].offset), KM_IRQ1);
293 }
294
295 local_irq_restore(flags);
296 278
297 skb->protocol = eth_type_trans(skb, net); 279 skb->protocol = eth_type_trans(skb, net);
298 skb->ip_summed = CHECKSUM_NONE; 280 skb->ip_summed = CHECKSUM_NONE;