diff --git a/dap-sdk/core/include/dap_math_ops.h b/dap-sdk/core/include/dap_math_ops.h index d67bad88e18d48a11ebf3fb6d4abde20f41aa39d..0d398559b478af6193478b1ba15123bff8a66458 100755 --- a/dap-sdk/core/include/dap_math_ops.h +++ b/dap-sdk/core/include/dap_math_ops.h @@ -29,12 +29,3 @@ typedef union int128{int64_t i64[2];} int128_t; #endif - -typedef union dap_uint128{ - uint8_t data_raw[16]; -#if defined(DAP_GLOBAL_IS_INT128) - _dap_int128_t data_int128; -#endif -} dap_uint128_t; - - diff --git a/dap-sdk/net/core/dap_proc_thread.c b/dap-sdk/net/core/dap_proc_thread.c index 203875d1d11ddebf223f8e4c0dcc1d215b031404..93c4ab15cc40cbb38c86a16ee2ba1d4adeb68d5c 100644 --- a/dap-sdk/net/core/dap_proc_thread.c +++ b/dap-sdk/net/core/dap_proc_thread.c @@ -161,11 +161,11 @@ static void * s_proc_thread_function(void * a_arg) l_thread->proc_event->_inheritor = l_thread; // we pass thread through it #ifdef DAP_EVENTS_CAPS_EPOLL - struct epoll_event l_epoll_events[DAP_MAX_EPOLL_EVENTS], l_ev; + struct epoll_event l_epoll_events[DAP_EVENTS_SOCKET_MAX], l_ev; memset(l_epoll_events, 0,sizeof (l_epoll_events)); // Create epoll ctl - l_thread->epoll_ctl = epoll_create( DAP_MAX_EPOLL_EVENTS ); + l_thread->epoll_ctl = epoll_create( DAP_EVENTS_SOCKET_MAX ); // add proc queue l_ev.events = l_thread->proc_queue->esocket->ev_base_flags; @@ -183,7 +183,7 @@ static void * s_proc_thread_function(void * a_arg) return NULL; } #elif defined(DAP_EVENTS_CAPS_POLL) - size_t l_poll_count_max = DAP_MAX_EVENTS_COUNT; + size_t l_poll_count_max = DAP_EVENTS_SOCKET_MAX; size_t l_poll_count = 0; bool l_poll_compress = false; struct pollfd * l_poll = DAP_NEW_Z_SIZE(struct pollfd,l_poll_count_max *sizeof (*l_poll)); @@ -214,7 +214,7 @@ static void * s_proc_thread_function(void * a_arg) #ifdef DAP_EVENTS_CAPS_EPOLL //log_it(L_DEBUG, "Epoll_wait call"); - int l_selected_sockets = epoll_wait(l_thread->epoll_ctl, l_epoll_events, DAP_MAX_EPOLL_EVENTS, -1); + int l_selected_sockets = epoll_wait(l_thread->epoll_ctl, l_epoll_events, DAP_EVENTS_SOCKET_MAX, -1); size_t l_sockets_max = l_selected_sockets; #elif defined (DAP_EVENTS_CAPS_POLL) int l_selected_sockets = poll(l_poll,l_poll_count,-1); diff --git a/dap-sdk/net/core/dap_worker.c b/dap-sdk/net/core/dap_worker.c index d740dcd794957fe723da0ec57ac3b941019f0574..e08e31b2b149df55e348049a7847492b82f14579 100644 --- a/dap-sdk/net/core/dap_worker.c +++ b/dap-sdk/net/core/dap_worker.c @@ -85,10 +85,10 @@ void *dap_worker_thread(void *arg) pthread_setschedparam(pthread_self(),SCHED_FIFO ,&l_shed_params); #ifdef DAP_EVENTS_CAPS_EPOLL - struct epoll_event l_epoll_events[ DAP_MAX_EPOLL_EVENTS]= {{0}}; + struct epoll_event l_epoll_events[ DAP_EVENTS_SOCKET_MAX]= {{0}}; log_it(L_INFO, "Worker #%d started with epoll fd %d and assigned to dedicated CPU unit", l_worker->id, l_worker->epoll_fd); #elif defined(DAP_EVENTS_CAPS_POLL) - l_worker->poll_count_max = _SC_PAGE_SIZE; + l_worker->poll_count_max = DAP_EVENTS_SOCKET_MAX; l_worker->poll = DAP_NEW_Z_SIZE(struct pollfd,l_worker->poll_count_max*sizeof (struct pollfd)); l_worker->poll_esocket = DAP_NEW_Z_SIZE(dap_events_socket_t*,l_worker->poll_count_max*sizeof (dap_events_socket_t*)); #else @@ -109,7 +109,7 @@ void *dap_worker_thread(void *arg) bool s_loop_is_active = true; while(s_loop_is_active) { #ifdef DAP_EVENTS_CAPS_EPOLL - int l_selected_sockets = epoll_wait(l_worker->epoll_fd, l_epoll_events, DAP_MAX_EPOLL_EVENTS, -1); + int l_selected_sockets = epoll_wait(l_worker->epoll_fd, l_epoll_events, DAP_EVENTS_SOCKET_MAX, -1); size_t l_sockets_max = l_selected_sockets; #elif defined(DAP_EVENTS_CAPS_POLL) int l_selected_sockets = poll(l_worker->poll, l_worker->poll_count, -1); @@ -650,8 +650,8 @@ int dap_worker_add_events_socket_unsafe( dap_events_socket_t * a_esocket, dap_wo return epoll_ctl(a_worker->epoll_fd, EPOLL_CTL_ADD, a_esocket->socket, &a_esocket->ev); #elif defined (DAP_EVENTS_CAPS_POLL) if ( a_worker->poll_count == a_worker->poll_count_max ){ // realloc - log_it(L_WARNING, "Too many descriptors, resizing array twice"); a_worker->poll_count_max *= 2; + log_it(L_WARNING, "Too many descriptors (%u), resizing array twice to %u", a_worker->poll_count, a_worker->poll_count_max); a_worker->poll =DAP_REALLOC(a_worker->poll, a_worker->poll_count_max * sizeof(*a_worker->poll)); a_worker->poll_esocket =DAP_REALLOC(a_worker->poll_esocket, a_worker->poll_count_max * sizeof(*a_worker->poll_esocket)); } diff --git a/dap-sdk/net/core/include/dap_events_socket.h b/dap-sdk/net/core/include/dap_events_socket.h index 84df687ffa4f0c18b64ed450e0b2b7a0bf9ef590..a93a0ad3b6fdb73ff53a83d9b7fedcc0637b6c5d 100644 --- a/dap-sdk/net/core/include/dap_events_socket.h +++ b/dap-sdk/net/core/include/dap_events_socket.h @@ -30,6 +30,7 @@ #include "dap_common.h" +#define DAP_EVENTS_SOCKET_MAX 8194 // Caps for different platforms #if defined(DAP_OS_LINUX) // #define DAP_EVENTS_CAPS_EPOLL