MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cmd_mempool

Function cmd_mempool

dpdk/examples/pipeline/cli.c:204–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202"numa <numa_node>\n";
203
204static void
205cmd_mempool(char **tokens,
206 uint32_t n_tokens,
207 char *out,
208 size_t out_size,
209 void *obj __rte_unused)
210{
211 struct rte_mempool *mp;
212 char *mempool_name;
213 uint32_t mbuf_private_size, pkt_buffer_size, pool_size, cache_size, numa_node;
214
215 if (n_tokens != 12) {
216 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
217 return;
218 }
219
220 mempool_name = tokens[1];
221
222 if (strcmp(tokens[2], "meta")) {
223 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "meta");
224 return;
225 }
226
227 if (parser_read_uint32(&mbuf_private_size, tokens[3])) {
228 snprintf(out, out_size, MSG_ARG_INVALID, "mbuf_private_size");
229 return;
230 }
231
232 if (strcmp(tokens[4], "pkt")) {
233 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "pkt");
234 return;
235 }
236
237 if (parser_read_uint32(&pkt_buffer_size, tokens[5])) {
238 snprintf(out, out_size, MSG_ARG_INVALID, "pkt_buffer_size");
239 return;
240 }
241
242 if (strcmp(tokens[6], "pool")) {
243 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "pool");
244 return;
245 }
246
247 if (parser_read_uint32(&pool_size, tokens[7])) {
248 snprintf(out, out_size, MSG_ARG_INVALID, "pool_size");
249 return;
250 }
251
252 if (strcmp(tokens[8], "cache")) {
253 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "cache");
254 return;
255 }
256
257 if (parser_read_uint32(&cache_size, tokens[9])) {
258 snprintf(out, out_size, MSG_ARG_INVALID, "cache_size");
259 return;
260 }
261

Callers 1

cli_processFunction · 0.70

Calls 4

snprintfFunction · 0.85
strcmpFunction · 0.85
rte_pktmbuf_pool_createFunction · 0.85
parser_read_uint32Function · 0.70

Tested by

no test coverage detected