diff mbox

[ovs-dev,1/6] rstp/stp: Unref the rstp/stp when bridges destroyed.

Message ID 1491016286-86218-1-git-send-email-nic@opencloud.tech
State Accepted
Headers show

Commit Message

nickcooper-zhangtonghao April 1, 2017, 3:11 a.m. UTC
When bridges destroyed, which stp enabled, you can
still get stp info via the command 'ovs-appctl stp/show'.
And the rstp is also in the same case. We should unref
them. The rstp/stp ports have been unregistered via
'ofproto_port_unregister' function when ports destroyed.
We will unref rstp/stp struct in the 'destruct' of
ofproto-dpif provider.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
---
 ofproto/ofproto-dpif.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

nickcooper-zhangtonghao April 20, 2017, 9:45 a.m. UTC | #1
who can help me to review patches ? Thanks very much.

stp:
http://patchwork.ozlabs.org/patch/745880/ <http://patchwork.ozlabs.org/patch/745880/>
http://patchwork.ozlabs.org/patch/745881/ <http://patchwork.ozlabs.org/patch/745881/>
http://patchwork.ozlabs.org/patch/745884/ <http://patchwork.ozlabs.org/patch/745884/>
http://patchwork.ozlabs.org/patch/745882/ <http://patchwork.ozlabs.org/patch/745882/>
http://patchwork.ozlabs.org/patch/745883/ <http://patchwork.ozlabs.org/patch/745883/>
http://patchwork.ozlabs.org/patch/745885/ <http://patchwork.ozlabs.org/patch/745885/>

ofproto:
http://patchwork.ozlabs.org/patch/743155/ <http://patchwork.ozlabs.org/patch/743155/>


Thanks.
Nick

> On Apr 1, 2017, at 11:11 AM, nickcooper-zhangtonghao <nic@opencloud.tech> wrote:
> 
> When bridges destroyed, which stp enabled, you can
> still get stp info via the command 'ovs-appctl stp/show'.
> And the rstp is also in the same case. We should unref
> them. The rstp/stp ports have been unregistered via
> 'ofproto_port_unregister' function when ports destroyed.
> We will unref rstp/stp struct in the 'destruct' of
> ofproto-dpif provider.
> 
> Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech <mailto:nic@opencloud.tech>>
> ---
> ofproto/ofproto-dpif.c | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> index 523adad..4beacda 100644
> --- a/ofproto/ofproto-dpif.c
> +++ b/ofproto/ofproto-dpif.c
> @@ -1494,6 +1494,8 @@ destruct(struct ofproto *ofproto_)
>     hmap_destroy(&ofproto->bundles);
>     mac_learning_unref(ofproto->ml);
>     mcast_snooping_unref(ofproto->ms);
> +    stp_unref(ofproto->stp);
> +    rstp_unref(ofproto->rstp);
> 
>     sset_destroy(&ofproto->ports);
>     sset_destroy(&ofproto->ghost_ports);
> -- 
> 1.8.3.1
Jarno Rajahalme April 21, 2017, 12:26 a.m. UTC | #2
Looks correct to me.

Acked-by: Jarno Rajahalme <jarno@ovn.org>

> On Mar 31, 2017, at 8:11 PM, nickcooper-zhangtonghao <nic@opencloud.tech> wrote:
> 
> When bridges destroyed, which stp enabled, you can
> still get stp info via the command 'ovs-appctl stp/show'.
> And the rstp is also in the same case. We should unref
> them. The rstp/stp ports have been unregistered via
> 'ofproto_port_unregister' function when ports destroyed.
> We will unref rstp/stp struct in the 'destruct' of
> ofproto-dpif provider.
> 
> Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
> ---
> ofproto/ofproto-dpif.c | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> index 523adad..4beacda 100644
> --- a/ofproto/ofproto-dpif.c
> +++ b/ofproto/ofproto-dpif.c
> @@ -1494,6 +1494,8 @@ destruct(struct ofproto *ofproto_)
>     hmap_destroy(&ofproto->bundles);
>     mac_learning_unref(ofproto->ml);
>     mcast_snooping_unref(ofproto->ms);
> +    stp_unref(ofproto->stp);
> +    rstp_unref(ofproto->rstp);
> 
>     sset_destroy(&ofproto->ports);
>     sset_destroy(&ofproto->ghost_ports);
> -- 
> 1.8.3.1
> 
> 
> 
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Ben Pfaff April 22, 2017, 1:30 a.m. UTC | #3
I applied this one to master and branch-2.7 back to branch-2.4.

I'm not planning to review the rest of the series, at least not for now.

On Thu, Apr 20, 2017 at 05:26:33PM -0700, Jarno Rajahalme wrote:
> Looks correct to me.
> 
> Acked-by: Jarno Rajahalme <jarno@ovn.org>
> 
> > On Mar 31, 2017, at 8:11 PM, nickcooper-zhangtonghao <nic@opencloud.tech> wrote:
> > 
> > When bridges destroyed, which stp enabled, you can
> > still get stp info via the command 'ovs-appctl stp/show'.
> > And the rstp is also in the same case. We should unref
> > them. The rstp/stp ports have been unregistered via
> > 'ofproto_port_unregister' function when ports destroyed.
> > We will unref rstp/stp struct in the 'destruct' of
> > ofproto-dpif provider.
> > 
> > Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
> > ---
> > ofproto/ofproto-dpif.c | 2 ++
> > 1 file changed, 2 insertions(+)
> > 
> > diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> > index 523adad..4beacda 100644
> > --- a/ofproto/ofproto-dpif.c
> > +++ b/ofproto/ofproto-dpif.c
> > @@ -1494,6 +1494,8 @@ destruct(struct ofproto *ofproto_)
> >     hmap_destroy(&ofproto->bundles);
> >     mac_learning_unref(ofproto->ml);
> >     mcast_snooping_unref(ofproto->ms);
> > +    stp_unref(ofproto->stp);
> > +    rstp_unref(ofproto->rstp);
> > 
> >     sset_destroy(&ofproto->ports);
> >     sset_destroy(&ofproto->ghost_ports);
> > -- 
> > 1.8.3.1
> > 
> > 
> > 
> > 
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox

Patch

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 523adad..4beacda 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1494,6 +1494,8 @@  destruct(struct ofproto *ofproto_)
     hmap_destroy(&ofproto->bundles);
     mac_learning_unref(ofproto->ml);
     mcast_snooping_unref(ofproto->ms);
+    stp_unref(ofproto->stp);
+    rstp_unref(ofproto->rstp);
 
     sset_destroy(&ofproto->ports);
     sset_destroy(&ofproto->ghost_ports);