MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pipeline_port_in_stats_read

Function pipeline_port_in_stats_read

dpdk/examples/ip_pipeline/thread.c:768–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766}
767
768int
769pipeline_port_in_stats_read(const char *pipeline_name,
770 uint32_t port_id,
771 struct rte_pipeline_port_in_stats *stats,
772 int clear)
773{
774 struct pipeline *p;
775 struct pipeline_msg_req *req;
776 struct pipeline_msg_rsp *rsp;
777 int status;
778
779 /* Check input params */
780 if ((pipeline_name == NULL) ||
781 (stats == NULL))
782 return -1;
783
784 p = pipeline_find(pipeline_name);
785 if ((p == NULL) ||
786 (port_id >= p->n_ports_in))
787 return -1;
788
789 if (!pipeline_is_running(p)) {
790 status = rte_pipeline_port_in_stats_read(p->p,
791 port_id,
792 stats,
793 clear);
794
795 return status;
796 }
797
798 /* Allocate request */
799 req = pipeline_msg_alloc();
800 if (req == NULL)
801 return -1;
802
803 /* Write request */
804 req->type = PIPELINE_REQ_PORT_IN_STATS_READ;
805 req->id = port_id;
806 req->port_in_stats_read.clear = clear;
807
808 /* Send request and wait for response */
809 rsp = pipeline_msg_send_recv(p, req);
810
811 /* Read response */
812 status = rsp->status;
813 if (status == 0)
814 memcpy(stats, &rsp->port_in_stats_read.stats, sizeof(*stats));
815
816 /* Free response */
817 pipeline_msg_free(rsp);
818
819 return status;
820}
821
822int
823pipeline_port_in_enable(const char *pipeline_name,

Callers 1

Calls 7

pipeline_is_runningFunction · 0.85
pipeline_msg_allocFunction · 0.85
pipeline_msg_send_recvFunction · 0.85
pipeline_msg_freeFunction · 0.85
pipeline_findFunction · 0.70
memcpyFunction · 0.50

Tested by

no test coverage detected