diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-10-26 11:24:10 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-10-26 11:24:10 +0200 |
commit | b5fcd780d69abce5764645e608c9abad42a955cb (patch) | |
tree | 502b9a4552fd6a53a9161e2afe86b0717a9714b1 | |
parent | d2ae65cff6a732ef6ad38a74380f27e36d464321 (diff) | |
download | ouroboros-b5fcd780d69abce5764645e608c9abad42a955cb.tar.gz ouroboros-b5fcd780d69abce5764645e608c9abad42a955cb.zip |
irmd: Add log messages for flow allocation
In the rewrite of the flow allocator for per-port ring buffers, the
messages were removed because they were not accurate anymore. This
adds messages when a port is allocated.
-rw-r--r-- | src/irmd/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c index 3884a9a7..8ae78394 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -1248,8 +1248,12 @@ static int flow_alloc_res(int port_id) pthread_rwlock_unlock(&irmd->flows_lock); pthread_rwlock_unlock(&irmd->state_lock); - if (irm_flow_wait_state(f, FLOW_ALLOCATED) == FLOW_ALLOCATED) + if (irm_flow_wait_state(f, FLOW_ALLOCATED) == FLOW_ALLOCATED) { + LOG_INFO("Flow on port_id %d allocated.", port_id); return 0; + } + + LOG_INFO("Pending flow on port_id %d torn down.", port_id); return -1; } @@ -1351,6 +1355,7 @@ static struct irm_flow * flow_req_arr(pid_t api, struct pid_el * c_api; pid_t h_api = -1; + int port_id = -1; LOG_DBGF("Flow req arrived from IPCP %d for %s on AE %s.", api, dst_name, ae_name); @@ -1469,7 +1474,7 @@ static struct irm_flow * flow_req_arr(pid_t api, pthread_rwlock_unlock(&irmd->reg_lock); pthread_rwlock_wrlock(&irmd->flows_lock); - f->port_id = bmp_allocate(irmd->port_ids); + port_id = f->port_id = bmp_allocate(irmd->port_ids); if (!bmp_is_id_valid(irmd->port_ids, f->port_id)) { pthread_rwlock_unlock(&irmd->flows_lock); pthread_rwlock_unlock(&irmd->state_lock); @@ -1534,6 +1539,8 @@ static struct irm_flow * flow_req_arr(pid_t api, pthread_mutex_unlock(&re->state_lock); + LOG_INFO("Flow on port_id %d allocated.", port_id); + return f; } |