| 908 | } |
| 909 | |
| 910 | int |
| 911 | pipeline_port_out_stats_read(const char *pipeline_name, |
| 912 | uint32_t port_id, |
| 913 | struct rte_pipeline_port_out_stats *stats, |
| 914 | int clear) |
| 915 | { |
| 916 | struct pipeline *p; |
| 917 | struct pipeline_msg_req *req; |
| 918 | struct pipeline_msg_rsp *rsp; |
| 919 | int status; |
| 920 | |
| 921 | /* Check input params */ |
| 922 | if ((pipeline_name == NULL) || |
| 923 | (stats == NULL)) |
| 924 | return -1; |
| 925 | |
| 926 | p = pipeline_find(pipeline_name); |
| 927 | if ((p == NULL) || |
| 928 | (port_id >= p->n_ports_out)) |
| 929 | return -1; |
| 930 | |
| 931 | if (!pipeline_is_running(p)) { |
| 932 | status = rte_pipeline_port_out_stats_read(p->p, |
| 933 | port_id, |
| 934 | stats, |
| 935 | clear); |
| 936 | |
| 937 | return status; |
| 938 | } |
| 939 | |
| 940 | /* Allocate request */ |
| 941 | req = pipeline_msg_alloc(); |
| 942 | if (req == NULL) |
| 943 | return -1; |
| 944 | |
| 945 | /* Write request */ |
| 946 | req->type = PIPELINE_REQ_PORT_OUT_STATS_READ; |
| 947 | req->id = port_id; |
| 948 | req->port_out_stats_read.clear = clear; |
| 949 | |
| 950 | /* Send request and wait for response */ |
| 951 | rsp = pipeline_msg_send_recv(p, req); |
| 952 | |
| 953 | /* Read response */ |
| 954 | status = rsp->status; |
| 955 | if (status == 0) |
| 956 | memcpy(stats, &rsp->port_out_stats_read.stats, sizeof(*stats)); |
| 957 | |
| 958 | /* Free response */ |
| 959 | pipeline_msg_free(rsp); |
| 960 | |
| 961 | return status; |
| 962 | } |
| 963 | |
| 964 | int |
| 965 | pipeline_table_stats_read(const char *pipeline_name, |
no test coverage detected