| 2960 | } |
| 2961 | |
| 2962 | static int |
| 2963 | ordered_atomic_hist_completion(struct test *t) |
| 2964 | { |
| 2965 | const int rx_enq = 0; |
| 2966 | int err; |
| 2967 | |
| 2968 | /* Create instance with 1 atomic QID going to 3 ports + 1 prod port */ |
| 2969 | if (init(t, 2, 2) < 0 || |
| 2970 | create_ports(t, 2) < 0 || |
| 2971 | create_ordered_qids(t, 1) < 0 || |
| 2972 | create_atomic_qids(t, 1) < 0) |
| 2973 | return -1; |
| 2974 | |
| 2975 | /* Helpers to identify queues */ |
| 2976 | const uint8_t qid_ordered = t->qid[0]; |
| 2977 | const uint8_t qid_atomic = t->qid[1]; |
| 2978 | |
| 2979 | /* CQ mapping to QID */ |
| 2980 | if (rte_event_port_link(evdev, t->port[1], &t->qid[0], NULL, 1) != 1) { |
| 2981 | printf("%d: error mapping port 1 qid\n", __LINE__); |
| 2982 | return -1; |
| 2983 | } |
| 2984 | if (rte_event_port_link(evdev, t->port[1], &t->qid[1], NULL, 1) != 1) { |
| 2985 | printf("%d: error mapping port 1 qid\n", __LINE__); |
| 2986 | return -1; |
| 2987 | } |
| 2988 | if (rte_event_dev_start(evdev) < 0) { |
| 2989 | printf("%d: Error with start call\n", __LINE__); |
| 2990 | return -1; |
| 2991 | } |
| 2992 | |
| 2993 | /* Enqueue 1x ordered event, to be RELEASE-ed by the worker |
| 2994 | * CPU, which may cause hist-list corruption (by not comleting) |
| 2995 | */ |
| 2996 | struct rte_event ord_ev = { |
| 2997 | .op = RTE_EVENT_OP_NEW, |
| 2998 | .queue_id = qid_ordered, |
| 2999 | .event_type = RTE_EVENT_TYPE_CPU, |
| 3000 | .priority = RTE_EVENT_DEV_PRIORITY_NORMAL, |
| 3001 | }; |
| 3002 | err = rte_event_enqueue_burst(evdev, t->port[rx_enq], &ord_ev, 1); |
| 3003 | if (err != 1) { |
| 3004 | printf("%d: Failed to enqueue\n", __LINE__); |
| 3005 | return -1; |
| 3006 | } |
| 3007 | |
| 3008 | /* call the scheduler. This schedules the above event as a single |
| 3009 | * event in an ORDERED queue, to the worker. |
| 3010 | */ |
| 3011 | rte_service_run_iter_on_app_lcore(t->service_id, 1); |
| 3012 | |
| 3013 | /* Dequeue ORDERED event 0 from port 1, so that we can then drop */ |
| 3014 | struct rte_event ev; |
| 3015 | if (!rte_event_dequeue_burst(evdev, t->port[1], &ev, 1, 0)) { |
| 3016 | printf("%d: failed to dequeue\n", __LINE__); |
| 3017 | return -1; |
| 3018 | } |
| 3019 |
no test coverage detected