Commit 7b2a1a3c authored by Lionel Gauthier's avatar Lionel Gauthier

no netlink thread in eNB if link PDCP with GTP-U, if there is no UE running in same process

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5458 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent a94c742c
......@@ -107,14 +107,13 @@ int pdcp_netlink_init(void) {
nb_inst_ue = 1;
#endif
#if defined(LINK_PDCP_TO_GTPV1U)
nb_inst_enb = 0;
LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n");
#else
pdcp_netlink_queue_enb = calloc(nb_inst_enb, sizeof(struct lfds611_queue_state*));
pdcp_netlink_nb_element_enb = malloc(nb_inst_enb * sizeof(uint32_t));
pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state*));
pdcp_netlink_nb_element_ue = malloc(nb_inst_ue * sizeof(uint32_t));
LOG_I(PDCP, "[NETLINK] Creating %d queues for eNB Netlink -> PDCP communication\n", nb_inst_enb);
LOG_I(PDCP, "[NETLINK] Creating %d queues for UE Netlink -> PDCP communication\n", nb_inst_ue);
for (i = 0; i < nb_inst_enb; i++) {
pdcp_netlink_nb_element_enb[i] = 0;
......@@ -123,6 +122,14 @@ int pdcp_netlink_init(void) {
exit(EXIT_FAILURE);
}
}
#endif
if (nb_inst_ue > 0) {
pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state*));
pdcp_netlink_nb_element_ue = malloc(nb_inst_ue * sizeof(uint32_t));
LOG_I(PDCP, "[NETLINK] Creating %d queues for UE Netlink -> PDCP communication\n", nb_inst_ue);
for (i = 0; i < nb_inst_ue; i++) {
pdcp_netlink_nb_element_ue[i] = 0;
if (lfds611_queue_new(&pdcp_netlink_queue_ue[i], PDCP_QUEUE_NB_ELEMENTS) < 0) {
......@@ -130,7 +137,9 @@ int pdcp_netlink_init(void) {
exit(EXIT_FAILURE);
}
}
}
if ((nb_inst_ue + nb_inst_enb) > 0) {
if (pthread_attr_init(&attr) != 0) {
LOG_E(PDCP, "[NETLINK]Failed to initialize pthread attribute for Netlink -> PDCP communication (%d:%s)\n",
errno, strerror(errno));
......@@ -151,7 +160,7 @@ int pdcp_netlink_init(void) {
errno, strerror(errno));
exit(EXIT_FAILURE);
}
}
return 0;
}
......
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