1<!-- Creator     : groff version 1.22.3 -->
2<!-- CreationDate: Sat Aug 26 17:18:05 2017 -->
3<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
4"http://www.w3.org/TR/html4/loose.dtd">
5<html>
6<head>
7<meta name="generator" content="groff -Thtml, see www.gnu.org">
8<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
9<meta name="Content-Style" content="text/css">
10<style type="text/css">
11       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
12       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
13       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
14       h1      { text-align: center }
15</style>
16<title>mtcp_setconf</title>
17<link rel="stylesheet" href="./common.css">
18</head>
19<body>
20<div class="main">
21<h1 align="center">mtcp_setconf</h1>
22<!--
23<a href="#NAME">NAME</a><br>
24<a href="#SYNOPSIS">SYNOPSIS</a><br>
25<a href="#DESCRIPTION">DESCRIPTION</a><br>
26<a href="#RETURN VALUE">RETURN VALUE</a><br>
27<a href="#ERRORS">ERRORS</a><br>
28<a href="#NOTES">NOTES</a><br>
29<a href="#AUTHORS">AUTHORS</a><br>
30<a href="#SEE ALSO">SEE ALSO</a><br>
31<a href="#COLOPHON">COLOPHON</a><br>
32
33<hr>
34-->
35
36<h2>NAME
37<a name="NAME"></a>
38</h2>
39
40
41<p style="margin-left:11%; margin-top: 1em">mtcp_setconf
42&minus; Update mOS-related configuration for mOS app
43initialization</p>
44
45<h2>SYNOPSIS
46<a name="SYNOPSIS"></a>
47</h2>
48
49
50<p style="margin-left:11%; margin-top: 1em"><b>#include
51&lt;mtcp_api.h&gt;</b></p>
52
53<p style="margin-left:11%; margin-top: 1em"><b>int
54mtcp_setconf(const struct mtcp_conf
55*</b><i>conf</i><b>);</b></p>
56
57<h2>DESCRIPTION
58<a name="DESCRIPTION"></a>
59</h2>
60
61
62
63<p style="margin-left:11%; margin-top: 1em"><b>mtcp_setconf</b>()
64call is used to update the configuration of the mOS core.
65The <i>conf</i> argument is a pointer to a user-defined
66<i>struct mtcp_conf</i> that contains a number of fields
67including:</p>
68
69<table width="100%" border="0" rules="none" frame="void"
70       cellspacing="0" cellpadding="0">
71<tr valign="top" align="left">
72<td width="11%"></td>
73<td width="23%">
74
75
76<p><i>num_cores</i></p></td>
77<td width="8%"></td>
78<td width="58%">
79
80
81<p>An integer that shows the total number of cores the mOS
82core is using.</p></td></tr>
83<tr valign="top" align="left">
84<td width="11%"></td>
85<td width="23%">
86
87
88<p><i>max_concurrency</i></p></td>
89<td width="8%"></td>
90<td width="58%">
91
92
93<p>An integer that holds how many ongoing flows each core
94thread manages concurrently. Default value is 100000.</p></td></tr>
95<tr valign="top" align="left">
96<td width="11%"></td>
97<td width="23%">
98
99
100<p><i>max_num_buffers</i></p></td>
101<td width="8%"></td>
102<td width="58%">
103
104
105<p>An integer that holds the maximum number of socket
106buffers each core thread can hold. Default value is
107100000.</p> </td></tr>
108<tr valign="top" align="left">
109<td width="11%"></td>
110<td width="23%">
111
112
113<p><i>rcvbuf_size</i></p></td>
114<td width="8%"></td>
115<td width="58%">
116
117
118<p>An integer that holds the size of the TCP receive
119buffer. Default value is 8KB.</p></td></tr>
120<tr valign="top" align="left">
121<td width="11%"></td>
122<td width="23%">
123
124
125<p><i>tcp_timeout</i></p></td>
126<td width="8%"></td>
127<td width="58%">
128
129
130<p>An integer that holds the idle flow expiry timeout of
131the monitoring flow. Default value is 30 secs.</p></td></tr>
132</table>
133
134<h2>RETURN VALUE
135<a name="RETURN VALUE"></a>
136</h2>
137
138
139<p style="margin-left:11%; margin-top: 1em">Returns 0 on
140success; -1 on failure and <i>errno</i> is set
141appropriately.</p>
142
143<h2>ERRORS
144<a name="ERRORS"></a>
145</h2>
146
147
148<table width="100%" border="0" rules="none" frame="void"
149       cellspacing="0" cellpadding="0">
150<tr valign="top" align="left">
151<td width="11%"></td>
152<td width="9%">
153
154
155<p style="margin-top: 1em"><b>EINVAL</b></p></td>
156<td width="6%"></td>
157<td width="40%">
158
159
160<p style="margin-top: 1em">The <i>conf</i> argument is
161NULL.</p> </td>
162<td width="34%">
163</td></tr>
164</table>
165
166<h2>NOTES
167<a name="NOTES"></a>
168</h2>
169
170
171<p style="margin-left:11%; margin-top: 1em">This function
172is useful when the user wants to override the mOS
173configuration. For example, the user can first call
174<b>mtcp_getconf()</b> function, and change the parameters of
175<i>struct mtcp_conf</i> and then call this function to
176override the configuration.</p>
177
178<p style="margin-left:11%; margin-top: 1em">Please note
179that this function should be called before you call
180<b>mtcp_create_context()</b> which creates mOS context and
181launches the mOS threads.</p>
182
183<p style="margin-left:11%; margin-top: 1em">See
184<i>http://mos.kaist.edu/guide/walkthrough/05_configuration.html</i>
185to view example startup mOS configuration file.</p>
186
187<h2>AUTHORS
188<a name="AUTHORS"></a>
189</h2>
190
191
192<p style="margin-left:11%; margin-top: 1em">mOS development
193team &lt;[email protected]&gt;</p>
194
195<!----------------------------------------------------------->
196<h2>EXAMPLES
197<a name="EXAMPLES"></a>
198</h2>
199
200<p style="margin-left:11%; margin-top: 1em">
201  <a href="http://mos.kaist.edu/guide/programmer/05_api_example.html#global-initialization-routine">
202	http://mos.kaist.edu/guide/programmer/05_api_example.html#global-initialization-routine
203	</a>
204</p>
205<!----------------------------------------------------------->
206
207<h2>SEE ALSO
208<a name="SEE ALSO"></a>
209</h2>
210
211
212
213<p style="margin-left:11%; margin-top: 1em"><b>mtcp_setconf</b>()</p>
214
215<h2>COLOPHON
216<a name="COLOPHON"></a>
217</h2>
218
219
220<p style="margin-left:11%; margin-top: 1em">This page is
221part of mOS release 0.3 <i>docs</i> section. A description
222of the project, and information about reporting bugs, can be
223found at http://mos.kaist.edu/.</p>
224<hr>
225<div class="footer">
226  <img src="back-arrow.jpg" width="2%" height="2%"><a href="http://mos.kaist.edu/index_man.html">Back to Index</a>
227</div>
228</div>
229</body>
230</html>
231