aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netfront.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r--drivers/net/xen-netfront.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index fc24eb9b3948..7ffa43bd7cf9 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1015,29 +1015,10 @@ err:
1015 i = xennet_fill_frags(np, skb, &tmpq); 1015 i = xennet_fill_frags(np, skb, &tmpq);
1016 1016
1017 /* 1017 /*
1018 * Truesize approximates the size of true data plus 1018 * Truesize is the actual allocation size, even if the
1019 * any supervisor overheads. Adding hypervisor 1019 * allocation is only partially used.
1020 * overheads has been shown to significantly reduce 1020 */
1021 * achievable bandwidth with the default receive 1021 skb->truesize += PAGE_SIZE * skb_shinfo(skb)->nr_frags;
1022 * buffer size. It is therefore not wise to account
1023 * for it here.
1024 *
1025 * After alloc_skb(RX_COPY_THRESHOLD), truesize is set
1026 * to RX_COPY_THRESHOLD + the supervisor
1027 * overheads. Here, we add the size of the data pulled
1028 * in xennet_fill_frags().
1029 *
1030 * We also adjust for any unused space in the main
1031 * data area by subtracting (RX_COPY_THRESHOLD -
1032 * len). This is especially important with drivers
1033 * which split incoming packets into header and data,
1034 * using only 66 bytes of the main data area (see the
1035 * e1000 driver for example.) On such systems,
1036 * without this last adjustement, our achievable
1037 * receive throughout using the standard receive
1038 * buffer size was cut by 25%(!!!).
1039 */
1040 skb->truesize += skb->data_len - RX_COPY_THRESHOLD;
1041 skb->len += skb->data_len; 1022 skb->len += skb->data_len;
1042 1023
1043 if (rx->flags & XEN_NETRXF_csum_blank) 1024 if (rx->flags & XEN_NETRXF_csum_blank)
@@ -1311,7 +1292,7 @@ static const struct net_device_ops xennet_netdev_ops = {
1311#endif 1292#endif
1312}; 1293};
1313 1294
1314static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev) 1295static struct net_device *xennet_create_dev(struct xenbus_device *dev)
1315{ 1296{
1316 int i, err; 1297 int i, err;
1317 struct net_device *netdev; 1298 struct net_device *netdev;
@@ -1407,8 +1388,8 @@ static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev
1407 * structures and the ring buffers for communication with the backend, and 1388 * structures and the ring buffers for communication with the backend, and
1408 * inform the backend of the appropriate details for those. 1389 * inform the backend of the appropriate details for those.
1409 */ 1390 */
1410static int __devinit netfront_probe(struct xenbus_device *dev, 1391static int netfront_probe(struct xenbus_device *dev,
1411 const struct xenbus_device_id *id) 1392 const struct xenbus_device_id *id)
1412{ 1393{
1413 int err; 1394 int err;
1414 struct net_device *netdev; 1395 struct net_device *netdev;
@@ -1967,7 +1948,7 @@ static const struct xenbus_device_id netfront_ids[] = {
1967}; 1948};
1968 1949
1969 1950
1970static int __devexit xennet_remove(struct xenbus_device *dev) 1951static int xennet_remove(struct xenbus_device *dev)
1971{ 1952{
1972 struct netfront_info *info = dev_get_drvdata(&dev->dev); 1953 struct netfront_info *info = dev_get_drvdata(&dev->dev);
1973 1954
@@ -1990,7 +1971,7 @@ static int __devexit xennet_remove(struct xenbus_device *dev)
1990 1971
1991static DEFINE_XENBUS_DRIVER(netfront, , 1972static DEFINE_XENBUS_DRIVER(netfront, ,
1992 .probe = netfront_probe, 1973 .probe = netfront_probe,
1993 .remove = __devexit_p(xennet_remove), 1974 .remove = xennet_remove,
1994 .resume = netfront_resume, 1975 .resume = netfront_resume,
1995 .otherend_changed = netback_changed, 1976 .otherend_changed = netback_changed,
1996); 1977);