linux/drivers
Vitaly Kuznetsov fd07160bb7 xen-netfront: avoid packet loss when ethernet header crosses page boundary
Small packet loss is reported on complex multi host network configurations
including tunnels, NAT, ... My investigation led me to the following check
in netback which drops packets:

        if (unlikely(txreq.size < ETH_HLEN)) {
                netdev_err(queue->vif->dev,
                           "Bad packet size: %d\n", txreq.size);
                xenvif_tx_err(queue, &txreq, extra_count, idx);
                break;
        }

But this check itself is legitimate. SKBs consist of a linear part (which
has to have the ethernet header) and (optionally) a number of frags.
Netfront transmits the head of the linear part up to the page boundary
as the first request and all the rest becomes frags so when we're
reconstructing the SKB in netback we can't distinguish between original
frags and the 'tail' of the linear part. The first SKB needs to be at
least ETH_HLEN size. So in case we have an SKB with its linear part
starting too close to the page boundary the packet is lost.

I see two ways to fix the issue:
- Change the 'wire' protocol between netfront and netback to start keeping
  the original SKB structure. We'll have to add a flag indicating the fact
  that the particular request is a part of the original linear part and not
  a frag. We'll need to know the length of the linear part to pre-allocate
  memory.
- Avoid transmitting SKBs with linear parts starting too close to the page
  boundary. That seems preferable short-term and shouldn't bring
  significant performance degradation as such packets are rare. That's what
  this patch is trying to achieve with skb_copy().

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-20 04:40:41 -04:00
..
accessibility
acpi Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm 2016-09-10 09:58:52 -07:00
amba
android
ata pata_ninja32: Avoid corrupting status flags 2016-08-30 11:59:47 -04:00
atm atm: iphase: fix newline escape and minor tweak to source formatting 2016-09-15 19:15:55 -04:00
auxdisplay
base regmap: Fixes for v4.8 2016-09-06 11:02:36 -07:00
bcma bcma: use of_dma_configure() to set initial dma mask 2016-09-09 12:00:37 +03:00
block Revert "floppy: refactor open() flags handling" 2016-08-25 08:56:51 -06:00
bluetooth
bus arm-cci: pmu: Fix typo in event name 2016-09-07 21:24:42 -07:00
cdrom
char virtio: fixes for 4.8 2016-09-09 14:52:05 -07:00
clk Some fixes for rk3399 register errors that revealed themself 2016-08-29 17:08:35 -07:00
clocksource clocksource/drivers/atmel-pit: Fix compilation error 2016-08-29 09:51:39 +02:00
connector
cpufreq cpufreq: dt: Add terminate entry for of_device_id tables 2016-08-31 02:49:05 +02:00
cpuidle
crypto chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's 2016-09-19 01:37:32 -04:00
dax dax: fix mapping size check 2016-09-03 10:40:57 -07:00
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2016-09-08 12:19:24 -07:00
fmc
fpga
gpio gpio: sa1100: fix irq probing for ucb1x00 2016-09-08 00:42:57 +02:00
gpu This pull request brings in fixes for VC4 3D in 4.8, most of which are 2016-09-02 15:55:15 +10:00
hid
hsi
hv
hwmon hwmon: (it87) Add missing sysfs attribute group terminator 2016-08-29 05:31:31 -07:00
hwspinlock
hwtracing
i2c i2c: rk3x: Restore clock settings at resume time 2016-09-08 22:50:33 +02:00
ide
idle
iio Second set of IIO fixes for the 4.8 cycle. 2016-09-09 13:44:37 +02:00
infiniband chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's 2016-09-19 01:37:32 -04:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2016-08-26 18:36:23 -07:00
iommu
ipack
irqchip irqchip/mips-gic: Implement activate op for device domain 2016-08-22 18:37:51 +02:00
isdn mISDN: mark symbols static where possible 2016-09-01 23:36:17 -07:00
leds
lguest
lightnvm
macintosh
mailbox fix📫bcm-pdc-mailbox:mark symbols static where possible 2016-08-29 18:43:39 +05:30
mcb
md - a stable fix in both DM crypt and DM log-writes for too large bios (as 2016-09-03 17:29:58 -07:00
media
memory
memstick
message
mfd
misc lkdtm: adjust usercopy tests to bypass const checks 2016-09-06 12:17:30 -07:00
mmc mmc: fix use-after-free of struct request 2016-08-25 14:11:43 -06:00
mtd
net xen-netfront: avoid packet loss when ethernet header crosses page boundary 2016-09-20 04:40:41 -04:00
nfc
ntb
nubus
nvdimm libnvdimm: allow legacy (e820) pmem region to clear bad blocks 2016-09-09 17:34:46 -07:00
nvme nvme: make NVME_RDMA depend on BLOCK 2016-09-11 14:41:49 -07:00
nvmem
of
oprofile
parisc
parport
pci Char/Misc driver fixes for 4.8-rc5 2016-09-03 11:38:43 -07:00
pcmcia
perf drivers/perf: arm_pmu: Fix NULL pointer dereference during probe 2016-09-02 17:17:52 +01:00
phy
pinctrl pinctrl: sunxi: fix uart1 CTS/RTS pins at PG on A23/A33 2016-08-23 12:28:31 +02:00
platform intel_pmic_gpio: Make explicitly non-modular 2016-08-28 22:31:52 -07:00
pnp
power
powercap
pps
ps3
ptp ptp: ixp46x: remove NO_IRQ handling 2016-09-06 16:57:02 -07:00
pwm
rapidio rapidio/tsi721: fix incorrect detection of address translation condition 2016-09-01 17:52:02 -07:00
ras
regulator Merge remote-tracking branches 'regulator/fix/email' and 'regulator/fix/qcom-smd' into regulator-linus 2016-09-06 12:31:34 +01:00
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's 2016-09-19 01:37:32 -04:00
sfi
sh
sn
soc
spi Merge remote-tracking branches 'spi/fix/lock', 'spi/fix/maintainers', 'spi/fix/put', 'spi/fix/pxa2xx', 'spi/fix/sh-msiof' and 'spi/fix/timeout' into spi-linus 2016-09-06 12:32:09 +01:00
spmi
ssb
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-09-12 15:52:44 -07:00
target chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's 2016-09-19 01:37:32 -04:00
tc
thermal thermal: rcar_thermal: Fix priv->zone error handling 2016-09-06 20:46:06 +08:00
thunderbolt thunderbolt: Don't declare Falcon Ridge unsupported 2016-08-31 13:25:02 +02:00
tty serial: 8250: added acces i/o products quad and octal serial cards 2016-08-31 16:28:26 +02:00
uio
usb usb: fixes for v4.8-rc6 2016-09-09 15:11:35 +02:00
uwb
vfio
vhost vhost/scsi: fix reuse of &vq->iov[out] in response 2016-08-23 17:16:57 +03:00
video
virt
virtio virtio: mark vring_dma_dev() static 2016-09-09 21:12:35 +03:00
vlynq
vme
w1
watchdog
xen xenbus: don't look up transaction IDs for ordinary writes 2016-08-24 18:16:18 +01:00
zorro
Kconfig
Makefile