| 132 | } |
| 133 | |
| 134 | int |
| 135 | order_test_setup(struct evt_test *test, struct evt_options *opt) |
| 136 | { |
| 137 | void *test_order; |
| 138 | struct test_order *t; |
| 139 | static const struct rte_mbuf_dynfield flow_id_dynfield_desc = { |
| 140 | .name = "test_event_dynfield_flow_id", |
| 141 | .size = sizeof(flow_id_t), |
| 142 | .align = __alignof__(flow_id_t), |
| 143 | }; |
| 144 | static const struct rte_mbuf_dynfield seqn_dynfield_desc = { |
| 145 | .name = "test_event_dynfield_seqn", |
| 146 | .size = sizeof(seqn_t), |
| 147 | .align = __alignof__(seqn_t), |
| 148 | }; |
| 149 | |
| 150 | test_order = rte_zmalloc_socket(test->name, sizeof(struct test_order), |
| 151 | RTE_CACHE_LINE_SIZE, opt->socket_id); |
| 152 | if (test_order == NULL) { |
| 153 | evt_err("failed to allocate test_order memory"); |
| 154 | goto nomem; |
| 155 | } |
| 156 | test->test_priv = test_order; |
| 157 | t = evt_test_priv(test); |
| 158 | |
| 159 | t->flow_id_dynfield_offset = |
| 160 | rte_mbuf_dynfield_register(&flow_id_dynfield_desc); |
| 161 | if (t->flow_id_dynfield_offset < 0) { |
| 162 | evt_err("failed to register mbuf field"); |
| 163 | return -rte_errno; |
| 164 | } |
| 165 | |
| 166 | t->seqn_dynfield_offset = |
| 167 | rte_mbuf_dynfield_register(&seqn_dynfield_desc); |
| 168 | if (t->seqn_dynfield_offset < 0) { |
| 169 | evt_err("failed to register mbuf field"); |
| 170 | return -rte_errno; |
| 171 | } |
| 172 | |
| 173 | t->producer_flow_seq = rte_zmalloc_socket("test_producer_flow_seq", |
| 174 | sizeof(*t->producer_flow_seq) * opt->nb_flows, |
| 175 | RTE_CACHE_LINE_SIZE, opt->socket_id); |
| 176 | |
| 177 | if (t->producer_flow_seq == NULL) { |
| 178 | evt_err("failed to allocate t->producer_flow_seq memory"); |
| 179 | goto prod_nomem; |
| 180 | } |
| 181 | |
| 182 | t->expected_flow_seq = rte_zmalloc_socket("test_expected_flow_seq", |
| 183 | sizeof(*t->expected_flow_seq) * opt->nb_flows, |
| 184 | RTE_CACHE_LINE_SIZE, opt->socket_id); |
| 185 | |
| 186 | if (t->expected_flow_seq == NULL) { |
| 187 | evt_err("failed to allocate t->expected_flow_seq memory"); |
| 188 | goto exp_nomem; |
| 189 | } |
| 190 | __atomic_store_n(&t->outstand_pkts, opt->nb_pkts, __ATOMIC_RELAXED); |
| 191 | t->err = false; |
nothing calls this directly
no test coverage detected