All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Alex Williamson <alex.williamson@hp.com>
Cc: kvm <kvm@vger.kernel.org>, qemu-devel <qemu-devel@nongnu.org>,
	Mark McLoughlin <markmc@redhat.com>
Subject: Re: [PATCH 3/5][RFC] virtio-net: Name the status bits, adding promisc and allmulti
Date: Wed, 07 Jan 2009 12:09:42 -0600	[thread overview]
Message-ID: <4964EFE6.2060209@codemonkey.ws> (raw)
In-Reply-To: <1231349859.7109.82.camel@lappy>

Alex Williamson wrote:
> virtio-net: Name the status bits, adding promisc and allmulti
>
> Signed-off-by: Alex Williamson <alex.williamson@hp.com>
> ---
>
>  hw/virtio-net.c |   36 ++++++++++++++++++++++++------------
>  hw/virtio-net.h |   11 ++++++++++-
>  2 files changed, 34 insertions(+), 13 deletions(-)
>
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> index 77e3077..653cad4 100644
> --- a/hw/virtio-net.c
> +++ b/hw/virtio-net.c
> @@ -22,7 +22,14 @@ typedef struct VirtIONet
>  {
>      VirtIODevice vdev;
>      uint8_t mac[6];
> -    uint16_t status;
> +    union {
> +        uint16_t raw;
> +        struct {
> +            uint16_t link:1;
> +            uint16_t promisc:1;
> +            uint16_t allmulti:1;
> +        } bits;
> +    } status;
>   

I'd prefer the use of #define's like we have today.  bit fields have 
really weird packing and ordering properties across architectures.

Regards,

Anthony Liguori


WARNING: multiple messages have this Message-ID (diff)
From: Anthony Liguori <anthony@codemonkey.ws>
To: Alex Williamson <alex.williamson@hp.com>
Cc: Mark McLoughlin <markmc@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>, kvm <kvm@vger.kernel.org>
Subject: [Qemu-devel] Re: [PATCH 3/5][RFC] virtio-net: Name the status bits, adding promisc and allmulti
Date: Wed, 07 Jan 2009 12:09:42 -0600	[thread overview]
Message-ID: <4964EFE6.2060209@codemonkey.ws> (raw)
In-Reply-To: <1231349859.7109.82.camel@lappy>

Alex Williamson wrote:
> virtio-net: Name the status bits, adding promisc and allmulti
>
> Signed-off-by: Alex Williamson <alex.williamson@hp.com>
> ---
>
>  hw/virtio-net.c |   36 ++++++++++++++++++++++++------------
>  hw/virtio-net.h |   11 ++++++++++-
>  2 files changed, 34 insertions(+), 13 deletions(-)
>
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> index 77e3077..653cad4 100644
> --- a/hw/virtio-net.c
> +++ b/hw/virtio-net.c
> @@ -22,7 +22,14 @@ typedef struct VirtIONet
>  {
>      VirtIODevice vdev;
>      uint8_t mac[6];
> -    uint16_t status;
> +    union {
> +        uint16_t raw;
> +        struct {
> +            uint16_t link:1;
> +            uint16_t promisc:1;
> +            uint16_t allmulti:1;
> +        } bits;
> +    } status;
>   

I'd prefer the use of #define's like we have today.  bit fields have 
really weird packing and ordering properties across architectures.

Regards,

Anthony Liguori

  reply	other threads:[~2009-01-07 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 17:37 [PATCH 3/5][RFC] virtio-net: Name the status bits, adding promisc and allmulti Alex Williamson
2009-01-07 17:37 ` [Qemu-devel] " Alex Williamson
2009-01-07 18:09 ` Anthony Liguori [this message]
2009-01-07 18:09   ` [Qemu-devel] " Anthony Liguori
2009-01-07 18:14   ` Alex Williamson
2009-01-07 18:14     ` [Qemu-devel] " Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4964EFE6.2060209@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=alex.williamson@hp.com \
    --cc=kvm@vger.kernel.org \
    --cc=markmc@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.