Commit 428c0ab6 authored by Bilel's avatar Bilel

[OAI-UE] pdcp netlink driver fix + fix on rlc um BOind to mac

parent f7d59ba0
Pipeline #3285 passed with stage
......@@ -644,7 +644,7 @@ add_boolean_option(ENABLE_USE_CPU_EXECUTION_TIME True "Add data in vcd traces: d
add_boolean_option(ENABLE_VCD True "always true now, time measurements of proc calls and var displays")
add_boolean_option(ENABLE_VCD_FIFO True "time measurements of proc calls and var displays sent to FIFO (one more thread)")
add_boolean_option(HARD_RT False "???")
add_boolean_option(LINUX False "used in weird memcpy() in pdcp.c ???")
add_boolean_option(LINUX True "used in weird memcpy() in pdcp.c ???")
add_boolean_option(LINUX_LIST False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False")
add_boolean_option(LOG_NO_THREAD True "Disable thread for log, seems always set to true")
add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
......@@ -727,7 +727,7 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
##########################
# PDCP LAYER OPTIONS
##########################
add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
add_boolean_option(PDCP_USE_NETLINK True "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
......
......@@ -1354,7 +1354,7 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
// Trigger BSR Periodic
UE_mac_inst[module_idP].BSR_reporting_active |= BSR_TRIGGER_PERIODIC;
LOG_I(MAC,"[UE %d] MAC BSR Triggered PeriodicBSR Timer expiry at frame%d subframe %d TBS=%d\n",
LOG_D(MAC,"[UE %d] MAC BSR Triggered PeriodicBSR Timer expiry at frame%d subframe %d TBS=%d\n",
module_idP, frameP, subframe, buflen);
}
......@@ -1419,8 +1419,16 @@ for (lcid=DCCH; lcid < DTCH ; lcid++) {
lcid,
buflen_remain);
if (UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] < rlc_status.bytes_in_buffer) {
LOG_I(MAC, "[UE %d] Frame %d Subframe%d: Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d\n",
module_idP,frameP,subframe,
lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count);
break;
}
/*
AssertFatal ( UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >= rlc_status.bytes_in_buffer, "Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d Frame %d Subrame %d\n",
lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count,frameP,subframe);
*/
if (rlc_status.bytes_in_buffer > 0) {
......@@ -1535,8 +1543,17 @@ if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY)
lcid,
buflen_remain);
AssertFatal ( UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >= rlc_status.bytes_in_buffer, "Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d Frame %d Subrame %d\n",
lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count,frameP,subframe);
if (UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] < rlc_status.bytes_in_buffer) {
LOG_I(MAC, "[UE %d] Frame %d Subframe%d: Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d\n",
module_idP,frameP,subframe,
lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count);
break;
}
/*
AssertFatal ( UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >= rlc_status.bytes_in_buffer, "Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d Frame %d Subrame %d\n",
lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count,frameP,subframe);
*/
if (rlc_status.bytes_in_buffer > 0) {
......
......@@ -493,7 +493,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
ctxt.enb_flag = ctxt_cpy.enb_flag;
#ifdef PDCP_DEBUG
LOG_I(PDCP, "[PDCP][NETLINK] pdcp_read_header_g.rb_id = %d\n", pdcp_read_header_g.rb_id);
LOG_D(PDCP, "[PDCP][NETLINK] pdcp_read_header_g.rb_id = %d\n", pdcp_read_header_g.rb_id);
#endif
if (ctxt_cpy.enb_flag) {
......
......@@ -426,7 +426,7 @@ rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, void *argP, struct mac_data_ind
//-----------------------------------------------------------------------------
struct mac_status_resp
rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP)
rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP)
{
struct mac_status_resp status_resp;
uint16_t sdu_size = 0;
......@@ -434,6 +434,7 @@ rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP
int32_t diff_time=0;
rlc_um_entity_t *rlc_p = NULL;
mem_block_t *mb_p = NULL;
unsigned int max_li_overhead = 0;
status_resp.buffer_occupancy_in_pdus = 0;
status_resp.buffer_occupancy_in_bytes = 0;
......@@ -453,7 +454,20 @@ rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP
if ((status_resp.buffer_occupancy_in_bytes > 0) && ((mb_p = list_get_head(&rlc_p->input_sdus)) != NULL)) {
status_resp.buffer_occupancy_in_bytes += rlc_p->tx_header_min_length_in_bytes;
//Fix on full Header size
if (enb_flagP == ENB_FLAG_NO)
{
// compute Length Indicator overhead to inform MAC of maximum full RLC PDU size according to stored SDUs
// For UE scheduler
// Could be useful for eNB: to be checked
if (rlc_p->input_sdus.nb_elements <= 1) {
max_li_overhead = 0;
} else {
unsigned int num_li = rlc_p->input_sdus.nb_elements - 1;
max_li_overhead = num_li + (num_li >> 1) + (num_li & 1);
}
}
status_resp.buffer_occupancy_in_bytes += (rlc_p->tx_header_min_length_in_bytes + max_li_overhead);
status_resp.buffer_occupancy_in_pdus = rlc_p->input_sdus.nb_elements;
diff_time = ctxt_pP->frame - ((struct rlc_um_tx_sdu_management *)mb_p->data)->sdu_creation_time;
......
......@@ -186,7 +186,7 @@ protected_rlc_um( void rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, rlc_
* \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU.
* \return The maximum number of bytes that can be served by RLC instance to MAC.
*/
public_rlc_um( struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP);)
public_rlc_um( struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP, const eNB_flag_t enb_flagP);)
/*! \fn struct mac_data_req rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP)
* \brief Gives PDUs to lower layer MAC.
......
......@@ -471,9 +471,9 @@ void rlc_um_v9_3_0_test_exchange_pdus(rlc_um_entity_t *um_txP,
memset(&mac_rlc_status_resp_tx, 0, sizeof(struct mac_status_resp));
memset(&mac_rlc_status_resp_rx, 0, sizeof(struct mac_status_resp));
mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, g_frame, 1, bytes_txP, tx_status);
mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, g_frame, 1, bytes_txP, tx_status,ENB_FLAG_YES);
data_request_tx = rlc_um_mac_data_request(um_txP, g_frame);
mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, g_frame, 0, bytes_rxP, tx_status);
mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, g_frame, 0, bytes_rxP, tx_status,ENB_FLAG_YES);
data_request_rx = rlc_um_mac_data_request(um_rxP, g_frame);
......@@ -517,9 +517,9 @@ void rlc_um_v9_3_0_test_exchange_delayed_pdus(rlc_um_entity_t *um_txP,
memset(&mac_rlc_status_resp_tx, 0, sizeof(struct mac_status_resp));
memset(&mac_rlc_status_resp_rx, 0, sizeof(struct mac_status_resp));
mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, g_frame, 1, bytes_txP, tx_status);
mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, g_frame, 1, bytes_txP, tx_status,ENB_FLAG_YES);
data_request_tx = rlc_um_mac_data_request(um_txP, g_frame);
mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, g_frame, 0, bytes_rxP, tx_status);
mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, g_frame, 0, bytes_rxP, tx_status,ENB_FLAG_YES);
data_request_rx = rlc_um_mac_data_request(um_rxP, g_frame);
......
......@@ -406,7 +406,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
break;
case RLC_MODE_UM:
status_resp = rlc_um_mac_status_indication(&ctxt, &rlc_union_p->rlc.um, tb_sizeP, tx_status);
status_resp = rlc_um_mac_status_indication(&ctxt, &rlc_union_p->rlc.um, tb_sizeP, tx_status, enb_flagP);
mac_rlc_status_resp.bytes_in_buffer = status_resp.buffer_occupancy_in_bytes;
mac_rlc_status_resp.pdus_in_buffer = status_resp.buffer_occupancy_in_pdus;
mac_rlc_status_resp.head_sdu_creation_time = status_resp.head_sdu_creation_time;
......
......@@ -99,7 +99,8 @@ ue_ip_common_class_wireless2ip(
hard_header_len = ue_ip_dev[instP]->hard_header_len;
skb_set_mac_header(skb_p, 0);
skb_set_network_header(skb_p, hard_header_len);
skb_p->mark = rb_idP;
//printk("[NAC_COMMIN_RECEIVE]: Packet Type %d (%d,%d)",skb_p->pkt_type,PACKET_HOST,PACKET_BROADCAST);
skb_p->pkt_type = PACKET_HOST;
......@@ -344,7 +345,7 @@ void ue_ip_common_wireless2ip(struct nlmsghdr *nlh_pP)
ue_ip_common_class_wireless2ip(pdcph_p->data_size,
(unsigned char *)NLMSG_DATA(nlh_pP) + UE_IP_PDCPH_SIZE,
pdcph_p->inst,
1, //pdcph_p->inst,
pdcph_p->rb_id);
}
......
......@@ -188,9 +188,9 @@ void pdcp_rlc_test_exchange_pdus(rlc_um_entity_t *um_txP,
memset(&mac_rlc_status_resp_tx, 0, sizeof(struct mac_status_resp));
memset(&mac_rlc_status_resp_rx, 0, sizeof(struct mac_status_resp));
mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, bytes_txP, tx_status);
mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, bytes_txP, tx_status, ENB_FLAG_YES);
data_request_tx = rlc_um_mac_data_request(um_txP);
mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, bytes_rxP, tx_status);
mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, bytes_rxP, tx_status, ENB_FLAG_YES);
data_request_rx = rlc_um_mac_data_request(um_rxP);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment