From: Alex Williamson <alex.williamson@hp.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: markmc@redhat.com, netdev@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH v3 2/4] virtio_net: Add a set_rx_mode interface
Date: Mon, 02 Feb 2009 14:34:07 -0700 [thread overview]
Message-ID: <1233610447.7026.970.camel@lappy> (raw)
In-Reply-To: <200902022022.20781.rusty@rustcorp.com.au>
Hi Rusty,
On Mon, 2009-02-02 at 20:22 +1030, Rusty Russell wrote:
> On Monday 02 February 2009 06:35:15 Alex Williamson wrote:
> > + sg_set_buf(&sg, &promisc, sizeof(promisc));
> > +
> > + if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_RX,
> > + VIRTIO_NET_CTRL_RX_PROMISC,
> > + &sg, 1, 0))
>
> Hmm, can we use sg_init_one(&sg, &promisc, sizeof(promisc)) then pass two sg
> to virtnet_send_command? ie. change virtnet_send_command to:
>
> static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
> struct scatterlist *out, struct scatterlist *in);
>
> NULL = no sg, otherwise it's assumed to be a nicely terminated sg? Neater for
> the callers I think...
I think the caller still ends up passing the counts of out and in
entries here or else we have to walk the lists in send_command().
Doable, but doesn't seem to be common practice that I can find. We
should also then clear the termination once we copy the sg[] into our
own, but functions to do that don't seem to exist (need an
sg_unmark_end()). I had avoided anything that would call
sg_init_table() on the caller provided sg[] to avoid that problem, does
it need to be addressed?
> > -#define VIRTIO_NET_MAX_CTRL_ARGS 2
> > +#define VIRTIO_NET_MAX_CTRL_ARGS 3
>
> Oh, and this should probably be called VIRTNET_SEND_COMMAND_SG_MAX, and be
> this value minus 2 (ie. informative for the caller of virtnet_send_command).
Yes, and yes to moving it to the c file, no need to expose it. Thanks,
Alex
--
Alex Williamson HP Open Source & Linux Org.
next prev parent reply other threads:[~2009-02-02 21:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-29 23:05 [PATCH v2 0/4] virtio_net: Add MAC and VLAN filtering Alex Williamson
2009-01-29 23:05 ` [PATCH v2 1/4] virtio_net: Add a virtqueue for outbound control commands Alex Williamson
2009-01-30 5:08 ` Rusty Russell
2009-01-29 23:05 ` [PATCH v2 2/4] virtio_net: Add a set_rx_mode interface Alex Williamson
2009-01-30 5:30 ` Rusty Russell
2009-01-29 23:05 ` [PATCH v2 3/4] virtio_net: Add a MAC filter table Alex Williamson
2009-01-30 5:46 ` Rusty Russell
2009-01-29 23:05 ` [PATCH v2 4/4] virtio_net: Add support for VLAN filtering in the hypervisor Alex Williamson
2009-01-30 6:01 ` Rusty Russell
2009-01-30 1:49 ` [PATCH v2 0/4] virtio_net: Add MAC and VLAN filtering David Miller
2009-01-30 7:05 ` Rusty Russell
2009-01-30 7:12 ` David Miller
2009-01-30 5:03 ` Rusty Russell
2009-02-01 20:05 ` [PATCH v3 " Alex Williamson
2009-02-01 20:05 ` [PATCH v3 1/4] virtio_net: Add a virtqueue for outbound control commands Alex Williamson
2009-02-02 9:40 ` Rusty Russell
2009-02-02 14:10 ` Anthony Liguori
2009-02-01 20:05 ` [PATCH v3 2/4] virtio_net: Add a set_rx_mode interface Alex Williamson
2009-02-02 9:52 ` Rusty Russell
2009-02-02 21:34 ` Alex Williamson [this message]
2009-02-03 2:54 ` Rusty Russell
2009-02-01 20:05 ` [PATCH v3 3/4] virtio_net: Add a MAC filter table Alex Williamson
2009-02-02 9:57 ` Rusty Russell
2009-02-01 20:05 ` [PATCH v3 4/4] virtio_net: Add support for VLAN filtering in the hypervisor 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=1233610447.7026.970.camel@lappy \
--to=alex.williamson@hp.com \
--cc=kvm@vger.kernel.org \
--cc=markmc@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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;
as well as URLs for NNTP newsgroup(s).