Skip to contentSkip to conversation

virtio-net: mac property is mandatory

PATCH Applied Michael S. Tsirkin 2 participants 2 messages Jan 12, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-net: mac property is mandatory

Mac feature bit isn't going to work as all network cards already have a 'mac' property to set the mac address. Remove it from mask and add in get_features.

---
 hw/virtio-net.c |    2 ++
 hw/virtio-net.h |    1 -
 2 files changed, 2 insertions(+), 1 deletions(-)
hw/virtio-net.c +2 -0
index c2a389f..02d9180 100644
@@ -151,6 +151,8 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features)
 {
     VirtIONet *n = to_virtio_net(vdev);
 
+    features |= (1 << VIRTIO_NET_F_MAC);
+
     if (peer_has_vnet_hdr(n)) {
         tap_using_vnet_hdr(n->nic->nc.peer, 1);
     } else {
hw/virtio-net.h +0 -1
index 9130d75..e55119b 100644
@@ -157,7 +157,6 @@ struct virtio_net_ctrl_mac {
         DEFINE_VIRTIO_COMMON_FEATURES(_state, _field), \
         DEFINE_PROP_BIT("csum", _state, _field, VIRTIO_NET_F_CSUM, true), \
         DEFINE_PROP_BIT("guest_csum", _state, _field, VIRTIO_NET_F_GUEST_CSUM, true), \
-        DEFINE_PROP_BIT("mac", _state, _field, VIRTIO_NET_F_MAC, true), \
         DEFINE_PROP_BIT("gso", _state, _field, VIRTIO_NET_F_GSO, true), \
         DEFINE_PROP_BIT("guest_tso4", _state, _field, VIRTIO_NET_F_GUEST_TSO4, true), \
         DEFINE_PROP_BIT("guest_tso6", _state, _field, VIRTIO_NET_F_GUEST_TSO6, true), \
Signature · 1 line
1.6.6.rc1.43.gf55cc
#1 lore raw
Quoted 7 lines · Michael S. Tsirkin

Mac feature bit isn't going to work as all network cards already have a 'mac' property to set the mac address. Remove it from mask and add in get_features.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 31 lines
---
  hw/virtio-net.c |    2 ++
  hw/virtio-net.h |    1 -
  2 files changed, 2 insertions(+), 1 deletions(-)
hw/virtio-net.c +2 -0
index c2a389f..02d9180 100644
@@ -151,6 +151,8 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features)
  {
      VirtIONet *n = to_virtio_net(vdev);
 
+    features |= (1<<  VIRTIO_NET_F_MAC);
+
      if (peer_has_vnet_hdr(n)) {
          tap_using_vnet_hdr(n->nic->nc.peer, 1);
      } else {
hw/virtio-net.h +0 -1
index 9130d75..e55119b 100644
@@ -157,7 +157,6 @@ struct virtio_net_ctrl_mac {
          DEFINE_VIRTIO_COMMON_FEATURES(_state, _field), \
          DEFINE_PROP_BIT("csum", _state, _field, VIRTIO_NET_F_CSUM, true), \
          DEFINE_PROP_BIT("guest_csum", _state, _field, VIRTIO_NET_F_GUEST_CSUM, true), \
-        DEFINE_PROP_BIT("mac", _state, _field, VIRTIO_NET_F_MAC, true), \
          DEFINE_PROP_BIT("gso", _state, _field, VIRTIO_NET_F_GSO, true), \
          DEFINE_PROP_BIT("guest_tso4", _state, _field, VIRTIO_NET_F_GUEST_TSO4, true), \
          DEFINE_PROP_BIT("guest_tso6", _state, _field, VIRTIO_NET_F_GUEST_TSO6, true), \