From 5ab96126078cb9166356beaff3458404664274ed Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 3 Jan 2017 11:57:59 +0100 Subject: lib, ipcpd, irmd: Proof of concept QoS Now correctly relays the qoscube end-to-end in the stack. A simple function specifying the cube in the spec is used for initial testing. The translation is now done in dev.c, but it could be moved elsewhere when qos cabability matures and the need arises. --- src/ipcpd/shim-eth-llc/main.c | 24 ++++++++++++++-------- src/ipcpd/shim-eth-llc/shim_eth_llc_messages.proto | 3 ++- 2 files changed, 18 insertions(+), 9 deletions(-) (limited to 'src/ipcpd/shim-eth-llc') diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c index da0bf97e..ab25ffb1 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/shim-eth-llc/main.c @@ -315,7 +315,8 @@ static int eth_llc_ipcp_send_mgmt_frame(shim_eth_llc_msg_t * msg, static int eth_llc_ipcp_sap_alloc(uint8_t * dst_addr, uint8_t ssap, char * dst_name, - char * src_ae_name) + char * src_ae_name, + qoscube_t cube) { shim_eth_llc_msg_t msg = SHIM_ETH_LLC_MSG__INIT; @@ -324,6 +325,8 @@ static int eth_llc_ipcp_sap_alloc(uint8_t * dst_addr, msg.ssap = ssap; msg.dst_name = dst_name; msg.src_ae_name = src_ae_name; + msg.has_qoscube = true; + msg.qoscube = cube; return eth_llc_ipcp_send_mgmt_frame(&msg, dst_addr); } @@ -349,7 +352,8 @@ static int eth_llc_ipcp_sap_alloc_resp(uint8_t * dst_addr, static int eth_llc_ipcp_sap_req(uint8_t r_sap, uint8_t * r_addr, char * dst_name, - char * src_ae_name) + char * src_ae_name, + qoscube_t cube) { int fd; @@ -357,7 +361,7 @@ static int eth_llc_ipcp_sap_req(uint8_t r_sap, pthread_rwlock_wrlock(ð_llc_data.flows_lock); /* reply to IRM */ - fd = ipcp_flow_req_arr(getpid(), dst_name, src_ae_name); + fd = ipcp_flow_req_arr(getpid(), dst_name, src_ae_name, cube); if (fd < 0) { pthread_rwlock_unlock(ð_llc_data.flows_lock); pthread_rwlock_unlock(&ipcpi.state_lock); @@ -464,7 +468,8 @@ static int eth_llc_ipcp_mgmt_frame(uint8_t * buf, size_t len, uint8_t * r_addr) eth_llc_ipcp_sap_req(msg->ssap, r_addr, msg->dst_name, - msg->src_ae_name); + msg->src_ae_name, + msg->qoscube); } break; case SHIM_ETH_LLC_MSG_CODE__FLOW_REPLY: @@ -934,7 +939,7 @@ static int eth_llc_ipcp_name_query(char * name) static int eth_llc_ipcp_flow_alloc(int fd, char * dst_name, char * src_ae_name, - qoscube_t qos) + qoscube_t cube) { uint8_t ssap = 0; uint8_t r_addr[MAC_SIZE]; @@ -945,8 +950,10 @@ static int eth_llc_ipcp_flow_alloc(int fd, if (dst_name == NULL || src_ae_name == NULL) return -1; - if (qos != QOS_CUBE_BE) - LOG_DBG("QoS requested. Ethernet LLC can't do that. For now."); + if (cube != QOS_CUBE_BE && cube != QOS_CUBE_FRC) { + LOG_DBG("Unsupported QoS requested."); + return -1; + } pthread_rwlock_rdlock(&ipcpi.state_lock); @@ -983,7 +990,8 @@ static int eth_llc_ipcp_flow_alloc(int fd, if (eth_llc_ipcp_sap_alloc(r_addr, ssap, dst_name, - src_ae_name) < 0) { + src_ae_name, + cube) < 0) { pthread_rwlock_rdlock(&ipcpi.state_lock); pthread_rwlock_wrlock(ð_llc_data.flows_lock); bmp_release(eth_llc_data.saps, eth_llc_data.fd_to_ef[fd].sap); diff --git a/src/ipcpd/shim-eth-llc/shim_eth_llc_messages.proto b/src/ipcpd/shim-eth-llc/shim_eth_llc_messages.proto index 9eebf610..63ab4519 100644 --- a/src/ipcpd/shim-eth-llc/shim_eth_llc_messages.proto +++ b/src/ipcpd/shim-eth-llc/shim_eth_llc_messages.proto @@ -35,5 +35,6 @@ message shim_eth_llc_msg { optional string src_ae_name = 3; optional uint32 ssap = 4; optional uint32 dsap = 5; - optional sint32 response = 6; + optional uint32 qoscube = 6; + optional sint32 response = 7; }; -- cgit v1.2.3