TAS
TCP Acceleration as an OS Service
|
Application-Kernel interface. More...
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/un.h>
#include <sys/socket.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <tas.h>
#include "internal.h"
#include "appif.h"
#include <kernel_appif.h>
#include <utils_nbqueue.h>
#include <tas_memif.h>
#include <fastpath.h>
Go to the source code of this file.
Macros | |
#define | EP_LISTEN (NULL) |
#define | EP_NOTIFY ((void *) (-1)) |
Functions | |
static int | uxsocket_init (void) |
static void * | uxsocket_thread (void *arg) |
static void | uxsocket_accept (void) |
static void | uxsocket_notify (void) |
static void | uxsocket_error (struct application *app) |
static void | uxsocket_receive (struct application *app) |
static void | uxsocket_notify_app (struct application *app) |
int | appif_init (void) |
unsigned | appif_poll (void) |
Variables | |
static int | uxfd = -1 |
static int | epfd = -1 |
static int | notifyfd = -1 |
static struct nbqueue | poll_to_ux |
static struct nbqueue | ux_to_poll |
static pthread_t | pt_ux |
static struct app_doorbell * | free_doorbells = NULL |
static uint16_t | app_id_next = 0 |
static struct application * | applications = NULL |
Application-Kernel interface.
The application-kernel interface consists of two parts: per-application unix socket for setup, and per-core application context queues for normal operation. The message format for both those is defined in kernel_appif.h.
During application initialization the application opens a Unix stream socket to the kernel. This stream socket is then used to negotiate creation of one or more application context queues in the shared packet memory region.
Communication on the application context queues is handled in appif_ctx.c.
The unix socket is handled on a separate thread so a blocking epoll can be used. To avoid synchronization in other kernel parts the ux socket thread just communicates on the sockets and uses two queues ux_to_poll and poll_to_ux to communicate with the main thread. The main thread then calls into other modules to register the context with flexnic etc.
Definition in file appif.c.
#define EP_NOTIFY ((void *) (-1)) |
epoll data for notifyfd associated with poll_to_ux queue
|
static |
|
static |
Linked list of all application structs
Definition at line 97 of file appif.c.
Referenced by appif_poll().
|
static |
|
static |
|
static |
|
static |
Queue to pass structs for new applications from UX to poll thread
Definition at line 86 of file appif.c.
Referenced by appif_poll().