diff --git a/server/src/gtfpga.c b/server/src/gtfpga.c index c763dd68d..72daded3a 100644 --- a/server/src/gtfpga.c +++ b/server/src/gtfpga.c @@ -31,6 +31,9 @@ static void gtfpga_debug(char *msg, ...) { int gtfpga_init(int argc, char * argv[], struct settings *set) { + if (check_root()) + error("The gtfpga node-type requires superuser privileges!"); + pacc = pci_alloc(); /* Get the pci_access structure */ if (!pacc) error("Failed to allocate PCI access structure"); diff --git a/server/src/if.c b/server/src/if.c index 03687a793..18e839d92 100644 --- a/server/src/if.c +++ b/server/src/if.c @@ -34,7 +34,11 @@ struct interface * if_create(struct rtnl_link *link) debug(3, "Created interface '%s'", rtnl_link_get_name(i->nl_link)); - if_get_irqs(i); + int n = if_get_irqs(i); + if (n > 0) + debug(6, "Found %u IRQs for interface '%s'", n, rtnl_link_get_name(i->nl_link)); + else + warn("Did not found any interrupts for interface '%s'", rtnl_link_get_name(i->nl_link)); list_init(&i->sockets, NULL); list_push(&interfaces, i); @@ -177,8 +181,6 @@ int if_get_irqs(struct interface *i) closedir(dir); } - - debug(6, "Found %u IRQs for interface '%s'", n, rtnl_link_get_name(i->nl_link)); return 0; } diff --git a/server/src/server.c b/server/src/server.c index 589a8582f..5c5f29e7f 100644 --- a/server/src/server.c +++ b/server/src/server.c @@ -60,6 +60,11 @@ static void quit() static void realtime_init() { INDENT + if (check_kernel_cmdline()) + warn("You should reserve some cores for the server (see 'isolcpus')"); + if (check_kernel_rtpreempt()) + warn("We recommend to use an RT_PREEMPT patched kernel!"); + /* Use FIFO scheduler with real time priority */ if (settings.priority) { struct sched_param param = { @@ -68,18 +73,20 @@ static void realtime_init() if (sched_setscheduler(0, SCHED_FIFO, ¶m)) serror("Failed to set real time priority"); - else - debug(3, "Set task priority to %u", settings.priority); + + debug(3, "Set task priority to %u", settings.priority); } + warn("Use setting 'priority' to enable real-time scheduling!"); /* Pin threads to CPUs by setting the affinity */ if (settings.affinity) { cpu_set_t cset = to_cpu_set(settings.affinity); if (sched_setaffinity(0, sizeof(cset), &cset)) serror("Failed to set CPU affinity to '%#x'", settings.affinity); - else - debug(3, "Set affinity to %#x", settings.affinity); + + debug(3, "Set affinity to %#x", settings.affinity); } + warn("Use setting 'affinity' to pin process to isolated CPU cores!"); } /* Setup exit handler */ @@ -149,8 +156,6 @@ int main(int argc, char *argv[]) BLD(MAG(__DATE__)), BLD(MAG(__TIME__))); /* Checks system requirements*/ - if (check_root()) - error("The server requires superuser privileges!"); #ifdef LICENSE if (check_license_trace()) error("This software should not be traced!"); @@ -161,10 +166,6 @@ int main(int argc, char *argv[]) #endif if (check_kernel_version()) error("Your kernel version is to old: required >= %u.%u", KERNEL_VERSION_MAJ, KERNEL_VERSION_MIN); - if (check_kernel_cmdline()) - warn("You should reserve some cores for the server (see 'isolcpus')"); - if (check_kernel_rtpreempt()) - warn("We recommend to use an RT_PREEMPT patched kernel!"); /* Initialize lists */ list_init(&nodes, (dtor_cb_t) node_destroy); diff --git a/server/src/socket.c b/server/src/socket.c index 5e1a5946b..8d6e1a0ed 100644 --- a/server/src/socket.c +++ b/server/src/socket.c @@ -30,6 +30,7 @@ #include "config.h" #include "utils.h" #include "socket.h" +#include "checks.h" /** Linked list of interfaces */ extern struct list interfaces; @@ -39,6 +40,9 @@ static struct list sockets; int socket_init(int argc, char * argv[], struct settings *set) { INDENT + if (check_root()) + error("The socket node-type requires superuser privileges!"); + nl_init(); /* Fill link cache */ list_init(&interfaces, (dtor_cb_t) if_destroy);