mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
add the support of LWIP_TCPIP_CORE_LOCKING_INPUT
- LWIP_TCPIP_CORE_LOCKING_INPUT promise a better performance because it reduce the number of context switches between LWIP and main thread - enable this feature in lwipopts.h
This commit is contained in:
parent
3f5e31f070
commit
8dcd5411fc
3 changed files with 15 additions and 4 deletions
|
@ -849,11 +849,16 @@ static void mmnif_irqhandler(struct state* s)
|
|||
|
||||
mmnif = (mmnif_t *) mmnif_dev->state;
|
||||
if (!mmnif->check_in_progress) {
|
||||
#if LWIP_TCPIP_CORE_LOCKING_INPUT
|
||||
mmnif->check_in_progress = 1;
|
||||
mmnif_rx(mmnif_dev);
|
||||
#else
|
||||
if (tcpip_callback_with_block((tcpip_callback_fn) mmnif_rx, (void*) mmnif_dev, 0) == ERR_OK) {
|
||||
mmnif->check_in_progress = 1;
|
||||
} else {
|
||||
DEBUGPRINTF("rckemacif_handler: unable to send a poll request to the tcpip thread\n");
|
||||
DEBUGPRINTF("mmnif_handler: unable to send a poll request to the tcpip thread\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,10 +172,16 @@ static int init_netifs(void)
|
|||
* - gw : the gateway wicht should be used
|
||||
* - mmnif_init : the initialization which has to be done in order to use our interface
|
||||
* - ip_input : tells him that he should use ip_input
|
||||
*
|
||||
*/
|
||||
#if LWIP_TCPIP_CORE_LOCKING_INPUT
|
||||
if ((err = netifapi_netif_add(&mmnif_netif, &ipaddr, &netmask, &gw, NULL, mmnif_init, tcpip_input)) != ERR_OK)
|
||||
#else
|
||||
/*
|
||||
* Note: Our drivers guarantee that the input function will be called in the context of the tcpip thread.
|
||||
* => Therefore, we are able to use ip_input instead of tcpip_input */
|
||||
* => Therefore, we are able to use ip_input instead of tcpip_input
|
||||
*/
|
||||
if ((err = netifapi_netif_add(&mmnif_netif, &ipaddr, &netmask, &gw, NULL, mmnif_init, ip_input)) != ERR_OK)
|
||||
#endif
|
||||
{
|
||||
kprintf("Unable to add the intra network interface: err = %d\n", err);
|
||||
return -ENODEV;
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 3a11d42097b7008ffd1b3ceac1e414dcc74a2228
|
||||
Subproject commit 12edcefed1a4e30a91ff969b5aa4630b2f7c7651
|
Loading…
Add table
Reference in a new issue