| 793 | } |
| 794 | |
| 795 | static int |
| 796 | test_basic(void) |
| 797 | { |
| 798 | int rc; |
| 799 | int i; |
| 800 | |
| 801 | rc = test_app_start(test_app); |
| 802 | if (rc != TEST_SUCCESS) |
| 803 | return rc; |
| 804 | |
| 805 | uint64_t sns[NUM_FLOWS] = { 0 }; |
| 806 | |
| 807 | for (i = 0; i < NUM_EVENTS;) { |
| 808 | struct rte_event events[ENQUEUE_BURST_SIZE]; |
| 809 | int left; |
| 810 | int batch_size; |
| 811 | int j; |
| 812 | uint16_t n = 0; |
| 813 | |
| 814 | batch_size = 1 + rte_rand_max(ENQUEUE_BURST_SIZE); |
| 815 | left = NUM_EVENTS - i; |
| 816 | |
| 817 | batch_size = RTE_MIN(left, batch_size); |
| 818 | |
| 819 | for (j = 0; j < batch_size; j++) { |
| 820 | struct rte_event *event = &events[j]; |
| 821 | uint64_t sn; |
| 822 | uint32_t flow_id; |
| 823 | |
| 824 | flow_id = rte_rand_max(NUM_FLOWS); |
| 825 | |
| 826 | sn = sns[flow_id]++; |
| 827 | |
| 828 | *event = (struct rte_event) { |
| 829 | .queue_id = 0, |
| 830 | .flow_id = flow_id, |
| 831 | .sched_type = RTE_SCHED_TYPE_ATOMIC, |
| 832 | .op = RTE_EVENT_OP_NEW, |
| 833 | .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, |
| 834 | .u64 = sn |
| 835 | }; |
| 836 | } |
| 837 | |
| 838 | while (n < batch_size) |
| 839 | n += rte_event_enqueue_new_burst(test_app->event_dev_id, |
| 840 | DRIVER_PORT_ID, |
| 841 | events + n, |
| 842 | batch_size - n); |
| 843 | |
| 844 | i += batch_size; |
| 845 | } |
| 846 | |
| 847 | while (test_app_get_completed_events(test_app) != NUM_EVENTS) |
| 848 | rte_event_maintain(test_app->event_dev_id, DRIVER_PORT_ID, 0); |
| 849 | |
| 850 | rc = test_app_get_errors(test_app); |
| 851 | TEST_ASSERT(rc == 0, "%d errors occurred", rc); |
| 852 |
nothing calls this directly
no test coverage detected