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 <simon.kuenzer@neclab.eu>
Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
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
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,