hammer2 - Message span tree work
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Aug 2012 18:20:24 +0000 (11:20 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 10 Aug 2012 18:20:24 +0000 (11:20 -0700)
* Trivially optimize out the sending of a SPAN back across the same
  connection it was received from.

sbin/hammer2/msg_lnk.c

index b1216e7..1c0ab69 100644 (file)
@@ -819,6 +819,13 @@ hammer2_relay_scan_specific(h2span_node_t *node, h2span_connect_t *conn)
                         * we can break out of the loop.
                         */
                        break;
+               } else if (slink->state->iocom == conn->state->iocom) {
+                       /*
+                        * No match but we would transmit a LNK_SPAN
+                        * out the same connection it came in on, which
+                        * can be trivially optimized out.
+                        */
+                       break;
                } else {
                        /*
                         * No match, distance is ok, construct a new relay.