From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Cc: Paul Brook <paul@codesourcery.com>, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 3/4] qemu:virtio-net: Add support for qemu_vlan_rxfilter
Date: Thu, 12 Feb 2009 20:26:49 +0000 [thread overview]
Message-ID: <20090212202649.GB805@shareable.org> (raw)
In-Reply-To: <1234462898.25178.277.camel@bling>
Alex Williamson wrote:
> They don't, but they do need to know whether a filter they previously
> applied successfully is no longer in place. If they don't know this,
> they have to assume the filter on the other side of the vlan is
> transient and always double check it with their own filtering, which
> seems like a waste of cache and cycles.
Double checking is not a waste of cycles if the host filtering is good
but not guaranteed, as it still means fewer packets cross the host
kernel/user boundary.
How reliable are the host filter interfaces anyway?
- Are they 100% reliable? For example, I remember at one time on
Linux, when application A listened for broadcast IP packets, you
wouldn't receive any which has a unicast MAC address for a
different host, except for the times when tcpdump was run in
parallel. That's an example of when the app sees the host filtering
behave differently depending on other apps run at the same time.
Multicast hash filtering is similar, but also depends on the host NIC.
- When updated, do the host filters take effect from the instant
the host syscall returned, or can there be already queued
packets which bypass the new filter?
> - A device requests a filter and is told if the request is successful
> - On success the device may skip it's own filtering
> - If another vlan client is added, the following _must_ occur:
> - The "filterer" must clear (remove) the filter
> - The "filteree" must revert to using their own filtering
> - If a vlan client is removed, the following _may_ occur:
> - vlan clients are notified that they may retry their filter
>
> The added()/removed() interface feels like the right solution to this.
> We could use a changed() function, but it would need to know the
> direction of the change, which leads back to the same mechanics. If
> there's a better way, please suggest it. Thanks,
If there are two vlan clients, you don't necessarily need them to use
their own filters, if they are both the same, or compatible in some way.
How about this:
- On any change, notify all clients by walking the list twice.
- Phase 1. For each client:
- The client requests a filter.
- Phase 2. For each client:
- The client enquires whether its filter is in place.
If yes, it relies on it. If no or unreliable, it filters itself.
During this procedure, don't do any packet I/O.
During phase 1, don't send a request to the host kernel until just one
at the end (if the filter has changed), otherwise there will be a
brief time window with no host filter which could leak packets despite
no real change wanted and no packet I/O performed.
The same procedure is done for any configuration change, and together
with that change. Actually: Stop packet I/O, then phase 1, then
update host kernel taps if they've changed, then phase 2, then restart
packet I/O.
-- Jamie
next prev parent reply other threads:[~2009-02-12 20:26 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-10 21:28 [Qemu-devel] [PATCH 0/4] qemu: TAP filtering support Alex Williamson
2009-02-10 21:28 ` [Qemu-devel] [PATCH 1/4] qemu:net: Add infrastructure for setting an RX filter through the vlan Alex Williamson
2009-02-10 21:28 ` [Qemu-devel] [PATCH 2/4] qemu:net: Add TAP support for RX filtering on Linux Alex Williamson
2009-02-10 21:28 ` [Qemu-devel] [PATCH 3/4] qemu:virtio-net: Add support for qemu_vlan_rxfilter Alex Williamson
2009-02-12 16:26 ` Paul Brook
2009-02-12 16:36 ` Alex Williamson
2009-02-12 17:05 ` Paul Brook
2009-02-12 18:21 ` Alex Williamson
2009-02-12 20:26 ` Jamie Lokier [this message]
2009-02-13 12:40 ` Paul Brook
2009-02-13 16:00 ` Jamie Lokier
2009-02-13 16:17 ` Paul Brook
2009-02-13 16:46 ` Jamie Lokier
2009-02-13 17:04 ` Paul Brook
2009-02-13 20:38 ` Jamie Lokier
2009-02-15 16:25 ` Paul Brook
2009-02-10 21:29 ` [Qemu-devel] [PATCH 4/4] qemu:e1000: " Alex Williamson
2009-02-11 15:11 ` [Qemu-devel] " Alex Williamson
2009-02-11 17:11 ` [Qemu-devel] " Alex Williamson
2009-02-11 19:31 ` [Qemu-devel] Re: [PATCH 0/4] qemu: TAP filtering support Mark McLoughlin
2009-02-11 19:43 ` Anthony Liguori
2009-02-11 19:51 ` Alex Williamson
2009-02-11 20:19 ` Mark McLoughlin
2009-02-11 20:37 ` Alex Williamson
2009-02-12 19:57 ` Jamie Lokier
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=20090212202649.GB805@shareable.org \
--to=jamie@shareable.org \
--cc=kvm@vger.kernel.org \
--cc=paul@codesourcery.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 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).