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

Function cmd_swq

dpdk/examples/ip_pipeline/cli.c:343–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341" cpu <cpu_id>\n";
342
343static void
344cmd_swq(char **tokens,
345 uint32_t n_tokens,
346 char *out,
347 size_t out_size)
348{
349 struct swq_params p;
350 char *name;
351 struct swq *swq;
352
353 if (n_tokens != 6) {
354 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
355 return;
356 }
357
358 name = tokens[1];
359
360 if (strcmp(tokens[2], "size") != 0) {
361 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "size");
362 return;
363 }
364
365 if (parser_read_uint32(&p.size, tokens[3]) != 0) {
366 snprintf(out, out_size, MSG_ARG_INVALID, "size");
367 return;
368 }
369
370 if (strcmp(tokens[4], "cpu") != 0) {
371 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "cpu");
372 return;
373 }
374
375 if (parser_read_uint32(&p.cpu_id, tokens[5]) != 0) {
376 snprintf(out, out_size, MSG_ARG_INVALID, "cpu_id");
377 return;
378 }
379
380 swq = swq_create(name, &p);
381 if (swq == NULL) {
382 snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
383 return;
384 }
385}
386
387static const char cmd_tmgr_subport_profile_help[] =
388"tmgr subport profile\n"

Callers 1

cli_processFunction · 0.70

Calls 4

snprintfFunction · 0.85
strcmpFunction · 0.85
swq_createFunction · 0.85
parser_read_uint32Function · 0.70

Tested by

no test coverage detected