summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fontaine <cfontain@redhat.com>2022-07-07 14:31:31 +0200
committerIlya Maximets <i.maximets@ovn.org>2022-07-15 23:08:38 +0200
commit1b53826d6c740c78857b66b1769650ffd3de7c63 (patch)
treec5aa31152ad4bd34fc8deb4234ec9e79bcdbb2f7
parent73ba04fd77a1c4ea98dd289268b9db9067ce3519 (diff)
downloadopenvswitch-1b53826d6c740c78857b66b1769650ffd3de7c63.tar.gz
ofproto/bond: Add knob 'all-members-active'.
This config param allows the delivery of broadcast and multicast packets to the secondary interface of non-lacp bonds, equivalent to the option 'all_slaves_active' for Linux kernel bonds. Reported-at: https://bugzilla.redhat.com/1720935 Signed-off-by: Christophe Fontaine <cfontain@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r--NEWS2
-rw-r--r--ofproto/bond.c12
-rw-r--r--ofproto/bond.h3
-rw-r--r--tests/ofproto-dpif.at129
-rw-r--r--vswitchd/bridge.c3
-rw-r--r--vswitchd/vswitch.xml14
6 files changed, 162 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 0c828ad1c..1fec839dd 100644
--- a/NEWS
+++ b/NEWS
@@ -77,6 +77,8 @@ Post-v2.17.0
- Linux datapath:
* Add offloading meter tc police.
* Add support for offloading the check_pkt_len action.
+ - New configuration knob 'other_config:all-members-active' for
+ balance-slb bonds.
- Previously deprecated Linux kernel module is now fully removed from
the OVS source tree. The version provided with the Linux kernel
should be used instead.
diff --git a/ofproto/bond.c b/ofproto/bond.c
index 845f69e21..f06cf20c9 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -125,6 +125,8 @@ 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. */
char *primary; /* Name of the primary member. */
/* SLB specific bonding info. */
@@ -480,6 +482,9 @@ bond_reconfigure(struct bond *bond, const struct bond_settings *s)
revalidate = true;
}
+ bond->all_members_active = (bond->balance == BM_SLB)
+ ? s->all_members_active : false;
+
if (bond->balance != BM_AB) {
if (!bond->recirc_id) {
bond->recirc_id = recirc_alloc_id(bond->ofproto);
@@ -893,7 +898,7 @@ bond_check_admissibility(struct bond *bond, const void *member_,
/* Drop all multicast packets on inactive members. */
if (eth_addr_is_multicast(eth_dst)) {
- if (bond->active_member != member) {
+ if (bond->active_member != member && !bond->all_members_active) {
goto out;
}
}
@@ -1495,6 +1500,11 @@ bond_print_details(struct ds *ds, const struct bond *bond)
use_lb_output_action ? "enabled" : "disabled",
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");
+ }
+
ds_put_format(ds, "updelay: %d ms\n", bond->updelay);
ds_put_format(ds, "downdelay: %d ms\n", bond->downdelay);
diff --git a/ofproto/bond.h b/ofproto/bond.h
index 1683ec878..2eb0c95a7 100644
--- a/ofproto/bond.h
+++ b/ofproto/bond.h
@@ -62,6 +62,9 @@ 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. */
};
/* Program startup. */
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 2c18e094d..dc689a67b 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -591,6 +591,135 @@ NXST_FLOW reply:
OVS_VSWITCHD_STOP()
AT_CLEANUP
+AT_SETUP([bond - discard duplicated frames])
+dnl With an active/active non-lacp bond, the default behaviour
+dnl is to discard multicast frames on the secondary interface.
+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
+ 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: false
+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
+])
+
+AT_CHECK([ovs-appctl ofproto/trace br0 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff], [0], [dnl
+Flow: in_port=1,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
+ -> no learned MAC for destination, flooding
+
+Final flow: unchanged
+Megaflow: recirc_id=0,eth,in_port=1,dl_src=00:00:00:00:00:00,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x0000
+Datapath actions: 100
+])
+
+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([bond - allow duplicated frames])
+dnl Receiving of duplicated multicast frames should be allowed with 'all_members_active'.
+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=true -- 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: true
+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
+])
+
+AT_CHECK([ovs-appctl ofproto/trace br0 in_port=1,dl_dst=ff:ff:ff:ff:ff:ff], [0], [dnl
+Flow: in_port=1,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
+ -> no learned MAC for destination, flooding
+
+Final flow: unchanged
+Megaflow: recirc_id=0,eth,in_port=1,dl_src=00:00:00:00:00:00,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x0000
+Datapath actions: 100
+])
+
+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
+ -> 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=ff:ff:ff:ff:ff:ff,dl_type=0x0000
+Datapath actions: 100
+])
+
+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 b704410d3..1db74de9d 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -4618,6 +4618,9 @@ 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);
}
/* Returns true if 'port' is synthetic, that is, if we constructed it locally
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 3eb3d4af2..4a9284f6b 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -2122,6 +2122,20 @@
<code>true</code>).
</column>
+ <column name="other_config" key="all-members-active"
+ type='{"type": "boolean"}'>
+ <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>.
+ </p>
+ <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.
+ </p>
+ </column>
+
<group title="Link Failure Detection">
<p>
An important part of link bonding is detecting that links are down so