avoid error log when additional inter-router data links attach
@@ -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;
}
}
