Skip to content

Commit

Permalink
hyperv: Remove extra allocated space for recv_pkt_list elements
Browse files Browse the repository at this point in the history
The receive code path doesn't use the page buffer, so remove the
extra allocated space here.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Haiyang Zhang authored and David S. Miller committed Oct 2, 2012
1 parent 99e3fcf commit 6562640
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions drivers/net/hyperv/hyperv_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,6 @@ struct nvsp_message {

#define NETVSC_RECEIVE_BUFFER_ID 0xcafe

#define NETVSC_RECEIVE_SG_COUNT 1

/* Preallocated receive packets */
#define NETVSC_RECEIVE_PACKETLIST_COUNT 256

Expand Down
4 changes: 1 addition & 3 deletions drivers/net/hyperv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,9 +904,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
INIT_LIST_HEAD(&net_device->recv_pkt_list);

for (i = 0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++) {
packet = kzalloc(sizeof(struct hv_netvsc_packet) +
(NETVSC_RECEIVE_SG_COUNT *
sizeof(struct hv_page_buffer)), GFP_KERNEL);
packet = kzalloc(sizeof(struct hv_netvsc_packet), GFP_KERNEL);
if (!packet)
break;

Expand Down

0 comments on commit 6562640

Please sign in to comment.