]> git.baikalelectronics.ru Git - kernel.git/commit
macvlan: Avoid unnecessary multicast cloning
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 1 Jun 2016 03:45:44 +0000 (11:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Jun 2016 00:48:46 +0000 (17:48 -0700)
commita280f2e17e4e011542b2b7919f5c408f76f932df
treed8f23cacc9a57251677d1c862e893e3caf6bb6ca
parent02334e9325a82dae83bcebc021c633093fd6a2f9
macvlan: Avoid unnecessary multicast cloning

Currently we always queue a multicast packet for further processing,
even if none of the macvlan devices are subscribed to the address.

This patch optimises this by adding a global multicast filter for
a macvlan_port.

Note that this patch doesn't handle the broadcast addresses of the
individual macvlan devices correctly, if they are not all identical
to vlan->lowerdev.  However, this is already broken because there
is no mechanism in place to update the individual multicast filters
when you change the broadcast address.

If someone cares enough they should fix this by collecting all
broadcast addresses for a macvlan as we do for multicast and unicast.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c