diff mbox

[ovs-dev,3/4] ofproto/bond: balance-slb mode fallbacks to active-backup mode.

Message ID 1487055173-113220-3-git-send-email-nic@opencloud.tech
State Accepted
Headers show

Commit Message

nickcooper-zhangtonghao Feb. 14, 2017, 6:52 a.m. UTC
lacp-fallback-ab determines the behavior of OvS bond in LACP mode.
If the partner switch does not support LACP, setting this option
to true allows OvS to fallback to active-backup. The balance-tcp
mode requires lacp. If LACP negotiation fails and
other-config:lacp-fallback-ab is true, then active-backup mode is
used. But if users configure the bond port to balance-slb and lacp
(unsuccessfully), active-backup mode is also used.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
---
 ofproto/bond.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

Comments

Andy Zhou Feb. 15, 2017, 4:01 a.m. UTC | #1
On Mon, Feb 13, 2017 at 10:52 PM, nickcooper-zhangtonghao
<nic@opencloud.tech> wrote:
> lacp-fallback-ab determines the behavior of OvS bond in LACP mode.
> If the partner switch does not support LACP, setting this option
> to true allows OvS to fallback to active-backup. The balance-tcp
> mode requires lacp. If LACP negotiation fails and
> other-config:lacp-fallback-ab is true, then active-backup mode is
> used. But if users configure the bond port to balance-slb and lacp
> (unsuccessfully), active-backup mode is also used.
>
> Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>

I think only accepts input from one port may be too restrictive. In case the
up stream switch choose to transmit on the port that we deicde not to receive,
then connection will be broken.

It seems the currently the lacp_fallback_ab only applies to
transmit(output).  Why should
it also apply to receive?
nickcooper-zhangtonghao Feb. 15, 2017, 8:06 a.m. UTC | #2
> On Feb 15, 2017, at 12:01 PM, Andy Zhou <azhou@ovn.org> wrote:
> 
> On Mon, Feb 13, 2017 at 10:52 PM, nickcooper-zhangtonghao
> <nic@opencloud.tech <mailto:nic@opencloud.tech>> wrote:
>> lacp-fallback-ab determines the behavior of OvS bond in LACP mode.
>> If the partner switch does not support LACP, setting this option
>> to true allows OvS to fallback to active-backup. The balance-tcp
>> mode requires lacp. If LACP negotiation fails and
>> other-config:lacp-fallback-ab is true, then active-backup mode is
>> used. But if users configure the bond port to balance-slb and lacp
>> (unsuccessfully), active-backup mode is also used.
>> 
>> Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech <mailto:nic@opencloud.tech>>
> 
> I think only accepts input from one port may be too restrictive. In case the
> up stream switch choose to transmit on the port that we deicde not to receive,
> then connection will be broken.
> 
> It seems the currently the lacp_fallback_ab only applies to
> transmit(output).  Why should
> it also apply to receive?


When we receive packets, balance-tcp may fallback to active-backup, and balance-slb
should also fallback. But I didn’t consider the case above. Maybe, this patch is not useful.

Thanks for your review.
diff mbox

Patch

diff --git a/ofproto/bond.c b/ofproto/bond.c
index 2703bc9..56996bf 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -798,6 +798,19 @@  bond_check_admissibility(struct bond *bond, const void *slave_,
     }
 
     switch (bond->balance) {
+    case BM_SLB:
+        /* Drop all packets for which we have learned a different input port,
+         * because we probably sent the packet on one slave and got it back on
+         * the other.  Gratuitous ARP packets are an exception to this rule:
+         * the host has moved to another switch.  The exception to the
+         * exception is if we locked the learning table to avoid reflections on
+         * bond slaves. */
+        if (bond->lacp_status == LACP_DISABLED) {
+            verdict = BV_DROP_IF_MOVED;
+            goto out;
+        }
+        /* Allows OvS to fallback to BM_AB. */
+
     case BM_TCP:
         /* TCP balanced bonds require successful LACP negotiations. Based on
          * the above check, LACP is off or lacp_fallback_ab is true on this
@@ -821,16 +834,6 @@  bond_check_admissibility(struct bond *bond, const void *slave_,
         }
         verdict = BV_ACCEPT;
         goto out;
-
-    case BM_SLB:
-        /* Drop all packets for which we have learned a different input port,
-         * because we probably sent the packet on one slave and got it back on
-         * the other.  Gratuitous ARP packets are an exception to this rule:
-         * the host has moved to another switch.  The exception to the
-         * exception is if we locked the learning table to avoid reflections on
-         * bond slaves. */
-        verdict = BV_DROP_IF_MOVED;
-        goto out;
     }
 
     OVS_NOT_REACHED();