| 1803 | } |
| 1804 | |
| 1805 | struct rte_flow_actions_template * |
| 1806 | rte_flow_actions_template_create(uint16_t port_id, |
| 1807 | const struct rte_flow_actions_template_attr *template_attr, |
| 1808 | const struct rte_flow_action actions[], |
| 1809 | const struct rte_flow_action masks[], |
| 1810 | struct rte_flow_error *error) |
| 1811 | { |
| 1812 | struct rte_eth_dev *dev = &rte_eth_devices[port_id]; |
| 1813 | const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error); |
| 1814 | struct rte_flow_actions_template *template; |
| 1815 | |
| 1816 | if (unlikely(!ops)) |
| 1817 | return NULL; |
| 1818 | if (dev->data->flow_configured == 0) { |
| 1819 | RTE_FLOW_LOG(INFO, |
| 1820 | "Flow engine on port_id=%"PRIu16" is not configured.\n", |
| 1821 | port_id); |
| 1822 | rte_flow_error_set(error, EINVAL, |
| 1823 | RTE_FLOW_ERROR_TYPE_STATE, |
| 1824 | NULL, rte_strerror(EINVAL)); |
| 1825 | return NULL; |
| 1826 | } |
| 1827 | if (template_attr == NULL) { |
| 1828 | RTE_FLOW_LOG(ERR, |
| 1829 | "Port %"PRIu16" template attr is NULL.\n", |
| 1830 | port_id); |
| 1831 | rte_flow_error_set(error, EINVAL, |
| 1832 | RTE_FLOW_ERROR_TYPE_ATTR, |
| 1833 | NULL, rte_strerror(EINVAL)); |
| 1834 | return NULL; |
| 1835 | } |
| 1836 | if (actions == NULL) { |
| 1837 | RTE_FLOW_LOG(ERR, |
| 1838 | "Port %"PRIu16" actions is NULL.\n", |
| 1839 | port_id); |
| 1840 | rte_flow_error_set(error, EINVAL, |
| 1841 | RTE_FLOW_ERROR_TYPE_ATTR, |
| 1842 | NULL, rte_strerror(EINVAL)); |
| 1843 | return NULL; |
| 1844 | } |
| 1845 | if (masks == NULL) { |
| 1846 | RTE_FLOW_LOG(ERR, |
| 1847 | "Port %"PRIu16" masks is NULL.\n", |
| 1848 | port_id); |
| 1849 | rte_flow_error_set(error, EINVAL, |
| 1850 | RTE_FLOW_ERROR_TYPE_ATTR, |
| 1851 | NULL, rte_strerror(EINVAL)); |
| 1852 | |
| 1853 | } |
| 1854 | if (likely(!!ops->actions_template_create)) { |
| 1855 | template = ops->actions_template_create(dev, template_attr, |
| 1856 | actions, masks, error); |
| 1857 | if (template == NULL) |
| 1858 | flow_err(port_id, -rte_errno, error); |
| 1859 | |
| 1860 | rte_flow_trace_actions_template_create(port_id, template_attr, actions, |
| 1861 | masks, template); |
| 1862 |
no test coverage detected