From c1963fb27dcd022b165fc27bb6586af2ea3ac41d Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 10 Aug 2012 11:20:24 -0700 Subject: [PATCH] hammer2 - Message span tree work * Trivially optimize out the sending of a SPAN back across the same connection it was received from. --- sbin/hammer2/msg_lnk.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/sbin/hammer2/msg_lnk.c b/sbin/hammer2/msg_lnk.c index b1216e7..1c0ab69 100644 --- a/sbin/hammer2/msg_lnk.c +++ b/sbin/hammer2/msg_lnk.c @@ -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. -- 1.7.7.2