[ovs-dev] [PATCH 09/17] rstp: Invoke updt_roles_tree__() in max_age and forward_delay setters.

Jarno Rajahalme jrajahalme at nicira.com
Fri Nov 14 19:12:28 UTC 2014


Acked-by: Jarno Rajahalme <jrajahalme at nicira.com>

On Nov 14, 2014, at 9:09 AM, Daniele Venturino <daniele.venturino at m3s.it> wrote:

> Possible commit message:
> 
> "This patch was necessary in a test on the acceptable range values of max_age and forward_delay. 
> Since rstp_set_bridge_max_age__() and rstp_set_bridge_forward_delay__() set the rstp->bridge_max_age
> and rstp->bridge_forward_delay variables, it was necessary to call updt_roles_tree__() to immediately
> update p->designated_times, used in tx_rstp() (in lib/rstp-state-machines.c).
> In this way the validation software received the expected maxAge and forwardDelay values. Otherwise, such test failed."
> 
> Daniele
> 
> 2014-11-14 0:30 GMT+01:00 Jarno Rajahalme <jrajahalme at nicira.com>:
> This patch needs a proper commit message, e.g., why the change is needed?
> 
> Thanks,
> 
>   Jarno
> 
> On Nov 6, 2014, at 7:31 AM, Daniele Venturino <daniele.venturino at m3s.it> wrote:
> 
> > Signed-off-by: Daniele Venturino <daniele.venturino at m3s.it>
> > ---
> > lib/rstp.c | 14 ++++++++++----
> > 1 file changed, 10 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/rstp.c b/lib/rstp.c
> > index e3007e2..55c43c0 100644
> > --- a/lib/rstp.c
> > +++ b/lib/rstp.c
> > @@ -523,8 +523,9 @@ static void
> > rstp_set_bridge_max_age__(struct rstp *rstp, int new_max_age)
> >     OVS_REQUIRES(rstp_mutex)
> > {
> > -    if (new_max_age >= RSTP_MIN_BRIDGE_MAX_AGE &&
> > -        new_max_age <= RSTP_MAX_BRIDGE_MAX_AGE) {
> > +    if (rstp->bridge_max_age != new_max_age
> > +            && new_max_age >= RSTP_MIN_BRIDGE_MAX_AGE
> > +            && new_max_age <= RSTP_MAX_BRIDGE_MAX_AGE) {
> >         /* [17.13] */
> >         if ((2 * (rstp->bridge_forward_delay - 1) >= new_max_age)
> >             && (new_max_age >= 2 * rstp->bridge_hello_time)) {
> > @@ -533,6 +534,8 @@ rstp_set_bridge_max_age__(struct rstp *rstp, int new_max_age)
> >
> >             rstp->bridge_max_age = new_max_age;
> >             rstp->bridge_times.max_age = new_max_age;
> > +            rstp->changes = true;
> > +            updt_roles_tree__(rstp);
> >         }
> >     }
> > }
> > @@ -551,13 +554,16 @@ static void
> > rstp_set_bridge_forward_delay__(struct rstp *rstp, int new_forward_delay)
> >     OVS_REQUIRES(rstp_mutex)
> > {
> > -    if (new_forward_delay >= RSTP_MIN_BRIDGE_FORWARD_DELAY
> > -        && new_forward_delay <= RSTP_MAX_BRIDGE_FORWARD_DELAY) {
> > +    if (rstp->bridge_forward_delay != new_forward_delay
> > +            && new_forward_delay >= RSTP_MIN_BRIDGE_FORWARD_DELAY
> > +            && new_forward_delay <= RSTP_MAX_BRIDGE_FORWARD_DELAY) {
> >         if (2 * (new_forward_delay - 1) >= rstp->bridge_max_age) {
> >             VLOG_DBG("%s: set RSTP Forward Delay to %d", rstp->name,
> >                      new_forward_delay);
> >             rstp->bridge_forward_delay = new_forward_delay;
> >             rstp->bridge_times.forward_delay = new_forward_delay;
> > +            rstp->changes = true;
> > +            updt_roles_tree__(rstp);
> >         }
> >     }
> > }
> > --
> > 1.8.1.2
> >
> 
> 




More information about the dev mailing list