summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-10-26 09:33:10 +0000
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-10-26 09:33:10 +0000
commit0fd97235ecf670f1fc6db2723c530934b5376458 (patch)
tree502b9a4552fd6a53a9161e2afe86b0717a9714b1
parent73f3719ae8b843997bc21c668684af69d2092383 (diff)
parentb5fcd780d69abce5764645e608c9abad42a955cb (diff)
downloadouroboros-0fd97235ecf670f1fc6db2723c530934b5376458.tar.gz
ouroboros-0fd97235ecf670f1fc6db2723c530934b5376458.zip
Merged in dstaesse/ouroboros/be-eth-llc (pull request #282)
irmd: Add log messages for flow allocation
-rw-r--r--src/irmd/main.c11
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;
}