Received: by 2002:a17:90a:bc8d:0:0:0:0 with SMTP id x13csp1160779pjr; Thu, 21 May 2020 01:20:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKiTFlb2tY8BHr1FzMb2Xgw7V+86soD9CiYrsiPgNREBF8Fh0+aK9FTF69V+WZpcf4uky2 X-Received: by 2002:a50:a9c4:: with SMTP id n62mr6546771edc.347.1590049213916; Thu, 21 May 2020 01:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590049213; cv=none; d=google.com; s=arc-20160816; b=G3R4Jh+gtrob4EaKatUJ6UN5A/S9LyPGIqqKtMbnbCLaA8Gxriig0TH32Ra/4amfgn 4j82kghmNJOz/AtU0VfWmToi+0g5eLeAgP9/GeHU/3JsubYRAk/wUm4i0pbFBOfgTOdr rydW54mhI+vOMZcaxftXW2EfPB7cFKidENOCWDhbMXiqhCpSFKuSKYbEdBfKSDVo9yEb 4PtEbR7f6qgOPUpTp6/S0L+sL4UzIAFcD0Zz4AvJkzHQnb7jn4JGhOhiKGq4iIrTdlH+ tfBCRImfpY24VUS1seZiCgOhKqMU0dzxYdJP322hvRHVeM5hHGj4dfX+wb76iJPRbJOq RNyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=bqOLOWJcEnmegQMbnR/7WAD5Ory2NkimcCLFj6PkXT4=; b=lRHm5hbUuNGl6ZO+Ks+pGAQ8jOr/51mufZeGU2+hesT++xMAL2znv/jYRnQ97VjadL tWtqWRckJppcPX04MC26abJSUG9ZVxCHfgvdKs9QfDWqIbh8loqEzSQ7YIJsjiSVEjXU 2UtEzvkb5mbVBCQhf0zUpScWeJMt9sIwTDiOzj955/cUfenCYGE/CJsF/3aF2jdwD2/A 0G/KO0o1G8R55bhP23RZCtjBzIHtl/nwJwfpNDnUbq9INkyJwWH2PKCsw8ewgli6Ty+Z l+T+N/lG7KdqYWcxs4vShdL6IQvLtf85EDBZ17s3+NcbOHBTNwdZJsmIBh7gznX8ySE3 wH7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cumulusnetworks.com header.s=google header.b=MNKVdqYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cumulusnetworks.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m26si2865989edp.465.2020.05.21.01.19.50; Thu, 21 May 2020 01:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cumulusnetworks.com header.s=google header.b=MNKVdqYI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cumulusnetworks.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728607AbgEUIS0 (ORCPT + 99 others); Thu, 21 May 2020 04:18:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728473AbgEUISZ (ORCPT ); Thu, 21 May 2020 04:18:25 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9343EC061A0E for ; Thu, 21 May 2020 01:18:25 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id u1so4806542wmn.3 for ; Thu, 21 May 2020 01:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=bqOLOWJcEnmegQMbnR/7WAD5Ory2NkimcCLFj6PkXT4=; b=MNKVdqYIQu1sZpEEWrjFHTTAgUy+R5a9ibTbTktvHRxg5WU3UwsT+DYDhAfDTZ1ZVN WUkF2IPbZmlF4VcwHRt2g+0rwVYfAWsxUMpNDxOZKs9mfmROSBdrBuvxcGKRLC1byQ50 gtHo3VrT/HT9vEGVkBYTSpJJxyNB1z1PPj1jQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bqOLOWJcEnmegQMbnR/7WAD5Ory2NkimcCLFj6PkXT4=; b=SitCp9dlGaJqsZcFz9vodRjt7JrkUwuhb1ne0+W6O4tGpHi2GWGft7OcH/Ltf3egq9 cdMp/Kl2ja1OlQ0ttz6knmlCuFkfFOa8IHjnWAaTQuYFr9EyiiKZNW/rNlY+cAXCSDYg Cg8Be2d063zEH0/r8mNG9XWz3aAlX4hVpYyH1J3vdQ2ZUikQ4nEFDYlLmhQqe0UcCnsn DqrNOGIzUmgfw1+hMHQ2AIaK2LAZCsfZ4wdNHR71i0RQpQ7zEHmWFd2rISt/Ek6KX6CO YtBnlKMzT7YI9FKfcCCUEbNZsV2XJcdmHIxBxEDlOevR+cFygWZ/2K/g6PLTtY+JoYvF MBEQ== X-Gm-Message-State: AOAM532XXBLv87V1a3Rt/JxS9OOYyAUs8CHAr7BsHYemW8UA+fBI+AMn zwow3kwqvtQMCaZvYTaCzCzDpQ== X-Received: by 2002:a1c:2186:: with SMTP id h128mr7558309wmh.108.1590049104333; Thu, 21 May 2020 01:18:24 -0700 (PDT) Received: from [192.168.0.109] (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id v2sm5840676wrn.21.2020.05.21.01.18.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2020 01:18:23 -0700 (PDT) Subject: Re: [PATCH 3/3] bridge: mrp: Restore port state when deleting MRP instance To: Horatiu Vultur , jiri@resnulli.us, ivecera@redhat.com, davem@davemloft.net, kuba@kernel.org, roopa@cumulusnetworks.com, andrew@lunn.ch, UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org References: <20200520130923.3196432-1-horatiu.vultur@microchip.com> <20200520130923.3196432-4-horatiu.vultur@microchip.com> From: Nikolay Aleksandrov Message-ID: <05ddf496-9f6d-ae23-1bdb-40f0fe0e3b3c@cumulusnetworks.com> Date: Thu, 21 May 2020 11:18:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200520130923.3196432-4-horatiu.vultur@microchip.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/05/2020 16:09, Horatiu Vultur wrote: > When a MRP instance is deleted, then restore the port according to the > bridge state. If the bridge is up then the ports will be in forwarding > state otherwise will be in disabled state. > > Fixes: 9a9f26e8f7ea ("bridge: mrp: Connect MRP API with the switchdev API") > Signed-off-by: Horatiu Vultur > --- > net/bridge/br_mrp.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > Acked-by: Nikolay Aleksandrov > diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c > index a5a3fa59c078a..bdd8920c15053 100644 > --- a/net/bridge/br_mrp.c > +++ b/net/bridge/br_mrp.c > @@ -229,6 +229,7 @@ static void br_mrp_test_work_expired(struct work_struct *work) > static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp) > { > struct net_bridge_port *p; > + u8 state; > > /* Stop sending MRP_Test frames */ > cancel_delayed_work_sync(&mrp->test_work); > @@ -240,20 +241,24 @@ static void br_mrp_del_impl(struct net_bridge *br, struct br_mrp *mrp) > p = rtnl_dereference(mrp->p_port); > if (p) { > spin_lock_bh(&br->lock); > - p->state = BR_STATE_FORWARDING; > + state = netif_running(br->dev) ? > + BR_STATE_FORWARDING : BR_STATE_DISABLED; > + p->state = state; > p->flags &= ~BR_MRP_AWARE; > spin_unlock_bh(&br->lock); > - br_mrp_port_switchdev_set_state(p, BR_STATE_FORWARDING); > + br_mrp_port_switchdev_set_state(p, state); > rcu_assign_pointer(mrp->p_port, NULL); > } > > p = rtnl_dereference(mrp->s_port); > if (p) { > spin_lock_bh(&br->lock); > - p->state = BR_STATE_FORWARDING; > + state = netif_running(br->dev) ? > + BR_STATE_FORWARDING : BR_STATE_DISABLED; > + p->state = state; > p->flags &= ~BR_MRP_AWARE; > spin_unlock_bh(&br->lock); > - br_mrp_port_switchdev_set_state(p, BR_STATE_FORWARDING); > + br_mrp_port_switchdev_set_state(p, state); > rcu_assign_pointer(mrp->s_port, NULL); > } > >