| 143 | } |
| 144 | |
| 145 | int |
| 146 | pipeline_port_in_create(const char *pipeline_name, |
| 147 | struct port_in_params *params, |
| 148 | int enabled) |
| 149 | { |
| 150 | struct rte_pipeline_port_in_params p; |
| 151 | |
| 152 | union { |
| 153 | struct rte_port_ethdev_reader_params ethdev; |
| 154 | struct rte_port_ring_reader_params ring; |
| 155 | struct rte_port_sched_reader_params sched; |
| 156 | struct rte_port_fd_reader_params fd; |
| 157 | struct rte_port_source_params source; |
| 158 | struct rte_port_sym_crypto_reader_params sym_crypto; |
| 159 | } pp; |
| 160 | |
| 161 | struct pipeline *pipeline; |
| 162 | struct port_in *port_in; |
| 163 | struct port_in_action_profile *ap; |
| 164 | struct rte_port_in_action *action; |
| 165 | uint32_t port_id; |
| 166 | int status; |
| 167 | |
| 168 | memset(&p, 0, sizeof(p)); |
| 169 | memset(&pp, 0, sizeof(pp)); |
| 170 | |
| 171 | /* Check input params */ |
| 172 | if ((pipeline_name == NULL) || |
| 173 | (params == NULL) || |
| 174 | (params->burst_size == 0) || |
| 175 | (params->burst_size > RTE_PORT_IN_BURST_SIZE_MAX)) |
| 176 | return -1; |
| 177 | |
| 178 | pipeline = pipeline_find(pipeline_name); |
| 179 | if (pipeline == NULL) |
| 180 | return -1; |
| 181 | |
| 182 | ap = NULL; |
| 183 | if (params->action_profile_name) { |
| 184 | ap = port_in_action_profile_find(params->action_profile_name); |
| 185 | if (ap == NULL) |
| 186 | return -1; |
| 187 | } |
| 188 | |
| 189 | switch (params->type) { |
| 190 | case PORT_IN_RXQ: |
| 191 | { |
| 192 | struct link *link; |
| 193 | |
| 194 | link = link_find(params->dev_name); |
| 195 | if (link == NULL) |
| 196 | return -1; |
| 197 | |
| 198 | if (params->rxq.queue_id >= link->n_rxq) |
| 199 | return -1; |
| 200 | |
| 201 | pp.ethdev.port_id = link->port_id; |
| 202 | pp.ethdev.queue_id = params->rxq.queue_id; |
no test coverage detected