Commit 317cbfd6 authored by Raymond Knopp's avatar Raymond Knopp

minor changes to thread synchronization after testing with N310 @ 122.88 Ms/s

parent 4c3c8f2c
...@@ -382,12 +382,14 @@ typedef struct { ...@@ -382,12 +382,14 @@ typedef struct {
/// scheduling parameters for RXn-TXnp4 thread /// scheduling parameters for RXn-TXnp4 thread
struct sched_param sched_param_rxtx; struct sched_param sched_param_rxtx;
/// \internal This variable is protected by \ref mutex_RUs. /// \internal This variable is protected by \ref mutex_RUs_tx.
int instance_cnt_RUs; int instance_cnt_RUs;
/// condition variable for tx processing thread /// condition variable for tx processing thread
pthread_cond_t cond_RUs; pthread_cond_t cond_RUs;
/// mutex for RXn-TXnp4 processing thread /// mutex for L1 RXTX processing thread
pthread_mutex_t mutex_RUs; pthread_mutex_t mutex_RUs;
/// mutex for L1 TX FH synchronization
pthread_mutex_t mutex_RUs_tx;
} gNB_L1_rxtx_proc_t; } gNB_L1_rxtx_proc_t;
......
...@@ -130,11 +130,9 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) { ...@@ -130,11 +130,9 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
} }
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
gNB_L1_rxtx_proc_t *proc, int frame,int slot,
int do_meas) { int do_meas) {
int aa; int aa;
int frame=proc->frame_tx;
int slot=proc->slot_tx;
uint8_t num_dci=0,num_pdsch_rnti; uint8_t num_dci=0,num_pdsch_rnti;
NR_DL_FRAME_PARMS *fp=&gNB->frame_parms; NR_DL_FRAME_PARMS *fp=&gNB->frame_parms;
nfapi_nr_config_request_t *cfg = &gNB->gNB_config; nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
nr_slot_t nr_slot_select (nfapi_nr_config_request_t *cfg, unsigned char slot); nr_slot_t nr_slot_select (nfapi_nr_config_request_t *cfg, unsigned char slot);
void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp); void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp);
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc, int do_meas); void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, int frame_tx,int slot_tx, int do_meas);
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot); void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot);
void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx); void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx);
void nr_feptx_ofdm(RU_t *ru); void nr_feptx_ofdm(RU_t *ru);
......
...@@ -434,6 +434,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -434,6 +434,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
if (u_sf_mode != 2) { // not replay mode if (u_sf_mode != 2) { // not replay mode
#endif #endif
usrp_state_t *s = (usrp_state_t *)device->priv; usrp_state_t *s = (usrp_state_t *)device->priv;
int nsamps2; // aligned to upper 32 or 16 byte boundary int nsamps2; // aligned to upper 32 or 16 byte boundary
#if defined(__x86_64) || defined(__i386__) #if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
...@@ -497,9 +498,9 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -497,9 +498,9 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
for (int i=0; i<cc; i++) for (int i=0; i<cc; i++)
buff_ptrs.push_back(buff_tx[i]); buff_ptrs.push_back(buff_tx[i]);
ret = (int)s->tx_stream->send(buff_ptrs, nsamps, s->tx_md,1e-3); ret = (int)s->tx_stream->send(buff_ptrs, nsamps, s->tx_md,250e-6);
} else } else
ret = (int)s->tx_stream->send(buff_tx[0], nsamps, s->tx_md,1e-3); ret = (int)s->tx_stream->send(buff_tx[0], nsamps, s->tx_md,250e-6);
if (ret != nsamps) if (ret != nsamps)
LOG_E(PHY,"[xmit] tx samples %d != %d\n",ret,nsamps); LOG_E(PHY,"[xmit] tx samples %d != %d\n",ret,nsamps);
......
This diff is collapsed.
...@@ -1368,14 +1368,14 @@ static void* ru_thread_tx( void* param ) { ...@@ -1368,14 +1368,14 @@ static void* ru_thread_tx( void* param ) {
gNB_proc->RU_mask_tx = 0; gNB_proc->RU_mask_tx = 0;
pthread_mutex_unlock(&gNB_proc->mutex_RU_tx); pthread_mutex_unlock(&gNB_proc->mutex_RU_tx);
pthread_mutex_lock( &L1_proc->mutex_RUs); pthread_mutex_lock(&L1_proc->mutex_RUs_tx);
L1_proc->instance_cnt_RUs = 0; L1_proc->instance_cnt_RUs = 0;
// the thread can now be woken up // the thread can now be woken up
if (pthread_cond_signal(&L1_proc->cond_RUs) != 0) { if (pthread_cond_signal(&L1_proc->cond_RUs) != 0) {
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n"); LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB L1 TX thread\n");
exit_fun( "ERROR pthread_cond_signal" ); exit_fun( "ERROR pthread_cond_signal" );
} }
pthread_mutex_unlock( &L1_proc->mutex_RUs ); pthread_mutex_unlock( &L1_proc->mutex_RUs_tx );
} }
} }
} }
......
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