mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #32 from adamgreen/netPerfRobustness
Updates to network code to improve performance/robustnesspull/33/head
commit
ff55aa3e13
|
@ -428,10 +428,31 @@ static struct pbuf *lpc_low_level_input(struct netif *netif)
|
||||||
p = lpc_enetif->rxb[idx];
|
p = lpc_enetif->rxb[idx];
|
||||||
p->len = (u16_t) length;
|
p->len = (u16_t) length;
|
||||||
|
|
||||||
/* Free pbuf from desriptor */
|
/* Free pbuf from descriptor */
|
||||||
lpc_enetif->rxb[idx] = NULL;
|
lpc_enetif->rxb[idx] = NULL;
|
||||||
lpc_enetif->rx_free_descs++;
|
lpc_enetif->rx_free_descs++;
|
||||||
|
|
||||||
|
/* Attempt to queue new buffer(s) */
|
||||||
|
if (lpc_rx_queue(lpc_enetif->netif) == 0) {
|
||||||
|
/* Drop the frame due to OOM. */
|
||||||
|
LINK_STATS_INC(link.drop);
|
||||||
|
|
||||||
|
/* Re-queue the pbuf for receive */
|
||||||
|
lpc_rxqueue_pbuf(lpc_enetif, p);
|
||||||
|
|
||||||
|
LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
|
||||||
|
("lpc_low_level_input: Packet index %d dropped for OOM\n",
|
||||||
|
idx));
|
||||||
|
|
||||||
|
#ifdef LOCK_RX_THREAD
|
||||||
|
#if NO_SYS == 0
|
||||||
|
sys_mutex_unlock(&lpc_enetif->TXLockMutex);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
|
LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
|
||||||
("lpc_low_level_input: Packet received: %p, size %d (index=%d)\n",
|
("lpc_low_level_input: Packet received: %p, size %d (index=%d)\n",
|
||||||
p, length, idx));
|
p, length, idx));
|
||||||
|
@ -439,9 +460,6 @@ static struct pbuf *lpc_low_level_input(struct netif *netif)
|
||||||
/* Save size */
|
/* Save size */
|
||||||
p->tot_len = (u16_t) length;
|
p->tot_len = (u16_t) length;
|
||||||
LINK_STATS_INC(link.recv);
|
LINK_STATS_INC(link.recv);
|
||||||
|
|
||||||
/* Queue new buffer(s) */
|
|
||||||
lpc_rx_queue(lpc_enetif->netif);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ typedef struct {
|
||||||
osMessageQId id;
|
osMessageQId id;
|
||||||
osMessageQDef_t def;
|
osMessageQDef_t def;
|
||||||
#ifdef CMSIS_OS_RTX
|
#ifdef CMSIS_OS_RTX
|
||||||
uint32_t queue[MB_SIZE];
|
uint32_t queue[4+MB_SIZE]; /* The +4 is required for RTX OS_MCB overhead. */
|
||||||
#endif
|
#endif
|
||||||
} sys_mbox_t;
|
} sys_mbox_t;
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,14 @@
|
||||||
|
|
||||||
#define LWIP_RAW 0
|
#define LWIP_RAW 0
|
||||||
|
|
||||||
#define TCPIP_MBOX_SIZE 6
|
#define TCPIP_MBOX_SIZE 8
|
||||||
#define DEFAULT_TCP_RECVMBOX_SIZE 6
|
#define DEFAULT_TCP_RECVMBOX_SIZE 8
|
||||||
#define DEFAULT_UDP_RECVMBOX_SIZE 6
|
#define DEFAULT_UDP_RECVMBOX_SIZE 8
|
||||||
#define DEFAULT_RAW_RECVMBOX_SIZE 6
|
#define DEFAULT_RAW_RECVMBOX_SIZE 8
|
||||||
#define DEFAULT_ACCEPTMBOX_SIZE 6
|
#define DEFAULT_ACCEPTMBOX_SIZE 8
|
||||||
|
|
||||||
#define TCPIP_THREAD_STACKSIZE 1024
|
#define TCPIP_THREAD_STACKSIZE 1024
|
||||||
#define TCPIP_THREAD_PRIO 1
|
#define TCPIP_THREAD_PRIO (osPriorityNormal)
|
||||||
|
|
||||||
#define DEFAULT_THREAD_STACKSIZE 512
|
#define DEFAULT_THREAD_STACKSIZE 512
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue