@samitouri / QOSamiQemu / commits / 9b960bbc13

hw/net/virtio-net: Remove VirtIONet::mtu_bypass_backend field

The VirtIONet::mtu_bypass_backend boolean was only set in the hw_compat_2_9[] array, via the 'x-mtu-bypass-backend=off' property. We removed all machines using that array, lets remove that property and all the code around it. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250501210456.89071-17-philmd@linaro.org> Reviewed-by: Igor Mammedov <imammedo@redhat.com> [thuth: Adjusted patch for latest changes in the master branch] Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260225092024.794595-14-thuth@redhat.com>

Philippe Mathieu-Daudé committed Feb 25, 2026 at 10:20 UTC 9b960bbc1361b2ab24022faa4957438c385dbc6e
2 files changed +2 -7
hw/net/virtio-net.c
+2 -6
@@ -935,8 +935,7 @@ static void virtio_net_set_features(VirtIODevice *vdev,
935 int i;
936
937 virtio_features_copy(features, in_features);
938 - if (n->mtu_bypass_backend &&
939 - !virtio_has_feature(vdev->backend_features, VIRTIO_NET_F_MTU)) {
938 + if (!virtio_has_feature(vdev->backend_features, VIRTIO_NET_F_MTU)) {
939 virtio_clear_feature_ex(features, VIRTIO_NET_F_MTU);
940 }
941
@@ -3160,8 +3159,7 @@ static void virtio_net_get_features(VirtIODevice *vdev, uint64_t *features,
3159 vhost_net_get_features_ex(get_vhost_net(nc->peer), features);
3160 virtio_features_copy(vdev->backend_features_ex, features);
3161
3163 - if (n->mtu_bypass_backend &&
3164 - (n->host_features & 1ULL << VIRTIO_NET_F_MTU)) {
3162 + if ((n->host_features & 1ULL << VIRTIO_NET_F_MTU) != 0) {
3163 virtio_add_feature_ex(features, VIRTIO_NET_F_MTU);
3164 }
3165
@@ -4251,8 +4249,6 @@ static const Property virtio_net_properties[] = {
4249 DEFINE_PROP_UINT16("tx_queue_size", VirtIONet, net_conf.tx_queue_size,
4250 VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE),
4251 DEFINE_PROP_UINT16("host_mtu", VirtIONet, net_conf.mtu, 0),
4254 - DEFINE_PROP_BOOL("x-mtu-bypass-backend", VirtIONet, mtu_bypass_backend,
4255 - true),
4252 DEFINE_PROP_INT32("speed", VirtIONet, net_conf.speed, SPEED_UNKNOWN),
4253 DEFINE_PROP_STRING("duplex", VirtIONet, net_conf.duplex_str),
4254 DEFINE_PROP_BOOL("failover", VirtIONet, failover, false),
include/hw/virtio/virtio-net.h
-1
@@ -218,7 +218,6 @@ struct VirtIONet {
218 uint64_t saved_guest_offloads;
219 AnnounceTimer announce_timer;
220 bool needs_vnet_hdr_swap;
221 - bool mtu_bypass_backend;
221 /* primary failover device is hidden*/
222 bool failover_primary_hidden;
223 bool failover;