Commit 18fb589b authored by laurent's avatar laurent

fixes: improves throughput

parent 3321a351
This diff is collapsed.
...@@ -76,6 +76,39 @@ typedef struct { ...@@ -76,6 +76,39 @@ typedef struct {
uint16_t UE_id; uint16_t UE_id;
int8_t harq_pid; int8_t harq_pid;
UE_type_t ue_type; UE_type_t ue_type;
uint8_t dci_alloc;
uint8_t rar_alloc;
SCH_status_t status;
uint8_t Msg3_flag;
uint8_t subframe;
uint32_t frame;
uint8_t handled;
uint8_t phich_active;
uint8_t phich_ACK;
uint16_t previous_first_rb;
uint32_t B;
uint32_t G;
UCI_format_t uci_format;
uint8_t Or2;
uint8_t o_RI[2];
uint8_t o_ACK[4];
uint8_t O_ACK;
uint8_t o_RCC;
int16_t q_ACK[MAX_ACK_PAYLOAD];
int16_t q_RI[MAX_RI_PAYLOAD];
uint32_t RTC[MAX_NUM_ULSCH_SEGMENTS];
uint8_t ndi;
uint8_t round;
uint8_t rvidx;
uint8_t Nl;
uint8_t n_DMRS;
uint8_t previous_n_DMRS;
uint8_t n_DMRS2;
int32_t delta_TF;
uint32_t repetition_number ;
uint32_t total_number_of_repetitions;
uint16_t harq_mask; uint16_t harq_mask;
uint16_t nb_rb; uint16_t nb_rb;
uint8_t Qm; uint8_t Qm;
...@@ -130,6 +163,10 @@ typedef struct { ...@@ -130,6 +163,10 @@ typedef struct {
int16_t nb_active_ue; int16_t nb_active_ue;
} fs6_dl_uespec_ulcch_t; } fs6_dl_uespec_ulcch_t;
typedef struct {
int ta;
} ul_propagation_t;
typedef struct { typedef struct {
enum pckType type:8; enum pckType type:8;
short UE_id; short UE_id;
...@@ -137,6 +174,9 @@ typedef struct { ...@@ -137,6 +174,9 @@ typedef struct {
uint8_t segment; uint8_t segment;
int segLen; int segLen;
int ulsch_power[2]; int ulsch_power[2];
int ta;
uint8_t o[MAX_CQI_BYTES];
uint8_t cqi_crc_status;
} fs6_ul_uespec_t; } fs6_ul_uespec_t;
typedef struct { typedef struct {
...@@ -144,6 +184,7 @@ typedef struct { ...@@ -144,6 +184,7 @@ typedef struct {
int UEid; int UEid;
int frame; int frame;
int subframe; int subframe;
LTE_eNB_UCI uci;
uint8_t harq_ack[4]; uint8_t harq_ack[4];
uint8_t tdd_mapping_mode; uint8_t tdd_mapping_mode;
uint16_t tdd_multiplexing_mask; uint16_t tdd_multiplexing_mask;
...@@ -185,7 +226,8 @@ static inline void *commonUDPdata(uint8_t *ptr) { ...@@ -185,7 +226,8 @@ static inline void *commonUDPdata(uint8_t *ptr) {
} }
void setAllfromTS(uint64_t TS); void setAllfromTS(uint64_t TS);
void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask, uint16_t rnti, int32_t stat); void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask,
uint16_t rnti, int32_t stat);
void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen); void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen);
void *cu_fs6(void *arg); void *cu_fs6(void *arg);
void *du_fs6(void *arg); void *du_fs6(void *arg);
......
...@@ -105,7 +105,7 @@ int lte_segmentation(unsigned char *input_buffer, ...@@ -105,7 +105,7 @@ int lte_segmentation(unsigned char *input_buffer,
#endif #endif
*Kminus = (*Kplus - 64); *Kminus = (*Kplus - 64);
} else { } else {
printf("lte_segmentation.c: Illegal codeword size !!!\n"); LOG_E(PHY,"lte_segmentation.c: Illegal codeword size !!!\n");
return(-1); return(-1);
} }
......
...@@ -593,7 +593,7 @@ void srs_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { ...@@ -593,7 +593,7 @@ void srs_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
void fill_sr_indication(int UEid, PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat) { void fill_sr_indication(int UEid, PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat) {
#ifdef FS6 #ifdef FS6
if ( getenv("fs6") != NULL && strncasecmp( getenv("fs6"), "du", 2) == 0 ) { if ( getenv("fs6") != NULL && strncasecmp( getenv("fs6"), "du", 2) == 0 ) {
sendFs6Ulharq(fs6ULindicationSr, UEid, eNB, frame, subframe, NULL,0,0, rnti, stat); sendFs6Ulharq(fs6ULindicationSr, UEid, eNB, NULL, frame, subframe, NULL,0,0, rnti, stat);
return; return;
} }
#endif #endif
...@@ -609,6 +609,7 @@ void fill_sr_indication(int UEid, PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int ...@@ -609,6 +609,7 @@ void fill_sr_indication(int UEid, PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG; pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = rnti; pdu->rx_ue_information.rnti = rnti;
int SNRtimes10 = dB_fixed_times10(stat) - 10 * eNB->measurements.n0_subband_power_dB[0][0]; int SNRtimes10 = dB_fixed_times10(stat) - 10 * eNB->measurements.n0_subband_power_dB[0][0];
LOG_D(PHY,"stat %d subbandpower %d, SNRtimes10 %d\n", stat, eNB->measurements.n0_subband_power_dB[0][0], SNRtimes10);
pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG; pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
if (SNRtimes10 < -640) pdu->ul_cqi_information.ul_cqi=0; if (SNRtimes10 < -640) pdu->ul_cqi_information.ul_cqi=0;
...@@ -1769,7 +1770,7 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har ...@@ -1769,7 +1770,7 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har
void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) { void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask) {
#ifdef FS6 #ifdef FS6
if ( getenv("fs6") != NULL && strncasecmp( getenv("fs6"), "du", 2) == 0 ) { if ( getenv("fs6") != NULL && strncasecmp( getenv("fs6"), "du", 2) == 0 ) {
sendFs6Ulharq(fs6ULindicationHarq, UEid, eNB, frame, subframe, harq_ack, tdd_mapping_mode, tdd_multiplexing_mask, 0, 0); sendFs6Ulharq(fs6ULindicationHarq, UEid, eNB, uci, frame, subframe, harq_ack, tdd_mapping_mode, tdd_multiplexing_mask, 0, 0);
return; return;
} }
#endif #endif
......
...@@ -1506,7 +1506,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -1506,7 +1506,7 @@ schedule_ue_spec(module_id_t module_idP,
tpc = 1; //0 tpc = 1; //0
} }
LOG_D(MAC, "[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, snr/target snr %d/%d\n", LOG_D(MAC, "[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, snr/target snr %d/%d (normal case)\n",
module_idP, module_idP,
frameP, frameP,
subframeP, subframeP,
......
...@@ -4990,7 +4990,12 @@ cqi_indication(module_id_t mod_idP, ...@@ -4990,7 +4990,12 @@ cqi_indication(module_id_t mod_idP,
UE_id, UE_id,
ul_cqi_information->channel, ul_cqi_information->channel,
ul_cqi_information->ul_cqi); ul_cqi_information->ul_cqi);
/*
int sum=0;
for (int i=0; i <rel9->length; i++)
sum+=pdu[i];
LOG_D(MAC, "pdu for channel: %d, checksum: %d\n", ul_cqi_information->channel, sum);
*/
if (ul_cqi_information->channel == 0) { // PUCCH if (ul_cqi_information->channel == 0) { // PUCCH
// extract pucch csi information before changing RI information // extract pucch csi information before changing RI information
extract_pucch_csi(mod_idP, extract_pucch_csi(mod_idP,
......
...@@ -127,14 +127,16 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) { ...@@ -127,14 +127,16 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
} else if (UE_NAS_USE_TUN) { } else if (UE_NAS_USE_TUN) {
ret = write(nas_sock_fd[ctxt_pP->module_id], &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite ); ret = write(nas_sock_fd[ctxt_pP->module_id], &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite );
} else if (ENB_NAS_USE_TUN) { } else if (ENB_NAS_USE_TUN) {
ret = write(nas_sock_fd[0], &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite ); if ((ret = write(nas_sock_fd[0], &(sdu_p->data[sizeof(pdcp_data_ind_header_t)]),sizeToWrite )) != sizeToWrite) {
printf("ret: %d\n",ret);
}
} else if (PDCP_USE_NETLINK) { } else if (PDCP_USE_NETLINK) {
memcpy(NLMSG_DATA(nas_nlh_tx), (uint8_t *) sdu_p->data, sizeToWrite); memcpy(NLMSG_DATA(nas_nlh_tx), (uint8_t *) sdu_p->data, sizeToWrite);
nas_nlh_tx->nlmsg_len = sizeToWrite; nas_nlh_tx->nlmsg_len = sizeToWrite;
ret = sendmsg(nas_sock_fd[0],&nas_msg_tx,0); ret = sendmsg(nas_sock_fd[0],&nas_msg_tx,0);
} // PDCP_USE_NETLINK } // PDCP_USE_NETLINK
AssertFatal(ret >= 0,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (errno: %d %s)\n", errno, strerror(errno)); if(ret < 0) LOG_E(PDCP,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (ret (instead of: %d) : %d, errno: %d %s)\n", ret, sizeToWrite, errno, strerror(errno));
list_remove_head (&pdcp_sdu_list); list_remove_head (&pdcp_sdu_list);
free_mem_block (sdu_p, __func__); free_mem_block (sdu_p, __func__);
pdcp_nb_sdu_sent ++; pdcp_nb_sdu_sent ++;
......
...@@ -7,6 +7,21 @@ ...@@ -7,6 +7,21 @@
volatile int oai_exit = 0; volatile int oai_exit = 0;
int fullread(int fd, void *_buf, int count)
{
char *buf = _buf;
int ret = 0;
int l;
while (count) {
l = read(fd, buf, count);
if (l <= 0) return -1;
count -= l;
buf += l;
ret += l;
}
return ret;
}
void fullwrite(int fd, void *_buf, int count) { void fullwrite(int fd, void *_buf, int count) {
char *buf = _buf; char *buf = _buf;
int l; int l;
...@@ -63,10 +78,10 @@ sin_addr: ...@@ -63,10 +78,10 @@ sin_addr:
bool connected=false; bool connected=false;
while(!connected) { while(!connected) {
LOG_I(HW,"rfsimulator: trying to connect to %s:%d\n", IP, port); //LOG_I(HW,"rfsimulator: trying to connect to %s:%d\n", IP, port);
if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) { if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) {
LOG_I(HW,"rfsimulator: connection established\n"); //LOG_I(HW,"rfsimulator: connection established\n");
connected=true; connected=true;
} }
...@@ -108,12 +123,13 @@ int main(int argc, char *argv[]) { ...@@ -108,12 +123,13 @@ int main(int argc, char *argv[]) {
if (strcmp(argv[2],"server")==0) { if (strcmp(argv[2],"server")==0) {
serviceSock=server_start(atoi(argv[3])); serviceSock=server_start(atoi(argv[3]));
} else { } else {
client_start(argv[2],atoi(argv[3])); serviceSock=client_start(argv[2],atoi(argv[3]));
} }
samplesBlockHeader_t header; samplesBlockHeader_t header;
int bufSize=100000; int bufSize=100000;
void *buff=malloc(bufSize); void *buff=malloc(bufSize);
uint64_t readTS=0;
while (1) { while (1) {
//Rewind the file to loop on the samples //Rewind the file to loop on the samples
...@@ -125,6 +141,7 @@ int main(int argc, char *argv[]) { ...@@ -125,6 +141,7 @@ int main(int argc, char *argv[]) {
AssertFatal(read(fd,&header,sizeof(header)), ""); AssertFatal(read(fd,&header,sizeof(header)), "");
fullwrite(serviceSock, &header, sizeof(header)); fullwrite(serviceSock, &header, sizeof(header));
int dataSize=sizeof(int32_t)*header.size*header.nbAnt; int dataSize=sizeof(int32_t)*header.size*header.nbAnt;
uint64_t wroteTS=header.timestamp;
if (dataSize>bufSize) { if (dataSize>bufSize) {
void * new_buff = realloc(buff, dataSize); void * new_buff = realloc(buff, dataSize);
...@@ -139,9 +156,16 @@ int main(int argc, char *argv[]) { ...@@ -139,9 +156,16 @@ int main(int argc, char *argv[]) {
AssertFatal(read(fd,buff,dataSize) == dataSize, ""); AssertFatal(read(fd,buff,dataSize) == dataSize, "");
fullwrite(serviceSock, buff, dataSize); fullwrite(serviceSock, buff, dataSize);
// Purge incoming samples // Purge incoming samples
setblocking(serviceSock, notBlocking); setblocking(serviceSock, blocking);
while(readTS < wroteTS) {
while(recv(serviceSock,buff, bufSize, MSG_DONTWAIT) > 0) { if ( fullread(serviceSock, &header,sizeof(header)) != sizeof(header) ||
fullread(serviceSock, buff, sizeof(int32_t)*header.size*header.nbAnt) !=
sizeof(int32_t)*header.size*header.nbAnt
) {
printf("error: %s\n", strerror(errno));
exit(1);
}
readTS=header.timestamp;
} }
} }
......
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