mtcp_setconf

NAME

mtcp_setconf − Update mOS-related configuration for mOS app initialization

SYNOPSIS

#include <mtcp_api.h>

int mtcp_setconf(const struct mtcp_conf *conf);

DESCRIPTION

mtcp_setconf() call is used to update the configuration of the mOS core. The conf argument is a pointer to a user-defined struct mtcp_conf that contains a number of fields including:

num_cores

An integer that shows the total number of cores the mOS core is using.

max_concurrency

An integer that holds how many ongoing flows each core thread manages concurrently. Default value is 100000.

max_num_buffers

An integer that holds the maximum number of socket buffers each core thread can hold. Default value is 100000.

rcvbuf_size

An integer that holds the size of the TCP receive buffer. Default value is 8KB.

tcp_timeout

An integer that holds the idle flow expiry timeout of the monitoring flow. Default value is 30 secs.

RETURN VALUE

Returns 0 on success; -1 on failure and errno is set appropriately.

ERRORS

EINVAL

The conf argument is NULL.

NOTES

This function is useful when the user wants to override the mOS configuration. For example, the user can first call mtcp_getconf() function, and change the parameters of struct mtcp_conf and then call this function to override the configuration.

Please note that this function should be called before you call mtcp_create_context() which creates mOS context and launches the mOS threads.

See http://mos.kaist.edu/guide/walkthrough/05_configuration.html to view example startup mOS configuration file.

AUTHORS

mOS development team <mtcp-user@list.ndsl.kaist.edu>

EXAMPLES

http://mos.kaist.edu/guide/programmer/05_api_example.html#global-initialization-routine

SEE ALSO

mtcp_setconf()

COLOPHON

This page is part of mOS release 0.3 docs section. A description of the project, and information about reporting bugs, can be found at http://mos.kaist.edu/.