[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJieiUjAhzwTeYD5DWHM0wUdp7bKhZm_CZ6Rg1R5Ykht6jAD5Q@mail.gmail.com>
Date: Sat, 13 Apr 2019 11:40:36 -0700
From: Roopa Prabhu <roopa@...ulusnetworks.com>
To: Litao Jiao <jiaolitao@...secom.com>
Cc: David Miller <davem@...emloft.net>,
Petr Machata <petrm@...lanox.com>,
Ido Schimmel <idosch@...lanox.com>,
Stefano Brivio <sbrivio@...hat.com>,
netdev <netdev@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] vxlan: do not add dynamic fdb entry when the dev has been downed
On Sat, Apr 13, 2019 at 2:52 AM Litao Jiao <jiaolitao@...secom.com> wrote:
>
> When the dev has been downed or goes downing, it should not
> add dynamic fdb entry for the dev.
>
> Signed-off-by: Litao Jiao <jiaolitao@...secom.com>
> ---
This will break existing users. netif_running check is already there
for dynamically learnt entries.
Why do you need it here ?. none of the ndo_fdb_add handlers check for
link state.
> drivers/net/vxlan.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index d76dfed..3b45fe4 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -1125,11 +1125,13 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
> if (vxlan->default_dst.remote_ip.sa.sa_family != ip.sa.sa_family)
> return -EAFNOSUPPORT;
>
> + err = -EINVAL;
> spin_lock_bh(&vxlan->hash_lock);
> - err = vxlan_fdb_update(vxlan, addr, &ip, ndm->ndm_state, flags,
> - port, src_vni, vni, ifindex,
> - ndm->ndm_flags | NTF_VXLAN_ADDED_BY_USER,
> - true, extack);
> + if (netif_running(dev) || (ndm->ndm_state & NUD_PERMANENT))
> + err = vxlan_fdb_update(vxlan, addr, &ip, ndm->ndm_state, flags,
> + port, src_vni, vni, ifindex,
> + ndm->ndm_flags | NTF_VXLAN_ADDED_BY_USER,
> + true, extack);
> spin_unlock_bh(&vxlan->hash_lock);
>
> return err;
> --
> 1.9.1
>
>
>
Powered by blists - more mailing lists