From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8" Message-Id: <20090422190249.309bcec7aba70cc9ede34e91806448df.f41ec56ed5.wbe@email01.secureserver.net> From: dwinn@QYPEA.COM Date: Wed, 22 Apr 2009 19:02:49 -0700 Mime-Version: 1.0 Subject: [Bridge] Bridge hardware filtering vs promiscuous mode List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: bridge@lists.linux-foundation.org Hi all,
I'm currently working on a driver for a new network card wh= ich supports filtering by mac address very well. I implemented set_multicas= t_list for my driver and got some great speed improvements, due to taking a= dvantage of the hardware filtering.

Unfortunately, when I add this d= evice to a bridge I lose a lot of these improvements due to the bridge swit= ching the device to promiscuous mode. I'm currently looking into how to cha= nge the bridge code to take advantage of these optimizations. Could people = more familiar with the bridge code take a look and let me know: a. Has this= been tried or talked about before? b. Are there any glaring flaws in my de= sign?

1. Remove dev_set_promiscuity from bridge code in net/bridge/b= r_if.c
2. Fill in the br_dev_set_multicast_list function found in net/br= idge/br_device.c
3. In net/bridge/br_fdb.c, add code which calls set_mul= ticast_list on each port in a bridge whenever that bridge's address databas= e changes. I believe the two functions that will need to change are fdb_del= ete and fdb_create.
    a. We need to always receive mult= icast traffic, so we can forward it. Set the IFF_ALLMULTI flag on all ports= .
    b. Call set_multicast_list with dev->mc_list set= to the list of addresses in the database for each port.
  &nb= sp; c. Fall back to promiscuous mode if multicast filtering isn't sup= ported on a port. This should only be for the one port which doesn't suppor= t it. The rest can still filter.

I'll probably be implementing these= changes shortly. Hopefully they work how I'm thinking they will.
Thanks= ,
David