Skip to content

Commit 4551dfa

Browse files
committed
lwip - Moved dropped packets into debug condition
Printing out dropped packets caused significantly more overhead in the parallel tests due to increased noise on the network. This noise would push the tests past their provided timeouts.
1 parent 39714f3 commit 4551dfa

File tree

3 files changed

+20
-8
lines changed
  • features/FEATURE_LWIP/TESTS/mbedmicro-net

3 files changed

+20
-8
lines changed

features/FEATURE_LWIP/TESTS/mbedmicro-net/tcp_packet_pressure_parallel/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ PressureTest *pressure_tests[MBED_CFG_TCP_CLIENT_PACKET_PRESSURE_THREADS];
204204

205205

206206
int main() {
207-
GREENTEA_SETUP(60, "tcp_echo");
207+
GREENTEA_SETUP(2*60, "tcp_echo");
208208

209209
uint8_t *buffer;
210210
size_t buffer_size;

features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_packet_pressure/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ int main() {
182182
// last good sequence and cut buffer in half
183183
if (window > MBED_CFG_UDP_CLIENT_PACKET_PRESSURE_MIN) {
184184
window /= 2;
185+
}
186+
187+
if (MBED_CFG_UDP_CLIENT_PACKET_PRESSURE_DEBUG) {
185188
printf("UDP: Not sent (%d), window = %d\r\n", td, window);
186189
}
187190
}
@@ -215,6 +218,9 @@ int main() {
215218
known_time = timer.read_ms();
216219
if (window > MBED_CFG_UDP_CLIENT_PACKET_PRESSURE_MIN) {
217220
window /= 2;
221+
}
222+
223+
if (MBED_CFG_UDP_CLIENT_PACKET_PRESSURE_DEBUG) {
218224
printf("UDP: Dropped, window = %d\r\n", window);
219225
}
220226
} else if (rd == NSAPI_ERROR_WOULD_BLOCK) {

features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_packet_pressure_parallel/main.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,12 @@ class PressureTest {
182182
if (window > MBED_CFG_UDP_CLIENT_PACKET_PRESSURE_MIN) {
183183
window /= 2;
184184
}
185-
iomutex.lock();
186-
printf("UDP: Not sent (%d), window = %d\r\n", td, window);
187-
iomutex.unlock();
185+
186+
if (MBED_CFG_UDP_CLIENT_PACKET_PRESSURE_DEBUG) {
187+
iomutex.lock();
188+
printf("UDP: Not sent (%d), window = %d\r\n", td, window);
189+
iomutex.unlock();
190+
}
188191
}
189192
}
190193

@@ -219,9 +222,12 @@ class PressureTest {
219222
if (window > MBED_CFG_UDP_CLIENT_PACKET_PRESSURE_MIN) {
220223
window /= 2;
221224
}
222-
iomutex.lock();
223-
printf("UDP: Dropped, window = %d\r\n", window);
224-
iomutex.unlock();
225+
226+
if (MBED_CFG_UDP_CLIENT_PACKET_PRESSURE_DEBUG) {
227+
iomutex.lock();
228+
printf("UDP: Dropped, window = %d\r\n", window);
229+
iomutex.unlock();
230+
}
225231
} else if (rd == NSAPI_ERROR_WOULD_BLOCK) {
226232
break;
227233
}
@@ -238,7 +244,7 @@ PressureTest *pressure_tests[MBED_CFG_UDP_CLIENT_PACKET_PRESSURE_THREADS];
238244

239245

240246
int main() {
241-
GREENTEA_SETUP(60, "udp_echo");
247+
GREENTEA_SETUP(2*60, "udp_echo");
242248

243249
uint8_t *buffer;
244250
size_t buffer_size;

0 commit comments

Comments
 (0)