Lines Matching full:packet
115 static void test_fail(int line, struct test_packet *packet) in test_fail() argument
119 test_failed_cnt = packet->data; in test_fail()
120 test_failed_ctx = packet->ctx; in test_fail()
125 static void consume_check(struct test_packet *packet) in consume_check() argument
127 bool res = track_consume(packet->ctx, packet->data); in consume_check()
130 test_fail(__LINE__, packet); in consume_check()
134 for (int i = 0; i < packet->len - 1; i++) { in consume_check()
135 if (packet->buf[i] != packet->data + i) { in consume_check()
136 test_fail(__LINE__, packet); in consume_check()
143 struct test_packet *packet = (struct test_packet *)item; in drop() local
146 consume_check(packet); in drop()
152 struct test_packet *packet = (struct test_packet *)mpsc_pbuf_claim(buffer); in consume() local
154 if (packet) { in consume()
156 consume_check(packet); in consume()
157 mpsc_pbuf_free(buffer, (union mpsc_pbuf_generic *)packet); in consume()
174 struct test_packet *packet = (struct test_packet *)mpsc_pbuf_alloc(buffer, wlen, K_NO_WAIT); in produce() local
176 if (!packet) { in produce()
191 packet->ctx = prio; in produce()
192 packet->data = id; in produce()
193 packet->len = wlen; in produce()
195 packet->buf[i] = id + i; in produce()
198 mpsc_pbuf_commit(buffer, (union mpsc_pbuf_generic *)packet); in produce()
205 struct test_packet *packet = (struct test_packet *)item; in get_wlen() local
207 return packet->len; in get_wlen()
213 * validates that each produced packet is consumed or dropped.
215 * Test is randomized. Thread sleep time and timer timeout are random. Packet