From: Rusty Russell <rusty@rustcorp.com.au>
To: Alex Williamson <alex.williamson@hp.com>
Cc: kvm <kvm@vger.kernel.org>, netdev <netdev@vger.kernel.org>,
Mark McLoughlin <markmc@redhat.com>
Subject: Re: [PATCH 1/2][RFC] virtio_net: Enable setting MAC, promisc, and allmulti mode
Date: Sat, 10 Jan 2009 21:13:42 +1030 [thread overview]
Message-ID: <200901102113.44185.rusty@rustcorp.com.au> (raw)
In-Reply-To: <1231351562.7109.129.camel@lappy>
On Thursday 08 January 2009 04:36:02 Alex Williamson wrote:
> virtio_net: Enable setting MAC, promisc, and allmulti mode
Hi Alex,
There's nothing wrong with this idea: I assume you have an actual usage
for this rather than it being an abstract improvement?
> @@ -41,7 +41,14 @@ struct virtnet_info
> struct virtqueue *rvq, *svq;
> struct net_device *dev;
> struct napi_struct napi;
> - unsigned int status;
> + union {
> + u16 raw;
> + struct {
> + u16 link:1;
> + u16 promisc:1;
> + u16 allmulti:1;
> + } bits;
> + } status;
I don't think this works, as it depends on bitfield endian.
> @@ -30,7 +32,14 @@ struct virtio_net_config
> __u8 mac[6];
> /* Status supplied by host; see VIRTIO_NET_F_STATUS and VIRTIO_NET_S_*
> * bits above */
> - __u16 status;
> + union {
> + __u16 raw;
> + struct {
> + __u16 link:1;
> + __u16 promisc:1;
> + __u16 allmulti:1;
> + } bits;
> + } status;
> } __attribute__((packed));
As does this. I think we need to leave the status bitfield as is.
Thanks,
Rusty.
prev parent reply other threads:[~2009-01-10 10:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-07 18:06 [PATCH 1/2][RFC] virtio_net: Enable setting MAC, promisc, and allmulti mode Alex Williamson
2009-01-09 11:34 ` Mark McLoughlin
2009-01-09 15:34 ` Alex Williamson
2009-01-10 10:43 ` Rusty Russell [this message]
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=200901102113.44185.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=alex.williamson@hp.com \
--cc=kvm@vger.kernel.org \
--cc=markmc@redhat.com \
--cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox