Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions src/router_core/connections.c
Original file line number Diff line number Diff line change
Expand Up @@ -1469,20 +1469,15 @@ static void qdr_detach_link_control_CT(qdr_core_t *core, qdr_connection_t *conn,
//
static void qdr_attach_link_data_CT(qdr_core_t *core, qdr_connection_t *conn, qdr_link_t *link)
{
if (conn->role == QDR_ROLE_INTER_ROUTER) {
// As inter-router links are attached to this connection, they
// are assigned priorities in the order in which they are attached.
int next_slot = core->data_links_by_mask_bit[conn->mask_bit].count ++;
if (next_slot > QDR_MAX_PRIORITY) {
// If somebody tries to exceed max links, log an error and
// do not allow replacement of the legitimate link that is already in the max slot.
// This is not serious enough to cause a program exit, but if it ever
// happens it should be investiagted as a bug.
qd_log(core->log, QD_LOG_ERROR, "Attempt to attach too many inter-router links for priority sheaf.");
return;
}
link->priority = next_slot;
core->data_links_by_mask_bit[conn->mask_bit].links[next_slot] = link;
assert(link->link_type == QD_LINK_ROUTER);
// The first QDR_N_PRIORITIES (10) QDR_LINK_ROUTER links to attach over the
// connection are the shared priority links. These links are attached in
// priority order starting at zero.
int next_pri = core->data_links_by_mask_bit[conn->mask_bit].count;
if (next_pri < QDR_N_PRIORITIES) {
link->priority = next_pri;
core->data_links_by_mask_bit[conn->mask_bit].links[next_pri] = link;
core->data_links_by_mask_bit[conn->mask_bit].count += 1;
}
}

Expand Down