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

Function pipeline_table_rule_ttl_read

dpdk/examples/ip_pipeline/thread.c:2067–2133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2065}
2066
2067int
2068pipeline_table_rule_ttl_read(const char *pipeline_name,
2069 uint32_t table_id,
2070 struct table_rule_match *match,
2071 struct rte_table_action_ttl_counters *stats,
2072 int clear)
2073{
2074 struct pipeline *p;
2075 struct table *table;
2076 struct pipeline_msg_req *req;
2077 struct pipeline_msg_rsp *rsp;
2078 struct table_rule *rule;
2079 int status;
2080
2081 /* Check input params */
2082 if ((pipeline_name == NULL) ||
2083 (match == NULL) ||
2084 (stats == NULL))
2085 return -1;
2086
2087 p = pipeline_find(pipeline_name);
2088 if ((p == NULL) ||
2089 (table_id >= p->n_tables) ||
2090 match_check(match, p, table_id))
2091 return -1;
2092
2093 table = &p->table[table_id];
2094 if (!table->ap->params.ttl.n_packets_enabled)
2095 return -1;
2096
2097 rule = table_rule_find(table, match);
2098 if (rule == NULL)
2099 return -1;
2100
2101 if (!pipeline_is_running(p)) {
2102 status = rte_table_action_ttl_read(table->a,
2103 rule->data,
2104 stats,
2105 clear);
2106
2107 return status;
2108 }
2109
2110 /* Allocate request */
2111 req = pipeline_msg_alloc();
2112 if (req == NULL)
2113 return -1;
2114
2115 /* Write request */
2116 req->type = PIPELINE_REQ_TABLE_RULE_TTL_READ;
2117 req->id = table_id;
2118 req->table_rule_ttl_read.data = rule->data;
2119 req->table_rule_ttl_read.clear = clear;
2120
2121 /* Send request and wait for response */
2122 rsp = pipeline_msg_send_recv(p, req);
2123
2124 /* Read response */

Callers 1

Calls 9

match_checkFunction · 0.85
table_rule_findFunction · 0.85
pipeline_is_runningFunction · 0.85
pipeline_msg_allocFunction · 0.85
pipeline_msg_send_recvFunction · 0.85
pipeline_msg_freeFunction · 0.85
pipeline_findFunction · 0.70
memcpyFunction · 0.50

Tested by

no test coverage detected