* Pipeline run-time */
| 1029 | * Pipeline run-time |
| 1030 | */ |
| 1031 | int |
| 1032 | rte_pipeline_check(struct rte_pipeline *p) |
| 1033 | { |
| 1034 | uint32_t port_in_id; |
| 1035 | |
| 1036 | /* Check input arguments */ |
| 1037 | if (p == NULL) { |
| 1038 | RTE_LOG(ERR, PIPELINE, "%s: pipeline parameter NULL\n", |
| 1039 | __func__); |
| 1040 | return -EINVAL; |
| 1041 | } |
| 1042 | |
| 1043 | /* Check that pipeline has at least one input port, one table and one |
| 1044 | output port */ |
| 1045 | if (p->num_ports_in == 0) { |
| 1046 | RTE_LOG(ERR, PIPELINE, "%s: must have at least 1 input port\n", |
| 1047 | __func__); |
| 1048 | return -EINVAL; |
| 1049 | } |
| 1050 | if (p->num_tables == 0) { |
| 1051 | RTE_LOG(ERR, PIPELINE, "%s: must have at least 1 table\n", |
| 1052 | __func__); |
| 1053 | return -EINVAL; |
| 1054 | } |
| 1055 | if (p->num_ports_out == 0) { |
| 1056 | RTE_LOG(ERR, PIPELINE, "%s: must have at least 1 output port\n", |
| 1057 | __func__); |
| 1058 | return -EINVAL; |
| 1059 | } |
| 1060 | |
| 1061 | /* Check that all input ports are connected */ |
| 1062 | for (port_in_id = 0; port_in_id < p->num_ports_in; port_in_id++) { |
| 1063 | struct rte_port_in *port_in = &p->ports_in[port_in_id]; |
| 1064 | |
| 1065 | if (port_in->table_id == RTE_TABLE_INVALID) { |
| 1066 | RTE_LOG(ERR, PIPELINE, |
| 1067 | "%s: Port IN ID %u is not connected\n", |
| 1068 | __func__, port_in_id); |
| 1069 | return -EINVAL; |
| 1070 | } |
| 1071 | } |
| 1072 | |
| 1073 | return 0; |
| 1074 | } |
| 1075 | |
| 1076 | static inline void |
| 1077 | rte_pipeline_compute_masks(struct rte_pipeline *p, uint64_t pkts_mask) |
no outgoing calls