| 2622 | } |
| 2623 | |
| 2624 | static int |
| 2625 | parallel_basic(struct test *t, int check_order) |
| 2626 | { |
| 2627 | const uint8_t rx_port = 0; |
| 2628 | const uint8_t w1_port = 1; |
| 2629 | const uint8_t w3_port = 3; |
| 2630 | const uint8_t tx_port = 4; |
| 2631 | int err; |
| 2632 | int i; |
| 2633 | uint32_t deq_pkts, j; |
| 2634 | struct rte_mbuf *mbufs[3]; |
| 2635 | struct rte_mbuf *mbufs_out[3] = { 0 }; |
| 2636 | const uint32_t MAGIC_SEQN = 1234; |
| 2637 | |
| 2638 | /* Create instance with 4 ports */ |
| 2639 | if (init(t, 2, tx_port + 1) < 0 || |
| 2640 | create_ports(t, tx_port + 1) < 0 || |
| 2641 | (check_order ? create_ordered_qids(t, 1) : |
| 2642 | create_unordered_qids(t, 1)) < 0 || |
| 2643 | create_directed_qids(t, 1, &tx_port)) { |
| 2644 | printf("%d: Error initializing device\n", __LINE__); |
| 2645 | return -1; |
| 2646 | } |
| 2647 | |
| 2648 | /* |
| 2649 | * CQ mapping to QID |
| 2650 | * We need three ports, all mapped to the same ordered qid0. Then we'll |
| 2651 | * take a packet out to each port, re-enqueue in reverse order, |
| 2652 | * then make sure the reordering has taken place properly when we |
| 2653 | * dequeue from the tx_port. |
| 2654 | * |
| 2655 | * Simplified test setup diagram: |
| 2656 | * |
| 2657 | * rx_port w1_port |
| 2658 | * \ / \ |
| 2659 | * qid0 - w2_port - qid1 |
| 2660 | * \ / \ |
| 2661 | * w3_port tx_port |
| 2662 | */ |
| 2663 | /* CQ mapping to QID for LB ports (directed mapped on create) */ |
| 2664 | for (i = w1_port; i <= w3_port; i++) { |
| 2665 | err = rte_event_port_link(evdev, t->port[i], &t->qid[0], NULL, |
| 2666 | 1); |
| 2667 | if (err != 1) { |
| 2668 | printf("%d: error mapping lb qid\n", __LINE__); |
| 2669 | cleanup(t); |
| 2670 | return -1; |
| 2671 | } |
| 2672 | } |
| 2673 | |
| 2674 | if (rte_event_dev_start(evdev) < 0) { |
| 2675 | printf("%d: Error with start call\n", __LINE__); |
| 2676 | return -1; |
| 2677 | } |
| 2678 | |
| 2679 | /* Enqueue 3 packets to the rx port */ |
| 2680 | for (i = 0; i < 3; i++) { |
| 2681 | struct rte_event ev; |
no test coverage detected