In a non-LACP balance-slb bond, bond_check_admissibility() drops broadcast
and multicast on members other than the active one, and the check runs
before the multicast-snooping lookup.  When an IGMP/MLD-snooping switch
forwards a group to a single member that is not the active one, OVS drops
the stream and a receiver behind the bond stalls.

other_config:all-members-active=true already lets such traffic through, but
it also admits broadcast, which a flooding switch then duplicates.  Extend
the knob to take a value: 'multicast' admits multicast but not broadcast on
the non-active members, while 'true' keeps admitting both and 'false' (the
default) keeps dropping both.  The boolean values remain valid, so existing
configurations are unaffected.

Signed-off-by: Sola Zhang <[email protected]>
---
v3 -> v4:
  - bridge.c: parse the value with strcasecmp (like smap_get_bool), so
    'True'/'MULTICAST' etc. keep working as before, and log a warning on an
    unrecognised value.
  - vswitch.xml: dropped the backward-compatibility note (document behaviour,
    not history).
  - Added a NEWS entry.
v2 -> v3:
  - Reworded two struct-field comments (no functional change) to avoid
    false-positive checkpatch "whitespace around operator" warnings.
v1 -> v2:
  - Per Aaron Conole's review, dropped the separate
    multicast-all-members-active knob and instead gave the existing
    all-members-active knob a value (true/false/multicast).  'true' still
    means both broadcast and multicast, so existing configurations are
    unaffected.  Did not add a 'broadcast' value, as suggested.
  - v1 (RFC): 
https://patchwork.ozlabs.org/project/openvswitch/patch/[email protected]/

 NEWS                  |  4 +++
 ofproto/bond.c        | 31 +++++++++++++++-----
 ofproto/bond.h        | 15 ++++++++--
 tests/ofproto-dpif.at | 68 +++++++++++++++++++++++++++++++++++++++++++
 vswitchd/bridge.c     | 19 ++++++++++--
 vswitchd/vswitch.xml  | 32 +++++++++++++++-----
 6 files changed, 148 insertions(+), 21 deletions(-)

diff --git a/NEWS b/NEWS
index de1a030ad..69beefb0d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
 Post-v4.0.0
 --------------------
+   - Bonding:
+     * The 'other_config:all-members-active' option on balance-slb bonds now
+       accepts the value 'multicast', which admits multicast but not broadcast
+       on non-active members.
 
 
 v4.0.0 - 17 Aug 2026
diff --git a/ofproto/bond.c b/ofproto/bond.c
index ef481a360..50728dd06 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -125,8 +125,10 @@ struct bond {
     uint32_t basis;             /* Basis for flow hash function. */
     bool use_lb_output_action;  /* Use lb_output action to avoid recirculation.
                                    Applicable only for Balance TCP mode. */
-    bool all_members_active;    /* Accept multicast packets on secondary
-                                   members of a non-LACP Balance SLB bond. */
+    enum bond_all_members_active all_members_active;
+                                /* Delivery of broadcast and multicast packets
+                                   on secondary members of a Balance SLB bond
+                                   without LACP. */
     char *primary;              /* Name of the primary member. */
 
     /* SLB specific bonding info. */
@@ -502,7 +504,8 @@ bond_reconfigure(struct bond *bond, const struct 
bond_settings *s)
     }
 
     bond->all_members_active = (bond->balance == BM_SLB)
