[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 20/25] vmxnet3: Pad short frames to minimum size (6
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 20/25] vmxnet3: Pad short frames to minimum size (60 bytes) |
Date: |
Wed, 27 Aug 2014 12:36:17 -0500 |
From: Ben Draper <address@hidden>
When running VMware ESXi under qemu-kvm the guest discards frames
that are too short. Short ARP Requests will be dropped, this prevents
guests on the same bridge as VMware ESXi from communicating. This patch
simply adds the padding on the network device itself.
Signed-off-by: Ben Draper <address@hidden>
Reviewed-by: Dmitry Fleytman <address@hidden>
Cc: address@hidden
Signed-off-by: Michael Tokarev <address@hidden>
(cherry picked from commit 40a87c6c9b11ef9c14e0301f76abf0eb2582f08e)
Signed-off-by: Michael Roth <address@hidden>
---
hw/net/vmxnet3.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 77bea6f..ae3e50f 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -34,6 +34,7 @@
#define PCI_DEVICE_ID_VMWARE_VMXNET3_REVISION 0x1
#define VMXNET3_MSIX_BAR_SIZE 0x2000
+#define MIN_BUF_SIZE 60
#define VMXNET3_BAR0_IDX (0)
#define VMXNET3_BAR1_IDX (1)
@@ -1871,12 +1872,21 @@ vmxnet3_receive(NetClientState *nc, const uint8_t *buf,
size_t size)
{
VMXNET3State *s = qemu_get_nic_opaque(nc);
size_t bytes_indicated;
+ uint8_t min_buf[MIN_BUF_SIZE];
if (!vmxnet3_can_receive(nc)) {
VMW_PKPRN("Cannot receive now");
return -1;
}
+ /* Pad to minimum Ethernet frame length */
+ if (size < sizeof(min_buf)) {
+ memcpy(min_buf, buf, size);
+ memset(&min_buf[size], 0, sizeof(min_buf) - size);
+ buf = min_buf;
+ size = sizeof(min_buf);
+ }
+
if (s->peer_has_vhdr) {
vmxnet_rx_pkt_set_vhdr(s->rx_pkt, (struct virtio_net_hdr *)buf);
buf += sizeof(struct virtio_net_hdr);
--
1.9.1
- [Qemu-stable] [PATCH 13/25] target-arm: Fix return address for A64 BRK instructions, (continued)
- [Qemu-stable] [PATCH 13/25] target-arm: Fix return address for A64 BRK instructions, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 11/25] acpi: align RSDP, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 12/25] virtio-blk: fix reference a pointer which might be freed, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 01/25] qmp: hide "hotplugged" device property from device-list-properties, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 15/25] arm/virt: Use PSCI v0.2 function IDs in the DT when KVM uses PSCI v0.2, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 17/25] raw-posix: fix O_DIRECT short reads, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 16/25] block/iscsi: fix memory corruption on iscsi resize, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 19/25] blkdebug: Delete BH in bdrv_aio_cancel, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 18/25] qemu-iotests: add test case 101 for short file I/O, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 21/25] hostmem: set MPOL_MF_MOVE, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 20/25] vmxnet3: Pad short frames to minimum size (60 bytes),
Michael Roth <=
- [Qemu-stable] [PATCH 23/25] pc: reserve more memory for ACPI for new machine types, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 25/25] thread-pool: avoid deadlock in nested aio_poll() calls, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 24/25] thread-pool: avoid per-thread-pool EventNotifier, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 14/25] target-arm: Rename QEMU PSCI v0.1 definitions, Michael Roth, 2014/08/27
- [Qemu-stable] [PATCH 22/25] pcihp: fix possible array out of bounds, Michael Roth, 2014/08/27
- Re: [Qemu-stable] [Qemu-devel] Patch Round-up for stable 2.1.1, freeze on 2014-09-03, zhanghailiang, 2014/08/28
- Re: [Qemu-stable] Patch Round-up for stable 2.1.1, freeze on 2014-09-03, Paolo Bonzini, 2014/08/29