From: Simon Kuenzer Date: Wed, 2 Dec 2020 23:32:14 +0000 (+0100) Subject: Option to force polling mode X-Git-Tag: RELEASE-0.5^0 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0330ef2df069d5d1a76abf2c3477201dbece7868;p=unikraft%2Flibs%2Flwip.git Option to force polling mode Introduces an option to force polling mode for uknetdev devices irrespective if the device supports interrupt-driven mode. Because this option always causes 100% CPU utilization it should be considered as workaround for cases where interrupt-based handling performs badly. Signed-off-by: Simon Kuenzer Reviewed-by: Cezar Craciunoiu --- diff --git a/Config.uk b/Config.uk index 658e272..6d1fdb1 100644 --- a/Config.uk +++ b/Config.uk @@ -23,6 +23,20 @@ config LWIP_UKNETDEV driver does not support receive interrupts the network interfaces have to be polled manually (uknetdev_poll()). +if LWIP_UKNETDEV +config LWIP_UKNETDEV_POLLONLY + depends on LWIP_THREADS + bool "Force polling mode (workaround)" + default n + help + This option forces polling mode for uknetdev devices + irrespective if the device supports interrupt-driven + mode. + Because this option always causes 100% CPU utilization + it should be considered as workaround for cases where + interrupt-based handling performs badly. +endif + config LWIP_UKNETDEV_SCRATCH int default 64 diff --git a/uknetdev.c b/uknetdev.c index 0524f12..b665830 100644 --- a/uknetdev.c +++ b/uknetdev.c @@ -477,6 +477,10 @@ err_t uknetdev_init(struct netif *nf) if (!lwip_data->dev_info.max_rx_queues || !lwip_data->dev_info.max_tx_queues) return ERR_IF; +#if CONFIG_LWIP_UKNETDEV_POLLONLY + /* Unset receive interrupt support: We force polling mode */ + lwip_data->dev_info.features &= ~UK_FEATURE_RXQ_INTR_AVAILABLE; +#endif /* CONFIG_LWIP_UKNETDEV_POLLONLY */ lwip_data->pkt_a = a; LWIP_DEBUGF(NETIF_DEBUG,