mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
+14
-13
@@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 */
|
||||
|
||||
+12
-9
@@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -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 <mh@uvc.de>
|
||||
*
|
||||
@@ -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
|
||||
|
||||
+11
-11
@@ -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.
|
||||
*/
|
||||
|
||||
+11
-11
@@ -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
|
||||
|
||||
+11
-9
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user