| 895 | } |
| 896 | |
| 897 | static int |
| 898 | test_drop(void) |
| 899 | { |
| 900 | int rc; |
| 901 | uint8_t unhandled_queue; |
| 902 | struct rte_dispatcher_stats stats; |
| 903 | |
| 904 | unhandled_queue = (uint8_t)rte_rand_max(NUM_QUEUES); |
| 905 | |
| 906 | rc = test_app_start(test_app); |
| 907 | if (rc != TEST_SUCCESS) |
| 908 | return rc; |
| 909 | |
| 910 | rc = test_app_unregister_callback(test_app, unhandled_queue); |
| 911 | if (rc != TEST_SUCCESS) |
| 912 | return rc; |
| 913 | |
| 914 | struct rte_event event = { |
| 915 | .queue_id = unhandled_queue, |
| 916 | .flow_id = 0, |
| 917 | .sched_type = RTE_SCHED_TYPE_ATOMIC, |
| 918 | .op = RTE_EVENT_OP_NEW, |
| 919 | .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, |
| 920 | .u64 = 0 |
| 921 | }; |
| 922 | |
| 923 | do { |
| 924 | rc = rte_event_enqueue_burst(test_app->event_dev_id, |
| 925 | DRIVER_PORT_ID, &event, 1); |
| 926 | } while (rc == 0); |
| 927 | |
| 928 | do { |
| 929 | rte_dispatcher_stats_get(test_app->dispatcher, &stats); |
| 930 | |
| 931 | rte_event_maintain(test_app->event_dev_id, DRIVER_PORT_ID, 0); |
| 932 | } while (stats.ev_drop_count == 0 && stats.ev_dispatch_count == 0); |
| 933 | |
| 934 | rc = test_app_stop(test_app); |
| 935 | if (rc != TEST_SUCCESS) |
| 936 | return rc; |
| 937 | |
| 938 | TEST_ASSERT_EQUAL(stats.ev_drop_count, 1, "Drop count is not one"); |
| 939 | TEST_ASSERT_EQUAL(stats.ev_dispatch_count, 0, |
| 940 | "Dispatch count is not zero"); |
| 941 | TEST_ASSERT(stats.poll_count > 0, "Poll count is zero"); |
| 942 | |
| 943 | return TEST_SUCCESS; |
| 944 | } |
| 945 | |
| 946 | #define MORE_THAN_MAX_HANDLERS 1000 |
| 947 | #define MIN_HANDLERS 32 |
nothing calls this directly
no test coverage detected