Acked-by: Jarno Rajahalme <jrajaha...@nicira.com>

No need to submit a new version!

Thanks,

  Jarno

On Nov 14, 2014, at 9:15 AM, Daniele Venturino <daniele.ventur...@m3s.it> wrote:

> Possible commit message: 
> "Invoke move_rstp__() in rstp_port_set_administrative_bridge_port__() if port 
> is
> not initializing.
> This was necessary in a test that check that a Port becoming 
> alternate/backup/disabled stops learning and forwarding.
> The move_rstp__() call is necessary to immediatly disable learning and 
> forwarding on that port.
> Without this, the test fails."
> 
> Do you have a working copy of this or should I submit a v2?
> 
> Daniele
> 
> 2014-11-14 0:57 GMT+01:00 Jarno Rajahalme <jrajaha...@nicira.com>:
> Assuming you fix the commit message:
> 
> Acked-by: Jarno Rajahalme <jrajaha...@nicira.com>
> 
> On Nov 6, 2014, at 7:31 AM, Daniele Venturino <daniele.ventur...@m3s.it> 
> wrote:
> 
> >      Invoke move_rstp__() in rstp_port_set_administrative_bridge_port__() if
> >      port is not initializing.
> >
> 
> Explain in the commit message why this is needed. And lose the indentation…
> 
> Also, tests/rstp.at needs the following after this patch:
> 
> diff --git a/tests/rstp.at b/tests/rstp.at
> index 5caa84f..ace693d 100644
> --- a/tests/rstp.at
> +++ b/tests/rstp.at
> @@ -233,6 +233,11 @@ AT_CHECK([ovs-appctl netdev-dummy/set-admin-state p2 
> up], [], [dnl
>  OK
>  ])
> 
> +# give time for RSTP to move initially
> +
> +ovs-appctl time/warp 1000
> +ovs-appctl time/warp 1000
> +
>  OVS_WAIT_UNTIL([test `cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY | wc -l` 
> -ge 4])
>  AT_CHECK([cat ovs-vswitchd.log | FILTER_STP_TOPOLOGY], [0], [dnl
>  port p1: RSTP state changed from Disabled to Discarding
> 
> 
> > Signed-off-by: Daniele Venturino <daniele.ventur...@m3s.it>
> > ---
> > lib/rstp.c | 16 ++++++++++++----
> > 1 file changed, 12 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/rstp.c b/lib/rstp.c
> > index 1ab4938..fd42a7d 100644
> > --- a/lib/rstp.c
> > +++ b/lib/rstp.c
> > @@ -104,7 +104,8 @@ static void rstp_port_set_port_number__(struct 
> > rstp_port *,
> > static void rstp_port_set_path_cost__(struct rstp_port *, uint32_t 
> > path_cost)
> >     OVS_REQUIRES(rstp_mutex);
> > static void rstp_port_set_administrative_bridge_port__(struct rstp_port *,
> > -                                                       uint8_t 
> > admin_port_state)
> > +                                                       uint8_t 
> > admin_port_state,
> > +                                                       bool initializing)
> >     OVS_REQUIRES(rstp_mutex);
> > static void rstp_port_set_admin_edge__(struct rstp_port *, bool admin_edge)
> >     OVS_REQUIRES(rstp_mutex);
> > @@ -946,7 +947,8 @@ rstp_port_set_mac_operational(struct rstp_port *p, bool 
> > new_mac_operational)
> > /* Sets the port Administrative Bridge Port parameter. */
> > static void
> > rstp_port_set_administrative_bridge_port__(struct rstp_port *p,
> > -                                           uint8_t admin_port_state)
> > +                                           uint8_t admin_port_state,
> > +                                           bool initializing)
> >     OVS_REQUIRES(rstp_mutex)
> > {
> >     VLOG_DBG("%s, port %u: set RSTP port admin-port-state to %d",
> > @@ -956,6 +958,11 @@ rstp_port_set_administrative_bridge_port__(struct 
> > rstp_port *p,
> >
> >         p->is_administrative_bridge_port = admin_port_state;
> >         update_port_enabled__(p);
> > +        if (!initializing) {
> > +            struct rstp * rstp = p->rstp;
> 
> Do not put a space after the ‘*’ above.
> 
> > +            rstp->changes = true;
> > +            move_rstp__(rstp);
> > +        }
> >     }
> > }
> >
> > @@ -979,7 +986,8 @@ rstp_initialize_port_defaults__(struct rstp_port *p)
> >     OVS_REQUIRES(rstp_mutex)
> > {
> >     rstp_port_set_administrative_bridge_port__(p,
> > -                                         
> > RSTP_ADMIN_BRIDGE_PORT_STATE_ENABLED);
> > +                                         
> > RSTP_ADMIN_BRIDGE_PORT_STATE_ENABLED,
> > +                                         true);
> >     rstp_port_set_oper_point_to_point_mac__(p,
> >                                          RSTP_OPER_P2P_MAC_STATE_ENABLED);
> >     rstp_port_set_path_cost__(p, RSTP_DEFAULT_PORT_PATH_COST);
> > @@ -1351,7 +1359,7 @@ rstp_port_set(struct rstp_port *port, uint16_t 
> > port_num, int priority,
> >     rstp_port_set_admin_edge__(port, is_admin_edge);
> >     rstp_port_set_auto_edge__(port, is_auto_edge);
> >     rstp_port_set_admin_point_to_point_mac__(port, admin_p2p_mac_state);
> > -    rstp_port_set_administrative_bridge_port__(port, admin_port_state);
> > +    rstp_port_set_administrative_bridge_port__(port, admin_port_state, 
> > false);
> >     rstp_port_set_mcheck__(port, do_mcheck);
> >     ovs_mutex_unlock(&rstp_mutex);
> > }
> > --
> > 1.8.1.2
> >
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
> 

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to