qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-net: mac property is mandatory
@ 2010-01-12 18:50 Michael S. Tsirkin
  2010-01-12 20:36 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2010-01-12 18:50 UTC (permalink / raw)
  To: qemu-devel, Anthony Liguori, Gerd Hoffmann

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.

Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio-net.c |    2 ++
 hw/virtio-net.h |    1 -
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index c2a389f..02d9180 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -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 {
diff --git a/hw/virtio-net.h b/hw/virtio-net.h
index 9130d75..e55119b 100644
--- a/hw/virtio-net.h
+++ b/hw/virtio-net.h
@@ -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), \
-- 
1.6.6.rc1.43.gf55cc

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-net: mac property is mandatory
  2010-01-12 18:50 [Qemu-devel] [PATCH] virtio-net: mac property is mandatory Michael S. Tsirkin
@ 2010-01-12 20:36 ` Anthony Liguori
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2010-01-12 20:36 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel, Gerd Hoffmann

On 01/12/2010 12:50 PM, Michael S. Tsirkin wrote:
> 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.
>
> Reported-by: Gerd Hoffmann<kraxel@redhat.com>
> Signed-off-by: Michael S. Tsirkin<mst@redhat.com>
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> ---
>   hw/virtio-net.c |    2 ++
>   hw/virtio-net.h |    1 -
>   2 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> index c2a389f..02d9180 100644
> --- a/hw/virtio-net.c
> +++ b/hw/virtio-net.c
> @@ -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 {
> diff --git a/hw/virtio-net.h b/hw/virtio-net.h
> index 9130d75..e55119b 100644
> --- a/hw/virtio-net.h
> +++ b/hw/virtio-net.h
> @@ -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), \
>    

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-12 20:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-12 18:50 [Qemu-devel] [PATCH] virtio-net: mac property is mandatory Michael S. Tsirkin
2010-01-12 20:36 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).