Commit a55d9766 authored by Andrew J. Bennieston's avatar Andrew J. Bennieston Committed by David S. Miller

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: default avatarAndrew J. Bennieston <andrew.bennieston@citrix.com>
Acked-by: default avatarWei Liu <wei.liu2@citrix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9bcc14d2
...@@ -158,8 +158,7 @@ struct xenvif { ...@@ -158,8 +158,7 @@ struct xenvif {
struct timer_list wake_queue; struct timer_list wake_queue;
/* This array is allocated seperately as it is large */ struct gnttab_copy grant_copy_op[MAX_GRANT_COPY_OPS];
struct gnttab_copy *grant_copy_op;
/* We create one meta structure per ring request we consume, so /* We create one meta structure per ring request we consume, so
* the maximum number is the same as the ring size. * the maximum number is the same as the ring size.
......
...@@ -334,14 +334,6 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, ...@@ -334,14 +334,6 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
vif = netdev_priv(dev); vif = netdev_priv(dev);
vif->grant_copy_op = vmalloc(sizeof(struct gnttab_copy) *
MAX_GRANT_COPY_OPS);
if (vif->grant_copy_op == NULL) {
pr_warn("Could not allocate grant copy space for %s\n", name);
free_netdev(dev);
return ERR_PTR(-ENOMEM);
}
vif->domid = domid; vif->domid = domid;
vif->handle = handle; vif->handle = handle;
vif->can_sg = 1; vif->can_sg = 1;
...@@ -601,7 +593,6 @@ void xenvif_free(struct xenvif *vif) ...@@ -601,7 +593,6 @@ void xenvif_free(struct xenvif *vif)
unregister_netdev(vif->dev); unregister_netdev(vif->dev);
vfree(vif->grant_copy_op);
free_netdev(vif->dev); free_netdev(vif->dev);
module_put(THIS_MODULE); module_put(THIS_MODULE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment