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

Function pipeline_table_dscp_table_update

dpdk/examples/ip_pipeline/thread.c:2012–2065  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2010}
2011
2012int
2013pipeline_table_dscp_table_update(const char *pipeline_name,
2014 uint32_t table_id,
2015 uint64_t dscp_mask,
2016 struct rte_table_action_dscp_table *dscp_table)
2017{
2018 struct pipeline *p;
2019 struct pipeline_msg_req *req;
2020 struct pipeline_msg_rsp *rsp;
2021 int status;
2022
2023 /* Check input params */
2024 if ((pipeline_name == NULL) ||
2025 (dscp_table == NULL))
2026 return -1;
2027
2028 p = pipeline_find(pipeline_name);
2029 if ((p == NULL) ||
2030 (table_id >= p->n_tables))
2031 return -1;
2032
2033 if (!pipeline_is_running(p)) {
2034 struct rte_table_action *a = p->table[table_id].a;
2035
2036 status = rte_table_action_dscp_table_update(a,
2037 dscp_mask,
2038 dscp_table);
2039
2040 return status;
2041 }
2042
2043 /* Allocate request */
2044 req = pipeline_msg_alloc();
2045 if (req == NULL)
2046 return -1;
2047
2048 /* Write request */
2049 req->type = PIPELINE_REQ_TABLE_DSCP_TABLE_UPDATE;
2050 req->id = table_id;
2051 req->table_dscp_table_update.dscp_mask = dscp_mask;
2052 memcpy(&req->table_dscp_table_update.dscp_table,
2053 dscp_table, sizeof(*dscp_table));
2054
2055 /* Send request and wait for response */
2056 rsp = pipeline_msg_send_recv(p, req);
2057
2058 /* Read response */
2059 status = rsp->status;
2060
2061 /* Free response */
2062 pipeline_msg_free(rsp);
2063
2064 return status;
2065}
2066
2067int
2068pipeline_table_rule_ttl_read(const char *pipeline_name,

Callers 1

cmd_pipeline_table_dscpFunction · 0.85

Calls 7

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