| 820 | } |
| 821 | |
| 822 | int |
| 823 | pipeline_port_in_enable(const char *pipeline_name, |
| 824 | uint32_t port_id) |
| 825 | { |
| 826 | struct pipeline *p; |
| 827 | struct pipeline_msg_req *req; |
| 828 | struct pipeline_msg_rsp *rsp; |
| 829 | int status; |
| 830 | |
| 831 | /* Check input params */ |
| 832 | if (pipeline_name == NULL) |
| 833 | return -1; |
| 834 | |
| 835 | p = pipeline_find(pipeline_name); |
| 836 | if ((p == NULL) || |
| 837 | (port_id >= p->n_ports_in)) |
| 838 | return -1; |
| 839 | |
| 840 | if (!pipeline_is_running(p)) { |
| 841 | status = rte_pipeline_port_in_enable(p->p, port_id); |
| 842 | return status; |
| 843 | } |
| 844 | |
| 845 | /* Allocate request */ |
| 846 | req = pipeline_msg_alloc(); |
| 847 | if (req == NULL) |
| 848 | return -1; |
| 849 | |
| 850 | /* Write request */ |
| 851 | req->type = PIPELINE_REQ_PORT_IN_ENABLE; |
| 852 | req->id = port_id; |
| 853 | |
| 854 | /* Send request and wait for response */ |
| 855 | rsp = pipeline_msg_send_recv(p, req); |
| 856 | |
| 857 | /* Read response */ |
| 858 | status = rsp->status; |
| 859 | |
| 860 | /* Free response */ |
| 861 | pipeline_msg_free(rsp); |
| 862 | |
| 863 | return status; |
| 864 | } |
| 865 | |
| 866 | int |
| 867 | pipeline_port_in_disable(const char *pipeline_name, |
no test coverage detected