Lines Matching refs:sp

69 iperf_udp_recv(struct iperf_stream *sp)  in iperf_udp_recv()  argument
74 int size = sp->settings->blksize; in iperf_udp_recv()
79 r = Nread(sp->socket, sp->buffer, size, Pudp); in iperf_udp_recv()
90 if (sp->test->state == TEST_RUNNING) { in iperf_udp_recv()
96 if (sp->result->bytes_received == 0) { in iperf_udp_recv()
100 sp->result->bytes_received += r; in iperf_udp_recv()
101 sp->result->bytes_received_this_interval += r; in iperf_udp_recv()
104 if (sp->test->udp_counters_64bit) { in iperf_udp_recv()
105 memcpy(&sec, sp->buffer, sizeof(sec)); in iperf_udp_recv()
106 memcpy(&usec, sp->buffer+4, sizeof(usec)); in iperf_udp_recv()
107 memcpy(&pcount, sp->buffer+8, sizeof(pcount)); in iperf_udp_recv()
116 memcpy(&sec, sp->buffer, sizeof(sec)); in iperf_udp_recv()
117 memcpy(&usec, sp->buffer+4, sizeof(usec)); in iperf_udp_recv()
118 memcpy(&pc, sp->buffer+8, sizeof(pc)); in iperf_udp_recv()
126 if (sp->test->debug_level >= DEBUG_LEVEL_DEBUG) in iperf_udp_recv()
127 fprintf(stderr, "pcount %" PRIu64 " packet_count %d\n", pcount, sp->packet_count); in iperf_udp_recv()
142 if (pcount >= sp->packet_count + 1) { in iperf_udp_recv()
145 if (pcount > sp->packet_count + 1) { in iperf_udp_recv()
147 sp->cnt_error += (pcount - 1) - sp->packet_count; in iperf_udp_recv()
150 sp->packet_count = pcount; in iperf_udp_recv()
157 sp->outoforder_packets++; in iperf_udp_recv()
165 if (sp->cnt_error > 0) in iperf_udp_recv()
166 sp->cnt_error--; in iperf_udp_recv()
169 if (sp->test->debug) in iperf_udp_recv()
170 …ence %" PRIu64 " but expected sequence %d on stream %d", pcount, sp->packet_count + 1, sp->socket); in iperf_udp_recv()
191 sp->prev_transit = transit; in iperf_udp_recv()
193 d = transit - sp->prev_transit; in iperf_udp_recv()
196 sp->prev_transit = transit; in iperf_udp_recv()
197 sp->jitter += (d - sp->jitter) / 16.0; in iperf_udp_recv()
200 if (sp->test->debug) in iperf_udp_recv()
201 printf("Late receive, state = %d\n", sp->test->state); in iperf_udp_recv()
213 iperf_udp_send(struct iperf_stream *sp) in iperf_udp_send() argument
216 int size = sp->settings->blksize; in iperf_udp_send()
221 ++sp->packet_count; in iperf_udp_send()
223 if (sp->test->udp_counters_64bit) { in iperf_udp_send()
230 pcount = htobe64(sp->packet_count); in iperf_udp_send()
232 memcpy(sp->buffer, &sec, sizeof(sec)); in iperf_udp_send()
233 memcpy(sp->buffer+4, &usec, sizeof(usec)); in iperf_udp_send()
234 memcpy(sp->buffer+8, &pcount, sizeof(pcount)); in iperf_udp_send()
243 pcount = htonl(sp->packet_count); in iperf_udp_send()
245 memcpy(sp->buffer, &sec, sizeof(sec)); in iperf_udp_send()
246 memcpy(sp->buffer+4, &usec, sizeof(usec)); in iperf_udp_send()
247 memcpy(sp->buffer+8, &pcount, sizeof(pcount)); in iperf_udp_send()
251 r = Nwrite(sp->socket, sp->buffer, size, Pudp); in iperf_udp_send()
256 sp->result->bytes_sent += r; in iperf_udp_send()
257 sp->result->bytes_sent_this_interval += r; in iperf_udp_send()
259 if (sp->test->debug_level >= DEBUG_LEVEL_DEBUG) in iperf_udp_send()
260 …printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sen… in iperf_udp_send()