-                               ? s->all_members_active : false;
+                               ? s->all_members_active
+                               : BOND_ALL_MEMBERS_ACTIVE_OFF;
 
     if (bond->balance != BM_AB) {
         if (!bond->recirc_id) {
@@ -931,9 +934,15 @@ bond_check_admissibility(struct bond *bond, const void 
*member_,
         break;
     }
 
-    /* Drop all multicast packets on inactive members. */
-    if (eth_addr_is_multicast(eth_dst)) {
-        if (bond->active_member != member && !bond->all_members_active) {
+    /* Drop broadcast and multicast packets on inactive members, unless
+     * 'all-members-active' admits them: 'true' admits both, 'multicast'
+     * admits multicast but not broadcast. */
+    if (eth_addr_is_multicast(eth_dst) && bond->active_member != member) {
+        enum bond_all_members_active ama = bond->all_members_active;
+        bool admit = ama == BOND_ALL_MEMBERS_ACTIVE_ALL
+                     || (ama == BOND_ALL_MEMBERS_ACTIVE_MULTICAST
+                         && !eth_addr_is_broadcast(eth_dst));
+        if (!admit) {
             goto out;
         }
     }
@@ -1565,8 +1574,14 @@ bond_print_details(struct ds *ds, const struct bond 
*bond)
                   use_lb_output_action ? recirc_id : -1);
 
     if (bond->balance == BM_SLB) {
-        ds_put_format(ds, "all members active: %s\n",
-                      bond->all_members_active ? "true" : "false");
+        const char *ama = "false";
+        if (bond->all_members_active == BOND_ALL_MEMBERS_ACTIVE_ALL) {
+            ama = "true";
+        } else if (bond->all_members_active
+                   == BOND_ALL_MEMBERS_ACTIVE_MULTICAST) {
+            ama = "multicast";
+        }
+        ds_put_format(ds, "all members active: %s\n", ama);
     }
 
     ds_put_format(ds, "updelay: %d ms\n", bond->updelay);
diff --git a/ofproto/bond.h b/ofproto/bond.h
index 3aa5c640d..263fdcd05 100644
--- a/ofproto/bond.h
+++ b/ofproto/bond.h
@@ -38,6 +38,14 @@ enum bond_mode {
 bool bond_mode_from_string(enum bond_mode *, const char *);
 const char *bond_mode_to_string(enum bond_mode);
 
+/* How a balance-slb bond treats broadcast and multicast frames received on its
+ * non-active members, configured via other_config:all-members-active. */
+enum bond_all_members_active {
+    BOND_ALL_MEMBERS_ACTIVE_OFF,        /* Drop broadcast and multicast. */
+    BOND_ALL_MEMBERS_ACTIVE_MULTICAST,  /* Admit multicast, drop broadcast. */
+    BOND_ALL_MEMBERS_ACTIVE_ALL,        /* Admit broadcast and multicast. */
+};
+
 /* Configuration for a bond as a whole. */
 struct bond_settings {
     char *name;                 /* Bond's name, for log messages. */
@@ -62,9 +70,10 @@ struct bond_settings {
                                    ovs run. */
     bool use_lb_output_action;  /* Use lb_output action. Only applicable for
                                    bond mode BALANCE TCP. */
-    bool all_members_active;    /* Accept multicast packets on secondary
-                                   interface. Only applicable for non-LACP
-                                   BALANCE SLB bond mode. */
+    enum bond_all_members_active all_members_active;
+                                /* Delivery of broadcast and multicast packets
+                                   on secondary members. Only applicable to
+                                   Balance SLB bonds without LACP. */
 };
 
 /* Program startup. */
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index efb36e058..20e9dee89 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -946,6 +946,74 @@ Datapath actions: 100
 OVS_VSWITCHD_STOP()
 AT_CLEANUP
 
+AT_SETUP([ofproto-dpif - bond - allow multicast only])
+dnl With 'all-members-active=multicast', multicast is accepted on the
+dnl non-active member but broadcast is still dropped.
+OVS_VSWITCHD_START([dnl
+        add-bond br0 bond0 p1 p2 -- dnl
+        set Port bond0 bond-mode=balance-slb 
other-config:bond-rebalance-interval=0 dnl
+                        other_config:all-members-active=multicast -- dnl
+        set Interface p1 type=dummy ofport_request=1 -- dnl
+        set Interface p2 type=dummy ofport_request=2])
+
+AT_CHECK([ovs-appctl bond/set-active-member bond0 p1], [0], [ignore])
+AT_CHECK([ovs-ofctl add-flow br0 actions=NORMAL])
+
+OVS_WAIT_UNTIL_EQUAL([ovs-appctl bond/show bond0 | STRIP_ACTIVE_MEMBER_MAC], 
[dnl
+---- bond0 ----
+bond_mode: balance-slb
+bond may use recirculation: no, Recirc-ID : -1
+bond-hash-basis: 0
+lb_output action: disabled, bond-id: -1
+all members active: multicast
+updelay: 0 ms
+downdelay: 0 ms
+lacp_status: off
+lacp_fallback_ab: false
+active-backup primary: <none>
+<active member mac del>
+
+member p1: enabled
+  active member
+  may_enable: true
+
+member p2: enabled
+  may_enable: true
+])
+
+dnl Multicast is admitted on the non-active member p2.
+AT_CHECK([ovs-appctl ofproto/trace br0 in_port=2,dl_dst=01:00:5e:00:00:01], 
[0], [dnl
+Flow: 
in_port=2,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=01:00:5e:00:00:01,dl_type=0x0000
+
+bridge("br0")
+-------------
+ 0. priority 32768
+    NORMAL
+     -> no learned MAC for destination, flooding
+
+Final flow: unchanged
+Megaflow: 
recirc_id=0,eth,in_port=2,dl_src=00:00:00:00:00:00,dl_dst=01:00:5e:00:00:01,dl_type=0x0000
+Datapath actions: 100
+])
+
+dnl Broadcast is still dropped on the non-active member p2.
+AT_CHECK([ovs-appctl ofproto/trace br0 in_port=2,dl_dst=ff:ff:ff:ff:ff:ff], 
[0], [dnl
+Flow: 
in_port=2,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x0000
+
+bridge("br0")
+-------------
+ 0. priority 32768
+    NORMAL
+     -> bonding refused admissibility, dropping
+
+Final flow: unchanged
+Megaflow: 
recirc_id=0,eth,in_port=2,dl_src=00:00:00:00:00:00,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x0000
+Datapath actions: drop
+])
+
+OVS_VSWITCHD_STOP()
+AT_CLEANUP
+
 AT_SETUP([ofproto-dpif - resubmit])
 OVS_VSWITCHD_START
 add_of_ports br0 1 10 11 12 13 14 15 16 17 18 19 20 21
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index c00abd295..c2e458666 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -4752,9 +4752,22 @@ port_configure_bond(struct port *port, struct 
bond_settings *s)
     s->use_lb_output_action = (s->balance == BM_TCP)
                               && smap_get_bool(&port->cfg->other_config,
                                                "lb-output-action", false);
-    /* all_members_active is disabled by default. */
-    s->all_members_active = smap_get_bool(&port->cfg->other_config,
-                                          "all-members-active", false);
+    /* all-members-active admits broadcast and multicast ("true") or multicast
+     * only ("multicast") on non-active members of a balance-slb bond; disabled
+     * ("false") by default. */
+    const char *all_members_active =
+        smap_get_def(&port->cfg->other_config, "all-members-active", "false");
+    if (!strcasecmp(all_members_active, "true")) {
+        s->all_members_active = BOND_ALL_MEMBERS_ACTIVE_ALL;
+    } else if (!strcasecmp(all_members_active, "multicast")) {
+        s->all_members_active = BOND_ALL_MEMBERS_ACTIVE_MULTICAST;
+    } else {
+        s->all_members_active = BOND_ALL_MEMBERS_ACTIVE_OFF;
+        if (strcasecmp(all_members_active, "false")) {
+            VLOG_WARN("port %s: unsupported all-members-active value '%s'",
+                      port->name, all_members_active);
+        }
+    }
 }
 
 /* Returns true if 'port' is synthetic, that is, if we constructed it locally
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 4eec70fe4..45c8e4037 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -2246,16 +2246,34 @@
       </column>
 
       <column name="other_config" key="all-members-active"
-              type='{"type": "boolean"}'>
+              type='{"type": "string",
+                     "enum": ["set", ["true", "false", "multicast"]]}'>
         <p>
-          Enable/Disable delivery of broadcast/multicast packets on secondary
-          interface of a balance-slb bond.  Relevant only when
-          <ref column="lacp"/> is <code>off</code>.
+          Controls delivery of broadcast and multicast packets to the
+          non-active members of a balance-slb bond.  Relevant only when
+          <ref column="lacp"/> is <code>off</code>.  Possible values:
         </p>
+        <dl>
+          <dt><code>false</code> (default)</dt>
+          <dd>
+            Drop broadcast and multicast on non-active members.
+          </dd>
+          <dt><code>true</code></dt>
+          <dd>
+            Deliver both broadcast and multicast on non-active members.
+            Identical to <code>all_slaves_active</code> for Linux kernel
+            bonds.
+          </dd>
+          <dt><code>multicast</code></dt>
+          <dd>
+            Deliver multicast but not broadcast on non-active members.  Useful
+            when an upstream switch snoops IGMP/MLD and forwards a group to a
+            single member, which need not be the bond's active one, while
+            still letting that switch handle broadcast.
+          </dd>
+        </dl>
         <p>
-          This parameter is identical to <code>all_slaves_active</code> for
-          Linux kernel bonds.  Disabled by default as it is not a desirable
-          configuration for most users.
+          Disabled (<code>false</code>) by default.
         </p>
       </column>
 
-- 
2.51.0.windows.1

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

Reply via email to