On Tue, May 26, 2026 at 1:51 PM Aaron Conole <[email protected]> wrote:

> When STP/RSTP are in a disabled transition on a bridge, the sets will call
> bundle_update() for each port as it should transition from FORWARDING to
> DISABLED.  However, this happens while the states are still non-NULL,
> which causes bundle_update() to assume that the STP/RSTP status will
> remain as forwarding.  After this happens, the bundle->floodable flag
> will remain 'false' and NORMAL action flood attempts will skip over
> the ports.
>
> In the case of RSTP, the state processing is a bit more complex, so we
> do a final bundle_update pass to reset the floodable flag.  We could
> choose to do a more simplistic fix in STP case by releasing the
> ofproto->stp object early; however to keep it consistent, the fix will
> adopt the same approach of doing a final pass for bundle updates.
>
> Reported-at: https://redhat.atlassian.net/browse/FDP-3852
> Fixes: 21f7563cef5f ("ovs-vswitchd: Add support for 802.1D STP.")
> Fixes: 9efd308e957c ("Rapid Spanning Tree Protocol (IEEE 802.1D).")
> Signed-off-by: Aaron Conole <[email protected]>
> ---
> NOTE: I didn't do the full archeology on the fixes above, but I these
>       issues are old enough that it doesn't matter too much.
>
>  ofproto/ofproto-dpif.c | 16 +++++++++
>  tests/ofproto-dpif.at  | 82 ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 98 insertions(+)
>
> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> index a02afe8ef3..c585816d78 100644
> --- a/ofproto/ofproto-dpif.c
> +++ b/ofproto/ofproto-dpif.c
> @@ -2813,12 +2813,21 @@ set_rstp(struct ofproto *ofproto_, const struct
> ofproto_rstp_settings *s)
>          rstp_set_bridge_transmit_hold_count(ofproto->rstp,
>                                              s->transmit_hold_count);
>      } else {
> +        struct ofbundle *bundle;
>          struct ofport *ofport;
> +
>          HMAP_FOR_EACH (ofport, hmap_node, &ofproto->up.ports) {
>              set_rstp_port(ofport, NULL);
>          }
>          rstp_unref(ofproto->rstp);
>          ofproto->rstp = NULL;
> +
> +        /* During processing above, RSTP state machine may have
> incorrectly
> +         * recalculated the floodable state, due to a transition.
> Recalculate
> +         * the bundle floodable flag now that RSTP states are quiet. */
> +        HMAP_FOR_EACH (bundle, hmap_node, &ofproto->bundles) {
> +            bundle_update(bundle);
> +        }
>      }
>  }
>
> @@ -2965,6 +2974,13 @@ set_stp(struct ofproto *ofproto_, const struct
> ofproto_stp_settings *s)
>
>          stp_unref(ofproto->stp);
>          ofproto->stp = NULL;
> +
> +        /* During processing above, STP state machine may have incorrectly
> +         * recalculated the floodable state, due to a transition.
> Recalculate
> +         * the bundle floodable flag now that STP states are quiet. */
> +        HMAP_FOR_EACH (bundle, hmap_node, &ofproto->bundles) {
>

The declaration of bundle got dropped out of this version. But the patch
seems to be good in the version you sent me.

-M
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to