Browse Source

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>
master
Philippe Mathieu-Daudé 5 months ago
committed by Thomas Huth
parent
commit
9b960bbc13
  1. 8
      hw/net/virtio-net.c
  2. 1
      include/hw/virtio/virtio-net.h

8
hw/net/virtio-net.c

@ -935,8 +935,7 @@ static void virtio_net_set_features(VirtIODevice *vdev,
int i;
virtio_features_copy(features, in_features);
if (n->mtu_bypass_backend &&
!virtio_has_feature(vdev->backend_features, VIRTIO_NET_F_MTU)) {
if (!virtio_has_feature(vdev->backend_features, VIRTIO_NET_F_MTU)) {
virtio_clear_feature_ex(features, VIRTIO_NET_F_MTU);
}
@ -3160,8 +3159,7 @@ static void virtio_net_get_features(VirtIODevice *vdev, uint64_t *features,
vhost_net_get_features_ex(get_vhost_net(nc->peer), features);
virtio_features_copy(vdev->backend_features_ex, features);
if (n->mtu_bypass_backend &&
(n->host_features & 1ULL << VIRTIO_NET_F_MTU)) {
if ((n->host_features & 1ULL << VIRTIO_NET_F_MTU) != 0) {
virtio_add_feature_ex(features, VIRTIO_NET_F_MTU);
}
@ -4251,8 +4249,6 @@ static const Property virtio_net_properties[] = {
DEFINE_PROP_UINT16("tx_queue_size", VirtIONet, net_conf.tx_queue_size,
VIRTIO_NET_TX_QUEUE_DEFAULT_SIZE),
DEFINE_PROP_UINT16("host_mtu", VirtIONet, net_conf.mtu, 0),
DEFINE_PROP_BOOL("x-mtu-bypass-backend", VirtIONet, mtu_bypass_backend,
true),
DEFINE_PROP_INT32("speed", VirtIONet, net_conf.speed, SPEED_UNKNOWN),
DEFINE_PROP_STRING("duplex", VirtIONet, net_conf.duplex_str),
DEFINE_PROP_BOOL("failover", VirtIONet, failover, false),

1
include/hw/virtio/virtio-net.h

@ -218,7 +218,6 @@ struct VirtIONet {
uint64_t saved_guest_offloads;
AnnounceTimer announce_timer;
bool needs_vnet_hdr_swap;
bool mtu_bypass_backend;
/* primary failover device is hidden*/
bool failover_primary_hidden;
bool failover;

Loading…
Cancel
Save