From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jiri Wiesner <jwiesner@suse.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Mahesh Bandewar <maheshb@google.com>,
Andreas Taschner <Andreas.Taschner@suse.com>,
Michal Kubecek <mkubecek@suse.cz>
Subject: Re: [PATCH net] ipvlan: do not add hardware address of master to its unicast filter list
Date: Thu, 5 Mar 2020 13:03:46 -0800 [thread overview]
Message-ID: <36cdfab2-aa29-fa21-2f46-bf9d744ee6db@gmail.com> (raw)
In-Reply-To: <20200305193101.GA16264@incl>
On 3/5/20 11:31 AM, Jiri Wiesner wrote:
> There is a problem when ipvlan slaves are created on a master device that
> is a vmxnet3 device (ipvlan in VMware guests). The vmxnet3 driver does not
> support unicast address filtering. When an ipvlan device is brought up in
> ipvlan_open(), the ipvlan driver calls dev_uc_add() to add the hardware
> address of the vmxnet3 master device to the unicast address list of the
> master device, phy_dev->uc. This inevitably leads to the vmxnet3 master
> device being forced into promiscuous mode by __dev_set_rx_mode().
>
> Promiscuous mode is switched on the master despite the fact that there is
> still only one hardware address that the master device should use for
> filtering in order for the ipvlan device to be able to receive packets.
> The comment above struct net_device describes the uc_promisc member as a
> "counter, that indicates, that promiscuous mode has been enabled due to
> the need to listen to additional unicast addresses in a device that does
> not implement ndo_set_rx_mode()". Moreover, the design of ipvlan
> guarantees that only the hardware address of a master device,
> phy_dev->dev_addr, will be used to transmit and receive all packets from
> its ipvlan slaves. Thus, the unicast address list of the master device
> should not be modified by ipvlan_open() and ipvlan_stop() in order to make
> ipvlan a workable option on masters that do not support unicast address
> filtering.
>
> Fixes: 2ad7bf3638411 ("ipvlan: Initial check-in of the IPVLAN driver")
> Reported-by: Per Sundstrom <per.sundstrom@redqube.se>
> Signed-off-by: Jiri Wiesner <jwiesner@suse.com>
> ---
> drivers/net/ipvlan/ipvlan_main.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
> index a70662261a5a..f23214003d42 100644
> --- a/drivers/net/ipvlan/ipvlan_main.c
> +++ b/drivers/net/ipvlan/ipvlan_main.c
> @@ -178,7 +178,7 @@ static int ipvlan_open(struct net_device *dev)
> ipvlan_ht_addr_add(ipvlan, addr);
> rcu_read_unlock();
>
> - return dev_uc_add(phy_dev, phy_dev->dev_addr);
> + return 0;
> }
>
> static int ipvlan_stop(struct net_device *dev)
> @@ -190,8 +190,6 @@ static int ipvlan_stop(struct net_device *dev)
> dev_uc_unsync(phy_dev, dev);
> dev_mc_unsync(phy_dev, dev);
>
> - dev_uc_del(phy_dev, phy_dev->dev_addr);
> -
> rcu_read_lock();
> list_for_each_entry_rcu(addr, &ipvlan->addrs, anode)
> ipvlan_ht_addr_del(addr);
>
This makes perfect sense, not sure why we left these calls in ipvlan
submission.
Thanks for the patch !
Reviewed-by: Eric Dumazet <edumazet@google.com>
next prev parent reply other threads:[~2020-03-05 21:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 19:31 [PATCH net] ipvlan: do not add hardware address of master to its unicast filter list Jiri Wiesner
2020-03-05 21:03 ` Eric Dumazet [this message]
2020-03-05 21:13 ` Mahesh Bandewar (महेश बंडेवार)
2020-03-07 6:36 ` 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=36cdfab2-aa29-fa21-2f46-bf9d744ee6db@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=Andreas.Taschner@suse.com \
--cc=davem@davemloft.net \
--cc=jwiesner@suse.com \
--cc=maheshb@google.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.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 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.