From: "Michael S. Tsirkin" <mst@redhat.com>
To: Vladislav Yasevich <vyasevic@redhat.com>
Cc: netdev@vger.kernel.org,
John Fastabend <john.r.fastabend@intel.com>,
Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH] macvlan: Allow setting multicast filter on all macvlan types
Date: Sun, 17 Aug 2014 11:43:08 +0200 [thread overview]
Message-ID: <20140817094308.GD21143@redhat.com> (raw)
In-Reply-To: <1408122299-29632-1-git-send-email-vyasevic@redhat.com>
On Fri, Aug 15, 2014 at 01:04:59PM -0400, Vladislav Yasevich wrote:
> Currently, macvlan code restricts multicast and unicast
> filter setting only to passthru devices. As a result,
> if a guest using macvtap wants to receive multicast
> traffic, it has to set IFF_ALLMULTI or IFF_PROMISC.
>
> This patch makes it possible to use the fdb interface
> to add multicast addresses to the filter thus allowing
> a guest to receive only targeted multicast traffic.
>
> CC: John Fastabend <john.r.fastabend@intel.com>
> CC: Michael S. Tsirkin <mst@redhat.com>
> CC: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/net/macvlan.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> index ef8a5c2..fad4b9e 100644
> --- a/drivers/net/macvlan.c
> +++ b/drivers/net/macvlan.c
> @@ -739,7 +739,10 @@ static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
> struct macvlan_dev *vlan = netdev_priv(dev);
> int err = -EINVAL;
>
> - if (!vlan->port->passthru)
> + /* Support unicast filter only on passthru devices.
> + * Multicast filter should be allowed on all devices.
> + */
> + if (!vlan->port->passthru && is_unicast_ether_addr(addr))
> return -EOPNOTSUPP;
>
> if (flags & NLM_F_REPLACE)
> @@ -760,7 +763,10 @@ static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
> struct macvlan_dev *vlan = netdev_priv(dev);
> int err = -EINVAL;
>
> - if (!vlan->port->passthru)
> + /* Support unicast filter only on passthru devices.
> + * Multicast filter should be allowed on all devices.
> + */
> + if (!vlan->port->passthru && is_unicast_ether_addr(addr))
> return -EOPNOTSUPP;
>
> if (is_unicast_ether_addr(addr))
> --
> 1.9.3
next prev parent reply other threads:[~2014-08-17 9:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-15 17:04 [PATCH] macvlan: Allow setting multicast filter on all macvlan types Vladislav Yasevich
2014-08-15 19:04 ` John Fastabend
2014-08-15 19:54 ` Vlad Yasevich
2014-08-17 10:54 ` Michael S. Tsirkin
2014-08-17 9:43 ` Michael S. Tsirkin [this message]
2014-08-21 23:54 ` David Miller
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=20140817094308.GD21143@redhat.com \
--to=mst@redhat.com \
--cc=jasowang@redhat.com \
--cc=john.r.fastabend@intel.com \
--cc=netdev@vger.kernel.org \
--cc=vyasevic@redhat.com \
/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.