You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gm...@apache.org on 2016/05/16 19:20:14 UTC

qpid-dispatch git commit: DISPATCH-335 - Added code to balance link routes over remote routers

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 2b17c00f7 -> 01a2c5fb9


DISPATCH-335 - Added code to balance link routes over remote routers

(cherry picked from commit 2b284971d5c3dcc7d379809f0a1fe753e561e72d)


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/01a2c5fb
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/01a2c5fb
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/01a2c5fb

Branch: refs/heads/master
Commit: 01a2c5fb9f2bcf2660bec57b7f5ac4306beb5d0a
Parents: 2b17c00
Author: Ganesh Murthy <gm...@redhat.com>
Authored: Fri May 13 16:11:48 2016 -0400
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Mon May 16 15:14:54 2016 -0400

----------------------------------------------------------------------
 src/router_core/forwarder.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/01a2c5fb/src/router_core/forwarder.c
----------------------------------------------------------------------
diff --git a/src/router_core/forwarder.c b/src/router_core/forwarder.c
index 836bc02..43c966f 100644
--- a/src/router_core/forwarder.c
+++ b/src/router_core/forwarder.c
@@ -559,12 +559,29 @@ bool qdr_forward_link_balanced_CT(qdr_core_t     *core,
         //
         // Look for a next-hop we can use to forward the link-attach.
         //
-        int         router_bit;
         qdr_node_t *next_node;
 
-        if (qd_bitmask_first_set(addr->rnodes, &router_bit)) {
-            qdr_node_t *rnode = core->routers_by_mask_bit[router_bit];
+        if (addr->cost_epoch != core->cost_epoch) {
+            addr->next_remote = -1;
+            addr->cost_epoch  = core->cost_epoch;
+        }
+
+        if (addr->next_remote < 0) {
+            qd_bitmask_first_set(addr->rnodes, &addr->next_remote);
+        }
+
+        if (addr->next_remote >= 0) {
+
+            qdr_node_t *rnode = core->routers_by_mask_bit[addr->next_remote];
+
             if (rnode) {
+                //
+                // Advance the addr->next_remote so there will be link balance across containers
+                //
+                _qdbm_next(addr->rnodes, &addr->next_remote);
+                if (addr->next_remote == -1)
+                    qd_bitmask_first_set(addr->rnodes, &addr->next_remote);
+
                 if (rnode->next_hop)
                     next_node = rnode->next_hop;
                 else


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org