Commit 446e0c75 authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'hotfix-106-usrp_rt_dc_offset' into bugfix-48-L1L2signaling

parents 20e24609 6e5d7cdd
...@@ -3302,6 +3302,11 @@ int main( int argc, char **argv ) ...@@ -3302,6 +3302,11 @@ int main( int argc, char **argv )
} }
#ifndef LOWLATENCY #ifndef LOWLATENCY
/* Currently we set affinity for UHD to CPU 0 for eNB only and only if number of CPUS >2 */
/* ToDo: Set CPU affinity for UE */
if (UE_flag == 0 && get_nprocs() > 2)
{
cpu_set_t cpuset; cpu_set_t cpuset;
int s; int s;
char cpu_affinity[1024]; char cpu_affinity[1024];
...@@ -3317,8 +3322,8 @@ int main( int argc, char **argv ) ...@@ -3317,8 +3322,8 @@ int main( int argc, char **argv )
perror( "pthread_setaffinity_np"); perror( "pthread_setaffinity_np");
exit_fun("Error setting processor affinity"); exit_fun("Error setting processor affinity");
} }
/* Check the actual affinity mask assigned to the thread */
/* Check the actual affinity mask assigned to the thread */
s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
if (s != 0) if (s != 0)
{ {
...@@ -3327,14 +3332,16 @@ int main( int argc, char **argv ) ...@@ -3327,14 +3332,16 @@ int main( int argc, char **argv )
} }
memset(cpu_affinity, 0 , sizeof(cpu_affinity)); memset(cpu_affinity, 0 , sizeof(cpu_affinity));
for (int j = 0; j < CPU_SETSIZE; j++) for (int j = 0; j < CPU_SETSIZE; j++)
{
if (CPU_ISSET(j, &cpuset)) if (CPU_ISSET(j, &cpuset))
{ {
char temp[1024]; char temp[1024];
sprintf(temp, " CPU_%d ", j); sprintf(temp, " CPU_%d ", j);
strcat(cpu_affinity, temp); strcat(cpu_affinity, temp);
} }
}
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity); LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
}
#endif #endif
/* device host type is set*/ /* device host type is set*/
......
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