]> xenbits.xensource.com Git - qemu-xen.git/commit
igb: Always copy ethernet header
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Tue, 23 May 2023 02:43:00 +0000 (11:43 +0900)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 24 May 2023 13:37:48 +0000 (16:37 +0300)
commit02bd13ae3acb3ff3c3c2bcea142d5aee880e3a88
tree736efc19c9701756723c5a4e3b511b860468d1e3
parentc84bcff3d3877658adf0bca3d8087488ecf0f3d9
igb: Always copy ethernet header

igb_receive_internal() used to check the iov length to determine
copy the iovs to a contiguous buffer, but the check is flawed in two
ways:
- It does not ensure that iovcnt > 0.
- It does not take virtio-net header into consideration.

The size of this copy is just 22 octets, which can be even less than
the code size required for checks. This (wrong) optimization is probably
not worth so just remove it. Removing this also allows igb to assume
aligned accesses for the ethernet header.

Fixes: 3a977deebe ("Intrdocue igb device emulation")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit dc9ef1bf454811646b3ee6387f1b96f63f538a18)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/net/igb_core.c