From 09f4dee6bc095000fd8772bece2409c688e1b0df Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 21 Nov 2018 07:57:26 -0600 Subject: [PATCH] All network drivers! Change pre-processor logic that selects the high priority work queue or gives preferential treatment to the high priority work. All network logic must run on the low priority work queue! Or suffer the consequences. --- arch/arm/src/c5471/Kconfig | 19 ---- arch/arm/src/c5471/c5471_ethernet.c | 25 ++--- arch/arm/src/kinetis/Kconfig | 20 ---- arch/arm/src/kinetis/kinetis_enet.c | 22 ++-- arch/arm/src/lpc17xx/Kconfig | 19 ---- arch/arm/src/lpc17xx/lpc17_ethernet.c | 24 ++--- arch/arm/src/lpc43xx/Kconfig | 20 ---- arch/arm/src/lpc43xx/lpc43_ethernet.c | 22 ++-- arch/arm/src/lpc54xx/lpc54_ethernet.c | 5 + arch/arm/src/sam34/Kconfig | 20 ---- arch/arm/src/sam34/sam_emac.c | 22 ++-- arch/arm/src/sama5/Kconfig | 60 ----------- arch/arm/src/sama5/sam_emaca.c | 22 ++-- arch/arm/src/sama5/sam_emacb.c | 24 ++--- arch/arm/src/sama5/sam_gmac.c | 22 ++-- arch/arm/src/samv7/Kconfig | 20 ---- arch/arm/src/samv7/sam_emac.c | 22 ++-- arch/arm/src/stm32/Kconfig | 20 ---- arch/arm/src/stm32/stm32_eth.c | 22 ++-- arch/arm/src/stm32f7/Kconfig | 20 ---- arch/arm/src/stm32f7/stm32_ethernet.c | 22 ++-- arch/arm/src/tiva/Kconfig | 40 ------- arch/arm/src/tiva/lm3s_ethernet.c | 25 ++--- arch/arm/src/tiva/tm4c_ethernet.c | 22 ++-- arch/mips/src/pic32mx/Kconfig | 20 ---- arch/mips/src/pic32mx/pic32mx-ethernet.c | 24 ++--- arch/mips/src/pic32mz/Kconfig | 20 ---- arch/mips/src/pic32mz/pic32mz-ethernet.c | 24 ++--- arch/z80/src/ez80/Kconfig | 20 ---- arch/z80/src/ez80/ez80_emac.c | 25 ++--- drivers/net/Kconfig | 101 ------------------ drivers/net/dm90x0.c | 27 ++--- drivers/net/enc28j60.c | 21 ++-- drivers/net/encx24j600.c | 21 ++-- drivers/net/ftmac100.c | 22 ++-- drivers/net/lan91c111.c | 22 ++-- drivers/net/tun.c | 20 ++-- drivers/usbdev/cdcecm.c | 5 +- drivers/wireless/ieee80211/Kconfig | 20 ---- drivers/wireless/ieee80211/bcmf_netdev.c | 22 ++-- drivers/wireless/ieee802154/xbee/Kconfig | 28 ----- .../wireless/ieee802154/xbee/xbee_netdev.c | 22 ++-- net/Kconfig | 19 ---- wireless/ieee802154/Kconfig | 49 --------- wireless/ieee802154/mac802154_loopback.c | 21 ++-- wireless/ieee802154/mac802154_netdev.c | 24 ++--- 46 files changed, 310 insertions(+), 826 deletions(-) diff --git a/arch/arm/src/c5471/Kconfig b/arch/arm/src/c5471/Kconfig index 5f46d7684a..937aa246a5 100644 --- a/arch/arm/src/c5471/Kconfig +++ b/arch/arm/src/c5471/Kconfig @@ -111,22 +111,3 @@ config C5471_BASET10 endchoice -choice - prompt "Ethernet work queue" - default C5471_LPWORK if SCHED_LPWORK - default C5471_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config C5471_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config C5471_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue diff --git a/arch/arm/src/c5471/c5471_ethernet.c b/arch/arm/src/c5471/c5471_ethernet.c index 03ba03820f..0d518633a7 100644 --- a/arch/arm/src/c5471/c5471_ethernet.c +++ b/arch/arm/src/c5471/c5471_ethernet.c @@ -1,7 +1,8 @@ /**************************************************************************** * arch/arm/src/c5471/c5471_ethernet.c * - * Copyright (C) 2007, 2009-2010, 2014-2015, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009-2010, 2014-2015, 2017-2018 Gregory Nutt. All + * rights reserved. * Author: Gregory Nutt * * Based one a C5471 Linux driver and released under this BSD license with @@ -82,19 +83,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the low priority work queue if possible */ - -# if defined(CONFIG_C5471_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_C5471_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_C5471_HPWORK nor CONFIG_C5471_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* CONFIG_C5471_NET_NINTERFACES determines the number of physical interfaces * that will be supported. */ diff --git a/arch/arm/src/kinetis/Kconfig b/arch/arm/src/kinetis/Kconfig index 0f66ace027..0ca9414a26 100644 --- a/arch/arm/src/kinetis/Kconfig +++ b/arch/arm/src/kinetis/Kconfig @@ -945,26 +945,6 @@ config KINETIS_EMAC_RMIICLK1588CLKIN bool "Use ENET_1588_CLKIN for RMII Clock" endchoice # RMII Clock Source - -choice - prompt "Work queue" - default KINETIS_EMAC_LPWORK if SCHED_LPWORK - default KINETIS_EMAC_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config KINETIS_EMAC_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config KINETIS_EMAC_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue endmenu # Kinetis Ethernet Configuration menu "Kinetis SDHC Configuration" diff --git a/arch/arm/src/kinetis/kinetis_enet.c b/arch/arm/src/kinetis/kinetis_enet.c index 11836da2ca..71fe0940a7 100644 --- a/arch/arm/src/kinetis/kinetis_enet.c +++ b/arch/arm/src/kinetis/kinetis_enet.c @@ -85,19 +85,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_KINETIS_EMAC_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_KINETIS_EMAC_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_KINETIS_EMAC_HPWORK nor CONFIG_KINETIS_EMAC_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* CONFIG_KINETIS_ENETNETHIFS determines the number of physical interfaces * that will be supported. */ diff --git a/arch/arm/src/lpc17xx/Kconfig b/arch/arm/src/lpc17xx/Kconfig index f130622d93..b021c08bca 100644 --- a/arch/arm/src/lpc17xx/Kconfig +++ b/arch/arm/src/lpc17xx/Kconfig @@ -724,25 +724,6 @@ config LPC17_MULTICAST Enable receipt of multicast (and unicast) frames. Automatically set if NET_MCASTGROUP is selected. -choice - prompt "Work queue" - default LPC17_ETHERNET_LPWORK if SCHED_LPWORK - default LPC17_ETHERNET_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config LPC17_ETHERNET_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config LPC17_ETHERNET_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue endmenu menu "LCD device driver options" diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index ccf843591d..89fe89d6b0 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc17xx/lpc17_ethernet.c * - * Copyright (C) 2010-2015, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2015, 2017-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -86,19 +86,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_LPC17_ETHERNET_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_LPC17_ETHERNET_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_LPC17_ETHERNET_HPWORK nor CONFIG_LPC17_ETHERNET_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* CONFIG_LPC17_NINTERFACES determines the number of physical interfaces * that will be supported -- unless it is more than actually supported by the * hardware! diff --git a/arch/arm/src/lpc43xx/Kconfig b/arch/arm/src/lpc43xx/Kconfig index 71d2e13743..39a6c36c3c 100644 --- a/arch/arm/src/lpc43xx/Kconfig +++ b/arch/arm/src/lpc43xx/Kconfig @@ -658,26 +658,6 @@ config LPC43_RMII bool default y if !LPC43_MII -choice - prompt "Work queue" - default LPC43_ETHERNET_LPWORK if SCHED_LPWORK - default LPC43_ETHERNET_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config LPC43_ETHERNET_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config LPC43_ETHERNET_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config LPC43_ETHERNET_REGDEBUG bool "Register-Level Debug" default n diff --git a/arch/arm/src/lpc43xx/lpc43_ethernet.c b/arch/arm/src/lpc43xx/lpc43_ethernet.c index 69f1eaef13..135b871f3d 100644 --- a/arch/arm/src/lpc43xx/lpc43_ethernet.c +++ b/arch/arm/src/lpc43xx/lpc43_ethernet.c @@ -85,19 +85,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_LPC43_ETHERNET_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_LPC43_ETHERNET_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_LPC43_ETHERNET_HPWORK nor CONFIG_LPC43_ETHERNET_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + #ifndef CONFIG_LPC43_PHYADDR # error "CONFIG_LPC43_PHYADDR must be defined in the NuttX configuration" #endif diff --git a/arch/arm/src/lpc54xx/lpc54_ethernet.c b/arch/arm/src/lpc54xx/lpc54_ethernet.c index 7548f1cb61..1f039902f1 100644 --- a/arch/arm/src/lpc54xx/lpc54_ethernet.c +++ b/arch/arm/src/lpc54xx/lpc54_ethernet.c @@ -123,6 +123,11 @@ /* The low priority work queue is preferred. If it is not enabled, LPWORK * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! */ #define ETHWORK LPWORK diff --git a/arch/arm/src/sam34/Kconfig b/arch/arm/src/sam34/Kconfig index f93eef1c99..6f19e21f37 100644 --- a/arch/arm/src/sam34/Kconfig +++ b/arch/arm/src/sam34/Kconfig @@ -1376,26 +1376,6 @@ config SAM34_EMAC_ISETH0 bool default y -choice - prompt "Work queue" - default SAM34_EMAC_LPWORK if SCHED_LPWORK - default SAM34_EMAC_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config SAM34_EMAC_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config SAM34_EMAC_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config SAM34_EMAC_REGDEBUG bool "Register-Level Debug" default n diff --git a/arch/arm/src/sam34/sam_emac.c b/arch/arm/src/sam34/sam_emac.c index b5677cd42a..19b25c32d0 100644 --- a/arch/arm/src/sam34/sam_emac.c +++ b/arch/arm/src/sam34/sam_emac.c @@ -99,19 +99,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_SAM34_EMAC_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_SAM34_EMAC_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_SAM34_EMAC_HPWORK nor CONFIG_SAM34_EMAC_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* Number of buffer for RX */ #ifndef CONFIG_SAM34_EMAC_NRXBUFFERS diff --git a/arch/arm/src/sama5/Kconfig b/arch/arm/src/sama5/Kconfig index a794b4fe4c..d6c158f57b 100644 --- a/arch/arm/src/sama5/Kconfig +++ b/arch/arm/src/sama5/Kconfig @@ -1448,26 +1448,6 @@ config SAMA5_GMAC_NBC ---help--- Select to disable receipt of broadcast packets. -choice - prompt "Work queue" - default SAMA5_GMAC_LPWORK if SCHED_LPWORK - default SAMA5_GMAC_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config SAMA5_GMAC_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config SAMA5_GMAC_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config SAMA5_GMAC_PHYADDR int "PHY address" default 1 @@ -1706,26 +1686,6 @@ config SAMA5_EMACA_NBC ---help--- Select to disable receipt of broadcast packets. -choice - prompt "Work queue" - default SAMA5_EMACA_LPWORK if SCHED_LPWORK - default SAMA5_EMACA_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config SAMA5_EMACA_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config SAMA5_EMACA_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config SAMA5_EMACA_REGDEBUG bool "Register-Level Debug" default n @@ -2119,26 +2079,6 @@ config SAMA5_EMACB_NBC ---help--- Select to disable receipt of broadcast packets. -choice - prompt "Work queue" - default SAMA5_EMACB_LPWORK if SCHED_LPWORK - default SAMA5_EMACB_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config SAMA5_EMACB_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config SAMA5_EMACB_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config SAMA5_EMACB_DEBUG bool "Force EMAC0/1 DEBUG" default n diff --git a/arch/arm/src/sama5/sam_emaca.c b/arch/arm/src/sama5/sam_emaca.c index e70eef75e0..9d940a7a98 100644 --- a/arch/arm/src/sama5/sam_emaca.c +++ b/arch/arm/src/sama5/sam_emaca.c @@ -101,19 +101,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_SAMA5_EMACA_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_SAMA5_EMACA_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_SAMA5_EMACA_HPWORK nor CONFIG_SAMA5_EMACA_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* Number of buffers for RX */ #ifndef CONFIG_SAMA5_EMAC_NRXBUFFERS diff --git a/arch/arm/src/sama5/sam_emacb.c b/arch/arm/src/sama5/sam_emacb.c index 0b01542878..d382186388 100644 --- a/arch/arm/src/sama5/sam_emacb.c +++ b/arch/arm/src/sama5/sam_emacb.c @@ -8,7 +8,7 @@ * separate (mostly because the 'B' driver needs to support two EMAC blocks. * But the 'B' driver should replace the 'A' driver someday. * - * Copyright (C) 2014-2015, 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2014-2015, 2017-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * This logic derives from the SAM4E Ethernet driver which, in turn, derived @@ -115,19 +115,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_SAMA5_EMACB_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_SAMA5_EMACB_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_SAMA5_EMACB_HPWORK nor CONFIG_SAMA5_EMACB_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* EMAC0 Configuration ******************************************************/ #ifdef CONFIG_SAMA5_EMAC0 diff --git a/arch/arm/src/sama5/sam_gmac.c b/arch/arm/src/sama5/sam_gmac.c index 40a18d1c51..ac409c53f4 100644 --- a/arch/arm/src/sama5/sam_gmac.c +++ b/arch/arm/src/sama5/sam_gmac.c @@ -98,19 +98,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_SAMA5_GMAC_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_SAMA5_GMAC_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_SAMA5_GMAC_HPWORK nor CONFIG_SAMA5_GMAC_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* Number of buffer for RX */ #ifndef CONFIG_SAMA5_GMAC_NRXBUFFERS diff --git a/arch/arm/src/samv7/Kconfig b/arch/arm/src/samv7/Kconfig index f542709311..868dcb84e9 100644 --- a/arch/arm/src/samv7/Kconfig +++ b/arch/arm/src/samv7/Kconfig @@ -2010,26 +2010,6 @@ config SAMV7_EMAC_NBC ---help--- Select to disable receipt of broadcast packets. -choice - prompt "Work queue" - default SAMV7_EMAC_LPWORK if SCHED_LPWORK - default SAMV7_EMAC_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config SAMV7_EMAC_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config SAMV7_EMAC_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config SAMV7_EMAC_DEBUG bool "Force EMAC0/1 DEBUG" default n diff --git a/arch/arm/src/samv7/sam_emac.c b/arch/arm/src/samv7/sam_emac.c index 41866e440c..7bfd212c1a 100644 --- a/arch/arm/src/samv7/sam_emac.c +++ b/arch/arm/src/samv7/sam_emac.c @@ -106,19 +106,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_SAMV7_EMAC_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_SAMV7_EMAC_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_SAMV7_EMAC_HPWORK nor CONFIG_SAMV7_EMAC_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* EMAC0 Configuration ******************************************************/ #ifdef CONFIG_SAMV7_EMAC0 diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index 5b500c1b90..cbee77c520 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -9097,26 +9097,6 @@ config STM32_RMII_EXTCLK endchoice -choice - prompt "Work queue" - default STM32_ETHMAC_LPWORK if SCHED_LPWORK - default STM32_ETHMAC_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config STM32_ETHMAC_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config STM32_ETHMAC_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config STM32_ETHMAC_REGDEBUG bool "Register-Level Debug" default n diff --git a/arch/arm/src/stm32/stm32_eth.c b/arch/arm/src/stm32/stm32_eth.c index 0a21496c3f..d9f7fde528 100644 --- a/arch/arm/src/stm32/stm32_eth.c +++ b/arch/arm/src/stm32/stm32_eth.c @@ -96,19 +96,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_STM32_ETHMAC_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_STM32_ETHMAC_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_STM32_ETHMAC_HPWORK nor CONFIG_STM32_ETHMAC_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + #if !defined(CONFIG_STM32_SYSCFG) && !defined(CONFIG_STM32_CONNECTIVITYLINE) # error "CONFIG_STM32_SYSCFG must be defined in the NuttX configuration" #endif diff --git a/arch/arm/src/stm32f7/Kconfig b/arch/arm/src/stm32f7/Kconfig index d64dcdbdcf..27558745a7 100644 --- a/arch/arm/src/stm32f7/Kconfig +++ b/arch/arm/src/stm32f7/Kconfig @@ -4939,26 +4939,6 @@ config STM32F7_RMII_EXTCLK endchoice # RMII clock configuration -choice - prompt "Work queue" - default STM32F7_ETHMAC_LPWORK if SCHED_LPWORK - default STM32F7_ETHMAC_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config STM32F7_ETHMAC_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config STM32F7_ETHMAC_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config STM32F7_ETHMAC_REGDEBUG bool "Register-Level Debug" default n diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index 7c1f454557..d22c8122a0 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -102,19 +102,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_STM32F7_ETHMAC_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_STM32F7_ETHMAC_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_STM32F7_ETHMAC_HPWORK nor CONFIG_STM32F7_ETHMAC_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + #ifndef CONFIG_STM32F7_PHYADDR # error "CONFIG_STM32F7_PHYADDR must be defined in the NuttX configuration" #endif diff --git a/arch/arm/src/tiva/Kconfig b/arch/arm/src/tiva/Kconfig index 498f10c4b7..68875778ef 100644 --- a/arch/arm/src/tiva/Kconfig +++ b/arch/arm/src/tiva/Kconfig @@ -932,26 +932,6 @@ config TIVA_BADCRC ---help--- Set to enable bad CRC rejection. -choice - prompt "Work queue" - default LM3S_ETHERNET_LPWORK if SCHED_LPWORK - default LM3S_ETHERNET_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config LM3S_ETHERNET_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config LM3S_ETHERNET_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config TIVA_DUMPPACKET bool "Dump Packets" default n @@ -1141,26 +1121,6 @@ config TIVA_EMAC_HWCHECKSUM ---help--- Use the hardware checksum capabilities of the Tiva chip -choice - prompt "Work queue" - default TIVA_ETHERNET_LPWORK if SCHED_LPWORK - default TIVA_ETHERNET_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config TIVA_ETHERNET_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config TIVA_ETHERNET_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config TIVA_ETHERNET_REGDEBUG bool "Register-Level Debug" default n diff --git a/arch/arm/src/tiva/lm3s_ethernet.c b/arch/arm/src/tiva/lm3s_ethernet.c index 50390c03fc..e5157695ff 100644 --- a/arch/arm/src/tiva/lm3s_ethernet.c +++ b/arch/arm/src/tiva/lm3s_ethernet.c @@ -1,7 +1,8 @@ /**************************************************************************** * arch/arm/src/tiva/lm3s_ethernet.c * - * Copyright (C) 2009-2010, 2014, 2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2014, 2016, 2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -79,19 +80,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the low priority work queue if possible */ - -# if defined(CONFIG_LM3S_ETHERNET_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_LM3S_ETHERNET_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_LM3S_ETHERNET_HPWORK nor CONFIG_LM3S_ETHERNET_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* Half duplex can be forced if CONFIG_TIVA_ETHHDUPLEX is defined. */ #ifdef CONFIG_TIVA_ETHHDUPLEX diff --git a/arch/arm/src/tiva/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c_ethernet.c index 5dfc3949de..5252ff057a 100644 --- a/arch/arm/src/tiva/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c_ethernet.c @@ -100,19 +100,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required -#else - - /* Select work queue */ - -# if defined(CONFIG_TIVA_ETHERNET_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_TIVA_ETHERNET_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_TIVA_ETHERNET_HPWORK nor CONFIG_TIVA_ETHERNET_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* Are we using the internal PHY or an external PHY? */ #if defined(CONFIG_TIVA_PHY_INTERNAL) diff --git a/arch/mips/src/pic32mx/Kconfig b/arch/mips/src/pic32mx/Kconfig index 494b76311f..4f57062327 100644 --- a/arch/mips/src/pic32mx/Kconfig +++ b/arch/mips/src/pic32mx/Kconfig @@ -1095,26 +1095,6 @@ config PIC32MX_MULTICAST Enable receipt of multicast (and unicast) frames. Automatically set if NET_MCASTGROUP is selected. -choice - prompt "Work queue" - default PIC32MX_ETHERNET_LPWORK if SCHED_LPWORK - default PIC32MX_ETHERNET_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config PIC32MX_ETHERNET_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config PIC32MX_ETHERNET_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config NET_REGDEBUG bool "Register level debug" default n diff --git a/arch/mips/src/pic32mx/pic32mx-ethernet.c b/arch/mips/src/pic32mx/pic32mx-ethernet.c index cabe4877c1..e81dbdabe0 100644 --- a/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/pic32mx/pic32mx_ethernet.c * - * Copyright (C) 2012, 2014-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * This driver derives from the PIC32MX Ethernet Driver @@ -88,19 +88,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the low priority work queue if possible */ - -# if defined(CONFIG_PIC32MX_ETHERNET_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_PIC32MX_ETHERNET_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_PIC32MX_ETHERNET_HPWORK nor CONFIG_PIC32MX_ETHERNET_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* CONFIG_PIC32MX_NINTERFACES determines the number of physical interfaces * that will be supported -- unless it is more than actually supported by the * hardware! diff --git a/arch/mips/src/pic32mz/Kconfig b/arch/mips/src/pic32mz/Kconfig index d8da5b5c9a..8db953ea86 100644 --- a/arch/mips/src/pic32mz/Kconfig +++ b/arch/mips/src/pic32mz/Kconfig @@ -422,26 +422,6 @@ config PIC32MZ_MULTICAST Enable receipt of multicast (and unicast) frames. Automatically set if NET_MCASTGROUP is selected. -choice - prompt "Work queue" - default PIC32MZ_ETHERNET_LPWORK if SCHED_LPWORK - default PIC32MZ_ETHERNET_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config PIC32MZ_ETHERNET_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config PIC32MZ_ETHERNET_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config NET_REGDEBUG bool "Register level debug" default n diff --git a/arch/mips/src/pic32mz/pic32mz-ethernet.c b/arch/mips/src/pic32mz/pic32mz-ethernet.c index e49fb8c626..76f06a90e3 100644 --- a/arch/mips/src/pic32mz/pic32mz-ethernet.c +++ b/arch/mips/src/pic32mz/pic32mz-ethernet.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/pic32mz/pic32mz_ethernet.c * - * Copyright (C) 2015-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * This driver derives from the PIC32MZ Ethernet Driver @@ -88,19 +88,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the low priority work queue if possible */ - -# if defined(CONFIG_PIC32MZ_ETHERNET_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_PIC32MZ_ETHERNET_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_PIC32MZ_ETHERNET_HPWORK nor CONFIG_PIC32MZ_ETHERNET_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + /* CONFIG_PIC32MZ_NINTERFACES determines the number of physical interfaces * that will be supported -- unless it is more than actually supported by the * hardware! diff --git a/arch/z80/src/ez80/Kconfig b/arch/z80/src/ez80/Kconfig index 759160a512..7529e2c7ad 100644 --- a/arch/z80/src/ez80/Kconfig +++ b/arch/z80/src/ez80/Kconfig @@ -117,26 +117,6 @@ config ARCH_MCFILTER ---help--- Enables multicast MAC address filtering (not fully implemented) -choice - prompt "Work queue" - default EZ80_EMAC_LPWORK if SCHED_LPWORK - default EZ80_EMAC_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config EZ80_EMAC_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config EZ80_EMAC_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - endif # EZ80_EMAC config ARCH_TIMERHOOK diff --git a/arch/z80/src/ez80/ez80_emac.c b/arch/z80/src/ez80/ez80_emac.c index 26f4040f3c..65aeee458b 100644 --- a/arch/z80/src/ez80/ez80_emac.c +++ b/arch/z80/src/ez80/ez80_emac.c @@ -1,7 +1,8 @@ /**************************************************************************** * arch/z80/src/ez80/ez80_emac.c * - * Copyright (C) 2009-2010, 2012, 2014-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2012, 2014-2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * References: @@ -82,19 +83,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the low priority work queue if possible */ - -# if defined(CONFIG_EZ80_EMAC_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_EZ80_EMAC_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_EZ80_EMAC_HPWORK nor CONFIG_EZ80_EMAC_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + #ifndef CONFIG_EZ80_RAMADDR # define CONFIG_EZ80_RAMADDR EZ80_EMACSRAM #endif diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 59faf9e681..3374a63a27 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -141,26 +141,6 @@ config DM9X_NINTERFACES default 1 depends on EXPERIMENTAL -choice - prompt "Work queue" - default DM9X_LPWORK if SCHED_LPWORK - default DM9X_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config DM9X_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config DM9X_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - endif # NET_DM90x0 menuconfig ENC28J60 @@ -199,26 +179,6 @@ config ENC28J60_FREQUENCY ---help--- Define to use a different bus frequency -choice - prompt "Work queue" - default ENC28J60_LPWORK if SCHED_LPWORK - default ENC28J60_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the ENC28J60 driver. If the - low priority work queue is available, then it should be used by the - ENC28J60 driver. - -config ENC28J60_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config ENC28J60_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config ENC28J60_HALFDUPPLEX bool "Enable half dupplex" default n @@ -287,26 +247,6 @@ config ENCX24J600_NRXDESCR The ENC has a relative large packet buffer of 24kB which can be used to buffer multiple packets simutaneously -choice - prompt "Work queue" - default ENCX24J600_LPWORK if SCHED_LPWORK - default ENCX24J600_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the ENCX24J600 driver. If the - low priority work queue is available, then it should be used by the - ENCX24J600 driver. - -config ENCX24J600_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config ENCX24J600_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config ENCX24J600_DUMPPACKET bool "Dump Packets" default n @@ -381,26 +321,6 @@ config FTMAC100_MAC0_ENV_ADDR hex "MAC0 address location" default 0 -choice - prompt "Work queue" - default FTMAC100_LPWORK if SCHED_LPWORK - default FTMAC100_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the FTMAC100 driver. If the - low priority work queue is available, then it should be used by the - FTMAC100 driver. - -config FTMAC100_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config FTMAC100_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - endif # NET_FTMAC100 menuconfig NET_LAN91C111 @@ -412,27 +332,6 @@ menuconfig NET_LAN91C111 DS00002276A, 2016 Microchip Technology Inc. if NET_LAN91C111 - -choice - prompt "Work queue" - default LAN91C111_LPWORK if SCHED_LPWORK - default LAN91C111_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the Ethernet driver. If the - low priority work queue is available, then it should be used by the - driver. - -config LAN91C111_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config LAN91C111_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - endif # NET_LAN91C111 if ARCH_HAVE_PHY diff --git a/drivers/net/dm90x0.c b/drivers/net/dm90x0.c index eaa69e6468..328df0f2b4 100644 --- a/drivers/net/dm90x0.c +++ b/drivers/net/dm90x0.c @@ -1,7 +1,8 @@ /**************************************************************************** * drivers/net/dm90x0.c * - * Copyright (C) 2007-2010, 2014-2016 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2010, 2014-2016, 2018 Gregory Nutt. All rights + * reserved. * Author: Gregory Nutt * * References: Davicom data sheets (DM9000-DS-F03-041906.pdf, @@ -82,20 +83,20 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the low priority work queue if possible */ - -# if defined(CONFIG_DM9X_HPWORK) -# define ETHWORK HPWORK -# elif defined(CONFIG_DM9X_LPWORK) -# define ETHWORK LPWORK -# else -# error Neither CONFIG_DM9X_HPWORK nor CONFIG_DM9X_LPWORK defined -# endif #endif -/* DM90000 and DM9010 register offets */ +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ETHWORK LPWORK + +/* DM90000 and DM9010 register offsets */ #define DM9X_NETC 0x00 /* Network control register */ #define DM9X_NETS 0x01 /* Network Status register */ diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index fb6afa3f1e..9ea1377d08 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/net/enc28j60.c * - * Copyright (C) 2010-2012, 2014-2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2012, 2014-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: @@ -117,16 +117,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error "Worker thread support is required (CONFIG_SCHED_WORKQUEUE)" -#else -# if defined(CONFIG_ENC28J60_HPWORK) -# define ENCWORK HPWORK -# elif defined(CONFIG_ENC28J60_LPWORK) -# define ENCWORK LPWORK -# else -# error "Neither CONFIG_ENC28J60_HPWORK nor CONFIG_ENC28J60_LPWORK defined" -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ENCWORK LPWORK + /* CONFIG_ENC28J60_DUMPPACKET will dump the contents of each packet to the console. */ #ifdef CONFIG_ENC28J60_DUMPPACKET diff --git a/drivers/net/encx24j600.c b/drivers/net/encx24j600.c index f5c35b4b22..4e62cc11ff 100644 --- a/drivers/net/encx24j600.c +++ b/drivers/net/encx24j600.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/net/encx24j600.c * - * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017-2018 Gregory Nutt. All rights reserved. * Copyright (C) 2013-2014 UVC Ingenieure. All rights reserved. * Author: Max Holtzberg * @@ -123,16 +123,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error "Worker thread support is required (CONFIG_SCHED_WORKQUEUE)" -#else -# if defined(CONFIG_ENCX24J600_HPWORK) -# define ENCWORK HPWORK -# elif defined(CONFIG_ENCX24J600_LPWORK) -# define ENCWORK LPWORK -# else -# error "Neither CONFIG_ENCX24J600_HPWORK nor CONFIG_ENCX24J600_LPWORK defined" -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define ENCWORK LPWORK + /* CONFIG_ENCX24J600_DUMPPACKET will dump the contents of each packet to the console. */ #ifdef CONFIG_ENCX24J600_DUMPPACKET diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index 30b0428b6d..ad36aa13ce 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c @@ -74,19 +74,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the low priority work queue if possible */ - -# if defined(CONFIG_FTMAC100_HPWORK) -# define FTMAWORK HPWORK -# elif defined(CONFIG_FTMAC100_LPWORK) -# define FTMAWORK LPWORK -# else -# error Neither CONFIG_FTMAC100_HPWORK nor CONFIG_FTMAC100_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define FTMAWORK LPWORK + /* CONFIG_FTMAC100_NINTERFACES determines the number of physical interfaces * that will be supported. */ diff --git a/drivers/net/lan91c111.c b/drivers/net/lan91c111.c index 63107f13e4..1a60f5788e 100644 --- a/drivers/net/lan91c111.c +++ b/drivers/net/lan91c111.c @@ -64,19 +64,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - -/* Use the selected work queue */ - -# if defined(CONFIG_LAN91C111_HPWORK) -# define LAN91C111_WORK HPWORK -# elif defined(CONFIG_LAN91C111_LPWORK) -# define LAN91C111_WORK LPWORK -# else -# error Neither CONFIG_LAN91C111_HPWORK nor CONFIG_LAN91C111_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define LAN91C111_WORK LPWORK + #ifdef CONFIG_NET_DUMPPACKET # define lan91c111_dumppacket lib_dumpbuffer #else diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 5c977a2395..988e5fd43f 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -81,17 +81,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - -# if defined(CONFIG_TUN_HPWORK) -# define TUNWORK HPWORK -# elif defined(CONFIG_TUN_LPWORK) -# define TUNWORK LPWORK -# else -# error "Neither CONFIG_TUN_HPWORK nor CONFIG_TUN_LPWORK defined" -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define TUNWORK LPWORK + /* CONFIG_TUN_NINTERFACES determines the number of physical interfaces * that will be supported. */ diff --git a/drivers/usbdev/cdcecm.c b/drivers/usbdev/cdcecm.c index bf7bb66afc..7060dc976f 100644 --- a/drivers/usbdev/cdcecm.c +++ b/drivers/usbdev/cdcecm.c @@ -93,7 +93,7 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else +#endif /* The low priority work queue is preferred. If it is not enabled, LPWORK * will be the same as HPWORK. NOTE: Use of the high priority work queue will @@ -101,8 +101,7 @@ * performance. This should be avoided. */ -# define ETHWORK LPWORK -#endif +#define ETHWORK LPWORK /* CONFIG_CDCECM_NINTERFACES determines the number of physical interfaces * that will be supported. diff --git a/drivers/wireless/ieee80211/Kconfig b/drivers/wireless/ieee80211/Kconfig index bcc7455772..f500621778 100644 --- a/drivers/wireless/ieee80211/Kconfig +++ b/drivers/wireless/ieee80211/Kconfig @@ -98,26 +98,6 @@ config IEEE80211_BROADCOM_FULLMAC_SDIO if IEEE80211_BROADCOM_FULLMAC -choice - prompt "Broadcom FullMAC driver work queue" - default IEEE80211_BROADCOM_LPWORK if SCHED_LPWORK - default IEEE80211_BROADCOM_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the loopback driver. If the - low priority work queue is available, then it should be used by the - loopback driver. - -config IEEE80211_BROADCOM_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config IEEE80211_BROADCOM_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config IEEE80211_BROADCOM_NINTERFACES int "Number of Broadcom FullMAC interfaces" default 1 diff --git a/drivers/wireless/ieee80211/bcmf_netdev.c b/drivers/wireless/ieee80211/bcmf_netdev.c index c530d899ac..a0f6ef55c0 100644 --- a/drivers/wireless/ieee80211/bcmf_netdev.c +++ b/drivers/wireless/ieee80211/bcmf_netdev.c @@ -77,19 +77,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the selected work queue */ - -# if defined(CONFIG_IEEE80211_BROADCOM_HPWORK) -# define BCMFWORK HPWORK -# elif defined(CONFIG_IEEE80211_BROADCOM_LPWORK) -# define BCMFWORK LPWORK -# else -# error Neither CONFIG_IEEE80211_BROADCOM_HPWORK nor CONFIG_IEEE80211_BROADCOM_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define BCMFWORK LPWORK + /* CONFIG_IEEE80211_BROADCOM_NINTERFACES determines the number of physical interfaces * that will be supported. */ diff --git a/drivers/wireless/ieee802154/xbee/Kconfig b/drivers/wireless/ieee802154/xbee/Kconfig index 5edea5770c..8fff3bc88f 100644 --- a/drivers/wireless/ieee802154/xbee/Kconfig +++ b/drivers/wireless/ieee802154/xbee/Kconfig @@ -11,34 +11,6 @@ config IEEE802154_XBEE_FREQUENCY ---help--- SPI SLCK frequency in Hz -choice - prompt "Work queue" - default XBEE_NETDEV_LPWORK if SCHED_LPWORK - default XBEE_NETDEV_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the XBee MAC network - driver. - - WARNING!! The IEEE802.15.4 network device must never run on the same - work queue as does the IEEE 802.15.4 MAC. That configuration will - cause deadlocks: The network logic may be blocked on the work queue - waiting on resources that can only be freed by the MAC logic but the - MAC is unable to run because the work queue is blocked. The - recommended configuration is: Network on the LP work queue; MAC on HP - work queue. Blocking on the HP work queue is a very bad thing in - any case. - -config XBEE_NETDEV_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config XBEE_NETDEV_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue - config XBEE_NETDEV_RECVRPRIO int "Priority of frame receiver registerd with the MAC layer" default 1 diff --git a/drivers/wireless/ieee802154/xbee/xbee_netdev.c b/drivers/wireless/ieee802154/xbee/xbee_netdev.c index 6435d1b38b..71afc64216 100644 --- a/drivers/wireless/ieee802154/xbee/xbee_netdev.c +++ b/drivers/wireless/ieee802154/xbee/xbee_netdev.c @@ -85,19 +85,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the selected work queue */ - -# if defined(CONFIG_XBEE_NETDEV_HPWORK) -# define XBEENET_WORK HPWORK -# elif defined(CONFIG_XBEE_NETDEV_LPWORK) -# define XBEENET_WORK LPWORK -# else -# error Neither CONFIG_XBEE_NETDEV_HPWORK nor CONFIG_XBEE_NETDEV_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define XBEENET_WORK LPWORK + /* Preferred address size */ #ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR diff --git a/net/Kconfig b/net/Kconfig index e5b800e06b..89ff649fbc 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -193,25 +193,6 @@ config NET_TUN_PKTSIZE the MSS (Maximum Segment Size). TUN has no link layer header so for TUN the MTU is the same as the PKTSIZE. -choice - prompt "Work queue" - default TUN_LPWORK if SCHED_LPWORK - default TUN_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the TUN driver. If the - low priority work queue is available, then it should be used by the - TUN driver. - -config TUN_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config TUN_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue endif # NET_TUN config NET_USRSOCK diff --git a/wireless/ieee802154/Kconfig b/wireless/ieee802154/Kconfig index 6d53df082b..021839b094 100644 --- a/wireless/ieee802154/Kconfig +++ b/wireless/ieee802154/Kconfig @@ -164,36 +164,7 @@ config IEEE802154_NETDEV_RECVRPRIO the MAC character driver (which should always be lowest priority since it is a "catch-all" type receiver). -choice - prompt "Work queue" - default IEEE802154_NETDEV_LPWORK if SCHED_LPWORK - default IEEE802154_NETDEV_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the IEEE802.15.4 network - driver. If the low priority work queue is available, then it should - be used by the loopback driver. - - WARNING!! The IEEE802.15.4 network device must never run on the same - work queue as does the IEEE 802.15.4 MAC. That configuration will - cause deadlocks: The network logic may be blocked on the work queue - waiting on resources that can only be freed by the MAC logic but the - MAC is unable to run because the work queue is blocked. The - recommended configuration is: Network on the LP work queue; MAC on HP - work queue. Blocking on the HP work queue is a very bad thing in - any case. - -config IEEE802154_NETDEV_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config IEEE802154_NETDEV_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue endif # IEEE802154_NETDEV - endif # IEEE802154_MACDEV config IEEE802154_LOOPBACK @@ -205,26 +176,6 @@ config IEEE802154_LOOPBACK Add support for the IEEE802.15.4 6LoWPAN Loopback test device. if IEEE802154_LOOPBACK - -choice - prompt "Work queue" - default IEEE802154_LOOPBACK_LPWORK if SCHED_LPWORK - default IEEE802154_LOOPBACK_HPWORK if !SCHED_LPWORK && SCHED_HPWORK - depends on SCHED_WORKQUEUE - ---help--- - Work queue support is required to use the loopback driver. If the - low priority work queue is available, then it should be used by the - loopback driver. - -config IEEE802154_LOOPBACK_HPWORK - bool "High priority" - depends on SCHED_HPWORK - -config IEEE802154_LOOPBACK_LPWORK - bool "Low priority" - depends on SCHED_LPWORK - -endchoice # Work queue endif # IEEE802154_LOOPBACK endif # WIRELESS_IEEE802154 diff --git a/wireless/ieee802154/mac802154_loopback.c b/wireless/ieee802154/mac802154_loopback.c index 201451db85..9dd3b02a31 100644 --- a/wireless/ieee802154/mac802154_loopback.c +++ b/wireless/ieee802154/mac802154_loopback.c @@ -1,7 +1,7 @@ /**************************************************************************** * wireless/iee802154/mac802154_loopback.c * - * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -71,16 +71,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Worker thread support is required (CONFIG_SCHED_WORKQUEUE) -#else -# if defined(CONFIG_IEEE802154_LOOPBACK_HPWORK) -# define LPBKWORK HPWORK -# elif defined(CONFIG_IEEE802154_LOOPBACK_LPWORK) -# define LPBKWORK LPWORK -# else -# error Neither CONFIG_IEEE802154_LOOPBACK_HPWORK nor CONFIG_IEEE802154_LOOPBACK_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define LPBKWORK LPWORK + /* Preferred address size */ #ifdef CONFIG_NET_6LOWPAN_EXTENDEDADDR diff --git a/wireless/ieee802154/mac802154_netdev.c b/wireless/ieee802154/mac802154_netdev.c index 6c9654a63b..8ad885cfae 100644 --- a/wireless/ieee802154/mac802154_netdev.c +++ b/wireless/ieee802154/mac802154_netdev.c @@ -1,7 +1,7 @@ /**************************************************************************** * wireless/ieee802154/mac802154_netdev.c * - * Copyright (C) 2017 Gregory Nutt. All rights reserved. + * Copyright (C) 2017-2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -77,19 +77,19 @@ #if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required in this configuration (CONFIG_SCHED_WORKQUEUE) -#else - - /* Use the selected work queue */ - -# if defined(CONFIG_IEEE802154_NETDEV_HPWORK) -# define WPANWORK HPWORK -# elif defined(CONFIG_IEEE802154_NETDEV_LPWORK) -# define WPANWORK LPWORK -# else -# error Neither CONFIG_IEEE802154_NETDEV_HPWORK nor CONFIG_IEEE802154_NETDEV_LPWORK defined -# endif #endif +/* The low priority work queue is preferred. If it is not enabled, LPWORK + * will be the same as HPWORK. + * + * NOTE: However, the network should NEVER run on the high priority work + * queue! That queue is intended only to service short back end interrupt + * processing that never suspends. Suspending the high priority work queue + * may bring the system to its knees! + */ + +#define WPANWORK LPWORK + /* CONFIG_IEEE802154_NETDEV_NINTERFACES determines the number of physical interfaces * that will be supported. */