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

Function cmd_config_dynf_specific_parsed

dpdk/app/test-pmd/cmdline.c:12039–12076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12037};
12038
12039static void
12040cmd_config_dynf_specific_parsed(void *parsed_result,
12041 __rte_unused struct cmdline *cl,
12042 __rte_unused void *data)
12043{
12044 struct cmd_config_tx_dynf_specific_result *res = parsed_result;
12045 struct rte_mbuf_dynflag desc_flag;
12046 int flag;
12047 uint64_t old_port_flags;
12048
12049 if (port_id_is_invalid(res->port_id, ENABLED_WARN))
12050 return;
12051 flag = rte_mbuf_dynflag_lookup(res->name, NULL);
12052 if (flag <= 0) {
12053 if (strlcpy(desc_flag.name, res->name,
12054 RTE_MBUF_DYN_NAMESIZE) >= RTE_MBUF_DYN_NAMESIZE) {
12055 fprintf(stderr, "Flag name too long\n");
12056 return;
12057 }
12058 desc_flag.flags = 0;
12059 flag = rte_mbuf_dynflag_register(&desc_flag);
12060 if (flag < 0) {
12061 fprintf(stderr, "Can't register flag\n");
12062 return;
12063 }
12064 strcpy(dynf_names[flag], desc_flag.name);
12065 }
12066 old_port_flags = ports[res->port_id].mbuf_dynf;
12067 if (!strcmp(res->value, "set")) {
12068 ports[res->port_id].mbuf_dynf |= 1UL << flag;
12069 if (old_port_flags == 0)
12070 add_tx_dynf_callback(res->port_id);
12071 } else {
12072 ports[res->port_id].mbuf_dynf &= ~(1UL << flag);
12073 if (ports[res->port_id].mbuf_dynf == 0)
12074 remove_tx_dynf_callback(res->port_id);
12075 }
12076}
12077
12078static cmdline_parse_token_string_t cmd_config_tx_dynf_specific_port =
12079 TOKEN_STRING_INITIALIZER(struct cmd_config_tx_dynf_specific_result,

Callers

nothing calls this directly

Calls 7

port_id_is_invalidFunction · 0.85
rte_mbuf_dynflag_lookupFunction · 0.85
strcmpFunction · 0.85
add_tx_dynf_callbackFunction · 0.85
remove_tx_dynf_callbackFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected