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

Function enable_pdump

dpdk/app/pdump/main.c:818–877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

816}
817
818static void
819enable_pdump(void)
820{
821 int i;
822 struct pdump_tuples *pt;
823 int ret = 0, ret1 = 0;
824
825 for (i = 0; i < num_tuples; i++) {
826 pt = &pdump_t[i];
827 if (pt->dir == RTE_PDUMP_FLAG_RXTX) {
828 if (pt->dump_by_type == DEVICE_ID) {
829 ret = rte_pdump_enable_by_deviceid(
830 pt->device_id,
831 pt->queue,
832 RTE_PDUMP_FLAG_RX,
833 pt->rx_ring,
834 pt->mp, NULL);
835 ret1 = rte_pdump_enable_by_deviceid(
836 pt->device_id,
837 pt->queue,
838 RTE_PDUMP_FLAG_TX,
839 pt->tx_ring,
840 pt->mp, NULL);
841 } else if (pt->dump_by_type == PORT_ID) {
842 ret = rte_pdump_enable(pt->port, pt->queue,
843 RTE_PDUMP_FLAG_RX,
844 pt->rx_ring, pt->mp, NULL);
845 ret1 = rte_pdump_enable(pt->port, pt->queue,
846 RTE_PDUMP_FLAG_TX,
847 pt->tx_ring, pt->mp, NULL);
848 }
849 } else if (pt->dir == RTE_PDUMP_FLAG_RX) {
850 if (pt->dump_by_type == DEVICE_ID)
851 ret = rte_pdump_enable_by_deviceid(
852 pt->device_id,
853 pt->queue,
854 pt->dir, pt->rx_ring,
855 pt->mp, NULL);
856 else if (pt->dump_by_type == PORT_ID)
857 ret = rte_pdump_enable(pt->port, pt->queue,
858 pt->dir,
859 pt->rx_ring, pt->mp, NULL);
860 } else if (pt->dir == RTE_PDUMP_FLAG_TX) {
861 if (pt->dump_by_type == DEVICE_ID)
862 ret = rte_pdump_enable_by_deviceid(
863 pt->device_id,
864 pt->queue,
865 pt->dir,
866 pt->tx_ring, pt->mp, NULL);
867 else if (pt->dump_by_type == PORT_ID)
868 ret = rte_pdump_enable(pt->port, pt->queue,
869 pt->dir,
870 pt->tx_ring, pt->mp, NULL);
871 }
872 if (ret < 0 || ret1 < 0) {
873 cleanup_pdump_resources();
874 rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno));
875 }

Callers 1

mainFunction · 0.70

Calls 5

rte_pdump_enableFunction · 0.85
rte_exitFunction · 0.85
rte_strerrorFunction · 0.85
cleanup_pdump_resourcesFunction · 0.70

Tested by

no test coverage detected