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

Function cmd_ethdev

dpdk/examples/pipeline/cli.c:291–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289" [rss <qid_0> ... <qid_n>]\n";
290
291static void
292cmd_ethdev(char **tokens,
293 uint32_t n_tokens,
294 char *out,
295 size_t out_size,
296 void *obj __rte_unused)
297{
298 struct ethdev_params p;
299 struct ethdev_params_rss rss;
300 char *name;
301 int status;
302
303 memset(&p, 0, sizeof(p));
304 memset(&rss, 0, sizeof(rss));
305
306 if (n_tokens < 11 || n_tokens > 12 + ETHDEV_RXQ_RSS_MAX) {
307 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
308 return;
309 }
310 name = tokens[1];
311
312 if (strcmp(tokens[2], "rxq") != 0) {
313 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "rxq");
314 return;
315 }
316
317 if (parser_read_uint32(&p.rx.n_queues, tokens[3]) != 0) {
318 snprintf(out, out_size, MSG_ARG_INVALID, "n_queues");
319 return;
320 }
321 if (parser_read_uint32(&p.rx.queue_size, tokens[4]) != 0) {
322 snprintf(out, out_size, MSG_ARG_INVALID, "queue_size");
323 return;
324 }
325
326 p.rx.mempool_name = tokens[5];
327
328 if (strcmp(tokens[6], "txq") != 0) {
329 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "txq");
330 return;
331 }
332
333 if (parser_read_uint32(&p.tx.n_queues, tokens[7]) != 0) {
334 snprintf(out, out_size, MSG_ARG_INVALID, "n_queues");
335 return;
336 }
337
338 if (parser_read_uint32(&p.tx.queue_size, tokens[8]) != 0) {
339 snprintf(out, out_size, MSG_ARG_INVALID, "queue_size");
340 return;
341 }
342
343 if (strcmp(tokens[9], "promiscuous") != 0) {
344 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "promiscuous");
345 return;
346 }
347
348 if (strcmp(tokens[10], "on") == 0)

Callers 1

cli_processFunction · 0.85

Calls 5

memsetFunction · 0.85
snprintfFunction · 0.85
strcmpFunction · 0.85
parser_read_uint32Function · 0.70
ethdev_configFunction · 0.70

Tested by

no test coverage detected