[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 04/12] hw/net: virtio-net: Initialize nc->do_not_pad to true
From: |
Bin Meng |
Subject: |
[PATCH v4 04/12] hw/net: virtio-net: Initialize nc->do_not_pad to true |
Date: |
Tue, 16 Mar 2021 20:04:12 +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>
---
(no changes since v1)
hw/net/virtio-net.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 96a3cc8357..66b9ff4511 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -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++) {
--
2.25.1
- [PATCH v4 00/12] net: Pad short frames for network backends, Bin Meng, 2021/03/16
- [PATCH v4 01/12] net: eth: Add a helper to pad a short Ethernet frame, Bin Meng, 2021/03/16
- [PATCH v4 02/12] net: Add a 'do_not_pad" to NetClientState, Bin Meng, 2021/03/16
- [PATCH v4 03/12] net: Pad short frames to minimum size before sending from SLiRP/TAP, Bin Meng, 2021/03/16
- [PATCH v4 04/12] hw/net: virtio-net: Initialize nc->do_not_pad to true,
Bin Meng <=
- [PATCH v4 05/12] hw/net: e1000: Remove the logic of padding short frames in the receive path, Bin Meng, 2021/03/16
- [PATCH v4 06/12] hw/net: vmxnet3: Remove the logic of padding short frames in the receive path, Bin Meng, 2021/03/16
- [PATCH v4 07/12] hw/net: i82596: Remove the logic of padding short frames in the receive path, Bin Meng, 2021/03/16
- [PATCH v4 08/12] hw/net: ne2000: Remove the logic of padding short frames in the receive path, Bin Meng, 2021/03/16
- [PATCH v4 09/12] hw/net: pcnet: Remove the logic of padding short frames in the receive path, Bin Meng, 2021/03/16
- [PATCH v4 10/12] hw/net: rtl8139: Remove the logic of padding short frames in the receive path, Bin Meng, 2021/03/16
- [PATCH v4 11/12] hw/net: sungem: Remove the logic of padding short frames in the receive path, Bin Meng, 2021/03/16
- [PATCH v4 12/12] hw/net: sunhme: Remove the logic of padding short frames in the receive path, Bin Meng, 2021/03/16