mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
sfxge: do no allow EFSYS_MEM_ALLOC sleep
It solves locking problem when EFSYS_MEM_ALLOC is called in the context holding a mutex (not allowed to sleep). E.g. on interface bring up or multicast addresses addition. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor)
This commit is contained in:
parent
7f979e0e92
commit
83488e1827
1 changed files with 5 additions and 1 deletions
|
|
@ -941,7 +941,11 @@ typedef clock_t efsys_timestamp_t;
|
|||
#define EFSYS_KMEM_ALLOC(_esip, _size, _p) \
|
||||
do { \
|
||||
(_esip) = (_esip); \
|
||||
(_p) = malloc((_size), M_SFXGE, M_WAITOK|M_ZERO); \
|
||||
/* \
|
||||
* The macro is used in non-sleepable contexts, for \
|
||||
* example, holding a mutex. \
|
||||
*/ \
|
||||
(_p) = malloc((_size), M_SFXGE, M_NOWAIT|M_ZERO); \
|
||||
_NOTE(CONSTANTCONDITION) \
|
||||
} while (B_FALSE)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue