Project

General

Profile

Feature #1443

link aggregation network interfaces need non-LACP failover mode of operation

Added by Andrzej Szeszo almost 8 years ago.

Status:
New
Priority:
High
Assignee:
-
Category:
kernel
Start date:
2011-09-02
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

At the moment it is not possible to create redundant network backends for vnics when the machine's physical interfaces are connected to multiple network switches and the switches don't support multichassis LACP (which is a typical scenario).

On other systems similar thing is easily achievable (lagg in failover mode on FreeBSD, nic bonding on Linux, nic teaming on Windows when using some drivers, etc.).

This functionality is rather important to have now, after KVM was ported to illumos. It is critical to have an ability to create vnics on top of aggr with physical link redundancy (when multichassis LACP cannot be used).

I propose we add additional mode of operation to the aggr interfaces, similar to the 'failover' mode of FreeBSD's lagg, as described here: http://www.freebsd.org/cgi/man.cgi?query=lagg

To test how difficult it would be implement, I have made the following changes locally:

  • made mac_pkt_hash() funtion in usr/src/uts/common/io/mac/mac_util.c to always return 0
  • made the changes below to usr/src/uts/common/io/aggr/aggr_send.c
diff --git a/usr/src/uts/common/io/aggr/aggr_send.c b/usr/src/uts/common/io/aggr/aggr_send.c
--- a/usr/src/uts/common/io/aggr/aggr_send.c
+++ b/usr/src/uts/common/io/aggr/aggr_send.c
@@ -96,24 +96,7 @@
     hash = mac_pkt_hash(DL_ETHER, mp, grp->lg_mac_tx_policy, B_TRUE);
     port = grp->lg_tx_ports[hash % grp->lg_ntx_ports];

-    /*
-     * Use hash as the hint so to direct traffic to
-     * different TX rings. Note below bit operation
-     * is needed in case hint is 0 to get the most
-     * benefit from HASH_HINT() algorithm.
-     */
-    if (port->lp_tx_ring_cnt > 1) {
-        if (hint == 0) {
-            hash = (hash << 24 | hash << 16 | hash);
-            hash = (hash << 32 | hash);
-        } else {
-            hash = hint;
-        }
-        hash = HASH_HINT(hash);
-        *rh = port->lp_pseudo_tx_rings[hash % port->lp_tx_ring_cnt];
-    } else {
-        *rh = port->lp_pseudo_tx_rings[0];
-    }
+    *rh = port->lp_pseudo_tx_rings[0];
     rw_exit(&grp->lg_tx_lock);

     return (mp);

With the changes above aggr traffic was always going out using the same physical interface. Unplugging active interface's cable would seamlessly switch aggr to use the secondary interface.

The code to support this functionality is mostly there in the kernel already and adding support for the failover mode should not be a major overtaking.

Also available in: Atom PDF