File tree Expand file tree Collapse file tree 3 files changed +29
-11
lines changed Expand file tree Collapse file tree 3 files changed +29
-11
lines changed Original file line number Diff line number Diff line change @@ -428,20 +428,38 @@ static struct pbuf *lpc_low_level_input(struct netif *netif)
428
428
p = lpc_enetif -> rxb [idx ];
429
429
p -> len = (u16_t ) length ;
430
430
431
- /* Free pbuf from desriptor */
431
+ /* Free pbuf from descriptor */
432
432
lpc_enetif -> rxb [idx ] = NULL ;
433
433
lpc_enetif -> rx_free_descs ++ ;
434
434
435
+ /* Attempt to queue new buffer(s) */
436
+ if (lpc_rx_queue (lpc_enetif -> netif ) == 0 ) {
437
+ /* Drop the frame due to OOM. */
438
+ LINK_STATS_INC (link .drop );
439
+
440
+ /* Re-queue the pbuf for receive */
441
+ lpc_rxqueue_pbuf (lpc_enetif , p );
442
+
443
+ LWIP_DEBUGF (UDP_LPC_EMAC | LWIP_DBG_TRACE ,
444
+ ("lpc_low_level_input: Packet index %d dropped for OOM\n" ,
445
+ idx ));
446
+
447
+ #ifdef LOCK_RX_THREAD
448
+ #if NO_SYS == 0
449
+ sys_mutex_unlock (& lpc_enetif -> TXLockMutex );
450
+ #endif
451
+ #endif
452
+
453
+ return NULL ;
454
+ }
455
+
435
456
LWIP_DEBUGF (UDP_LPC_EMAC | LWIP_DBG_TRACE ,
436
457
("lpc_low_level_input: Packet received: %p, size %d (index=%d)\n" ,
437
458
p , length , idx ));
438
459
439
460
/* Save size */
440
461
p -> tot_len = (u16_t ) length ;
441
462
LINK_STATS_INC (link .recv );
442
-
443
- /* Queue new buffer(s) */
444
- lpc_rx_queue (lpc_enetif -> netif );
445
463
}
446
464
}
447
465
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ typedef struct {
51
51
osMessageQId id ;
52
52
osMessageQDef_t def ;
53
53
#ifdef CMSIS_OS_RTX
54
- uint32_t queue [MB_SIZE ];
54
+ uint32_t queue [4 + MB_SIZE ]; /* The +4 is required for RTX OS_MCB overhead. */
55
55
#endif
56
56
} sys_mbox_t ;
57
57
Original file line number Diff line number Diff line change 29
29
30
30
#define LWIP_RAW 0
31
31
32
- #define TCPIP_MBOX_SIZE 6
33
- #define DEFAULT_TCP_RECVMBOX_SIZE 6
34
- #define DEFAULT_UDP_RECVMBOX_SIZE 6
35
- #define DEFAULT_RAW_RECVMBOX_SIZE 6
36
- #define DEFAULT_ACCEPTMBOX_SIZE 6
32
+ #define TCPIP_MBOX_SIZE 8
33
+ #define DEFAULT_TCP_RECVMBOX_SIZE 8
34
+ #define DEFAULT_UDP_RECVMBOX_SIZE 8
35
+ #define DEFAULT_RAW_RECVMBOX_SIZE 8
36
+ #define DEFAULT_ACCEPTMBOX_SIZE 8
37
37
38
38
#define TCPIP_THREAD_STACKSIZE 1024
39
- #define TCPIP_THREAD_PRIO 1
39
+ #define TCPIP_THREAD_PRIO (osPriorityNormal)
40
40
41
41
#define DEFAULT_THREAD_STACKSIZE 512
42
42
You can’t perform that action at this time.
0 commit comments