diff options
| -rw-r--r-- | drivers/net/xen-netfront.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index c26e28b4bd9f..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) |
