Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cellframe/cellframe-sdk
  • MIKA83/cellframe-sdk
2 results
Show changes
Commits on Source (2)
......@@ -2,7 +2,7 @@ project(cellframe-sdk C)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_C_STANDARD 11)
set(CELLFRAME_SDK_NATIVE_VERSION "2.5-25")
set(CELLFRAME_SDK_NATIVE_VERSION "2.5-26")
add_definitions ("-DCELLFRAME_SDK_VERSION=\"${CELLFRAME_SDK_NATIVE_VERSION}\"")
set(DAPSDK_MODULES "")
......
......@@ -30,11 +30,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;
......@@ -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);
......
......@@ -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);
......
......@@ -30,6 +30,8 @@
#include "dap_common.h"
#define DAP_EVENTS_SOCKET_MAX 8194
// Caps for different platforms
#if defined(DAP_OS_LINUX)
#define DAP_EVENTS_CAPS_EPOLL
......