| 864 | } |
| 865 | |
| 866 | int |
| 867 | pipeline_port_in_disable(const char *pipeline_name, |
| 868 | uint32_t port_id) |
| 869 | { |
| 870 | struct pipeline *p; |
| 871 | struct pipeline_msg_req *req; |
| 872 | struct pipeline_msg_rsp *rsp; |
| 873 | int status; |
| 874 | |
| 875 | /* Check input params */ |
| 876 | if (pipeline_name == NULL) |
| 877 | return -1; |
| 878 | |
| 879 | p = pipeline_find(pipeline_name); |
| 880 | if ((p == NULL) || |
| 881 | (port_id >= p->n_ports_in)) |
| 882 | return -1; |
| 883 | |
| 884 | if (!pipeline_is_running(p)) { |
| 885 | status = rte_pipeline_port_in_disable(p->p, port_id); |
| 886 | return status; |
| 887 | } |
| 888 | |
| 889 | /* Allocate request */ |
| 890 | req = pipeline_msg_alloc(); |
| 891 | if (req == NULL) |
| 892 | return -1; |
| 893 | |
| 894 | /* Write request */ |
| 895 | req->type = PIPELINE_REQ_PORT_IN_DISABLE; |
| 896 | req->id = port_id; |
| 897 | |
| 898 | /* Send request and wait for response */ |
| 899 | rsp = pipeline_msg_send_recv(p, req); |
| 900 | |
| 901 | /* Read response */ |
| 902 | status = rsp->status; |
| 903 | |
| 904 | /* Free response */ |
| 905 | pipeline_msg_free(rsp); |
| 906 | |
| 907 | return status; |
| 908 | } |
| 909 | |
| 910 | int |
| 911 | pipeline_port_out_stats_read(const char *pipeline_name, |
no test coverage detected