diff options
author | Andrew J. Bennieston <andrew.bennieston@citrix.com> | 2014-06-04 05:30:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-04 17:48:16 -0400 |
commit | a55d9766cecf2b1b9af4fcf93b2d41b71e599c76 (patch) | |
tree | d0900ed18437217a6270bed86af5e97c82b1e45e /drivers/net/xen-netback | |
parent | 9bcc14d23982491998dc43ef321884f3408399c7 (diff) |
xen-netback: Move grant_copy_op array back into struct xenvif.
This array was allocated separately in commit ac3d5ac2 ("xen-netback:
fix guest-receive-side array sizes") due to it being very large, and a
struct xenvif is allocated as the netdev_priv part of a struct
net_device, i.e. via kmalloc() but falling back to vmalloc() if the
initial alloc. fails.
In preparation for the multi-queue patches, where this array becomes
part of struct xenvif_queue and is always allocated through vzalloc(),
move this back into the struct xenvif.
Signed-off-by: Andrew J. Bennieston <andrew.bennieston@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback')
-rw-r--r-- | drivers/net/xen-netback/common.h | 3 | ||||
-rw-r--r-- | drivers/net/xen-netback/interface.c | 9 |
2 files changed, 1 insertions, 11 deletions
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 0d4a285cbd7e..2c283d693330 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h | |||
@@ -158,8 +158,7 @@ struct xenvif { | |||
158 | 158 | ||
159 | struct timer_list wake_queue; | 159 | struct timer_list wake_queue; |
160 | 160 | ||
161 | /* This array is allocated seperately as it is large */ | 161 | struct gnttab_copy grant_copy_op[MAX_GRANT_COPY_OPS]; |
162 | struct gnttab_copy *grant_copy_op; | ||
163 | 162 | ||
164 | /* We create one meta structure per ring request we consume, so | 163 | /* We create one meta structure per ring request we consume, so |
165 | * the maximum number is the same as the ring size. | 164 | * the maximum number is the same as the ring size. |
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 53cdcdf3dfa1..8fdedac3fab2 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -334,14 +334,6 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, | |||
334 | 334 | ||
335 | vif = netdev_priv(dev); | 335 | vif = netdev_priv(dev); |
336 | 336 | ||
337 | vif->grant_copy_op = vmalloc(sizeof(struct gnttab_copy) * | ||
338 | MAX_GRANT_COPY_OPS); | ||
339 | if (vif->grant_copy_op == NULL) { | ||
340 | pr_warn("Could not allocate grant copy space for %s\n", name); | ||
341 | free_netdev(dev); | ||
342 | return ERR_PTR(-ENOMEM); | ||
343 | } | ||
344 | |||
345 | vif->domid = domid; | 337 | vif->domid = domid; |
346 | vif->handle = handle; | 338 | vif->handle = handle; |
347 | vif->can_sg = 1; | 339 | vif->can_sg = 1; |
@@ -601,7 +593,6 @@ void xenvif_free(struct xenvif *vif) | |||
601 | 593 | ||
602 | unregister_netdev(vif->dev); | 594 | unregister_netdev(vif->dev); |
603 | 595 | ||
604 | vfree(vif->grant_copy_op); | ||
605 | free_netdev(vif->dev); | 596 | free_netdev(vif->dev); |
606 | 597 | ||
607 | module_put(THIS_MODULE); | 598 | module_put(THIS_MODULE); |