mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 02:48:37 +08:00
netdev/upper: Fix wrong CPU when RSS is disabled
When `CONFIG_NETDEV_RSS` is disabled, `NETDEV_THREAD_COUNT` will be 1, and we should not access `upper->sem[cpu]` with `cpu > 0`. Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
parent
233e175f28
commit
286de7df01
1 changed files with 4 additions and 0 deletions
|
@ -754,7 +754,11 @@ static inline void netdev_upper_queue_work(FAR struct net_driver_s *dev)
|
|||
FAR struct netdev_upperhalf_s *upper = dev->d_private;
|
||||
|
||||
#ifdef CONFIG_NETDEV_WORK_THREAD
|
||||
# ifdef CONFIG_NETDEV_RSS
|
||||
int cpu = this_cpu();
|
||||
# else
|
||||
const int cpu = 0;
|
||||
# endif
|
||||
int semcount;
|
||||
|
||||
if (nxsem_get_value(&upper->sem[cpu], &semcount) == OK &&
|
||||
|
|
Loading…
Reference in a new issue