virtio-net.c (d6271b657286de80260413684a1f2a63f44ea17b) virtio-net.c (cd69d47cddabc9adf4562ac968437bb547f46630)
1/*
2 * Virtio Network Device
3 *
4 * Copyright IBM, Corp. 2007
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 806 unchanged lines hidden (view full) ---

815 features = vhost_net_get_features(get_vhost_net(nc->peer), features);
816 vdev->backend_features = features;
817
818 if (n->mtu_bypass_backend &&
819 (n->host_features & 1ULL << VIRTIO_NET_F_MTU)) {
820 features |= (1ULL << VIRTIO_NET_F_MTU);
821 }
822
1/*
2 * Virtio Network Device
3 *
4 * Copyright IBM, Corp. 2007
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *

--- 806 unchanged lines hidden (view full) ---

815 features = vhost_net_get_features(get_vhost_net(nc->peer), features);
816 vdev->backend_features = features;
817
818 if (n->mtu_bypass_backend &&
819 (n->host_features & 1ULL << VIRTIO_NET_F_MTU)) {
820 features |= (1ULL << VIRTIO_NET_F_MTU);
821 }
822
823 /*
824 * Since GUEST_ANNOUNCE is emulated the feature bit could be set without
825 * enabled. This happens in the vDPA case.
826 *
827 * Make sure the feature set is not incoherent, as the driver could refuse
828 * to start.
829 *
830 * TODO: QEMU is able to emulate a CVQ just for guest_announce purposes,
831 * helping guest to notify the new location with vDPA devices that does not
832 * support it.
833 */
834 if (!virtio_has_feature(vdev->backend_features, VIRTIO_NET_F_CTRL_VQ)) {
835 virtio_clear_feature(&features, VIRTIO_NET_F_GUEST_ANNOUNCE);
836 }
837
823 return features;
824}
825
826static uint64_t virtio_net_bad_features(VirtIODevice *vdev)
827{
828 uint64_t features = 0;
829
830 /* Linux kernel 2.6.25. It understood MAC (as everyone must),

--- 3104 unchanged lines hidden ---
838 return features;
839}
840
841static uint64_t virtio_net_bad_features(VirtIODevice *vdev)
842{
843 uint64_t features = 0;
844
845 /* Linux kernel 2.6.25. It understood MAC (as everyone must),

--- 3104 unchanged lines hidden ---