update nettle to new interface, update deadline scheduler option (doesnt compile without this), update build/install script to use regular nettle and gnutls in ubuntu 16.04 (should also be fine with 14.04 up-to-date), update init_exmimo2 for ubuntu 16.04)

This commit is contained in:
Laurent THOMAS
2016-08-05 15:26:36 +02:00
parent 8014a94020
commit 6da3f494f4
6 changed files with 21 additions and 22 deletions
+8 -3
View File
@@ -386,9 +386,14 @@ check_install_oai_software() {
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
# First we remove gnutls/nettle installation and then install from sources
$SUDO apt-get remove -y libgnutls-dev nettle-dev nettle-bin
install_nettle_from_source
install_gnutls_from_source
v=$(lsb_release -ris | tr -d '\n')
if [ "$v" == Ubuntu16.04 ] ; then
$SUDO apt-get install libgnutls-dev nettle-dev nettle-bin
else
$SUDO apt-get remove -y libgnutls-dev nettle-dev nettle-bin
install_nettle_from_source
install_gnutls_from_source
fi
install_asn1c_from_source
}
-8
View File
@@ -71,15 +71,7 @@ if [ ! -e /dev/openair0 ]; then
sudo chmod a+rw /dev/openair0
fi
DEVICE=`echo $PCI | awk -F\" '{print $(NF-1)}' | awk '{print $2}'`
DEVICE_SWID=${DEVICE:2:2}
if [ $DEVICE_SWID == '0a' ]; then
echo "Using firware version 10"
$OPENAIR_DIR/targets/bin/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v10
else
echo 'No corresponding firmware found'
return
fi
}
main "$@"
+1 -1
View File
@@ -199,7 +199,7 @@ int stream_encrypt_eea2(stream_cipher_t *stream_cipher, uint8_t **out)
}
#endif
nettle_aes128.set_encrypt_key(ctx, stream_cipher->key_length,
nettle_aes128.set_encrypt_key(ctx,
stream_cipher->key);
nettle_ctr_crypt(ctx, nettle_aes128.encrypt,
+1 -1
View File
@@ -85,7 +85,7 @@ int nas_stream_encrypt_eea2(nas_stream_cipher_t *stream_cipher, uint8_t *out)
}
#endif
nettle_aes128.set_encrypt_key(ctx, stream_cipher->key_length,
nettle_aes128.set_encrypt_key(ctx,
stream_cipher->key);
nettle_ctr_crypt(ctx, nettle_aes128.encrypt,
+1 -1
View File
@@ -48,7 +48,7 @@ void test_uncipher_ctr(const struct nettle_cipher *cipher, const uint8_t *key,
uint8_t *data = malloc(length);
uint8_t *ctr = malloc(cipher->block_size);
cipher->set_encrypt_key(ctx, key_length, key);
cipher->set_encrypt_key(ctx, key);
memcpy(ctr, ictr, cipher->block_size);
ctr_crypt(ctx, cipher->encrypt,
+10 -8
View File
@@ -157,6 +157,8 @@ static struct {
volatile uint8_t phy_proc_CC_id;
} sync_phy_proc;
extern double cpuf;
void exit_fun(const char* s);
void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst,eth_params_t *);
@@ -432,6 +434,10 @@ static void* eNB_thread_rxtx( void* param ) {
MSC_START_USE();
struct timespec wait;
wait.tv_sec=0;
wait.tv_nsec=5000000L;
#ifdef DEADLINE_SCHEDULER
struct sched_attr attr;
@@ -462,10 +468,6 @@ static void* eNB_thread_rxtx( void* param ) {
struct sched_param sparam;
char cpu_affinity[1024];
cpu_set_t cpuset;
struct timespec wait;
wait.tv_sec=0;
wait.tv_nsec=5000000L;
/* Set affinity mask to include CPUs 1 to MAX_CPUS */
/* CPU 0 is reserved for UHD threads */
@@ -819,7 +821,7 @@ static void* eNB_thread_asynch_rxtx( void* param ) {
if (sched_setattr(0, &attr, flags) < 0 ) {
perror("[SCHED] eNB FH sched_setattr failed\n");
return &eNB_thread_FH_status;
return &eNB_thread_asynch_rxtx_status;
}
LOG_I( HW, "[SCHED] eNB asynch RX deadline thread (TID %ld) started on CPU %d\n", gettid(), sched_getcpu() );
@@ -1403,7 +1405,7 @@ static void* eNB_thread_FH( void* param ) {
#ifdef DEADLINE_SCHEDULER
if (opp_enabled){
if(softmodem_stats_rxtx_sf.diff_now/(cpuf) > attr.sched_runtime) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RXTX_ENB, (softmodem_stats_rxtx_sf.diff_now/cpuf - attr.sched_runtime)/1000000.0);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, (softmodem_stats_rxtx_sf.diff_now/cpuf - attr.sched_runtime)/1000000.0);
}
}
#endif // DEADLINE_SCHEDULER
@@ -1664,8 +1666,8 @@ void init_eNB_proc(int inst) {
(eNB->node_function == NGFI_RRU_IF4p5))
pthread_create( &proc->pthread_asynch_rxtx, &proc->attr_asynch_rxtx, eNB_thread_asynch_rxtx, &eNB->proc );
#else
pthread_create( &proc_rxtx[0].pthread_rxtx, NULL, eNB_thread_rxtx, &eNB->proc_rxtx[0] );
pthread_create( &proc_rxtx[1].pthread_rxtx, NULL, eNB_thread_rxtx, &eNB->proc_rxtx[1] );
pthread_create( &proc_rxtx[0].pthread_rxtx, NULL, eNB_thread_rxtx, &proc_rxtx[0] );
pthread_create( &proc_rxtx[1].pthread_rxtx, NULL, eNB_thread_rxtx, &proc_rxtx[1] );
pthread_create( &proc->pthread_FH, NULL, eNB_thread_FH, &eNB->proc );
pthread_create( &proc->pthread_prach, NULL, eNB_thread_prach, &eNB->proc );
if (eNB->node_timing == synch_to_other)