diff options
author | dimitri staessens <[email protected]> | 2016-09-02 13:48:36 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-09-02 14:59:42 +0200 |
commit | 4f44c91c68a3706e04334066f28471d56cc71849 (patch) | |
tree | c31bfb75b7abfea47a1773fcbe2782d4832d5c49 /src/ipcpd | |
parent | 4493d36a4769c6625e3025a0c484bf0ec65708bd (diff) | |
download | ouroboros-4f44c91c68a3706e04334066f28471d56cc71849.tar.gz ouroboros-4f44c91c68a3706e04334066f28471d56cc71849.zip |
lib: Add northbound ringbuffers
Fast path is split in north and southbound paths.
Diffstat (limited to 'src/ipcpd')
-rw-r--r-- | src/ipcpd/local/main.c | 6 | ||||
-rw-r--r-- | src/ipcpd/normal/fmgr.c | 4 | ||||
-rw-r--r-- | src/ipcpd/normal/main.c | 2 | ||||
-rw-r--r-- | src/ipcpd/shim-eth-llc/main.c | 6 | ||||
-rw-r--r-- | src/ipcpd/shim-udp/main.c | 6 |
5 files changed, 12 insertions, 12 deletions
diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c index f1b6dd9e..c0809429 100644 --- a/src/ipcpd/local/main.c +++ b/src/ipcpd/local/main.c @@ -105,7 +105,7 @@ static int shim_ap_init() return -1; } - _ap_instance->rb = shm_ap_rbuff_create(); + _ap_instance->rb = shm_ap_rbuff_create_n(); if (_ap_instance->rb == NULL) { shm_rdrbuff_close(_ap_instance->rdrb); bmp_destroy(_ap_instance->fds); @@ -331,7 +331,7 @@ static int ipcp_local_flow_alloc(pid_t n_api, return -1; /* -ENOTENROLLED */ } - rb = shm_ap_rbuff_open(n_api); + rb = shm_ap_rbuff_open_s(n_api); if (rb == NULL) { pthread_rwlock_unlock(&_ipcp->state_lock); return -1; /* -ENORBUFF */ @@ -421,7 +421,7 @@ static int ipcp_local_flow_alloc_resp(pid_t n_api, return -1; } - rb = shm_ap_rbuff_open(n_api); + rb = shm_ap_rbuff_open_s(n_api); if (rb == NULL) { LOG_ERR("Could not open N + 1 ringbuffer."); _ap_instance->flows[in_fd].state = FLOW_NULL; diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c index 3056b46d..d74ad0c8 100644 --- a/src/ipcpd/normal/fmgr.c +++ b/src/ipcpd/normal/fmgr.c @@ -367,7 +367,7 @@ int fmgr_flow_alloc(pid_t n_api, free(buf.data); - flow->flow.rb = shm_ap_rbuff_open(n_api); + flow->flow.rb = shm_ap_rbuff_open_s(n_api); if (flow->flow.rb == NULL) { pthread_mutex_unlock(&fmgr->n_flows_lock); free(flow); @@ -478,7 +478,7 @@ int fmgr_flow_alloc_resp(pid_t n_api, flow->flow.state = FLOW_ALLOCATED; flow->flow.api = n_api; - flow->flow.rb = shm_ap_rbuff_open(n_api); + flow->flow.rb = shm_ap_rbuff_open_s(n_api); if (flow->flow.rb == NULL) { n_flow_dealloc(port_id); pthread_mutex_unlock(&fmgr->n_flows_lock); diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index cf4ae3f1..082973f4 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -212,7 +212,7 @@ struct normal_ipcp_data * normal_ipcp_data_create() return NULL; } - normal_data->rb = shm_ap_rbuff_open(getpid()); + normal_data->rb = shm_ap_rbuff_create_n(); if (normal_data->rb == NULL) { shm_rdrbuff_close(normal_data->rdrb); free(normal_data); diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c index d1100001..028d249f 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/shim-eth-llc/main.c @@ -161,7 +161,7 @@ struct eth_llc_ipcp_data * eth_llc_ipcp_data_create() return NULL; } - eth_llc_data->rb = shm_ap_rbuff_create(); + eth_llc_data->rb = shm_ap_rbuff_create_n(); if (eth_llc_data->rb == NULL) { shm_rdrbuff_close(eth_llc_data->rdrb); free(eth_llc_data); @@ -1084,7 +1084,7 @@ static int eth_llc_ipcp_flow_alloc(pid_t n_api, if (qos != QOS_CUBE_BE) LOG_DBGF("QoS requested. Ethernet LLC can't do that. For now."); - rb = shm_ap_rbuff_open(n_api); + rb = shm_ap_rbuff_open_s(n_api); if (rb == NULL) return -1; /* -ENORBUFF */ @@ -1169,7 +1169,7 @@ static int eth_llc_ipcp_flow_alloc_resp(pid_t n_api, return -1; } - rb = shm_ap_rbuff_open(n_api); + rb = shm_ap_rbuff_open_s(n_api); if (rb == NULL) { LOG_ERR("Could not open N + 1 ringbuffer."); ipcp_flow(index)->state = FLOW_NULL; diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c index 451a2a4c..85de1eec 100644 --- a/src/ipcpd/shim-udp/main.c +++ b/src/ipcpd/shim-udp/main.c @@ -128,7 +128,7 @@ static int shim_ap_init() return -1; } - _ap_instance->rb = shm_ap_rbuff_create(); + _ap_instance->rb = shm_ap_rbuff_create_n(); if (_ap_instance->rb == NULL) { shm_rdrbuff_close(_ap_instance->rdrb); bmp_destroy(_ap_instance->fds); @@ -1179,7 +1179,7 @@ static int ipcp_udp_flow_alloc(pid_t n_api, if (qos != QOS_CUBE_BE) LOG_DBG("QoS requested. UDP/IP can't do that."); - rb = shm_ap_rbuff_open(n_api); + rb = shm_ap_rbuff_open_s(n_api); if (rb == NULL) return -1; /* -ENORBUFF */ @@ -1333,7 +1333,7 @@ static int ipcp_udp_flow_alloc_resp(pid_t n_api, return -1; } - rb = shm_ap_rbuff_open(n_api); + rb = shm_ap_rbuff_open_s(n_api); if (rb == NULL) { LOG_ERR("Could not open N + 1 ringbuffer."); _ap_instance->flows[fd].state = FLOW_NULL; |