All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@hp.com>
To: Mark McLoughlin <markmc@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>, kvm <kvm@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH 2/2][RFC] virtio_net: Add MAC fitler table support
Date: Fri, 09 Jan 2009 08:34:30 -0700	[thread overview]
Message-ID: <1231515270.7109.202.camel@lappy> (raw)
In-Reply-To: <1231500852.4481.72.camel@localhost.localdomain>

On Fri, 2009-01-09 at 11:34 +0000, Mark McLoughlin wrote:
> On Wed, 2009-01-07 at 11:06 -0700, Alex Williamson wrote:
> > @@ -38,8 +40,10 @@ struct virtio_net_config
> >  			__u16 link:1;
> >  			__u16 promisc:1;
> >  			__u16 allmulti:1;
> > +			__u16 mac_table:1;
> >  		} bits;
> > -       } status;
> > +	} status;
> > +	__u64 mac_table[16];
> 
> You're using two bytes per entry to indicate the flag is valid. Why
> not
> an array of 6 byte entries with a count of how many entries are valid?
> 
> That would also keep the virtio-net I/O space under 128 bytes.

Thanks for the comments, they look correct.  For the mac_table, that's
exactly how I'm thinking of doing it with virt-queues.  The problem with
that here is that the driver has direct access to the table and doesn't
necessarily have to make it contiguous.  If we expose a table, I think
the more space efficient way is to make the table size a multiple of 8
and have a bitmap of valid entries.

The virt-queue implementation I'm thinking of has 2 interfaces, ALLOC
and SET.  ALLOC can only be called once by the guest driver and
allocates a mac filter table supporting the given number of entries.
The SET interface provides a contiguous list of MACs, fitting into the
size previously allocated.  SET can also be used to clear if called with
no entries.  I'm steering away from a dynamically changeable size as
that implies locking or some kind of linked list implementation, or
both.  Thanks,

Alex

-- 
Alex Williamson                             HP Open Source & Linux Org.


  reply	other threads:[~2009-01-09 15:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07 18:06 [PATCH 2/2][RFC] virtio_net: Add MAC fitler table support Alex Williamson
2009-01-09 11:34 ` Mark McLoughlin
2009-01-09 15:34   ` Alex Williamson [this message]
2009-01-10 11:18 ` Rusty Russell
2009-01-10 15:10   ` Alex Williamson
2009-01-10 18:18   ` Anthony Liguori
2009-01-10 18:50     ` Alex Williamson
2009-01-10 19:41       ` Anthony Liguori

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=1231515270.7109.202.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 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.