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

Function cmd_pipeline_port_out

dpdk/examples/ip_pipeline/cli.c:1714–1881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1712" | cryptodev <cryptodev_name> txq <txq_id> offset <crypto_op_offset>\n";
1713
1714static void
1715cmd_pipeline_port_out(char **tokens,
1716 uint32_t n_tokens,
1717 char *out,
1718 size_t out_size)
1719{
1720 struct port_out_params p;
1721 char *pipeline_name;
1722 int status;
1723
1724 memset(&p, 0, sizeof(p));
1725
1726 if (n_tokens < 7) {
1727 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
1728 return;
1729 }
1730
1731 pipeline_name = tokens[1];
1732
1733 if (strcmp(tokens[2], "port") != 0) {
1734 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "port");
1735 return;
1736 }
1737
1738 if (strcmp(tokens[3], "out") != 0) {
1739 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "out");
1740 return;
1741 }
1742
1743 if (strcmp(tokens[4], "bsz") != 0) {
1744 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "bsz");
1745 return;
1746 }
1747
1748 if (parser_read_uint32(&p.burst_size, tokens[5]) != 0) {
1749 snprintf(out, out_size, MSG_ARG_INVALID, "burst_size");
1750 return;
1751 }
1752
1753 if (strcmp(tokens[6], "link") == 0) {
1754 if (n_tokens != 10) {
1755 snprintf(out, out_size, MSG_ARG_MISMATCH,
1756 "pipeline port out link");
1757 return;
1758 }
1759
1760 p.type = PORT_OUT_TXQ;
1761
1762 p.dev_name = tokens[7];
1763
1764 if (strcmp(tokens[8], "txq") != 0) {
1765 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "txq");
1766 return;
1767 }
1768
1769 if (parser_read_uint16(&p.txq.queue_id, tokens[9]) != 0) {
1770 snprintf(out, out_size, MSG_ARG_INVALID, "queue_id");
1771 return;

Callers 1

cli_processFunction · 0.85

Calls 6

memsetFunction · 0.85
snprintfFunction · 0.85
strcmpFunction · 0.85
pipeline_port_out_createFunction · 0.85
parser_read_uint32Function · 0.70
parser_read_uint16Function · 0.70

Tested by

no test coverage detected