hw/net: virtio-net: Initialize nc->do_not_pad to true
authorBin Meng <bmeng.cn@gmail.com>
Wed, 17 Mar 2021 06:26:30 +0000 (14:26 +0800)
committerJason Wang <jasowang@redhat.com>
Mon, 22 Mar 2021 09:34:31 +0000 (17:34 +0800)
For virtio-net, there is no need to pad the Ethernet frame size to
60 bytes before sending to it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/virtio-net.c

index 96a3cc8357e0579ae6518d974aa03b395aa8f510..66b9ff451185c8ad20f3b94bd310b143d635c9c1 100644 (file)
@@ -3314,6 +3314,10 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
                               object_get_typename(OBJECT(dev)), dev->id, n);
     }
 
+    for (i = 0; i < n->max_queues; i++) {
+        n->nic->ncs[i].do_not_pad = true;
+    }
+
     peer_test_vnet_hdr(n);
     if (peer_has_vnet_hdr(n)) {
         for (i = 0; i < n->max_queues; i++) {