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

Function pipeline_table_rule_delete_default

dpdk/examples/ip_pipeline/thread.c:1718–1771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1716}
1717
1718int
1719pipeline_table_rule_delete_default(const char *pipeline_name,
1720 uint32_t table_id)
1721{
1722 struct pipeline *p;
1723 struct table *table;
1724 struct pipeline_msg_req *req;
1725 struct pipeline_msg_rsp *rsp;
1726 int status;
1727
1728 /* Check input params */
1729 if (pipeline_name == NULL)
1730 return -1;
1731
1732 p = pipeline_find(pipeline_name);
1733 if ((p == NULL) ||
1734 (table_id >= p->n_tables))
1735 return -1;
1736
1737 table = &p->table[table_id];
1738
1739 if (!pipeline_is_running(p)) {
1740 status = rte_pipeline_table_default_entry_delete(p->p,
1741 table_id,
1742 NULL);
1743
1744 if (status == 0)
1745 table_rule_default_delete(table);
1746
1747 return status;
1748 }
1749
1750 /* Allocate request */
1751 req = pipeline_msg_alloc();
1752 if (req == NULL)
1753 return -1;
1754
1755 /* Write request */
1756 req->type = PIPELINE_REQ_TABLE_RULE_DELETE_DEFAULT;
1757 req->id = table_id;
1758
1759 /* Send request and wait for response */
1760 rsp = pipeline_msg_send_recv(p, req);
1761
1762 /* Read response */
1763 status = rsp->status;
1764 if (status == 0)
1765 table_rule_default_delete(table);
1766
1767 /* Free response */
1768 pipeline_msg_free(rsp);
1769
1770 return status;
1771}
1772
1773int
1774pipeline_table_rule_stats_read(const char *pipeline_name,

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

Tested by

no test coverage detected